Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion enginetest/queries/create_table_queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ var CreateTableScriptTests = []ScriptTest{
Query: "show create table t4;",
Expected: []sql.Row{
{"t4", "CREATE TABLE `t4` (\n" +
" `(a.j + 1)` bigint\n" +
" `j + 1` bigint\n" +
") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"},
},
},
Expand Down Expand Up @@ -985,6 +985,21 @@ var CreateTableScriptTests = []ScriptTest{
},
},
},
{
Name: "create table column from aggregate function",
SetUpScript: []string{
"create table t1 (i int)",
"insert into t1 values (1)",
"create table t2 select sum(i) from t1",
},
Assertions: []ScriptTestAssertion{
{
Query: "show create table t2;",
// TODO: MySQL has the column type as 'decimal(32,0) DEFAULT NULL' https://github.com/dolthub/dolt/issues/9754
Expected: []sql.Row{{"t2", "CREATE TABLE `t2` (\n `sum(i)` double NOT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"}},
},
},
},
}

var CreateTableInSubroutineTests = []ScriptTest{
Expand Down
2 changes: 1 addition & 1 deletion enginetest/queries/script_queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -4693,7 +4693,7 @@ CREATE TABLE tab3 (
{
Query: "select COLUMN_NAME, DATA_TYPE from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='c';",
Expected: []sql.Row{
{"coalesce(NULL,1)", "int"},
{"coalesce(NULL, 1)", "int"},
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/dolthub/go-icu-regex v0.0.0-20250820171420-f2b78f56ce9f
github.com/dolthub/jsonpath v0.0.2-0.20240227200619-19675ab05c71
github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81
github.com/dolthub/vitess v0.0.0-20250828224346-f347481664da
github.com/dolthub/vitess v0.0.0-20250829204624-8c8e5f2c4ae9
github.com/go-sql-driver/mysql v1.7.2-0.20231213112541-0004702b931d
github.com/gocraft/dbr/v2 v2.7.2
github.com/google/uuid v1.3.0
Expand Down
10 changes: 2 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,8 @@ github.com/dolthub/jsonpath v0.0.2-0.20240227200619-19675ab05c71 h1:bMGS25NWAGTE
github.com/dolthub/jsonpath v0.0.2-0.20240227200619-19675ab05c71/go.mod h1:2/2zjLQ/JOOSbbSboojeg+cAwcRV0fDLzIiWch/lhqI=
github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81 h1:7/v8q9XGFa6q5Ap4Z/OhNkAMBaK5YeuEzwJt+NZdhiE=
github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81/go.mod h1:siLfyv2c92W1eN/R4QqG/+RjjX5W2+gCTRjZxBjI3TY=
github.com/dolthub/vitess v0.0.0-20250730174048-497aebb8cea7 h1:l+mWO0xoh4eG1J9gMS87opL6N6WGAQitF36R/Lg4bWs=
github.com/dolthub/vitess v0.0.0-20250730174048-497aebb8cea7/go.mod h1:1gQZs/byeHLMSul3Lvl3MzioMtOW1je79QYGyi2fd70=
github.com/dolthub/vitess v0.0.0-20250813175212-45844169a751 h1:BBQKyvyODewdQxS+ICklMn1d/fFj2pVlkmMN1QFY4ms=
github.com/dolthub/vitess v0.0.0-20250813175212-45844169a751/go.mod h1:1gQZs/byeHLMSul3Lvl3MzioMtOW1je79QYGyi2fd70=
github.com/dolthub/vitess v0.0.0-20250814204310-c749d213f235 h1:uXrK+xn8rCwz/8jWDKaDyqZG1HbZI9F4V4HJ7zXFPMY=
github.com/dolthub/vitess v0.0.0-20250814204310-c749d213f235/go.mod h1:1gQZs/byeHLMSul3Lvl3MzioMtOW1je79QYGyi2fd70=
github.com/dolthub/vitess v0.0.0-20250828224346-f347481664da h1:8yD4o8bK8giyoJvjxYQ48mmNoBQ1WaBOUbIGhP3J0Ms=
github.com/dolthub/vitess v0.0.0-20250828224346-f347481664da/go.mod h1:1gQZs/byeHLMSul3Lvl3MzioMtOW1je79QYGyi2fd70=
github.com/dolthub/vitess v0.0.0-20250829204624-8c8e5f2c4ae9 h1:XKRVCBX0DvXVEMOp/pDuaQfUXivboBl4uEIu7A/dFB8=
github.com/dolthub/vitess v0.0.0-20250829204624-8c8e5f2c4ae9/go.mod h1:1gQZs/byeHLMSul3Lvl3MzioMtOW1je79QYGyi2fd70=
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
Expand Down
Loading