summaryrefslogtreecommitdiff
path: root/mysql-test/t/myisam.test
diff options
context:
space:
mode:
authorunknown <svoj@may.pils.ru>2006-06-21 17:30:59 +0500
committerunknown <svoj@may.pils.ru>2006-06-21 17:30:59 +0500
commit5c0cdea62341da75f0560216af1b363b156ed1ab (patch)
tree8321d5354f0f2cad96af6f61c246c17bdb8bdf4d /mysql-test/t/myisam.test
parentef02d496a07f76a830ca7e21907df65a58ddb4d7 (diff)
downloadmariadb-git-5c0cdea62341da75f0560216af1b363b156ed1ab.tar.gz
BUG#20357 - Got error 124 from storage engine using MIN and MAX
functions in queries Using MAX()/MIN() on table with disabled indexes (by ALTER TABLE) results in error 124 (wrong index) from storage engine. The problem was that optimizer use disabled index to optimize MAX()/MIN(). Normally it must skip disabled index and perform table scan. This patch skips disabled indexes for min/max optimization. mysql-test/r/myisam.result: Test case for BUG#20357. mysql-test/t/myisam.test: Test case for BUG#20357. sql/opt_sum.cc: Skip disabled/ignored indexes for min/max optimization.
Diffstat (limited to 'mysql-test/t/myisam.test')
-rw-r--r--mysql-test/t/myisam.test12
1 files changed, 12 insertions, 0 deletions
diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test
index 7e4cc324b12..06f913111d3 100644
--- a/mysql-test/t/myisam.test
+++ b/mysql-test/t/myisam.test
@@ -705,4 +705,16 @@ select count(*) from t1 where id2 = 10;
select count(id1) from t1 where id2 = 10;
drop table t1;
+#
+# BUG##20357 - Got error 124 from storage engine using MIN and MAX functions
+# in queries
+#
+CREATE TABLE t1(a TINYINT, KEY(a)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES(1);
+SELECT MAX(a) FROM t1 IGNORE INDEX(a);
+ALTER TABLE t1 DISABLE KEYS;
+SELECT MAX(a) FROM t1;
+SELECT MAX(a) FROM t1 IGNORE INDEX(a);
+DROP TABLE t1;
+
# End of 4.1 tests