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
986a51e4
Commit
986a51e4
authored
Sep 21, 2005
by
ramil@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a fix (bug #7589: Decimal types are ignored when updating data from another column).
parent
a26e1b72
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
23 deletions
+22
-23
mysql-test/r/type_decimal.result
mysql-test/r/type_decimal.result
+9
-0
mysql-test/r/union.result
mysql-test/r/union.result
+0
-15
mysql-test/t/type_decimal.test
mysql-test/t/type_decimal.test
+10
-0
mysql-test/t/union.test
mysql-test/t/union.test
+0
-8
sql/field_conv.cc
sql/field_conv.cc
+3
-0
No files found.
mysql-test/r/type_decimal.result
View file @
986a51e4
...
...
@@ -646,3 +646,12 @@ a
9999.999
0000.000
drop table t1;
create table t1(a decimal(10,5), b decimal(10,1));
insert into t1 values(123.12345, 123.12345);
update t1 set b=a;
Warnings:
Warning 1265 Data truncated for column 'b' at row 1
select * from t1;
a b
123.12345 123.1
drop table t1;
mysql-test/r/union.result
View file @
986a51e4
...
...
@@ -780,21 +780,6 @@ t1 CREATE TABLE `t1` (
`b` longblob
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1,t2;
create table t1 (d decimal(10,1));
create table t2 (d decimal(10,9));
insert into t1 values ("100000000.0");
insert into t2 values ("1.23456780");
create table t3 select * from t2 union select * from t1;
select * from t3;
d
1.234567800
100000000.0
show create table t3;
Table Create Table
t3 CREATE TABLE `t3` (
`d` decimal(10,9) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1,t2,t3;
create table t1 select 1 union select -1;
select * from t1;
1
...
...
mysql-test/t/type_decimal.test
View file @
986a51e4
...
...
@@ -266,4 +266,14 @@ insert into t1 values ('1'),('+1'),('-1'),('0000000001'),('+0000000001'),('-0000
select
*
from
t1
;
drop
table
t1
;
#
# Bug #7589: a problem with update from column
#
create
table
t1
(
a
decimal
(
10
,
5
),
b
decimal
(
10
,
1
));
insert
into
t1
values
(
123.12345
,
123.12345
);
update
t1
set
b
=
a
;
select
*
from
t1
;
drop
table
t1
;
# End of 4.1 tests
mysql-test/t/union.test
View file @
986a51e4
...
...
@@ -425,14 +425,6 @@ create table t1 SELECT b from t2 UNION select tx from t2;
select
*
from
t1
;
show
create
table
t1
;
drop
table
t1
,
t2
;
create
table
t1
(
d
decimal
(
10
,
1
));
create
table
t2
(
d
decimal
(
10
,
9
));
insert
into
t1
values
(
"100000000.0"
);
insert
into
t2
values
(
"1.23456780"
);
create
table
t3
select
*
from
t2
union
select
*
from
t1
;
select
*
from
t3
;
show
create
table
t3
;
drop
table
t1
,
t2
,
t3
;
create
table
t1
select
1
union
select
-
1
;
select
*
from
t1
;
show
create
table
t1
;
...
...
sql/field_conv.cc
View file @
986a51e4
...
...
@@ -599,6 +599,9 @@ void field_conv(Field *to,Field *from)
!
(
to
->
flags
&
UNSIGNED_FLAG
&&
!
(
from
->
flags
&
UNSIGNED_FLAG
))
&&
to
->
real_type
()
!=
FIELD_TYPE_ENUM
&&
to
->
real_type
()
!=
FIELD_TYPE_SET
&&
(
to
->
real_type
()
!=
FIELD_TYPE_DECIMAL
||
(
to
->
field_length
==
from
->
field_length
&&
(((
Field_num
*
)
to
)
->
dec
==
((
Field_num
*
)
from
)
->
dec
)))
&&
from
->
charset
()
==
to
->
charset
()
&&
to
->
table
->
db_low_byte_first
==
from
->
table
->
db_low_byte_first
)
{
// Identical fields
...
...
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