summaryrefslogtreecommitdiffstats
path: root/mysql-test/main/ext_key_noPK_6794.test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:07:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:07:14 +0000
commita175314c3e5827eb193872241446f2f8f5c9d33c (patch)
treecd3d60ca99ae00829c52a6ca79150a5b6e62528b /mysql-test/main/ext_key_noPK_6794.test
parentInitial commit. (diff)
downloadmariadb-10.5-upstream.tar.xz
mariadb-10.5-upstream.zip
Adding upstream version 1:10.5.12.upstream/1%10.5.12upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/main/ext_key_noPK_6794.test')
-rw-r--r--mysql-test/main/ext_key_noPK_6794.test15
1 files changed, 15 insertions, 0 deletions
diff --git a/mysql-test/main/ext_key_noPK_6794.test b/mysql-test/main/ext_key_noPK_6794.test
new file mode 100644
index 00000000..fc8a2724
--- /dev/null
+++ b/mysql-test/main/ext_key_noPK_6794.test
@@ -0,0 +1,15 @@
+#
+# MDEV-6794 XtraDB no longer using UNIQUE as clustered index when PK missing
+#
+
+--source include/have_innodb.inc
+
+create table t1 (c1 int not null, c2 int, unique index(c1), index (c2)) engine=innodb;
+insert into t1 (c1, c2) select 1, round(rand()*100);
+insert into t1 (c1, c2) select (select max(c1) from t1) + c1, c1*93563%100 from t1;
+insert into t1 (c1, c2) select (select max(c1) from t1) + c1, c1*93563%100 from t1;
+insert into t1 (c1, c2) select (select max(c1) from t1) + c1, c1*93563%100 from t1;
+select count(*) from t1;
+--query_vertical explain select * from t1 where c2 = 1 order by c1
+drop table t1;
+