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

Pluggable DOUBLE type lost on CTAS through plugin FIRST() aggregate

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 13.1
    • 13.2.1
    • Plugins
    • None
    • Not for Release Notes

    Description

      Pluggable DOUBLE type lost on CTAS through plugin FIRST() aggregate

      INSTALL SONAME 'func_test';
      INSTALL SONAME 'type_test';
      CREATE TABLE t1 (d test_double);
      INSERT INTO t1 VALUES (1.5);
      CREATE TABLE t2 AS SELECT test_plugin_first(d) AS first_d FROM t1;
      SHOW CREATE TABLE t2\G
       
      #cleanup
      DROP TABLE t2, t1;
      UNINSTALL SONAME 'type_test';
      UNINSTALL SONAME 'func_test';
      

      CLI Output

      13.1.0-dbg>INSTALL SONAME 'func_test';
      Query OK, 0 rows affected (0.011 sec)
       
      13.1.0-dbg>INSTALL SONAME 'type_test';
      Query OK, 0 rows affected (0.005 sec)
       
      13.1.0-dbg>CREATE TABLE t1 (d test_double);
      Query OK, 0 rows affected (0.013 sec)
       
      13.1.0-dbg>INSERT INTO t1 VALUES (1.5);
      Query OK, 1 row affected (0.002 sec)
       
      13.1.0-dbg>CREATE TABLE t2 AS SELECT test_plugin_first(d) AS first_d FROM t1;
      Query OK, 1 row affected (0.010 sec)
      Records: 1  Duplicates: 0  Warnings: 0
       
      13.1.0-dbg>SHOW CREATE TABLE t2\G
      *************************** 1. row ***************************
             Table: t2
      Create Table: CREATE TABLE `t2` (
        `first_d` double DEFAULT NULL
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
      1 row in set (0.000 sec)
       
      13.1.0-dbg>
      

      Plain CTAS looks good.

      13.1.0-dbg>CREATE TABLE t2_plain AS SELECT  d FROM t1;
      Query OK, 1 row affected (0.015 sec)
      Records: 1  Duplicates: 0  Warnings: 0
       
      13.1.0-dbg>SHOW CREATE TABLE t2_plain\G
      *************************** 1. row ***************************
             Table: t2_plain
      Create Table: CREATE TABLE `t2_plain` (
        `d` test_double DEFAULT NULL
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
      1 row in set (0.000 sec)
       
      13.1.0-dbg>
      

      Attachments

        Issue Links

          Activity

            People

              drrtuy Roman
              ramesh Ramesh Sivaraman
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 0.5h
                  0.5h

                  Git Integration

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