Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
Merge pull request #118 from tinyspeck/slack-vitess-2018-12-3.r0
Browse files Browse the repository at this point in the history
Slack vitess 2018 12 3.r0
  • Loading branch information
rafael authored Dec 3, 2018
2 parents b865bb0 + df486b6 commit b0bbbdb
Show file tree
Hide file tree
Showing 172 changed files with 11,118 additions and 3,995 deletions.
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* @sougou

/docker/ @derekperkins @dkhenry
/helm/ @derekperkins @dkhenry
2 changes: 1 addition & 1 deletion config/mycnf/default-fast.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ key_buffer_size = 2M
log-error = {{.ErrorLogPath}}
long_query_time = 2
max_allowed_packet = 16M
max_connections = 100
max_connections = 200
net_write_timeout = 60
pid-file = {{.PidFile}}
port = {{.MysqlPort}}
Expand Down
36 changes: 18 additions & 18 deletions data/test/tabletserver/ddl_cases.txt
Original file line number Diff line number Diff line change
@@ -1,86 +1,86 @@
"create table a(abcd)"
{
"Action": "create", "NewName": "a"
"Action": "create"
}

"drop table b"
{
"Action": "drop", "TableName": "b"
"Action": "drop"
}

"drop table b.c"
{
"Action": "drop", "TableName": "b.c"
"Action": "drop"
}

"alter table c alter foo"
{
"Action": "alter", "TableName": "c", "NewTable": "c"
"Action": "alter"
}

"alter table c comment 'aa'"
{
"Action": "alter", "TableName": "c", "NewTable": "c"
"Action": "alter"
}

"alter table b.c comment 'aa'"
{
"Action": "alter", "TableName": "b.c", "NewTable": "b.c"
"Action": "alter"
}

"drop index a on b"
{
"Action": "alter", "TableName": "b", "NewName": "b"
"Action": "alter"
}

"drop index a on b.c"
{
"Action": "alter", "TableName": "b.c", "NewName": "b.c"
"Action": "alter"
}

"drop index a on b lock=none"
{
"Action": "alter", "TableName": "b", "NewName": "b"
"Action": "alter"
}

"rename table a to b"
{
"Action": "rename", "TableName": "a", "NewTable": "b"
"Action": "rename"
}

"rename table c.a to c.b"
{
"Action": "rename", "TableName": "c.a", "NewTable": "c.b"
"Action": "rename"
}

"alter table a rename b"
{
"Action": "rename", "TableName": "a", "NewTable": "b"
"Action": "rename"
}

"alter table a rename to b"
{
"Action": "rename", "TableName": "a", "NewTable": "b"
"Action": "rename"
}

"alter table c.a rename to c.b"
{
"Action": "rename", "TableName": "c.a", "NewTable": "c.b"
"Action": "rename"
}

"create view a asdasd"
{
"Action": "create", "NewName": "a"
"Action": "create"
}

"alter view c as foo"
{
"Action": "alter", "TableName": "c", "NewTable": "c"
"Action": "alter"
}

"drop view b"
{
"Action": "drop", "TableName": "b"
"Action": "drop"
}

"select * from a"
Expand All @@ -100,7 +100,7 @@

"alter table a partition by range (id) (partition p0 values less than (10), partition p1 values less than (maxvalue))"
{
"Action": "alter", "TableName": "a", "NewTable": "a"
"Action": "alter"
}

# truncate
Expand Down
64 changes: 47 additions & 17 deletions data/test/tabletserver/exec_cases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2076,12 +2076,8 @@ options:PassthroughDMLs
"alter table a add column(a int)"
{
"PlanID": "DDL",
"TableName": "a",
"TableName": "",
"Permissions": [
{
"TableName": "a",
"Role": 2
},
{
"TableName": "a",
"Role": 2
Expand All @@ -2093,7 +2089,7 @@ options:PassthroughDMLs
"alter table a rename b"
{
"PlanID": "DDL",
"TableName": "a",
"TableName": "",
"Permissions": [
{
"TableName": "a",
Expand All @@ -2110,7 +2106,24 @@ options:PassthroughDMLs
"rename table a to b"
{
"PlanID": "DDL",
"TableName": "a",
"TableName": "",
"Permissions": [
{
"TableName": "a",
"Role": 2
},
{
"TableName": "b",
"Role": 2
}
]
}

# multi-rename
"rename table a to b, b to a"
{
"PlanID": "DDL",
"TableName": "",
"Permissions": [
{
"TableName": "a",
Expand All @@ -2119,6 +2132,14 @@ options:PassthroughDMLs
{
"TableName": "b",
"Role": 2
},
{
"TableName": "b",
"Role": 2
},
{
"TableName": "a",
"Role": 2
}
]
}
Expand All @@ -2127,7 +2148,7 @@ options:PassthroughDMLs
"drop table a"
{
"PlanID": "DDL",
"TableName": "a",
"TableName": "",
"Permissions": [
{
"TableName": "a",
Expand All @@ -2136,16 +2157,29 @@ options:PassthroughDMLs
]
}

# analyze
"analyze table a"
# multi-drop
"drop table a, b"
{
"PlanID": "DDL",
"TableName": "a",
"TableName": "",
"Permissions": [
{
"TableName": "a",
"Role": 2
},
{
"TableName": "b",
"Role": 2
}
]
}

# analyze
"analyze table a"
{
"PlanID": "DDL",
"TableName": "",
"Permissions": [
{
"TableName": "a",
"Role": 2
Expand All @@ -2157,7 +2191,7 @@ options:PassthroughDMLs
"alter table a reorganize partition b into (partition c values less than (:bv), partition d values less than (maxvalue))"
{
"PlanID": "DDL",
"TableName": "a",
"TableName": "",
"Permissions": [
{
"TableName": "a",
Expand All @@ -2171,12 +2205,8 @@ options:PassthroughDMLs
"alter table a partition by range (id) (partition p0 values less than (10), partition p1 values less than (maxvalue))"
{
"PlanID": "DDL",
"TableName": "a",
"TableName": "",
"Permissions": [
{
"TableName": "a",
"Role": 2
},
{
"TableName": "a",
"Role": 2
Expand Down
38 changes: 38 additions & 0 deletions data/test/vtexplain/multi-output/selectsharded-output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,41 @@ select * from (select id from user) s /* scatter paren select */
1 ks_sharded/c0-: select * from (select id from user) as s limit 10001 /* scatter paren select */

----------------------------------------------------------------------
select name from user where id = (select id from t1) /* non-correlated subquery as value */

1 ks_unsharded/-: select id from t1 limit 10001 /* non-correlated subquery as value */
2 ks_sharded/-40: select name from user where id = 1 limit 10001 /* non-correlated subquery as value */

----------------------------------------------------------------------
select name from user where id in (select id from t1) /* non-correlated subquery in IN clause */

1 ks_unsharded/-: select id from t1 limit 10001 /* non-correlated subquery in IN clause */
2 ks_sharded/-40: select name from user where 1 = 1 and (id in (1)) limit 10001 /* non-correlated subquery in IN clause */

----------------------------------------------------------------------
select name from user where id not in (select id from t1) /* non-correlated subquery in NOT IN clause */

1 ks_unsharded/-: select id from t1 limit 10001 /* non-correlated subquery in NOT IN clause */
2 ks_sharded/-40: select name from user where (1 = 0 or (id not in (1))) limit 10001 /* non-correlated subquery in NOT IN clause */
2 ks_sharded/40-80: select name from user where (1 = 0 or (id not in (1))) limit 10001 /* non-correlated subquery in NOT IN clause */
2 ks_sharded/80-c0: select name from user where (1 = 0 or (id not in (1))) limit 10001 /* non-correlated subquery in NOT IN clause */
2 ks_sharded/c0-: select name from user where (1 = 0 or (id not in (1))) limit 10001 /* non-correlated subquery in NOT IN clause */

----------------------------------------------------------------------
select name from user where exists (select id from t1) /* non-correlated subquery as EXISTS */

1 ks_unsharded/-: select id from t1 limit 10001 /* non-correlated subquery as EXISTS */
2 ks_sharded/-40: select name from user where 1 limit 10001 /* non-correlated subquery as EXISTS */
2 ks_sharded/40-80: select name from user where 1 limit 10001 /* non-correlated subquery as EXISTS */
2 ks_sharded/80-c0: select name from user where 1 limit 10001 /* non-correlated subquery as EXISTS */
2 ks_sharded/c0-: select name from user where 1 limit 10001 /* non-correlated subquery as EXISTS */

----------------------------------------------------------------------
select * from name_info order by info /* select * and order by varchar column */

1 ks_sharded/-40: select name, info, weight_string(info) from name_info order by info asc limit 10001 /* select * and order by varchar column */
1 ks_sharded/40-80: select name, info, weight_string(info) from name_info order by info asc limit 10001 /* select * and order by varchar column */
1 ks_sharded/80-c0: select name, info, weight_string(info) from name_info order by info asc limit 10001 /* select * and order by varchar column */
1 ks_sharded/c0-: select name, info, weight_string(info) from name_info order by info asc limit 10001 /* select * and order by varchar column */

----------------------------------------------------------------------
7 changes: 7 additions & 0 deletions data/test/vtexplain/selectsharded-queries.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,10 @@ select name, count(*) from user group by name /* scatter aggregate */;

select 1, "hello", 3.14 from user limit 10 /* select constant sql values */;
select * from (select id from user) s /* scatter paren select */;

select name from user where id = (select id from t1) /* non-correlated subquery as value */;
select name from user where id in (select id from t1) /* non-correlated subquery in IN clause */;
select name from user where id not in (select id from t1) /* non-correlated subquery in NOT IN clause */;
select name from user where exists (select id from t1) /* non-correlated subquery as EXISTS */;

select * from name_info order by info /* select * and order by varchar column */
19 changes: 15 additions & 4 deletions data/test/vtexplain/test-vschema.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"ks_unsharded": {
"Sharded": false,
"Tables": {
"sharded": false,
"tables": {
"t1": {},
"table_not_in_schema": {}
}
},
"ks_sharded": {
"Sharded": true,
"sharded": true,
"vindexes": {
"music_user_map": {
"type": "lookup_hash_unique",
Expand Down Expand Up @@ -81,7 +81,18 @@
"column": "name",
"name": "md5"
}
]
],
"columns": [
{
"name": "name",
"type": "VARCHAR"
},
{
"name": "info",
"type": "VARCHAR"
}
],
"column_list_authoritative": true
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions data/test/vtgate/dml_cases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1015,6 +1015,10 @@
}
}

# insert into a vindex not allowed
"insert into user_index(id) values(1)"
"inserting into a vindex not allowed: user_index"

# simple replace unsharded
"replace into unsharded values(1, 2)"
{
Expand Down
Loading

0 comments on commit b0bbbdb

Please sign in to comment.