Skip to content

Commit

Permalink
Fix bug in vtexplain around JOINs (#12384)
Browse files Browse the repository at this point in the history
Signed-off-by: Andres Taylor <andres@planetscale.com>
Co-authored-by: Andres Taylor <andres@planetscale.com>
  • Loading branch information
vitess-bot[bot] and systay committed Feb 17, 2023
1 parent 49ae2a9 commit 29e137a
Show file tree
Hide file tree
Showing 6 changed files with 205 additions and 177 deletions.
5 changes: 5 additions & 0 deletions go/vt/vtexplain/testdata/multi-output/unsharded-output.txt
Expand Up @@ -45,3 +45,8 @@ select ID from t1
1 ks_unsharded/-: select ID from t1 limit 10001

----------------------------------------------------------------------
select t1.id, t2.c2 from t1 join t2 on t1.id = t2.t1_id where t2.c2 in (1)

1 ks_unsharded/-: select t1.id, t2.c2 from t1 join t2 on t1.id = t2.t1_id where t2.c2 in (1) limit 10001

----------------------------------------------------------------------

This file was deleted.

6 changes: 6 additions & 0 deletions go/vt/vtexplain/testdata/test-schema.sql
Expand Up @@ -4,6 +4,12 @@ create table t1 (
floatval float not null default 0,
primary key (id)
);
create table t2 (
id bigint(20) unsigned not null,
t1_id bigint(20) unsigned not null default 0,
c2 bigint(20) null,
primary key (id)
);

create table user (
id bigint,
Expand Down
1 change: 1 addition & 0 deletions go/vt/vtexplain/testdata/test-vschema.json
Expand Up @@ -3,6 +3,7 @@
"sharded": false,
"tables": {
"t1": {},
"t2": {},
"table_not_in_schema": {}
}
},
Expand Down
1 change: 1 addition & 0 deletions go/vt/vtexplain/testdata/unsharded-queries.sql
Expand Up @@ -6,3 +6,4 @@ update t1 set floatval = 9.99;
delete from t1 where id = 100;
insert into t1 (id,intval,floatval) values (1,2,3.14) on duplicate key update intval=3, floatval=3.14;
select ID from t1;
select t1.id, t2.c2 from t1 join t2 on t1.id = t2.t1_id where t2.c2 in (1);

0 comments on commit 29e137a

Please sign in to comment.