List:Commits« Previous MessageNext Message »
From:marko.makela Date:January 31 2011 11:56am
Subject:bzr commit into mysql-trunk-innodb branch (marko.makela:3473) Bug#59483
View as plain text  
#At file:///home/marko/innobase/dev/mysql2a/5.6-innodb/ based on revid:marko.makela@stripped7vujykidd8b1

 3473 Marko Mäkelä	2011-01-31
      Bug#59483 Crash on INSERT/REPLACE in rec_convert_dtuple_to_rec_comp
      with ICP on
      
      ha_innobase::reset_template(): When an index condition was used,
      invalidate prebuilt->mysql_template so that it will be rebuilt
      by write_row().

    modified:
      mysql-test/include/icp_tests.inc
      mysql-test/r/innodb_icp.result
      mysql-test/r/innodb_icp_none.result
      mysql-test/r/myisam_icp.result
      mysql-test/r/myisam_icp_none.result
      storage/innobase/handler/ha_innodb.cc
=== modified file 'mysql-test/include/icp_tests.inc'
--- a/mysql-test/include/icp_tests.inc	revid:marko.makela@stripped-20110131092642-5sg57vujykidd8b1
+++ b/mysql-test/include/icp_tests.inc	revid:marko.makela@stripped15-qfli2tcine0nrb7k
@@ -798,3 +798,26 @@ SELECT pk FROM t1 WHERE c1 <> 1 HAVING p
 SELECT pk FROM t1 WHERE c1 <> 1 HAVING pk = 3 ORDER BY pk LIMIT 5;
 
 DROP TABLE t1;
+
+--echo #
+--echo # Bug#59483 "Crash on INSERT/REPLACE in
+--echo #            rec_convert_dtuple_to_rec_comp with ICP on"
+--echo #
+
+CREATE TABLE t1 (
+ pk INTEGER AUTO_INCREMENT PRIMARY KEY,
+ i1 INTEGER,
+ c1 CHAR(6),
+ i2 INTEGER NOT NULL,
+ KEY (i2)
+);
+
+INSERT INTO t1 VALUES
+ (NULL, 4, 'that', 8),
+ (NULL, 1, 'she', 6),
+ (NULL, 6, 'tell', 2);
+
+SELECT * FROM t1 WHERE i2 IN (3, 6) LIMIT 2 FOR UPDATE;
+INSERT INTO t1 (i2) VALUES (1);
+
+DROP TABLE t1;

=== modified file 'mysql-test/r/innodb_icp.result'
--- a/mysql-test/r/innodb_icp.result	revid:marko.makela@stripped
+++ b/mysql-test/r/innodb_icp.result	revid:marko.makela@stripped20110131115615-qfli2tcine0nrb7k
@@ -739,5 +739,25 @@ SELECT pk FROM t1 WHERE c1 <> 1 HAVING p
 pk
 3
 DROP TABLE t1;
+#
+# Bug#59483 "Crash on INSERT/REPLACE in
+#            rec_convert_dtuple_to_rec_comp with ICP on"
+#
+CREATE TABLE t1 (
+pk INTEGER AUTO_INCREMENT PRIMARY KEY,
+i1 INTEGER,
+c1 CHAR(6),
+i2 INTEGER NOT NULL,
+KEY (i2)
+);
+INSERT INTO t1 VALUES
+(NULL, 4, 'that', 8),
+(NULL, 1, 'she', 6),
+(NULL, 6, 'tell', 2);
+SELECT * FROM t1 WHERE i2 IN (3, 6) LIMIT 2 FOR UPDATE;
+pk	i1	c1	i2
+2	1	she	6
+INSERT INTO t1 (i2) VALUES (1);
+DROP TABLE t1;
 set default_storage_engine= @save_storage_engine;
 set optimizer_switch=default;

=== modified file 'mysql-test/r/innodb_icp_none.result'
--- a/mysql-test/r/innodb_icp_none.result	revid:marko.makela@strippedykidd8b1
+++ b/mysql-test/r/innodb_icp_none.result	revid:marko.makela@stripped
@@ -738,5 +738,25 @@ SELECT pk FROM t1 WHERE c1 <> 1 HAVING p
 pk
 3
 DROP TABLE t1;
+#
+# Bug#59483 "Crash on INSERT/REPLACE in
+#            rec_convert_dtuple_to_rec_comp with ICP on"
+#
+CREATE TABLE t1 (
+pk INTEGER AUTO_INCREMENT PRIMARY KEY,
+i1 INTEGER,
+c1 CHAR(6),
+i2 INTEGER NOT NULL,
+KEY (i2)
+);
+INSERT INTO t1 VALUES
+(NULL, 4, 'that', 8),
+(NULL, 1, 'she', 6),
+(NULL, 6, 'tell', 2);
+SELECT * FROM t1 WHERE i2 IN (3, 6) LIMIT 2 FOR UPDATE;
+pk	i1	c1	i2
+2	1	she	6
+INSERT INTO t1 (i2) VALUES (1);
+DROP TABLE t1;
 set default_storage_engine= @save_storage_engine;
 set optimizer_switch=default;

=== modified file 'mysql-test/r/myisam_icp.result'
--- a/mysql-test/r/myisam_icp.result	revid:marko.makela@stripped92642-5sg57vujykidd8b1
+++ b/mysql-test/r/myisam_icp.result	revid:marko.makela@strippede0nrb7k
@@ -737,4 +737,24 @@ SELECT pk FROM t1 WHERE c1 <> 1 HAVING p
 pk
 3
 DROP TABLE t1;
+#
+# Bug#59483 "Crash on INSERT/REPLACE in
+#            rec_convert_dtuple_to_rec_comp with ICP on"
+#
+CREATE TABLE t1 (
+pk INTEGER AUTO_INCREMENT PRIMARY KEY,
+i1 INTEGER,
+c1 CHAR(6),
+i2 INTEGER NOT NULL,
+KEY (i2)
+);
+INSERT INTO t1 VALUES
+(NULL, 4, 'that', 8),
+(NULL, 1, 'she', 6),
+(NULL, 6, 'tell', 2);
+SELECT * FROM t1 WHERE i2 IN (3, 6) LIMIT 2 FOR UPDATE;
+pk	i1	c1	i2
+2	1	she	6
+INSERT INTO t1 (i2) VALUES (1);
+DROP TABLE t1;
 set optimizer_switch=default;

=== modified file 'mysql-test/r/myisam_icp_none.result'
--- a/mysql-test/r/myisam_icp_none.result	revid:marko.makela@stripped
+++ b/mysql-test/r/myisam_icp_none.result	revid:marko.makela@oracle.com-20110131115615-qfli2tcine0nrb7k
@@ -736,4 +736,24 @@ SELECT pk FROM t1 WHERE c1 <> 1 HAVING p
 pk
 3
 DROP TABLE t1;
+#
+# Bug#59483 "Crash on INSERT/REPLACE in
+#            rec_convert_dtuple_to_rec_comp with ICP on"
+#
+CREATE TABLE t1 (
+pk INTEGER AUTO_INCREMENT PRIMARY KEY,
+i1 INTEGER,
+c1 CHAR(6),
+i2 INTEGER NOT NULL,
+KEY (i2)
+);
+INSERT INTO t1 VALUES
+(NULL, 4, 'that', 8),
+(NULL, 1, 'she', 6),
+(NULL, 6, 'tell', 2);
+SELECT * FROM t1 WHERE i2 IN (3, 6) LIMIT 2 FOR UPDATE;
+pk	i1	c1	i2
+2	1	she	6
+INSERT INTO t1 (i2) VALUES (1);
+DROP TABLE t1;
 set optimizer_switch=default;

=== modified file 'storage/innobase/handler/ha_innodb.cc'
--- a/storage/innobase/handler/ha_innodb.cc	revid:marko.makela@stripped1092642-5sg57vujykidd8b1
+++ b/storage/innobase/handler/ha_innodb.cc	revid:marko.makela@strippedqfli2tcine0nrb7k
@@ -2266,9 +2266,14 @@ ha_innobase::reset_template(void)
 
 	prebuilt->keep_other_fields_on_keyread = 0;
 	prebuilt->read_just_key = 0;
-	/* Reset index condition pushdown state */
-	prebuilt->idx_cond = NULL;
-	prebuilt->idx_cond_n_cols = 0;
+	/* Reset index condition pushdown state. */
+	if (prebuilt->idx_cond) {
+		prebuilt->idx_cond = NULL;
+		prebuilt->idx_cond_n_cols = 0;
+		/* Invalidate prebuilt->mysql_template
+		in ha_innobase::write_row(). */
+		prebuilt->template_type = ROW_MYSQL_NO_TEMPLATE;
+	}
 }
 
 /*****************************************************************//**

Attachment: [text/bzr-bundle] bzr/marko.makela@oracle.com-20110131115615-qfli2tcine0nrb7k.bundle
Thread
bzr commit into mysql-trunk-innodb branch (marko.makela:3473) Bug#59483marko.makela31 Jan