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

MAX(old_decimal) produces a column of the old DECIMAL type

Details

    Description

      I add this code into type_decimal.test.

      let $MYSQLD_DATADIR= `select @@datadir`;
       
      --copy_file std_data/old_decimal/t1dec102.frm $MYSQLD_DATADIR/test/t1dec102.frm
      --copy_file std_data/old_decimal/t1dec102.MYD $MYSQLD_DATADIR/test/t1dec102.MYD
      --copy_file std_data/old_decimal/t1dec102.MYI $MYSQLD_DATADIR/test/t1dec102.MYI
       
      CREATE TABLE t1 AS SELECT MAX(a) FROM t1dec102;
      SHOW CREATE TABLE t1;
      DROP TABLE t1;
      

      It adds the following output to the test result:

      CREATE TABLE t1 AS SELECT MAX(a) FROM t1dec102;
      SHOW CREATE TABLE t1;
      Table	Create Table
      t1	CREATE TABLE `t1` (
        `MAX(a)` decimal(10,2)/*old*/ DEFAULT NULL
      ) ENGINE=MyISAM DEFAULT CHARSET=latin1
      DROP TABLE t1;
      

      Notice, a field of the "old" decimal type was created. It should create the new decimal variant.

      Attachments

        Issue Links

          Activity

            bar Alexander Barkov created issue -
            bar Alexander Barkov made changes -
            Field Original Value New Value
            bar Alexander Barkov made changes -
            Description {code:sql}
            let $MYSQLD_DATADIR= `select @@datadir`;

            --copy_file std_data/old_decimal/t1dec102.frm $MYSQLD_DATADIR/test/t1dec102.frm
            --copy_file std_data/old_decimal/t1dec102.MYD $MYSQLD_DATADIR/test/t1dec102.MYD
            --copy_file std_data/old_decimal/t1dec102.MYI $MYSQLD_DATADIR/test/t1dec102.MYI

            CREATE TABLE t1 AS SELECT MAX(a) FROM t1dec102;
            SHOW CREATE TABLE t1;
            DROP TABLE t1;
            {code}

            It add the following output to the test result:
            {noformat}
            CREATE TABLE t1 AS SELECT MAX(a) FROM t1dec102;
            SHOW CREATE TABLE t1;
            Table Create Table
            t1 CREATE TABLE `t1` (
              `MAX(a)` decimal(10,2)/*old*/ DEFAULT NULL
            ) ENGINE=MyISAM DEFAULT CHARSET=latin1
            DROP TABLE t1;
            {noformat}
            I add this code into {{type_decimal.test}}.
            {code:sql}
            let $MYSQLD_DATADIR= `select @@datadir`;

            --copy_file std_data/old_decimal/t1dec102.frm $MYSQLD_DATADIR/test/t1dec102.frm
            --copy_file std_data/old_decimal/t1dec102.MYD $MYSQLD_DATADIR/test/t1dec102.MYD
            --copy_file std_data/old_decimal/t1dec102.MYI $MYSQLD_DATADIR/test/t1dec102.MYI

            CREATE TABLE t1 AS SELECT MAX(a) FROM t1dec102;
            SHOW CREATE TABLE t1;
            DROP TABLE t1;
            {code}

            It adds the following output to the test result:
            {noformat}
            CREATE TABLE t1 AS SELECT MAX(a) FROM t1dec102;
            SHOW CREATE TABLE t1;
            Table Create Table
            t1 CREATE TABLE `t1` (
              `MAX(a)` decimal(10,2)/*old*/ DEFAULT NULL
            ) ENGINE=MyISAM DEFAULT CHARSET=latin1
            DROP TABLE t1;
            {noformat}
            bar Alexander Barkov made changes -
            Description I add this code into {{type_decimal.test}}.
            {code:sql}
            let $MYSQLD_DATADIR= `select @@datadir`;

            --copy_file std_data/old_decimal/t1dec102.frm $MYSQLD_DATADIR/test/t1dec102.frm
            --copy_file std_data/old_decimal/t1dec102.MYD $MYSQLD_DATADIR/test/t1dec102.MYD
            --copy_file std_data/old_decimal/t1dec102.MYI $MYSQLD_DATADIR/test/t1dec102.MYI

            CREATE TABLE t1 AS SELECT MAX(a) FROM t1dec102;
            SHOW CREATE TABLE t1;
            DROP TABLE t1;
            {code}

            It adds the following output to the test result:
            {noformat}
            CREATE TABLE t1 AS SELECT MAX(a) FROM t1dec102;
            SHOW CREATE TABLE t1;
            Table Create Table
            t1 CREATE TABLE `t1` (
              `MAX(a)` decimal(10,2)/*old*/ DEFAULT NULL
            ) ENGINE=MyISAM DEFAULT CHARSET=latin1
            DROP TABLE t1;
            {noformat}
            I add this code into {{type_decimal.test}}.
            {code:sql}
            let $MYSQLD_DATADIR= `select @@datadir`;

            --copy_file std_data/old_decimal/t1dec102.frm $MYSQLD_DATADIR/test/t1dec102.frm
            --copy_file std_data/old_decimal/t1dec102.MYD $MYSQLD_DATADIR/test/t1dec102.MYD
            --copy_file std_data/old_decimal/t1dec102.MYI $MYSQLD_DATADIR/test/t1dec102.MYI

            CREATE TABLE t1 AS SELECT MAX(a) FROM t1dec102;
            SHOW CREATE TABLE t1;
            DROP TABLE t1;
            {code}

            It adds the following output to the test result:
            {noformat}
            CREATE TABLE t1 AS SELECT MAX(a) FROM t1dec102;
            SHOW CREATE TABLE t1;
            Table Create Table
            t1 CREATE TABLE `t1` (
              `MAX(a)` decimal(10,2)/*old*/ DEFAULT NULL
            ) ENGINE=MyISAM DEFAULT CHARSET=latin1
            DROP TABLE t1;
            {noformat}

            Notice, a field of the "old" decimal type was created. It should create the new decimal variant.
            bar Alexander Barkov made changes -
            Labels datatype
            bar Alexander Barkov made changes -
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.2 [ 14601 ]
            bar Alexander Barkov made changes -
            Component/s Data types [ 13906 ]
            Component/s OTHER [ 10125 ]
            bar Alexander Barkov made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            bar Alexander Barkov made changes -
            Assignee Alexander Barkov [ bar ] Sergei Golubchik [ serg ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Alexander Barkov [ bar ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            bar Alexander Barkov made changes -
            Fix Version/s 10.2.16 [ 23110 ]
            Fix Version/s 10.3.8 [ 23113 ]
            Fix Version/s 10.4.0 [ 23115 ]
            Fix Version/s 10.3 [ 22126 ]
            bar Alexander Barkov made changes -
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            bar Alexander Barkov made changes -
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 80444 ] MariaDB v4 [ 152001 ]

            People

              bar Alexander Barkov
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.