summaryrefslogtreecommitdiff
path: root/mysql-test/r/update.result
diff options
context:
space:
mode:
authorunknown <igor@olga.mysql.com>2007-02-02 15:22:10 -0800
committerunknown <igor@olga.mysql.com>2007-02-02 15:22:10 -0800
commite0d8e8fd09f46b9ccda0b39e5483bca4d3d672de (patch)
treec43db5c7b276574cabf4a5f8e38755f9d43e60e7 /mysql-test/r/update.result
parenta30830460794651c0e9fc5ec4779cf77680514ee (diff)
downloadmariadb-git-e0d8e8fd09f46b9ccda0b39e5483bca4d3d672de.tar.gz
Fix bug #24035.
This performance degradation for UPDATEs could be observed in the update statements for which the search key cannot be converted to any valid value of the type of the search column, like for a the condition int_fld=99999999999999999999999999, though it can be guaranteed here that there is no row with such a key value. mysql-test/r/update.result: Added a test case for bug #24035. mysql-test/t/update.test: Added a test case for bug #24035. sql/opt_range.cc: Fix bug #24035. This performance degradation for could be observed in the update statements for which the search key cannot be converted to any valid value of the type of the search column, like for a the condition int_fld=99999999999999999999999999, though it can be guaranteed here that there is no row with such a key value. Now the function get_mm_leaf creates trees of the type SEL_ARG::IMPOSSIBLE for such conditions that tells the range scan not to perform any search at all.
Diffstat (limited to 'mysql-test/r/update.result')
-rw-r--r--mysql-test/r/update.result57
1 files changed, 57 insertions, 0 deletions
diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result
index 4b7dbb3dbe9..9e2bc52657a 100644
--- a/mysql-test/r/update.result
+++ b/mysql-test/r/update.result
@@ -377,3 +377,60 @@ create table t1(f1 int, `*f2` int);
insert into t1 values (1,1);
update t1 set `*f2`=1;
drop table t1;
+CREATE TABLE t1 (
+request_id int unsigned NOT NULL auto_increment,
+user_id varchar(12) default NULL,
+time_stamp datetime NOT NULL default '0000-00-00 00:00:00',
+ip_address varchar(15) default NULL,
+PRIMARY KEY (request_id),
+KEY user_id_2 (user_id,time_stamp)
+);
+INSERT INTO t1 (user_id) VALUES ('user1');
+INSERT INTO t1(user_id) SELECT user_id FROM t1;
+INSERT INTO t1(user_id) SELECT user_id FROM t1;
+INSERT INTO t1(user_id) SELECT user_id FROM t1;
+INSERT INTO t1(user_id) SELECT user_id FROM t1;
+INSERT INTO t1(user_id) SELECT user_id FROM t1;
+INSERT INTO t1(user_id) SELECT user_id FROM t1;
+INSERT INTO t1(user_id) SELECT user_id FROM t1;
+INSERT INTO t1(user_id) SELECT user_id FROM t1;
+flush status;
+SELECT user_id FROM t1 WHERE request_id=9999999999999;
+user_id
+show status like '%Handler_read%';
+Variable_name Value
+Handler_read_first 0
+Handler_read_key 1
+Handler_read_next 0
+Handler_read_prev 0
+Handler_read_rnd 0
+Handler_read_rnd_next 0
+SELECT user_id FROM t1 WHERE request_id=999999999999999999999999999999;
+user_id
+show status like '%Handler_read%';
+Variable_name Value
+Handler_read_first 0
+Handler_read_key 2
+Handler_read_next 0
+Handler_read_prev 0
+Handler_read_rnd 0
+Handler_read_rnd_next 7
+UPDATE t1 SET user_id=null WHERE request_id=9999999999999;
+show status like '%Handler_read%';
+Variable_name Value
+Handler_read_first 0
+Handler_read_key 3
+Handler_read_next 0
+Handler_read_prev 0
+Handler_read_rnd 0
+Handler_read_rnd_next 14
+UPDATE t1 SET user_id=null WHERE request_id=999999999999999999999999999999;
+show status like '%Handler_read%';
+Variable_name Value
+Handler_read_first 0
+Handler_read_key 3
+Handler_read_next 0
+Handler_read_prev 0
+Handler_read_rnd 0
+Handler_read_rnd_next 21
+DROP TABLE t1;