diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2013-10-07 17:29:51 +0400 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2013-10-07 17:29:51 +0400 |
commit | 98a8642fe827fd9ac16bdfaf556599fa509d4180 (patch) | |
tree | 4215cf494f23de959522090ee386e125ba359308 /mysql-test | |
parent | 69393db3d15b5eac143ab6068037f938b3003ce1 (diff) | |
download | mariadb-git-98a8642fe827fd9ac16bdfaf556599fa509d4180.tar.gz |
MDEV-3798: EXPLAIN UPDATE/DELETE
- Add support for EXPLAIN INSERT.
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/explain_non_select.result | 17 | ||||
-rw-r--r-- | mysql-test/t/explain_non_select.test | 15 |
2 files changed, 32 insertions, 0 deletions
diff --git a/mysql-test/r/explain_non_select.result b/mysql-test/r/explain_non_select.result index 3cc4d4f1e26..1c5d545fd99 100644 --- a/mysql-test/r/explain_non_select.result +++ b/mysql-test/r/explain_non_select.result @@ -181,3 +181,20 @@ explain partitions update t1 set b=12345 where a in (32,33); id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No matching rows after partition pruning drop table t1; +# +# Tests for EXPLAIN INSERT ... VALUES +# +create table t1 (a int, key(a)); +explain insert into t1 values (1),(2),(3); +id select_type table type possible_keys key key_len ref rows Extra +1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL +insert into t1 values (1),(2),(3); +create table t2 (a int, b int); +explain insert into t2 values +(10, 1+(select max(a) from t1)), +(11, 1+(select max(a+1) from t1)); +id select_type table type possible_keys key key_len ref rows Extra +1 INSERT t2 ALL NULL NULL NULL NULL NULL NULL +3 SUBQUERY t1 index NULL a 5 NULL 3 Using index +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +drop table t1,t2; diff --git a/mysql-test/t/explain_non_select.test b/mysql-test/t/explain_non_select.test index 3c4c2d0739d..7220a00bd2a 100644 --- a/mysql-test/t/explain_non_select.test +++ b/mysql-test/t/explain_non_select.test @@ -155,3 +155,18 @@ explain partitions delete from t1 where a in (32,33); explain partitions update t1 set b=12345 where a in (32,33); drop table t1; + +--echo # +--echo # Tests for EXPLAIN INSERT ... VALUES +--echo # +create table t1 (a int, key(a)); +explain insert into t1 values (1),(2),(3); +insert into t1 values (1),(2),(3); + +create table t2 (a int, b int); +explain insert into t2 values + (10, 1+(select max(a) from t1)), + (11, 1+(select max(a+1) from t1)); + +drop table t1,t2; + |