diff options
author | Jan Lindström <jan.lindstrom@skysql.com> | 2014-06-26 20:47:08 +0300 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@skysql.com> | 2014-06-26 20:47:08 +0300 |
commit | c6d29cd30db9053023124bf74f17f6ee9d8e168d (patch) | |
tree | a3f90d99d29655c249a8437b421523309cb473fb /mysql-test/t | |
parent | 3e5994868de68f5112e5faf63188e4f53050afd5 (diff) | |
parent | be885ebe8c3df78d090c2ad25772959fc2ae9fc9 (diff) | |
download | mariadb-git-c6d29cd30db9053023124bf74f17f6ee9d8e168d.tar.gz |
Merge branch '10.1' of github.com:MariaDB/server into 10.1
Diffstat (limited to 'mysql-test/t')
-rw-r--r-- | mysql-test/t/analyze_stmt.test | 54 |
1 files changed, 53 insertions, 1 deletions
diff --git a/mysql-test/t/analyze_stmt.test b/mysql-test/t/analyze_stmt.test index 2f9de4a3763..8bd4ce37dd3 100644 --- a/mysql-test/t/analyze_stmt.test +++ b/mysql-test/t/analyze_stmt.test @@ -1,5 +1,5 @@ # -# Tests for "ANALYZE $statement" feature (PostgreSQL's analog is called EXPLAIN ANALYZE) +# Tests for "ANALYZE $statement" feature # --disable_warnings drop table if exists t0,t1,t2,t3; @@ -146,3 +146,55 @@ select * from t1; drop table t0, t1; +--echo # +--echo # MDEV-6393: ANALYZE SELECT crashes in Explain_query::print_explain with a non-existing column +--echo # +create table t1 (i int); +insert into t1 values (1),(2); +--error ER_BAD_FIELD_ERROR +analyze select a from t1; + +--error ER_BAD_FIELD_ERROR +analyze delete from t1 where a=2; + +--error ER_BAD_FIELD_ERROR +analyze update t1 set a=2; + +create table t2 like t1; +insert into t2 select * from t1; + +--error ER_BAD_FIELD_ERROR +analyze update t2,t1 set t2.i=5 where t2.a=t1.a; + +--error ER_BAD_FIELD_ERROR +analyze delete t1 from t2,t1 where t2.a=t1.a; + +drop table t1, t2; +--echo # +--echo # MDEV-6395: ANALYZE UPDATE/DELETE with impossible where does not produce any output +--echo # +create table t1 (a int, b int, key(a)); +insert into t1 values (1,1),(2,2),(3,3),(4,4),(5,5); + +analyze delete from t1 where 1 > 2; +analyze delete from t1 where a > 30 and a < 10; + +analyze update t1 set b=12345 where 1 > 2; +analyze update t1 set b=12345 where a > 30 and a < 10; + +drop table t1; +--echo # +--echo # MDEV-6398: ANALYZE UPDATE does not populate r_rows +--echo # +create table t1 (i int); +insert into t1 values (1),(2),(3),(4); +analyze update t1 set i=8; +drop table t1; + +--echo # +--echo # Check ANALYZE SELECT INTO +--echo # +create table t1 (i int); +insert into t1 values (1); +analyze select * from t1 into @var; +drop table t1; |