You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: enginetest/queries/script_queries.go
+70-9Lines changed: 70 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -7448,6 +7448,73 @@ where
7448
7448
},
7449
7449
},
7450
7450
},
7451
+
{
7452
+
Name: "preserve enums through alter statements",
7453
+
SetUpScript: []string{
7454
+
"create table t (i int primary key, e enum('a', 'b', 'c'));",
7455
+
"insert into t values (1, 'a');",
7456
+
"insert into t values (2, 'b');",
7457
+
"insert into t values (3, 'c');",
7458
+
},
7459
+
Assertions: []ScriptTestAssertion{
7460
+
{
7461
+
Query: "select i, e, e + 0 from t;",
7462
+
Expected: []sql.Row{
7463
+
{1, "a", float64(1)},
7464
+
{2, "b", float64(2)},
7465
+
{3, "c", float64(3)},
7466
+
},
7467
+
},
7468
+
{
7469
+
Query: "alter table t modify column e enum('c', 'a', 'b');",
7470
+
Expected: []sql.Row{
7471
+
{types.NewOkResult(0)},
7472
+
},
7473
+
},
7474
+
{
7475
+
Query: "select i, e, e + 0 from t;",
7476
+
Expected: []sql.Row{
7477
+
{1, "a", float64(2)},
7478
+
{2, "b", float64(3)},
7479
+
{3, "c", float64(1)},
7480
+
},
7481
+
},
7482
+
{
7483
+
Query: "alter table t modify column e enum('asdf', 'a', 'b', 'c');",
7484
+
Expected: []sql.Row{
7485
+
{types.NewOkResult(0)},
7486
+
},
7487
+
},
7488
+
{
7489
+
Query: "select i, e, e + 0 from t;",
7490
+
Expected: []sql.Row{
7491
+
{1, "a", float64(2)},
7492
+
{2, "b", float64(3)},
7493
+
{3, "c", float64(4)},
7494
+
},
7495
+
},
7496
+
{
7497
+
Query: "alter table t modify column e enum('abc');",
7498
+
ExpectedErrStr: "value 2 is not valid for this Enum",
7499
+
},
7500
+
},
7501
+
},
7502
+
{
7503
+
Name: "coalesce with system types",
7504
+
SetUpScript: []string{
7505
+
"create table t as select @@admin_port as port1, @@port as port2, COALESCE(@@admin_port, @@port) as\n port3;",
7506
+
},
7507
+
Assertions: []ScriptTestAssertion{
7508
+
{
7509
+
Query: "describe t;",
7510
+
Expected: []sql.Row{
7511
+
{"port1", "bigint", "NO", "", nil, ""},
7512
+
{"port2", "bigint", "NO", "", nil, ""},
7513
+
{"port3", "bigint", "NO", "", nil, ""},
7514
+
},
7515
+
},
7516
+
},
7517
+
},
7451
7518
}
7452
7519
7453
7520
varSpatialScriptTests= []ScriptTest{
@@ -8758,21 +8825,17 @@ var CreateDatabaseScripts = []ScriptTest{
8758
8825
Expected: []sql.Row{{types.NewOkResult(1)}},
8759
8826
},
8760
8827
{
8761
-
SkipResultCheckOnServerEngine: true, // tracking issue here, https://github.com/dolthub/dolt/issues/6921. Also for when run with prepares, the warning is added twice
8762
-
Query: "SHOW WARNINGS /* 1 */",
8763
-
Expected: []sql.Row{{"Warning", 1235, "Setting CHARACTER SET, COLLATION and ENCRYPTION are not supported yet"}},
8828
+
Query: "SHOW WARNINGS /* 1 */",
8829
+
Expected: []sql.Row{{"Warning", 1235, "Setting CHARACTER SET, COLLATION and ENCRYPTION are not supported yet"}},
// TODO: There should only be one warning (the warnings are not clearing for create database query) AND 'PREPARE' statements should not create warning from its query
8772
8836
Query: "SHOW WARNINGS /* 2 */",
8773
8837
Expected: []sql.Row{
8774
8838
{"Warning", 1235, "Setting CHARACTER SET, COLLATION and ENCRYPTION are not supported yet"},
8775
-
{"Warning", 1235, "Setting CHARACTER SET, COLLATION and ENCRYPTION are not supported yet"},
8776
8839
},
8777
8840
},
8778
8841
{
@@ -8888,10 +8951,8 @@ var DropDatabaseScripts = []ScriptTest{
0 commit comments