diff options
Diffstat (limited to 'mysql-test/t/handler_read_last.test')
-rw-r--r-- | mysql-test/t/handler_read_last.test | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/mysql-test/t/handler_read_last.test b/mysql-test/t/handler_read_last.test new file mode 100644 index 00000000000..376829b9baf --- /dev/null +++ b/mysql-test/t/handler_read_last.test @@ -0,0 +1,40 @@ +# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +CREATE TABLE t1 (a INT, INDEX (a)); +INSERT INTO t1 VALUES (),(),(),(),(),(),(),(),(),(); + +FLUSH STATUS; +SELECT a FROM t1 ORDER BY a LIMIT 1; +SHOW STATUS LIKE 'HANDLER_READ%'; + +FLUSH STATUS; +SELECT a FROM t1 ORDER BY a DESC LIMIT 1; +SHOW STATUS LIKE 'HANDLER_READ%'; + +FLUSH STATUS; +SELECT a FROM t1 ORDER BY a LIMIT 3; +SHOW STATUS LIKE 'HANDLER_READ%'; + +FLUSH STATUS; +SELECT a FROM t1 ORDER BY a DESC LIMIT 3; +SHOW STATUS LIKE 'HANDLER_READ%'; + +DROP TABLE t1; + |