List:Commits« Previous MessageNext Message »
From:Staale Smedseng Date:January 22 2009 3:14pm
Subject:bzr commit into mysql-5.0-bugteam branch (staale.smedseng:2735) Bug#40565
View as plain text  
#At file:///export/home/tmp/ss156133/z/b40565-50/

 2735 Staale Smedseng	2009-01-22
      A verification test for Bug#40565 'Update Query Results 
      in "1 Row Affected" But Should Be "Zero Rows"'
modified:
  mysql-test/r/type_decimal.result
  mysql-test/t/type_decimal.test

=== modified file 'mysql-test/r/type_decimal.result'
--- a/mysql-test/r/type_decimal.result	2008-04-24 20:39:37 +0000
+++ b/mysql-test/r/type_decimal.result	2009-01-22 15:13:57 +0000
@@ -953,4 +953,28 @@ max(case 1 when 1 then c else null end)
 201.11
 300.00
 drop table t1;
+USE test;
+DROP TABLE IF EXISTS tn;
+Warnings:
+Note	1051	Unknown table 'tn'
+CREATE TABLE tn(id INT, value DECIMAL(4,2));
+INSERT INTO tn VALUES (1, NULL);
+SELECT * FROM tn;
+id	value
+1	NULL
+UPDATE tn SET value=NULL;
+affected rows: 0
+info: Rows matched: 1  Changed: 0  Warnings: 0
+INSERT INTO tn VALUES (2, 3.5);
+SELECT * FROM tn;
+id	value
+1	NULL
+2	3.50
+UPDATE tn SET value=NULL;
+affected rows: 1
+info: Rows matched: 2  Changed: 1  Warnings: 0
+UPDATE tn SET value=NULL;
+affected rows: 0
+info: Rows matched: 2  Changed: 0  Warnings: 0
+DROP TABLE tn;
 End of 5.0 tests

=== modified file 'mysql-test/t/type_decimal.test'
--- a/mysql-test/t/type_decimal.test	2008-04-24 20:39:37 +0000
+++ b/mysql-test/t/type_decimal.test	2009-01-22 15:13:57 +0000
@@ -529,4 +529,30 @@ insert into t1 values (300),(201.11);
 select max(case 1 when 1 then c else null end) from t1 group by c;
 drop table t1;
 
+
+#
+# Bug#40565: Update Query Results in "1 Row Affected" But Should Be "Zero Rows"
+#
+USE test;
+DROP TABLE IF EXISTS tn;
+
+CREATE TABLE tn(id INT, value DECIMAL(4,2));
+INSERT INTO tn VALUES (1, NULL);
+SELECT * FROM tn;
+
+--enable_info
+UPDATE tn SET value=NULL;
+--disable_info 
+
+INSERT INTO tn VALUES (2, 3.5);
+SELECT * FROM tn;
+
+--enable_info
+UPDATE tn SET value=NULL;
+UPDATE tn SET value=NULL;
+--disable_info
+
+DROP TABLE tn;
+
+
 --echo End of 5.0 tests

Thread
bzr commit into mysql-5.0-bugteam branch (staale.smedseng:2735) Bug#40565Staale Smedseng22 Jan