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
a35c3243
Commit
a35c3243
authored
Jan 17, 2005
by
jimw@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix over-optimization that could result in an unsigned double field being
set to a negative value. (Bug #7700)
parent
46e44429
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
0 deletions
+14
-0
mysql-test/r/type_float.result
mysql-test/r/type_float.result
+7
-0
mysql-test/t/type_float.test
mysql-test/t/type_float.test
+6
-0
sql/field_conv.cc
sql/field_conv.cc
+1
-0
No files found.
mysql-test/r/type_float.result
View file @
a35c3243
...
...
@@ -120,3 +120,10 @@ drop table t1;
create table t1 (f float(54));
Incorrect column specifier for column 'f'
drop table if exists t1;
create table t1 (d1 double, d2 double unsigned);
insert into t1 set d1 = -1.0;
update t1 set d2 = d1;
select * from t1;
d1 d2
-1 0
drop table t1;
mysql-test/t/type_float.test
View file @
a35c3243
...
...
@@ -67,3 +67,9 @@ drop table t1;
create
table
t1
(
f
float
(
54
));
# Should give an error
drop
table
if
exists
t1
;
# Don't allow 'double unsigned' to be set to a negative value (Bug #7700)
create
table
t1
(
d1
double
,
d2
double
unsigned
);
insert
into
t1
set
d1
=
-
1.0
;
update
t1
set
d2
=
d1
;
select
*
from
t1
;
drop
table
t1
;
sql/field_conv.cc
View file @
a35c3243
...
...
@@ -537,6 +537,7 @@ void field_conv(Field *to,Field *from)
if
(
to
->
real_type
()
==
from
->
real_type
())
{
if
(
to
->
pack_length
()
==
from
->
pack_length
()
&&
!
(
to
->
flags
&
UNSIGNED_FLAG
&&
!
(
from
->
flags
&
UNSIGNED_FLAG
))
&&
to
->
real_type
()
!=
FIELD_TYPE_ENUM
&&
to
->
real_type
()
!=
FIELD_TYPE_SET
&&
to
->
table
->
db_low_byte_first
==
from
->
table
->
db_low_byte_first
)
...
...
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