From 857df7cc2b7efe64e402be389ca8131b635abc14 Mon Sep 17 00:00:00 2001
From: Zardosht Kasheff <zardosht@tokutek.com>
Date: Fri, 3 Dec 2010 00:50:44 +0000
Subject: [PATCH] [t:3083], write test

git-svn-id: file:///svn/mysql/tests/mysql-test@26144 c7de825b-a66e-492c-adef-691d508d4ae1
---
 mysql-test/suite/tokudb.bugs/r/3083.result | 23 +++++++++++++++++
 mysql-test/suite/tokudb.bugs/t/3083.test   | 30 ++++++++++++++++++++++
 2 files changed, 53 insertions(+)
 create mode 100755 mysql-test/suite/tokudb.bugs/r/3083.result
 create mode 100755 mysql-test/suite/tokudb.bugs/t/3083.test

diff --git a/mysql-test/suite/tokudb.bugs/r/3083.result b/mysql-test/suite/tokudb.bugs/r/3083.result
new file mode 100755
index 0000000000..fa67ae805b
--- /dev/null
+++ b/mysql-test/suite/tokudb.bugs/r/3083.result
@@ -0,0 +1,23 @@
+SET STORAGE_ENGINE = 'tokudb';
+DROP TABLE IF EXISTS foo;
+set session tokudb_prelock_empty=0;
+create table foo (a int, b int, c int, primary key (a), clustering key (b));
+insert into foo values (1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5);
+# Both explains should use primary key;
+explain select * from foo;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	foo	ALL	NULL	NULL	NULL	NULL	5	
+explain select a from foo;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	foo	index	NULL	PRIMARY	4	NULL	5	Using index
+DROP table foo;
+create table foo (a int, b int, c int, clustering key (b), primary key (a));
+insert into foo values (1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5);
+# Both explains should use primary key;
+explain select * from foo;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	foo	ALL	NULL	NULL	NULL	NULL	5	
+explain select a from foo;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	foo	index	NULL	PRIMARY	4	NULL	5	Using index
+DROP TABLE foo;
diff --git a/mysql-test/suite/tokudb.bugs/t/3083.test b/mysql-test/suite/tokudb.bugs/t/3083.test
new file mode 100755
index 0000000000..f307755c29
--- /dev/null
+++ b/mysql-test/suite/tokudb.bugs/t/3083.test
@@ -0,0 +1,30 @@
+#--source include/have_tokudb.inc
+#
+#test update multiple
+#
+#
+SET STORAGE_ENGINE = 'tokudb';
+
+--disable_warnings
+DROP TABLE IF EXISTS foo;
+--enable_warnings
+
+set session tokudb_prelock_empty=0;
+
+create table foo (a int, b int, c int, primary key (a), clustering key (b));
+insert into foo values (1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5);
+
+--echo # Both explains should use primary key;
+explain select * from foo;
+explain select a from foo;
+DROP table foo;
+
+create table foo (a int, b int, c int, clustering key (b), primary key (a));
+insert into foo values (1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5);
+
+--echo # Both explains should use primary key;
+explain select * from foo;
+explain select a from foo;
+
+DROP TABLE foo;
+
-- 
2.30.9