List:Commits« Previous MessageNext Message »
From:Gleb Shchepa Date:February 5 2009 9:49am
Subject:bzr commit into mysql-5.1-bugteam branch (gshchepa:2784) Bug#39265
View as plain text  
#At file:///work/bzr/mysql-5.1-bugteam/ based on revid:gshchepa@stripped

 2784 Gleb Shchepa	2009-02-05
      Bug #39265: fix for the bug 33699 should be reverted
      
      Documented behaviour was broken by the patch for bug 33699
      that actually is not a bug.
      
      This fix reverts patch for bug 33699 and reverts the
      UPDATE of NOT NULL field with NULL query to old
      behavior.
modified:
  mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test
  mysql-test/include/ps_modify.inc
  mysql-test/r/auto_increment.result
  mysql-test/r/csv_not_null.result
  mysql-test/r/null.result
  mysql-test/r/ps_2myisam.result
  mysql-test/r/ps_3innodb.result
  mysql-test/r/ps_4heap.result
  mysql-test/r/ps_5merge.result
  mysql-test/r/warnings.result
  mysql-test/suite/ndb/r/ps_7ndb.result
  mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result
  mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result
  mysql-test/suite/rpl/t/rpl_err_ignoredtable.test
  mysql-test/t/auto_increment.test
  mysql-test/t/csv_not_null.test
  mysql-test/t/null.test
  mysql-test/t/warnings.test
  sql/sql_update.cc

per-file messages:
  mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test
    Bug #39265: fix for the bug 33699 should be reverted
  mysql-test/include/ps_modify.inc
    Bug #39265: fix for the bug 33699 should be reverted
  mysql-test/r/auto_increment.result
    Bug #39265: fix for the bug 33699 should be reverted
  mysql-test/r/csv_not_null.result
    Bug #39265: fix for the bug 33699 should be reverted
  mysql-test/r/null.result
    Bug #39265: fix for the bug 33699 should be reverted
  mysql-test/r/ps_2myisam.result
    Bug #39265: fix for the bug 33699 should be reverted
  mysql-test/r/ps_3innodb.result
    Bug #39265: fix for the bug 33699 should be reverted
  mysql-test/r/ps_4heap.result
    Bug #39265: fix for the bug 33699 should be reverted
  mysql-test/r/ps_5merge.result
    Bug #39265: fix for the bug 33699 should be reverted
  mysql-test/r/warnings.result
    Bug #39265: fix for the bug 33699 should be reverted
  mysql-test/suite/ndb/r/ps_7ndb.result
    Bug #39265: fix for the bug 33699 should be reverted
  mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result
    Bug #39265: fix for the bug 33699 should be reverted
  mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result
    Bug #39265: fix for the bug 33699 should be reverted
  mysql-test/suite/rpl/t/rpl_err_ignoredtable.test
    Bug #39265: fix for the bug 33699 should be reverted
  mysql-test/t/auto_increment.test
    Bug #39265: fix for the bug 33699 should be reverted
  mysql-test/t/csv_not_null.test
    Bug #39265: fix for the bug 33699 should be reverted
  mysql-test/t/null.test
    Bug #39265: fix for the bug 33699 should be reverted
  mysql-test/t/warnings.test
    Bug #39265: fix for the bug 33699 should be reverted
  sql/sql_update.cc
    Bug #39265: fix for the bug 33699 should be reverted
=== modified file 'mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test'
--- a/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test	2008-07-10 16:09:39 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test	2009-02-05 09:49:32 +0000
@@ -419,7 +419,7 @@ connection master;
    update t31 set f5=555555555555555 where f3=6;
    update t31 set f2=2 where f3=2;
    update t31 set f1=NULL where f3=1;
-   update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3;
+   update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3;
 
 --echo
 --echo ** Delete from Master **

=== modified file 'mysql-test/include/ps_modify.inc'
--- a/mysql-test/include/ps_modify.inc	2008-01-11 01:06:08 +0000
+++ b/mysql-test/include/ps_modify.inc	2009-02-05 09:49:32 +0000
@@ -108,7 +108,6 @@ execute stmt1 using @arg00, @arg01;
 select a,b from t1 where a=@arg00;
 set @arg00=NULL;
 set @arg01=2;
---error 1048
 execute stmt1 using @arg00, @arg01;
 select a,b from t1 order by a;
 set @arg00=0;

=== modified file 'mysql-test/r/auto_increment.result'
--- a/mysql-test/r/auto_increment.result	2008-09-16 13:07:59 +0000
+++ b/mysql-test/r/auto_increment.result	2009-02-05 09:49:32 +0000
@@ -231,7 +231,8 @@ a	b
 204	7
 delete from t1 where a=0;
 update t1 set a=NULL where b=6;
-ERROR 23000: Column 'a' cannot be null
+Warnings:
+Warning	1048	Column 'a' cannot be null
 update t1 set a=300 where b=7;
 SET SQL_MODE='';
 insert into t1(a,b)values(NULL,8);
@@ -246,7 +247,7 @@ a	b
 1	1
 200	2
 201	4
-203	6
+0	6
 300	7
 301	8
 400	9
@@ -262,7 +263,6 @@ a	b
 1	1
 200	2
 201	4
-203	6
 300	7
 301	8
 400	9
@@ -273,20 +273,20 @@ a	b
 405	14
 delete from t1 where a=0;
 update t1 set a=NULL where b=13;
-ERROR 23000: Column 'a' cannot be null
+Warnings:
+Warning	1048	Column 'a' cannot be null
 update t1 set a=500 where b=14;
 select * from t1 order by b;
 a	b
 1	1
 200	2
 201	4
-203	6
 300	7
 301	8
 400	9
 401	10
 402	11
-404	13
+0	13
 500	14
 drop table t1;
 create table t1 (a bigint);

=== modified file 'mysql-test/r/csv_not_null.result'
--- a/mysql-test/r/csv_not_null.result	2008-02-14 13:17:47 +0000
+++ b/mysql-test/r/csv_not_null.result	2009-02-05 09:49:32 +0000
@@ -46,8 +46,9 @@ SELECT * FROM t1;
 a	b
 0	new_value
 UPDATE t1 set b = NULL where b = 'new_value';
-ERROR 23000: Column 'b' cannot be null
+Warnings:
+Warning	1048	Column 'b' cannot be null
 SELECT * FROM t1;
 a	b
-0	new_value
+0	
 DROP TABLE t1;

=== modified file 'mysql-test/r/null.result'
--- a/mysql-test/r/null.result	2008-02-12 19:09:16 +0000
+++ b/mysql-test/r/null.result	2009-02-05 09:49:32 +0000
@@ -93,9 +93,11 @@ INSERT INTO t1 SET a = "", d= "2003-01-1
 Warnings:
 Warning	1265	Data truncated for column 'd' at row 1
 UPDATE t1 SET d=1/NULL;
-ERROR 23000: Column 'd' cannot be null
+Warnings:
+Warning	1265	Data truncated for column 'd' at row 1
 UPDATE t1 SET d=NULL;
-ERROR 23000: Column 'd' cannot be null
+Warnings:
+Warning	1048	Column 'd' cannot be null
 INSERT INTO t1 (a) values (null);
 ERROR 23000: Column 'a' cannot be null
 INSERT INTO t1 (a) values (1/null);
@@ -130,7 +132,7 @@ Warning	1048	Column 'd' cannot be null
 Warning	1048	Column 'd' cannot be null
 select * from t1;
 a	b	c	d
-	0	0000-00-00 00:00:00	2003
+	0	0000-00-00 00:00:00	0
 	0	0000-00-00 00:00:00	0
 	0	0000-00-00 00:00:00	0
 	0	0000-00-00 00:00:00	0

=== modified file 'mysql-test/r/ps_2myisam.result'
--- a/mysql-test/r/ps_2myisam.result	2008-08-15 20:42:29 +0000
+++ b/mysql-test/r/ps_2myisam.result	2009-02-05 09:49:32 +0000
@@ -1303,11 +1303,12 @@ a	b
 set @arg00=NULL;
 set @arg01=2;
 execute stmt1 using @arg00, @arg01;
-ERROR 23000: Column 'a' cannot be null
+Warnings:
+Warning	1048	Column 'a' cannot be null
 select a,b from t1 order by a;
 a	b
+0	two
 1	one
-2	two
 3	three
 4	four
 set @arg00=0;

=== modified file 'mysql-test/r/ps_3innodb.result'
--- a/mysql-test/r/ps_3innodb.result	2008-08-15 20:42:29 +0000
+++ b/mysql-test/r/ps_3innodb.result	2009-02-05 09:49:32 +0000
@@ -1286,11 +1286,12 @@ a	b
 set @arg00=NULL;
 set @arg01=2;
 execute stmt1 using @arg00, @arg01;
-ERROR 23000: Column 'a' cannot be null
+Warnings:
+Warning	1048	Column 'a' cannot be null
 select a,b from t1 order by a;
 a	b
+0	two
 1	one
-2	two
 3	three
 4	four
 set @arg00=0;

=== modified file 'mysql-test/r/ps_4heap.result'
--- a/mysql-test/r/ps_4heap.result	2008-08-15 20:42:29 +0000
+++ b/mysql-test/r/ps_4heap.result	2009-02-05 09:49:32 +0000
@@ -1287,11 +1287,12 @@ a	b
 set @arg00=NULL;
 set @arg01=2;
 execute stmt1 using @arg00, @arg01;
-ERROR 23000: Column 'a' cannot be null
+Warnings:
+Warning	1048	Column 'a' cannot be null
 select a,b from t1 order by a;
 a	b
+0	two
 1	one
-2	two
 3	three
 4	four
 set @arg00=0;

=== modified file 'mysql-test/r/ps_5merge.result'
--- a/mysql-test/r/ps_5merge.result	2008-08-15 20:42:29 +0000
+++ b/mysql-test/r/ps_5merge.result	2009-02-05 09:49:32 +0000
@@ -1329,11 +1329,12 @@ a	b
 set @arg00=NULL;
 set @arg01=2;
 execute stmt1 using @arg00, @arg01;
-ERROR 23000: Column 'a' cannot be null
+Warnings:
+Warning	1048	Column 'a' cannot be null
 select a,b from t1 order by a;
 a	b
+0	two
 1	one
-2	two
 3	three
 4	four
 set @arg00=0;
@@ -4350,11 +4351,12 @@ a	b
 set @arg00=NULL;
 set @arg01=2;
 execute stmt1 using @arg00, @arg01;
-ERROR 23000: Column 'a' cannot be null
+Warnings:
+Warning	1048	Column 'a' cannot be null
 select a,b from t1 order by a;
 a	b
+0	two
 1	one
-2	two
 3	three
 4	four
 set @arg00=0;

=== modified file 'mysql-test/r/warnings.result'
--- a/mysql-test/r/warnings.result	2008-10-23 19:27:09 +0000
+++ b/mysql-test/r/warnings.result	2009-02-05 09:49:32 +0000
@@ -98,7 +98,8 @@ Warning	1265	Data truncated for column '
 Warning	1265	Data truncated for column 'c' at row 2
 alter table t1 add d char(2);
 update t1 set a=NULL where a=10;
-ERROR 23000: Column 'a' cannot be null
+Warnings:
+Warning	1048	Column 'a' cannot be null
 update t1 set c='mysql ab' where c='test';
 Warnings:
 Warning	1265	Data truncated for column 'c' at row 4

=== modified file 'mysql-test/suite/ndb/r/ps_7ndb.result'
--- a/mysql-test/suite/ndb/r/ps_7ndb.result	2008-08-15 20:42:29 +0000
+++ b/mysql-test/suite/ndb/r/ps_7ndb.result	2009-02-05 09:49:32 +0000
@@ -1286,11 +1286,12 @@ a	b
 set @arg00=NULL;
 set @arg01=2;
 execute stmt1 using @arg00, @arg01;
-ERROR 23000: Column 'a' cannot be null
+Warnings:
+Warning	1048	Column 'a' cannot be null
 select a,b from t1 order by a;
 a	b
+0	two
 1	one
-2	two
 3	three
 4	four
 set @arg00=0;

=== modified file 'mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result'
--- a/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result	2008-01-11 17:39:45 +0000
+++ b/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result	2009-02-05 09:49:32 +0000
@@ -454,7 +454,9 @@ f1	f2	f3	f4
 update t31 set f5=555555555555555 where f3=6;
 update t31 set f2=2 where f3=2;
 update t31 set f1=NULL where f3=1;
-update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3;
+update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3;
+Warnings:
+Warning	1048	Column 'f3' cannot be null
 
 ** Delete from Master **
 
@@ -1593,7 +1595,9 @@ f1	f2	f3	f4
 update t31 set f5=555555555555555 where f3=6;
 update t31 set f2=2 where f3=2;
 update t31 set f1=NULL where f3=1;
-update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3;
+update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3;
+Warnings:
+Warning	1048	Column 'f3' cannot be null
 
 ** Delete from Master **
 
@@ -2732,7 +2736,9 @@ f1	f2	f3	f4
 update t31 set f5=555555555555555 where f3=6;
 update t31 set f2=2 where f3=2;
 update t31 set f1=NULL where f3=1;
-update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3;
+update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3;
+Warnings:
+Warning	1048	Column 'f3' cannot be null
 
 ** Delete from Master **
 

=== modified file 'mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result'
--- a/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result	2008-01-11 17:39:45 +0000
+++ b/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result	2009-02-05 09:49:32 +0000
@@ -454,7 +454,9 @@ f1	f2	f3	f4
 update t31 set f5=555555555555555 where f3=6;
 update t31 set f2=2 where f3=2;
 update t31 set f1=NULL where f3=1;
-update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3;
+update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3;
+Warnings:
+Warning	1048	Column 'f3' cannot be null
 
 ** Delete from Master **
 
@@ -1593,7 +1595,9 @@ f1	f2	f3	f4
 update t31 set f5=555555555555555 where f3=6;
 update t31 set f2=2 where f3=2;
 update t31 set f1=NULL where f3=1;
-update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3;
+update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3;
+Warnings:
+Warning	1048	Column 'f3' cannot be null
 
 ** Delete from Master **
 
@@ -2732,7 +2736,9 @@ f1	f2	f3	f4
 update t31 set f5=555555555555555 where f3=6;
 update t31 set f2=2 where f3=2;
 update t31 set f1=NULL where f3=1;
-update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3;
+update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3;
+Warnings:
+Warning	1048	Column 'f3' cannot be null
 
 ** Delete from Master **
 

=== modified file 'mysql-test/suite/rpl/t/rpl_err_ignoredtable.test'
--- a/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test	2008-01-31 16:46:50 +0000
+++ b/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test	2009-02-05 09:49:32 +0000
@@ -50,7 +50,7 @@ kill @id;
 drop table t2,t3;
 insert into t4 values (3),(4);
 connection master;
---error 0,1053,2013,1048
+--error 0,1053,2013
 reap;
 connection master1;
 save_master_pos;

=== modified file 'mysql-test/t/auto_increment.test'
--- a/mysql-test/t/auto_increment.test	2008-09-16 13:07:59 +0000
+++ b/mysql-test/t/auto_increment.test	2009-02-05 09:49:32 +0000
@@ -149,7 +149,6 @@ delete from t1 where a=0;
 update t1 set a=0 where b=5;
 select * from t1 order by b;
 delete from t1 where a=0;
---error 1048
 update t1 set a=NULL where b=6;
 update t1 set a=300 where b=7;
 SET SQL_MODE='';
@@ -165,7 +164,6 @@ delete from t1 where a=0;
 update t1 set a=0 where b=12;
 select * from t1 order by b;
 delete from t1 where a=0;
---error 1048
 update t1 set a=NULL where b=13;
 update t1 set a=500 where b=14;
 select * from t1 order by b;

=== modified file 'mysql-test/t/csv_not_null.test'
--- a/mysql-test/t/csv_not_null.test	2008-02-14 13:17:47 +0000
+++ b/mysql-test/t/csv_not_null.test	2009-02-05 09:49:32 +0000
@@ -93,7 +93,6 @@ SELECT * FROM t1;
 UPDATE t1 set b = 'new_value' where a = 0;
 --enable_warnings
 SELECT * FROM t1;
---error ER_BAD_NULL_ERROR
 UPDATE t1 set b = NULL where b = 'new_value';
 SELECT * FROM t1;
 

=== modified file 'mysql-test/t/null.test'
--- a/mysql-test/t/null.test	2008-01-11 01:06:08 +0000
+++ b/mysql-test/t/null.test	2009-02-05 09:49:32 +0000
@@ -61,9 +61,7 @@ drop table t1;
 #
 CREATE TABLE t1 (a varchar(16) NOT NULL default '', b smallint(6) NOT NULL default 0, c datetime NOT NULL default '0000-00-00 00:00:00', d smallint(6) NOT NULL default 0);
 INSERT INTO t1 SET a = "", d= "2003-01-14 03:54:55";
---error 1048
 UPDATE t1 SET d=1/NULL;
---error 1048
 UPDATE t1 SET d=NULL;
 --error 1048
 INSERT INTO t1 (a) values (null);

=== modified file 'mysql-test/t/warnings.test'
--- a/mysql-test/t/warnings.test	2008-04-03 09:50:43 +0000
+++ b/mysql-test/t/warnings.test	2009-02-05 09:49:32 +0000
@@ -65,7 +65,6 @@ create table t1(a tinyint NOT NULL, b ti
 insert into t1 values(NULL,100,'mysql'),(10,-1,'mysql ab'),(500,256,'open source'),(20,NULL,'test');
 alter table t1 modify c char(4);
 alter table t1 add d char(2);
---error 1048
 update t1 set a=NULL where a=10;
 update t1 set c='mysql ab' where c='test';
 update t1 set d=c;

=== modified file 'sql/sql_update.cc'
--- a/sql/sql_update.cc	2009-01-08 19:03:56 +0000
+++ b/sql/sql_update.cc	2009-02-05 09:49:32 +0000
@@ -526,9 +526,11 @@ int mysql_update(THD *thd,
   init_read_record(&info, thd, table, select, 0, 1, FALSE);
 
   updated= found= 0;
-  /* Generate an error when trying to set a NOT NULL field to NULL. */
-  thd->count_cuted_fields= ignore ? CHECK_FIELD_WARN
-                                  : CHECK_FIELD_ERROR_FOR_NULL;
+  /*
+    Generate an error (in TRADITIONAL mode) or warning
+    when trying to set a NOT NULL field to NULL.
+  */
+  thd->count_cuted_fields= CHECK_FIELD_WARN;
   thd->cuted_fields=0L;
   thd_proc_info(thd, "Updating");
 

Thread
bzr commit into mysql-5.1-bugteam branch (gshchepa:2784) Bug#39265Gleb Shchepa5 Feb