diff options
author | gkodinov/kgeorge@magare.gmz <> | 2007-05-22 15:58:30 +0300 |
---|---|---|
committer | gkodinov/kgeorge@magare.gmz <> | 2007-05-22 15:58:30 +0300 |
commit | 604ef46327cf0bb57f1fc4e7160783acd1707d54 (patch) | |
tree | 08d9d02d66f614e32a6d645cfda994fa73990360 /mysql-test/t/myisam.test | |
parent | 4ac1e98630759c9b86bb73035b4f95cd6909a2a9 (diff) | |
download | mariadb-git-604ef46327cf0bb57f1fc4e7160783acd1707d54.tar.gz |
Bug #28476: force index on a disabled myisam index gives error 124
When processing the USE/FORCE index hints
the optimizer was not checking if the indexes
specified are enabled (see ALTER TABLE).
Fixed by:
Backporting the fix for bug 20604 to 5.0
Diffstat (limited to 'mysql-test/t/myisam.test')
-rw-r--r-- | mysql-test/t/myisam.test | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 82d10059c65..12b9423be21 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -1145,4 +1145,20 @@ create table t3 (c1 int) engine=myisam pack_keys=default; create table t4 (c1 int) engine=myisam pack_keys=2; drop table t1, t2, t3; +# +# Bug#28476: force index on a disabled myisam index gives error 124 +# +CREATE TABLE t1(a INT, b INT, KEY inx (a), UNIQUE KEY uinx (b)) ENGINE=MyISAM; +INSERT INTO t1(a,b) VALUES (1,1),(2,2),(3,3),(4,4),(5,5); +SELECT a FROM t1 FORCE INDEX (inx) WHERE a=1; +ALTER TABLE t1 DISABLE KEYS; +SELECT a FROM t1 FORCE INDEX (inx) WHERE a=1; +SELECT a FROM t1 USE INDEX (inx) WHERE a=1; +SELECT b FROM t1 FORCE INDEX (uinx) WHERE b=1; +SELECT b FROM t1 USE INDEX (uinx) WHERE b=1; +SELECT a FROM t1 FORCE INDEX (inx,uinx) WHERE a=1; +ALTER TABLE t1 ENABLE KEYS; +SELECT a FROM t1 FORCE INDEX (inx) WHERE a=1; +DROP TABLE t1; + --echo End of 5.0 tests |