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

MDB crashes in CREATE TABLE AS SELECT when the precision of returning type = 0.

    XMLWordPrintable

Details

    Description

      MDB crashes trying to execute CTAS with decimal column which precision is 0.

      MariaDB [test]> create table t42(d decimal(5,5));
      Query OK, 0 rows affected (0.015 sec)
       
      MariaDB [test]> insert into t42 values (0.55555);
      Query OK, 1 row affected (0.004 sec)
       
      MariaDB [test]> select * from t42;
      +---------+
      | d       |
      +---------+
      | 0.55555 |
      +---------+
      1 row in set (0.001 sec)
       
      MariaDB [test]> select truncate(d,0) from t42;
      +---------------+
      | truncate(d,0) |
      +---------------+
      |             0 |
      +---------------+
      1 row in set (0.001 sec)
       
      MariaDB [test]> create table t43 as select truncate(d,0) from t42;
      ERROR 2013 (HY000): Lost connection to MySQL server during query
      

      Attachments

        Issue Links

          Activity

            People

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