Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-15459

Window Functions seems to return string instead of numbers

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Duplicate
    • 10.2.13
    • N/A
    • libmariadb
    • None
    • Linux, Ubuntu 14.04, n.a.

    Description

      Window Functions seems to return string instead of numbers:

      Just following your examples here:
      https://mariadb.com/kb/en/library/window-functions-overview/

      SELECT salary, SUM(salary) OVER () FROM employee_salaries;
      +--------+---------------------+
      | salary | SUM(salary) OVER () |
      +--------+---------------------+
      |   3500 | 17750               |
      |   3000 | 17750               |
      |   2800 | 17750               |
      |   2500 | 17750               |
      |   2200 | 17750               |
      |   1800 | 17750               |
      |    500 | 17750               |
      |    400 | 17750               |
      |    300 | 17750               |
      |    300 | 17750               |
      |    250 | 17750               |
      |    200 | 17750               |
      +--------+---------------------+
      

      SELECT salary, CAST(SUM(salary) OVER () AS INT) FROM employee_salaries;
      +--------+----------------------------------+
      | salary | CAST(SUM(salary) OVER () AS INT) |
      +--------+----------------------------------+
      |   3500 |                            17750 |
      |   3000 |                            17750 |
      |   2800 |                            17750 |
      |   2500 |                            17750 |
      |   2200 |                            17750 |
      |   1800 |                            17750 |
      |    500 |                            17750 |
      |    400 |                            17750 |
      |    300 |                            17750 |
      |    300 |                            17750 |
      |    250 |                            17750 |
      |    200 |                            17750 |
      +--------+----------------------------------+
      

      If you did not fake the docu I would say you have introduced a bug...

      I do not know if this is dramatic. But I could imagine, that some applications relay on the data type and behave differently/wrong?

      Attachments

        Issue Links

          Activity

            People

              georg Georg Richter
              oli Oli Sennhauser
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.