Skip to content

Commit d6b71b4

Browse files
committed
Merge branch 'main' into jennifer/domain
2 parents 59aac3c + 9aafbeb commit d6b71b4

26 files changed

+144
-690
lines changed

enginetest/queries/foreign_key_queries.go

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2616,6 +2616,74 @@ var ForeignKeyTests = []ScriptTest{
26162616
},
26172617
},
26182618
},
2619+
{
2620+
Name: "multiple foreign key refs",
2621+
SetUpScript: []string{
2622+
"create table parent1 (i int primary key);",
2623+
"create table child1 (j int, k int, foreign key (j) references parent1(i) on delete cascade on update cascade, foreign key (k) references parent1 (i) on delete cascade on update cascade);",
2624+
"insert into parent1 values (1), (2), (3);",
2625+
"insert into child1 values (1, 2), (2, 3), (3, 1);",
2626+
},
2627+
Assertions: []ScriptTestAssertion{
2628+
{
2629+
Query: "select * from parent1;",
2630+
Expected: []sql.Row{
2631+
{1},
2632+
{2},
2633+
{3},
2634+
},
2635+
},
2636+
{
2637+
Query: "select * from child1 order by j, k;",
2638+
Expected: []sql.Row{
2639+
{1, 2},
2640+
{2, 3},
2641+
{3, 1},
2642+
},
2643+
},
2644+
{
2645+
Query: "update parent1 set i = 20 where i = 2;",
2646+
Expected: []sql.Row{
2647+
{types.OkResult{RowsAffected: 1, Info: plan.UpdateInfo{Matched: 1, Updated: 1}}},
2648+
},
2649+
},
2650+
{
2651+
Query: "select * from parent1 order by i;",
2652+
Expected: []sql.Row{
2653+
{1},
2654+
{3},
2655+
{20},
2656+
},
2657+
},
2658+
{
2659+
Query: "select * from child1 order by j, k;",
2660+
Expected: []sql.Row{
2661+
{1, 20},
2662+
{3, 1},
2663+
{20, 3},
2664+
},
2665+
},
2666+
{
2667+
Query: "delete from parent1 where i = 1;",
2668+
Expected: []sql.Row{
2669+
{types.OkResult{RowsAffected: 1}},
2670+
},
2671+
},
2672+
{
2673+
Query: "select * from parent1;",
2674+
Expected: []sql.Row{
2675+
{3},
2676+
{20},
2677+
},
2678+
},
2679+
{
2680+
Query: "select * from child1 order by j, k;",
2681+
Expected: []sql.Row{
2682+
{20, 3},
2683+
},
2684+
},
2685+
},
2686+
},
26192687
}
26202688

26212689
var CreateForeignKeyTests = []ScriptTest{

enginetest/queries/insert_queries.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,10 +1278,10 @@ var InsertScripts = []ScriptTest{
12781278
},
12791279
},
12801280
{
1281-
Name: "sql_mode=NO_AUTO_VALUE_ON_ZERO",
1281+
Name: "sql_mode=NO_auto_value_ON_ZERO",
12821282
SetUpScript: []string{
12831283
"set @old_sql_mode=@@sql_mode;",
1284-
"set @@sql_mode='NO_AUTO_VALUE_ON_ZERO';",
1284+
"set @@sql_mode='NO_auto_value_ON_ZERO';",
12851285
"create table auto (i int auto_increment, index (i));",
12861286
"create table auto_pk (i int auto_increment primary key);",
12871287
},

enginetest/queries/update_queries.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -707,9 +707,9 @@ var UpdateIgnoreScripts = []ScriptTest{
707707
Name: "UPDATE IGNORE with foreign keys",
708708
SetUpScript: []string{
709709
"CREATE TABLE colors ( id INT NOT NULL, color VARCHAR(32) NOT NULL, PRIMARY KEY (id), INDEX color_index(color));",
710-
"CREATE TABLE objects (id INT NOT NULL, name VARCHAR(64) NOT NULL,color VARCHAR(32), PRIMARY KEY(id),FOREIGN KEY (color) REFERENCES colors(color))",
711-
"INSERT INTO colors (id,color) VALUES (1,'red'),(2,'green'),(3,'blue'),(4,'purple')",
712-
"INSERT INTO objects (id,name,color) VALUES (1,'truck','red'),(2,'ball','green'),(3,'shoe','blue')",
710+
"CREATE TABLE objects (id INT NOT NULL, name VARCHAR(64) NOT NULL,color VARCHAR(32), PRIMARY KEY(id),FOREIGN KEY (color) REFERENCES colors(color));",
711+
"INSERT INTO colors (id,color) VALUES (1,'red'),(2,'green'),(3,'blue'),(4,'purple');",
712+
"INSERT INTO objects (id,name,color) VALUES (1,'truck','red'),(2,'ball','green'),(3,'shoe','blue');",
713713
},
714714
Assertions: []ScriptTestAssertion{
715715
{

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
github.com/dolthub/go-icu-regex v0.0.0-20240916130659-0118adc6b662
77
github.com/dolthub/jsonpath v0.0.2-0.20240227200619-19675ab05c71
88
github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81
9-
github.com/dolthub/vitess v0.0.0-20241010201417-9d4f54b29ccc
9+
github.com/dolthub/vitess v0.0.0-20241016191424-d14e107a654e
1010
github.com/go-kit/kit v0.10.0
1111
github.com/go-sql-driver/mysql v1.7.2-0.20231213112541-0004702b931d
1212
github.com/gocraft/dbr/v2 v2.7.2

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ github.com/dolthub/vitess v0.0.0-20241009160728-54c0746cbff7 h1:mepdzTqvr0ZAbyOE
6262
github.com/dolthub/vitess v0.0.0-20241009160728-54c0746cbff7/go.mod h1:uBvlRluuL+SbEWTCZ68o0xvsdYZER3CEG/35INdzfJM=
6363
github.com/dolthub/vitess v0.0.0-20241010201417-9d4f54b29ccc h1:ZZgTRuxEwd3X67njtK30buHeZScLAd4W0rbRV8CORhE=
6464
github.com/dolthub/vitess v0.0.0-20241010201417-9d4f54b29ccc/go.mod h1:uBvlRluuL+SbEWTCZ68o0xvsdYZER3CEG/35INdzfJM=
65+
github.com/dolthub/vitess v0.0.0-20241016191424-d14e107a654e h1:Ssd/iV0hAOShAgr0c4pJQNgh2E4my2XHblFIIam0D+4=
66+
github.com/dolthub/vitess v0.0.0-20241016191424-d14e107a654e/go.mod h1:uBvlRluuL+SbEWTCZ68o0xvsdYZER3CEG/35INdzfJM=
6567
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
6668
github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
6769
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=

sql/analyzer/aggregations.go

Lines changed: 0 additions & 257 deletions
This file was deleted.

0 commit comments

Comments
 (0)