summaryrefslogtreecommitdiff
path: root/mysql-test/t/analyze_stmt.test
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2014-06-26 15:55:25 +0400
committerSergei Petrunia <psergey@askmonty.org>2014-06-26 15:55:25 +0400
commit12d6f89b073351169e070355e8db363d0d649749 (patch)
treeebe91f65ec5277b713ef9a968fd2c6d12094e8ee /mysql-test/t/analyze_stmt.test
parentb7d10e56872f32b437d4d7ef0d1dc1b2ab000d5b (diff)
downloadmariadb-git-12d6f89b073351169e070355e8db363d0d649749.tar.gz
MDEV-6393: ANALYZE SELECT crashes ... Don't try printing EXPLAIN if we had an error.
Diffstat (limited to 'mysql-test/t/analyze_stmt.test')
-rw-r--r--mysql-test/t/analyze_stmt.test25
1 files changed, 25 insertions, 0 deletions
diff --git a/mysql-test/t/analyze_stmt.test b/mysql-test/t/analyze_stmt.test
index 2f9de4a3763..d310ab2a3fb 100644
--- a/mysql-test/t/analyze_stmt.test
+++ b/mysql-test/t/analyze_stmt.test
@@ -146,3 +146,28 @@ 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;
+