A failed create table still creates a table but of a different specification
Author: timsehnCreated Mar 17, 2022Updated Sep 14, 2026
Labelsbugsqlcorrectness
test-busteroni $ dolt sql
# Welcome to the DoltSQL shell.
# Statements must be terminated with ';'.
# "exit" or "quit" (or Ctrl-D) to exit.
test_busteroni> CREATE DATABASE test;
test_busteroni> CREATE TABLE IF NOT EXISTS restaurants (
-> id INT PRIMARY KEY,
-> coordinate POINT
-> );
test_busteroni> CREATE TABLE IF NOT EXISTS hours (
-> restaurant_id INT PRIMARY KEY AUTO_INCREMENT,
-> FOREIGN KEY (restaurant_id) REFERENCES restaurants(id)
-> );
cannot create an index over spatial type columns
test_busteroni> show tables;
+-------------+
| Table |
+-------------+
| hours |
| restaurants |
+-------------+
test_busteroni> show create table hours
-> ;
+-------+--------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+--------------------------------------------------------------------------------------------------------------------------------------------+
| hours | CREATE TABLE `hours` (
`restaurant_id` int NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`restaurant_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 |
+-------+--------------------------------------------------------------------------------------------------------------------------------------------+When piped in as a SQL statement the table is not created as in #3023.
Source: dolthub/dolt