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
b0ec1cd8
Commit
b0ec1cd8
authored
Jul 13, 2005
by
gluh@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/gluh/MySQL/Merge/4.1
into mysql.com:/home/gluh/MySQL/Merge/5.0
parents
738e0f15
672e1f20
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
2 deletions
+22
-2
mysql-test/r/func_str.result
mysql-test/r/func_str.result
+3
-0
mysql-test/t/func_str.test
mysql-test/t/func_str.test
+5
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+14
-2
No files found.
mysql-test/r/func_str.result
View file @
b0ec1cd8
...
...
@@ -876,3 +876,6 @@ abc abc c bc abc
abcd abcd d cd bcd abcd
abcde abcde e de cde bcde abcde
drop table t1;
select hex(29223372036854775809), hex(-29223372036854775809);
hex(29223372036854775809) hex(-29223372036854775809)
FFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFF
mysql-test/t/func_str.test
View file @
b0ec1cd8
...
...
@@ -608,3 +608,8 @@ insert t1 values ('ab'), ('abc'), ('abcd'), ('abcde');
select
*
,
substring
(
b
,
1
),
substring
(
b
,
-
1
),
substring
(
b
,
-
2
),
substring
(
b
,
-
3
),
substring
(
b
,
-
4
),
substring
(
b
,
-
5
)
from
t1
;
select
*
from
(
select
*
,
substring
(
b
,
1
),
substring
(
b
,
-
1
),
substring
(
b
,
-
2
),
substring
(
b
,
-
3
),
substring
(
b
,
-
4
),
substring
(
b
,
-
5
)
from
t1
)
t
;
drop
table
t1
;
#
# Bug #9854 hex() and out of range handling
#
select
hex
(
29223372036854775809
),
hex
(
-
29223372036854775809
);
sql/item_strfunc.cc
View file @
b0ec1cd8
...
...
@@ -2380,9 +2380,21 @@ String *Item_func_hex::val_str(String *str)
DBUG_ASSERT
(
fixed
==
1
);
if
(
args
[
0
]
->
result_type
()
!=
STRING_RESULT
)
{
/* Return hex of unsigned longlong value */
longlong
dec
=
args
[
0
]
->
val_int
();
ulonglong
dec
;
char
ans
[
65
],
*
ptr
;
/* Return hex of unsigned longlong value */
if
(
args
[
0
]
->
result_type
()
==
REAL_RESULT
)
{
double
val
=
args
[
0
]
->
val
();
if
((
val
<=
(
double
)
LONGLONG_MIN
)
||
(
val
>=
(
double
)
(
ulonglong
)
ULONGLONG_MAX
))
dec
=
~
(
longlong
)
0
;
else
dec
=
(
ulonglong
)
(
val
+
(
val
>
0
?
0.5
:
-
0.5
));
}
else
dec
=
(
ulonglong
)
args
[
0
]
->
val_int
();
if
((
null_value
=
args
[
0
]
->
null_value
))
return
0
;
ptr
=
longlong2str
(
dec
,
ans
,
16
);
...
...
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