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
3d4e75d5
Commit
3d4e75d5
authored
Jun 16, 2007
by
gshchepa/uchum@gleb.loc
Browse files
Options
Browse Files
Download
Plain Diff
Merge gleb.loc:/home/uchum/work/bk/5.0-opt
into gleb.loc:/home/uchum/work/bk/5.0-opt-28625
parents
0f0d4720
8f09a374
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
9 deletions
+52
-9
mysql-test/r/bigint.result
mysql-test/r/bigint.result
+26
-0
mysql-test/t/bigint.test
mysql-test/t/bigint.test
+13
-0
sql/item_func.cc
sql/item_func.cc
+13
-9
No files found.
mysql-test/r/bigint.result
View file @
3d4e75d5
...
...
@@ -362,3 +362,29 @@ cast(-19999999999999999999 as signed)
-9223372036854775808
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
select -9223372036854775808;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def -9223372036854775808 8 20 20 N 32897 0 63
-9223372036854775808
-9223372036854775808
select -(9223372036854775808);
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def -(9223372036854775808) 8 20 20 N 32897 0 63
-(9223372036854775808)
-9223372036854775808
select -((9223372036854775808));
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def -((9223372036854775808)) 8 20 20 N 32897 0 63
-((9223372036854775808))
-9223372036854775808
select -(-(9223372036854775808));
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def -(-(9223372036854775808)) 246 21 19 N 129 0 63
-(-(9223372036854775808))
9223372036854775808
select --9223372036854775808, ---9223372036854775808, ----9223372036854775808;
--9223372036854775808 ---9223372036854775808 ----9223372036854775808
9223372036854775808 -9223372036854775808 9223372036854775808
select -(-9223372036854775808), -(-(-9223372036854775808));
-(-9223372036854775808) -(-(-9223372036854775808))
9223372036854775808 -9223372036854775808
mysql-test/t/bigint.test
View file @
3d4e75d5
...
...
@@ -294,3 +294,16 @@ drop table t1;
select
cast
(
19999999999999999999
as
signed
);
select
cast
(
-
19999999999999999999
as
signed
);
#
# Bug #28625: -9223372036854775808 doesn't fit in BIGINT.
#
--
enable_metadata
select
-
9223372036854775808
;
select
-
(
9223372036854775808
);
select
-
((
9223372036854775808
));
select
-
(
-
(
9223372036854775808
));
--
disable_metadata
select
--
9223372036854775808
,
---
9223372036854775808
,
----
9223372036854775808
;
select
-
(
-
9223372036854775808
),
-
(
-
(
-
9223372036854775808
));
sql/item_func.cc
View file @
3d4e75d5
...
...
@@ -1523,9 +1523,12 @@ void Item_func_neg::fix_length_and_dec()
Use val() to get value as arg_type doesn't mean that item is
Item_int or Item_real due to existence of Item_param.
*/
if
(
hybrid_type
==
INT_RESULT
&&
args
[
0
]
->
type
()
==
INT_ITEM
&&
((
ulonglong
)
args
[
0
]
->
val_int
()
>=
(
ulonglong
)
LONGLONG_MIN
))
if
(
hybrid_type
==
INT_RESULT
&&
args
[
0
]
->
const_item
())
{
longlong
val
=
args
[
0
]
->
val_int
();
if
((
ulonglong
)
val
>=
(
ulonglong
)
LONGLONG_MIN
&&
((
ulonglong
)
val
!=
(
ulonglong
)
LONGLONG_MIN
||
args
[
0
]
->
type
()
!=
INT_ITEM
))
{
/*
Ensure that result is converted to DECIMAL, as longlong can't hold
...
...
@@ -1534,6 +1537,7 @@ void Item_func_neg::fix_length_and_dec()
hybrid_type
=
DECIMAL_RESULT
;
DBUG_PRINT
(
"info"
,
(
"Type changed: DECIMAL_RESULT"
));
}
}
unsigned_flag
=
0
;
DBUG_VOID_RETURN
;
}
...
...
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