[MCOL-5377] Columnstore appears to allow a Temporary Table to be created and altered, but then not dropped Created: 2022-12-30  Updated: 2023-02-01

Status: Open
Project: MariaDB ColumnStore
Component/s: None
Affects Version/s: None
Fix Version/s: Icebox

Type: Bug Priority: Major
Reporter: Maria M Pflaum Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Customer repro on 22.08.3
SkySQL Server version: 10.6.7-3-MariaDB-enterprise-log MariaDB Enterprise Server



 Description   

Using Alter table like make it look like a temporary table was created:

MariaDB [(none)]> use test;
Database changed
MariaDB [test]> CREATE TABLE columnstore_table (
-> orderkey INTEGER,
-> customer VARCHAR(45)
-> ) ENGINE=ColumnStore;
Query OK, 0 rows affected (0.250 sec)

MariaDB [test]> show tables;
-------------------

Tables_in_test

-------------------

columnstore_table

-------------------
1 row in set (0.017 sec)

show create table columnstore_table;

Table Create Table
columnstore_table CREATE TABLE `columnstore_table` (
`orderkey` int(11) DEFAULT NULL,
`customer` varchar(45) DEFAULT NULL
) ENGINE=Columnstore DEFAULT CHARSET=utf8mb3

1 row in set (0.015 sec)

MariaDB [test]> CREATE TEMPORARY TABLE temp1 LIKE test.columnstore_table;
Query OK, 0 rows affected (0.226 sec)

MariaDB [test]> show create table temp1;

Table Create Table
temp1 CREATE TEMPORARY TABLE `temp1` (
`orderkey` int(11) DEFAULT NULL,
`customer` varchar(45) DEFAULT NULL
) ENGINE=Columnstore DEFAULT CHARSET=utf8mb3

1 row in set (0.015 sec)

MariaDB [test]> ALTER TABLE test.temp1 ENGINE = InnoDB;
Query OK, 0 rows affected (0.089 sec)
Records: 0 Duplicates: 0 Warnings: 0

MariaDB [test]> show create table temp1;

MariaDB [test]> ALTER TABLE test.temp1 ENGINE = InnoDB;
Query OK, 0 rows affected (0.089 sec)
Records: 0 Duplicates: 0 Warnings: 0

MariaDB [test]> show create table temp1;

Table Create Table
temp1 CREATE TEMPORARY TABLE `temp1` (
`orderkey` int(11) DEFAULT NULL,
`customer` varchar(45) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3

1 row in set (0.015 sec)

MariaDB [test]> DROP TEMPORARY TABLE temp1;
Query OK, 0 rows affected (0.015 sec)

MariaDB [test]> CREATE TEMPORARY TABLE temp1 LIKE test.columnstore_table;
ERROR 1815 (HY000): Internal error: CAL0009: Internal create table error for test.temp1 : table already exists (your schema is probably out-of-sync)



 Comments   
Comment by Maria M Pflaum [ 2023-01-05 ]

This worked to delete table temp1:
CREATE TABLE temp1 (c1 int) engine=columnstore COMMENT='SCHEMA SYNC ONLY';
drop table temp1;

Generated at Thu Feb 08 02:57:26 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.