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

Bad result in view

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.2.8
    • Fix Version/s: 10.2.9
    • Component/s: Parser, Views
    • Labels:
      None
    • Environment:
      Centos 7.3

      Description

      View return bad result "31457280.0000", but correct value is "30":

      MariaDB [test]> CREATE TABLE `t1` (bps INT);
      Query OK, 0 rows affected (0.01 sec)
       
      MariaDB [test]> INSERT INTO t1 (bps) VALUES(31457280);
      Query OK, 1 row affected (0.00 sec)
       
      MariaDB [test]> SELECT (t1.bps / (1024 * 1024)) AS Mbit FROM t1;
      +---------+
      | Mbit    |
      +---------+
      | 30.0000 |
      +---------+
      1 row in set (0.00 sec)
       
      MariaDB [test]> CREATE VIEW v1 AS SELECT (t1.bps / (1024 * 1024)) AS Mbit FROM t1;
      Query OK, 0 rows affected (0.00 sec)
       
      MariaDB [test]> SELECT * FROM v1;
      +---------------+
      | Mbit          |
      +---------------+
      | 31457280.0000 |
      +---------------+
      1 row in set (0.00 sec)
      

        Attachments

          Activity

            People

            Assignee:
            serg Sergei Golubchik
            Reporter:
            chaky Michal Hucik
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: