Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-4453

CREATE TABLE t2 AS SELECT..LIMIT 0 erroneously writes a row into the table

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 5.4.3
    • 5.5.2
    • None
    • None
    • 2021-1, 2021-2

    Description

      I run this script with intent to copy the datatype of the column t1.c1 to t2.c2, but without copying the data:

      DROP TABLE IF EXISTS t1,t2;
      CREATE TABLE t1 (c1 INT) ENGINE=ColumnStore;
      INSERT INTO t1 VALUES (1),(2);
      CREATE TABLE t2 AS SELECT c1 FROM t1 LIMIT 0;
      SELECT * FROM t2;
      

      +------+
      | c1   |
      +------+
      |    1 |
      +------+
      

      Notice, t2 erroneously has one record, while the statement asked to write 0 rows to the destination table t2.

      Attachments

        Issue Links

          Activity

            People

              dleeyh Daniel Lee (Inactive)
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.