-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Join Predicate Cleanup Bug in Route Merging (#16386)
Signed-off-by: Andres Taylor <andres@planetscale.com> Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr> Co-authored-by: Florent Poinsard <florent.poinsard@outlook.fr>
- Loading branch information
1 parent
563d950
commit fb8966b
Showing
4 changed files
with
114 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
CREATE TABLE `t1` | ||
( | ||
`id` int unsigned NOT NULL AUTO_INCREMENT, | ||
`name` varchar(191) NOT NULL, | ||
PRIMARY KEY (`id`) | ||
) ENGINE InnoDB, | ||
CHARSET utf8mb4, | ||
COLLATE utf8mb4_unicode_ci; | ||
|
||
CREATE TABLE `t2` | ||
( | ||
`id` bigint unsigned NOT NULL AUTO_INCREMENT, | ||
`t1_id` int unsigned NOT NULL, | ||
PRIMARY KEY (`id`) | ||
) ENGINE InnoDB, | ||
CHARSET utf8mb4, | ||
COLLATE utf8mb4_unicode_ci; | ||
|
||
CREATE TABLE `t3` | ||
( | ||
`id` bigint unsigned NOT NULL AUTO_INCREMENT, | ||
`name` varchar(191) NOT NULL, | ||
PRIMARY KEY (`id`) | ||
) ENGINE InnoDB, | ||
CHARSET utf8mb4, | ||
COLLATE utf8mb4_unicode_ci; | ||
|
||
insert into t1 (id, name) | ||
values (1, 'A'), | ||
(2, 'B'), | ||
(3, 'C'), | ||
(4, 'D'); | ||
|
||
insert into t2 (id, t1_id) | ||
values (1, 1), | ||
(2, 2), | ||
(3, 3); | ||
|
||
insert into t3 (id, name) | ||
values (1, 'A'), | ||
(2, 'B'), | ||
(3, 'B'), | ||
(4, 'B'), | ||
(5, 'B'); | ||
|
||
-- wait_authoritative t1 | ||
-- wait_authoritative t2 | ||
-- wait_authoritative t3 | ||
select 42 from t1 join t2 on t1.id = t2.t1_id join t3 on t1.id = t3.id where t1.name or t2.id or t3.name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"keyspaces": { | ||
"joinks": { | ||
"sharded": true, | ||
"vindexes": { | ||
"hash": { | ||
"type": "hash" | ||
} | ||
}, | ||
"tables": { | ||
"t1": { | ||
"column_vindexes": [ | ||
{ | ||
"column": "id", | ||
"name": "hash" | ||
} | ||
] | ||
}, | ||
"t2": { | ||
"column_vindexes": [ | ||
{ | ||
"column": "t1_id", | ||
"name": "hash" | ||
} | ||
] | ||
}, | ||
"t3": { | ||
"column_vindexes": [ | ||
{ | ||
"column": "id", | ||
"name": "hash" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters