diff options
Diffstat (limited to 'mysql-test/t/update.test')
-rw-r--r-- | mysql-test/t/update.test | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test index e9d7ff243dd..e5ef0b11127 100644 --- a/mysql-test/t/update.test +++ b/mysql-test/t/update.test @@ -632,3 +632,25 @@ SET data_entry_cost drop view v1; drop table t1, t2; +--echo # +--echo # MDEV-4410: update does not want to use a covering index, but select uses it. +--echo # +create table t2(a int); +insert into t2 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); + +create table t1 (key1 int, col1 int, key(key1)); +insert into t1 +select A.a + 10 * B.a + 100 * C.a, 1234 from t2 A, t2 B, t2 C; + +--echo # This must not have "Using filesort": +explain +update t1 set key1=key1+1 where key1 between 10 and 110 order by key1 limit 2; + +flush status; +update t1 set key1=key1+1 where key1 between 10 and 110 order by key1 limit 2; +# Handler_read_next should be 1 (due to LIMIT), not 100: +show status like 'Handler_read%'; + +drop table t1, t2; + +--echo # End of MariaDB 10.0 tests |