Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
935b5ec4
Commit
935b5ec4
authored
Jun 08, 2005
by
hf@deer.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for bug #9894 (Negative numbers are allowed to 'unsigned' column)
parent
79b82323
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
8 deletions
+22
-8
mysql-test/r/type_decimal.result
mysql-test/r/type_decimal.result
+6
-6
mysql-test/r/type_newdecimal.result
mysql-test/r/type_newdecimal.result
+6
-1
mysql-test/t/type_newdecimal.test
mysql-test/t/type_newdecimal.test
+9
-0
sql/field.cc
sql/field.cc
+1
-1
No files found.
mysql-test/r/type_decimal.result
View file @
935b5ec4
...
@@ -414,8 +414,8 @@ Warning 1264 Out of range value adjusted for column 'a' at row 2
...
@@ -414,8 +414,8 @@ Warning 1264 Out of range value adjusted for column 'a' at row 2
Warning 1264 Out of range value adjusted for column 'a' at row 7
Warning 1264 Out of range value adjusted for column 'a' at row 7
select * from t1;
select * from t1;
a
a
9999999999
0
9999999999
0
1
1
1
1
1
1
...
@@ -430,8 +430,8 @@ Warning 1264 Out of range value adjusted for column 'a' at row 2
...
@@ -430,8 +430,8 @@ Warning 1264 Out of range value adjusted for column 'a' at row 2
Warning 1264 Out of range value adjusted for column 'a' at row 7
Warning 1264 Out of range value adjusted for column 'a' at row 7
select * from t1;
select * from t1;
a
a
9999999999
0000000000
9999999999
0000000000
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
...
@@ -446,8 +446,8 @@ Warning 1264 Out of range value adjusted for column 'a' at row 2
...
@@ -446,8 +446,8 @@ Warning 1264 Out of range value adjusted for column 'a' at row 2
Warning 1264 Out of range value adjusted for column 'a' at row 7
Warning 1264 Out of range value adjusted for column 'a' at row 7
select * from t1;
select * from t1;
a
a
9999999999
0000000000
9999999999
0000000000
0000000001
0000000001
0000000001
0000000001
0000000001
0000000001
...
...
mysql-test/r/type_newdecimal.result
View file @
935b5ec4
...
@@ -119,7 +119,7 @@ a
...
@@ -119,7 +119,7 @@ a
99.99
99.99
99.99
99.99
99.99
99.99
99.99
0.00
0.00
0.00
0.00
0.00
0.00
0.00
...
@@ -891,3 +891,8 @@ NULL
...
@@ -891,3 +891,8 @@ NULL
select abs(NULL);
select abs(NULL);
abs(NULL)
abs(NULL)
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;
mysql-test/t/type_newdecimal.test
View file @
935b5ec4
...
@@ -925,3 +925,12 @@ DROP TABLE t1;
...
@@ -925,3 +925,12 @@ DROP TABLE t1;
select
abs
(
10
/
0
);
select
abs
(
10
/
0
);
select
abs
(
NULL
);
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
;
sql/field.cc
View file @
935b5ec4
...
@@ -2446,7 +2446,7 @@ int Field_new_decimal::store(longlong nr)
...
@@ -2446,7 +2446,7 @@ int Field_new_decimal::store(longlong nr)
int
err
;
int
err
;
if
((
err
=
int2my_decimal
(
E_DEC_FATAL_ERROR
&
~
E_DEC_OVERFLOW
,
if
((
err
=
int2my_decimal
(
E_DEC_FATAL_ERROR
&
~
E_DEC_OVERFLOW
,
nr
,
unsigned_flag
,
&
decimal_value
)))
nr
,
false
,
&
decimal_value
)))
{
{
if
(
check_overflow
(
err
))
if
(
check_overflow
(
err
))
set_value_on_overflow
(
&
decimal_value
,
decimal_value
.
sign
());
set_value_on_overflow
(
&
decimal_value
,
decimal_value
.
sign
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment