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
2747a738
Commit
2747a738
authored
Oct 13, 2005
by
kent@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
5b448a8d
3bfe3579
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
0 deletions
+16
-0
mysql-test/r/cast.result
mysql-test/r/cast.result
+3
-0
mysql-test/t/cast.test
mysql-test/t/cast.test
+5
-0
sql/item.h
sql/item.h
+8
-0
No files found.
mysql-test/r/cast.result
View file @
2747a738
...
...
@@ -367,3 +367,6 @@ DROP TABLE t1;
select cast(NULL as decimal(6)) as t1;
t1
NULL
select cast(1.0e+300 as signed int);
cast(1.0e+300 as signed int)
9223372036854775807
mysql-test/t/cast.test
View file @
2747a738
...
...
@@ -160,6 +160,11 @@ select cast(concat('184467440','73709551615') as signed);
select
cast
(
repeat
(
'1'
,
20
)
as
unsigned
);
select
cast
(
repeat
(
'1'
,
20
)
as
signed
);
#
# Bug #13344: cast of large decimal to signed int not handled correctly
#
select
cast
(
1.0e+300
as
signed
int
);
# End of 4.1 tests
...
...
sql/item.h
View file @
2747a738
...
...
@@ -1331,6 +1331,14 @@ class Item_float :public Item_num
longlong
val_int
()
{
DBUG_ASSERT
(
fixed
==
1
);
if
(
value
<=
(
double
)
LONGLONG_MIN
)
{
return
LONGLONG_MIN
;
}
else
if
(
value
>=
(
double
)
(
ulonglong
)
LONGLONG_MAX
)
{
return
LONGLONG_MAX
;
}
return
(
longlong
)
(
value
+
(
value
>
0
?
0.5
:
-
0.5
));
}
String
*
val_str
(
String
*
);
...
...
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