Below is the list of changes that have just been committed into a local
5.0 repository of hf. When hf does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1946 05/06/08 12:25:57 hf@deer.(none) +4 -0
Fix for bug #9894 (Negative numbers are allowed to 'unsigned' column)
sql/field.cc
1.267 05/06/08 12:24:05 hf@deer.(none) +1 -1
We need to refuse negative integers when 'unsigned'
mysql-test/t/type_newdecimal.test
1.15 05/06/08 12:24:05 hf@deer.(none) +9 -0
test case added
mysql-test/r/type_newdecimal.result
1.15 05/06/08 12:24:05 hf@deer.(none) +6 -1
test result fixed
mysql-test/r/type_decimal.result
1.33 05/06/08 12:24:05 hf@deer.(none) +6 -6
test result fixed
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: hf
# Host: deer.(none)
# Root: /home/hf/work/mysql-5.0.9894
--- 1.266/sql/field.cc Mon Jun 6 23:21:22 2005
+++ 1.267/sql/field.cc Wed Jun 8 12:24:05 2005
@@ -2446,7 +2446,7 @@
int err;
if ((err= int2my_decimal(E_DEC_FATAL_ERROR & ~E_DEC_OVERFLOW,
- nr, unsigned_flag, &decimal_value)))
+ nr, false, &decimal_value)))
{
if (check_overflow(err))
set_value_on_overflow(&decimal_value, decimal_value.sign());
--- 1.14/mysql-test/r/type_newdecimal.result Thu May 19 23:41:22 2005
+++ 1.15/mysql-test/r/type_newdecimal.result Wed Jun 8 12:24:05 2005
@@ -119,7 +119,7 @@
99.99
99.99
99.99
-99.99
+0.00
0.00
0.00
0.00
@@ -891,3 +891,8 @@
select abs(NULL);
abs(NULL)
NULL
+set @@sql_mode='traditional';
+create table t1( d1 decimal(18) unsigned, d2 decimal(20) unsigned, d3 decimal (22) unsigned);
+insert into t1 values(1,-1,-1);
+ERROR 22003: Out of range value adjusted for column 'd2' at row 1
+drop table t1;
--- 1.14/mysql-test/t/type_newdecimal.test Sun Jun 5 19:01:07 2005
+++ 1.15/mysql-test/t/type_newdecimal.test Wed Jun 8 12:24:05 2005
@@ -925,3 +925,12 @@
select abs(10/0);
select abs(NULL);
+
+#
+# Bug #9894 (negative to unsigned column)
+#
+set @@sql_mode='traditional';
+create table t1( d1 decimal(18) unsigned, d2 decimal(20) unsigned, d3 decimal (22) unsigned);
+--error 1264
+insert into t1 values(1,-1,-1);
+drop table t1;
--- 1.32/mysql-test/r/type_decimal.result Fri May 6 01:01:35 2005
+++ 1.33/mysql-test/r/type_decimal.result Wed Jun 8 12:24:05 2005
@@ -414,8 +414,8 @@
Warning 1264 Out of range value adjusted for column 'a' at row 7
select * from t1;
a
-9999999999
-9999999999
+0
+0
1
1
1
@@ -430,8 +430,8 @@
Warning 1264 Out of range value adjusted for column 'a' at row 7
select * from t1;
a
-9999999999
-9999999999
+0000000000
+0000000000
0000000001
0000000001
0000000001
@@ -446,8 +446,8 @@
Warning 1264 Out of range value adjusted for column 'a' at row 7
select * from t1;
a
-9999999999
-9999999999
+0000000000
+0000000000
0000000001
0000000001
0000000001
| Thread |
|---|
| • bk commit into 5.0 tree (hf:1.1946) BUG#9894 | holyfoot | 8 Jun |