summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/analyze_stmt.result19
-rw-r--r--mysql-test/t/analyze_stmt.test15
2 files changed, 34 insertions, 0 deletions
diff --git a/mysql-test/r/analyze_stmt.result b/mysql-test/r/analyze_stmt.result
index 50063324faf..c3c98593210 100644
--- a/mysql-test/r/analyze_stmt.result
+++ b/mysql-test/r/analyze_stmt.result
@@ -315,3 +315,22 @@ id select_type table type possible_keys key key_len ref rows r_rows filtered r_f
1 SIMPLE t1 ALL NULL NULL NULL NULL 10 10.00 100.00 100.00 Using where
1 SIMPLE t2 ref a a 5 test.t1.a 2 0.20 100.00 100.00 Using index
drop table t1,t2;
+#
+# MDEV-8063: Unconditional ANALYZE DELETE does not delete rows
+#
+create table t1 (i int);
+insert into t1 values (1),(2);
+analyze delete from t1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL 2 NULL NULL NULL Deleting all rows
+select * from t1;
+i
+insert into t1 values (1),(2);
+explain delete from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL 2 Deleting all rows
+select * from t1;
+i
+1
+2
+drop table t1;
diff --git a/mysql-test/t/analyze_stmt.test b/mysql-test/t/analyze_stmt.test
index 0355b4e4e0f..d02139fe0c8 100644
--- a/mysql-test/t/analyze_stmt.test
+++ b/mysql-test/t/analyze_stmt.test
@@ -258,3 +258,18 @@ insert into t2 values (0),(1);
analyze select * from t1 straight_join t2 force index(a) where t2.a=t1.a;
drop table t1,t2;
+
+--echo #
+--echo # MDEV-8063: Unconditional ANALYZE DELETE does not delete rows
+--echo #
+
+create table t1 (i int);
+insert into t1 values (1),(2);
+analyze delete from t1;
+select * from t1;
+
+insert into t1 values (1),(2);
+explain delete from t1;
+select * from t1;
+
+drop table t1;