List:Commits« Previous MessageNext Message »
From:marko.makela Date:November 7 2011 12:10pm
Subject:bzr push into mysql-5.1 branch (marko.makela:3636 to 3637) Bug#13345378
View as plain text  
 3637 Marko Mäkelä	2011-11-07
      Add debug assertions to catch Bug#13345378 earlier.
      
      In all callers of row_sel_convert_mysql_key_to_innobase(), assert
      that the converted key is empty or nonempty when it should be.

    modified:
      storage/innobase/handler/ha_innodb.cc
      storage/innodb_plugin/handler/ha_innodb.cc
 3636 Tor Didriksen	2011-11-01
      Bug#12406055 post-push fix: unused variable 'num_chars' in optimized build.
      Also fixed possibly uninitialized use of need_copy_table_res.

    modified:
      client/sql_string.cc
      sql/sql_table.cc
=== modified file 'storage/innobase/handler/ha_innodb.cc'
--- a/storage/innobase/handler/ha_innodb.cc	revid:tor.didriksen@strippedb1sigkazrb60paf
+++ b/storage/innobase/handler/ha_innodb.cc	revid:marko.makela@strippedpy1li52
@@ -4713,6 +4713,7 @@ ha_innobase::index_read(
 					index,
 					(byte*) key_ptr,
 					(ulint) key_len, prebuilt->trx);
+		DBUG_ASSERT(prebuilt->search_tuple->n_fields > 0);
 	} else {
 		/* We position the cursor to the last or the first entry
 		in the index */
@@ -6168,6 +6169,7 @@ ha_innobase::records_in_range(
 	void*		heap2;
 
 	DBUG_ENTER("records_in_range");
+	DBUG_ASSERT(min_key || max_key);
 
 	ut_a(prebuilt->trx == thd_to_trx(ha_thd()));
 
@@ -6198,6 +6200,9 @@ ha_innobase::records_in_range(
 					 (const uchar*) 0),
 				(ulint) (min_key ? min_key->length : 0),
 				prebuilt->trx);
+	DBUG_ASSERT(min_key
+		    ? range_start->n_fields > 0
+		    : range_start->n_fields == 0);
 
 	row_sel_convert_mysql_key_to_innobase(
 				range_end, (byte*) key_val_buff2,
@@ -6206,6 +6211,9 @@ ha_innobase::records_in_range(
 					 (const uchar*) 0),
 				(ulint) (max_key ? max_key->length : 0),
 				prebuilt->trx);
+	DBUG_ASSERT(max_key
+		    ? range_end->n_fields > 0
+		    : range_end->n_fields == 0);
 
 	mode1 = convert_search_mode_to_innobase(min_key ? min_key->flag :
 						HA_READ_KEY_EXACT);

=== modified file 'storage/innodb_plugin/handler/ha_innodb.cc'
--- a/storage/innodb_plugin/handler/ha_innodb.cc	revid:tor.didriksen@oracle.com-20111101065054-8b1sigkazrb60paf
+++ b/storage/innodb_plugin/handler/ha_innodb.cc	revid:marko.makela@oracle.com-20111107113719-geae9ea2tpy1li52
@@ -5428,6 +5428,7 @@ ha_innobase::index_read(
 			(byte*) key_ptr,
 			(ulint) key_len,
 			prebuilt->trx);
+		DBUG_ASSERT(prebuilt->search_tuple->n_fields > 0);
 	} else {
 		/* We position the cursor to the last or the first entry
 		in the index */
@@ -7226,6 +7227,7 @@ ha_innobase::records_in_range(
 	mem_heap_t*	heap;
 
 	DBUG_ENTER("records_in_range");
+	DBUG_ASSERT(min_key || max_key);
 
 	ut_a(prebuilt->trx == thd_to_trx(ha_thd()));
 
@@ -7271,6 +7273,9 @@ ha_innobase::records_in_range(
 					 (const uchar*) 0),
 				(ulint) (min_key ? min_key->length : 0),
 				prebuilt->trx);
+	DBUG_ASSERT(min_key
+		    ? range_start->n_fields > 0
+		    : range_start->n_fields == 0);
 
 	row_sel_convert_mysql_key_to_innobase(
 				range_end, (byte*) key_val_buff2,
@@ -7279,6 +7284,9 @@ ha_innobase::records_in_range(
 					 (const uchar*) 0),
 				(ulint) (max_key ? max_key->length : 0),
 				prebuilt->trx);
+	DBUG_ASSERT(max_key
+		    ? range_end->n_fields > 0
+		    : range_end->n_fields == 0);
 
 	mode1 = convert_search_mode_to_innobase(min_key ? min_key->flag :
 						HA_READ_KEY_EXACT);

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1 branch (marko.makela:3636 to 3637) Bug#13345378marko.makela7 Nov