List:Commits« Previous MessageNext Message »
From:Konstantin Osipov Date:October 2 2008 11:02pm
Subject:bzr commit into mysql-6.0 branch (kostja:2721)
View as plain text  
#At file:///opt/local/work/mysql-6.0-runtime/

 2721 Konstantin Osipov	2008-10-03
      Test
modified:
  mysql-test/suite/falcon/r/falcon_bugs.result
  mysql-test/suite/falcon/t/falcon_bugs.test
  storage/falcon/ha_falcon.cpp

=== modified file 'mysql-test/suite/falcon/r/falcon_bugs.result'
--- a/mysql-test/suite/falcon/r/falcon_bugs.result	2007-11-26 15:50:23 +0000
+++ b/mysql-test/suite/falcon/r/falcon_bugs.result	2008-10-02 21:01:42 +0000
@@ -3263,4 +3263,20 @@ count(*)
 select count(*) from t2 where b = 150;
 count(*)
 1
+#
+# Bug #36473 Assertion "! is_set()" fails in
+# Diagnostics_area::set_ok_status with Falcon
+# Ensure that we check the return value of update_auto_increment().
+#
+set @@storage_engine = falcon;
+drop table if exists t1;
+create table t1 (a tinyint(4) NOT NULL auto_increment, primary key (a));
+set @@sql_mode='strict_all_tables';
+set auto_increment_increment=1000;
+set auto_increment_offset=700;
+insert into t1 values (null);
+ERROR 22003: Out of range value for column 'a' at row 1
+set @@sql_mode=default;
+set auto_increment_offset=default;
+set auto_increment_increment=default;
 DROP TABLE t1, t2;

=== modified file 'mysql-test/suite/falcon/t/falcon_bugs.test'
--- a/mysql-test/suite/falcon/t/falcon_bugs.test	2007-12-19 18:55:35 +0000
+++ b/mysql-test/suite/falcon/t/falcon_bugs.test	2008-10-02 21:01:42 +0000
@@ -1772,5 +1772,26 @@ update t1, t2 set t1.b = 150, t2.b = t1.
 select count(*) from t1 where b = 150;
 select count(*) from t2 where b = 150;
 
+
+--echo #
+--echo # Bug #36473 Assertion "! is_set()" fails in
+--echo # Diagnostics_area::set_ok_status with Falcon
+--echo # Ensure that we check the return value of update_auto_increment().
+--echo #
+set @@storage_engine = falcon;
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+create table t1 (a tinyint(4) NOT NULL auto_increment, primary key (a));
+set @@sql_mode='strict_all_tables';
+set auto_increment_increment=1000;
+set auto_increment_offset=700;
+--error ER_WARN_DATA_OUT_OF_RANGE
+insert into t1 values (null);
+set @@sql_mode=default;
+set auto_increment_offset=default;
+set auto_increment_increment=default;
+
 # Final cleanup.
 DROP TABLE t1, t2;

=== modified file 'storage/falcon/ha_falcon.cpp'
--- a/storage/falcon/ha_falcon.cpp	2008-09-04 18:30:34 +0000
+++ b/storage/falcon/ha_falcon.cpp	2008-10-02 21:01:42 +0000
@@ -1079,14 +1079,19 @@ int StorageInterface::write_row(uchar *b
 
 	if (table->next_number_field && buff == table->record[0])
 		{
-		update_auto_increment();
+		int code = update_auto_increment();
+		/*
+		   May fail, e.g. due to an out of range value in STRICT mode.
+		*/
+		if (code)
+			DBUG_RETURN(code);
 
 		/*
 		   If the new value is less than the current highest value, it will be
 		   ignored by setSequenceValue().
 		*/
 
-		int code =
storageShare->setSequenceValue(table->next_number_field->val_int());
+		code = storageShare->setSequenceValue(table->next_number_field->val_int());
 
 		if (code)
 			DBUG_RETURN(error(code));

Thread
bzr commit into mysql-6.0 branch (kostja:2721)Konstantin Osipov2 Oct