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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
aa7a27d2
Commit
aa7a27d2
authored
Nov 06, 2006
by
holyfoot/hf@mysql.com/deer.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk@192.168.21.1:mysql-5.0-opt
into mysql.com:/home/hf/work/8663/my50-8663
parents
0d10dbe3
fca6f714
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
3 deletions
+19
-3
mysql-test/r/type_newdecimal.result
mysql-test/r/type_newdecimal.result
+5
-0
mysql-test/t/type_newdecimal.test
mysql-test/t/type_newdecimal.test
+5
-1
sql/item_func.cc
sql/item_func.cc
+8
-1
strings/decimal.c
strings/decimal.c
+1
-1
No files found.
mysql-test/r/type_newdecimal.result
View file @
aa7a27d2
...
@@ -1420,3 +1420,8 @@ f1
...
@@ -1420,3 +1420,8 @@ 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: ''
mysql-test/t/type_newdecimal.test
View file @
aa7a27d2
...
@@ -1109,10 +1109,14 @@ select i, count(distinct j) from t1 group by i;
...
@@ -1109,10 +1109,14 @@ select i, count(distinct j) from t1 group by i;
select
i
+
0.0
as
i2
,
count
(
distinct
j
)
from
t1
group
by
i2
;
select
i
+
0.0
as
i2
,
count
(
distinct
j
)
from
t1
group
by
i2
;
drop
table
t1
;
drop
table
t1
;
create
table
t1
(
f1
decimal
(
20
,
6
));
create
table
t1
(
f1
decimal
(
20
,
6
));
insert
into
t1
values
(
CAST
(
'10:11:12'
AS
date
)
+
interval
14
microsecond
);
insert
into
t1
values
(
CAST
(
'10:11:12'
AS
date
)
+
interval
14
microsecond
);
insert
into
t1
values
(
CAST
(
'10:11:12'
AS
time
));
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
);
sql/item_func.cc
View file @
aa7a27d2
...
@@ -964,7 +964,14 @@ longlong Item_func_unsigned::val_int()
...
@@ -964,7 +964,14 @@ longlong Item_func_unsigned::val_int()
longlong
value
;
longlong
value
;
int
error
;
int
error
;
if
(
args
[
0
]
->
cast_to_int_type
()
!=
STRING_RESULT
)
if
(
args
[
0
]
->
cast_to_int_type
()
==
DECIMAL_RESULT
)
{
my_decimal
tmp
,
*
dec
=
args
[
0
]
->
val_decimal
(
&
tmp
);
if
(
!
(
null_value
=
args
[
0
]
->
null_value
))
my_decimal2int
(
E_DEC_FATAL_ERROR
,
dec
,
1
,
&
value
);
return
value
;
}
else
if
(
args
[
0
]
->
cast_to_int_type
()
!=
STRING_RESULT
)
{
{
value
=
args
[
0
]
->
val_int
();
value
=
args
[
0
]
->
val_int
();
null_value
=
args
[
0
]
->
null_value
;
null_value
=
args
[
0
]
->
null_value
;
...
...
strings/decimal.c
View file @
aa7a27d2
...
@@ -1036,7 +1036,7 @@ int decimal2ulonglong(decimal_t *from, ulonglong *to)
...
@@ -1036,7 +1036,7 @@ int decimal2ulonglong(decimal_t *from, ulonglong *to)
x
=
x
*
DIG_BASE
+
*
buf
++
;
x
=
x
*
DIG_BASE
+
*
buf
++
;
if
(
unlikely
(
y
>
((
ulonglong
)
ULONGLONG_MAX
/
DIG_BASE
)
||
x
<
y
))
if
(
unlikely
(
y
>
((
ulonglong
)
ULONGLONG_MAX
/
DIG_BASE
)
||
x
<
y
))
{
{
*
to
=
y
;
*
to
=
ULONGLONG_MAX
;
return
E_DEC_OVERFLOW
;
return
E_DEC_OVERFLOW
;
}
}
}
}
...
...
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