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

UNION of FLOAT type results in erroneous precision

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 5.5.53, 10.0.27, 10.1.20, 10.2.2
    • 10.2.10
    • Data types
    • None

    Description

      MariaDB [test]> create table t1(f float);
      Query OK, 0 rows affected (0.03 sec)
       
      MariaDB [test]> insert into t1 values(1.1);
      Query OK, 1 row affected (0.02 sec)
       
      MariaDB [test]> select f from t1 union select 1;
      +------+
      | f    |
      +------+
      |  1.1 |
      |    1 |
      +------+
      2 rows in set (0.00 sec)
       
      MariaDB [test]> select 1 union select f from t1;
      +-------------------+
      | 1                 |
      +-------------------+
      |                 1 |
      | 1.100000023841858 |
      +-------------------+
      2 rows in set (0.00 sec)
       
      MariaDB [test]> select "foo" union select f from t1;
      +--------------+
      | foo          |
      +--------------+
      | foo          |
      | 1.1000000238 |
      +--------------+
      2 rows in set (0.00 sec)
      

      Attachments

        Activity

          People

            bar Alexander Barkov
            nirbhay_c Nirbhay Choubey (Inactive)
            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.