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
56ce4907
Commit
56ce4907
authored
Mar 19, 2007
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal:/home/bk/mysql-5.1-new-maint
into pilot.blaudden:/home/msvensson/mysql/mysql-5.1-maint
parents
9955750b
fdb2e640
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
10 deletions
+38
-10
mysql-test/r/type_newdecimal.result
mysql-test/r/type_newdecimal.result
+13
-5
mysql-test/t/type_newdecimal.test
mysql-test/t/type_newdecimal.test
+16
-5
sql/field_conv.cc
sql/field_conv.cc
+9
-0
No files found.
mysql-test/r/type_newdecimal.result
View file @
56ce4907
...
@@ -1428,6 +1428,19 @@ f1
...
@@ -1428,6 +1428,19 @@ f1
20101112000000.000014
20101112000000.000014
101112.000000
101112.000000
drop table t1;
drop table t1;
select cast(19999999999999999999 as unsigned);
cast(19999999999999999999 as unsigned)
18446744073709551615
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
create table t1(a decimal(18));
insert into t1 values(123456789012345678);
alter table t1 modify column a decimal(19);
select * from t1;
a
123456789012345678
drop table t1;
End of 5.0 tests
select cast(143.481 as decimal(4,1));
select cast(143.481 as decimal(4,1));
cast(143.481 as decimal(4,1))
cast(143.481 as decimal(4,1))
143.5
143.5
...
@@ -1455,8 +1468,3 @@ Error 1264 Out of range value for column 'cast(-13.4 as decimal(2,1))' at row 1
...
@@ -1455,8 +1468,3 @@ Error 1264 Out of range value for column 'cast(-13.4 as decimal(2,1))' at row 1
select cast(98.6 as decimal(2,0));
select cast(98.6 as decimal(2,0));
cast(98.6 as decimal(2,0))
cast(98.6 as decimal(2,0))
99
99
select cast(19999999999999999999 as unsigned);
cast(19999999999999999999 as unsigned)
18446744073709551615
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
mysql-test/t/type_newdecimal.test
View file @
56ce4907
...
@@ -1126,6 +1126,22 @@ insert into t1 values (CAST('10:11:12' AS time));
...
@@ -1126,6 +1126,22 @@ insert into t1 values (CAST('10:11:12' AS time));
select
*
from
t1
;
select
*
from
t1
;
drop
table
t1
;
drop
table
t1
;
#
# Bug #8663 (cant use bigint as input to CAST)
#
select
cast
(
19999999999999999999
as
unsigned
);
#
# Bug #24558: Increasing decimal column length causes data loss
#
create
table
t1
(
a
decimal
(
18
));
insert
into
t1
values
(
123456789012345678
);
alter
table
t1
modify
column
a
decimal
(
19
);
select
*
from
t1
;
drop
table
t1
;
--
echo
End
of
5.0
tests
#
#
# Bug#16172 DECIMAL data type processed incorrectly
# Bug#16172 DECIMAL data type processed incorrectly
#
#
...
@@ -1136,8 +1152,3 @@ select cast(-3.4 as decimal(2,1));
...
@@ -1136,8 +1152,3 @@ select cast(-3.4 as decimal(2,1));
select
cast
(
99.6
as
decimal
(
2
,
0
));
select
cast
(
99.6
as
decimal
(
2
,
0
));
select
cast
(
-
13.4
as
decimal
(
2
,
1
));
select
cast
(
-
13.4
as
decimal
(
2
,
1
));
select
cast
(
98.6
as
decimal
(
2
,
0
));
select
cast
(
98.6
as
decimal
(
2
,
0
));
# Bug #8663 (cant use bigint as input to CAST)
#
select
cast
(
19999999999999999999
as
unsigned
);
sql/field_conv.cc
View file @
56ce4907
...
@@ -336,6 +336,13 @@ static void do_field_real(Copy_field *copy)
...
@@ -336,6 +336,13 @@ static void do_field_real(Copy_field *copy)
}
}
static
void
do_field_decimal
(
Copy_field
*
copy
)
{
my_decimal
value
;
copy
->
to_field
->
store_decimal
(
copy
->
from_field
->
val_decimal
(
&
value
));
}
/*
/*
string copy for single byte characters set when to string is shorter than
string copy for single byte characters set when to string is shorter than
from string
from string
...
@@ -580,6 +587,8 @@ void (*Copy_field::get_copy_func(Field *to,Field *from))(Copy_field*)
...
@@ -580,6 +587,8 @@ void (*Copy_field::get_copy_func(Field *to,Field *from))(Copy_field*)
if
(
to
->
real_type
()
==
MYSQL_TYPE_BIT
||
if
(
to
->
real_type
()
==
MYSQL_TYPE_BIT
||
from
->
real_type
()
==
MYSQL_TYPE_BIT
)
from
->
real_type
()
==
MYSQL_TYPE_BIT
)
return
do_field_int
;
return
do_field_int
;
if
(
to
->
result_type
()
==
DECIMAL_RESULT
)
return
do_field_decimal
;
// Check if identical fields
// Check if identical fields
if
(
from
->
result_type
()
==
STRING_RESULT
)
if
(
from
->
result_type
()
==
STRING_RESULT
)
{
{
...
...
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