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
fe57b750
Commit
fe57b750
authored
Jul 07, 2004
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug#4441 - crash in UNHEX(NULL)
parent
d8dabe43
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
7 deletions
+10
-7
mysql-test/r/func_str.result
mysql-test/r/func_str.result
+3
-3
mysql-test/t/func_str.test
mysql-test/t/func_str.test
+1
-1
sql/item_strfunc.cc
sql/item_strfunc.cc
+6
-3
No files found.
mysql-test/r/func_str.result
View file @
fe57b750
...
...
@@ -192,9 +192,9 @@ length(quote(concat(char(0),"test")))
select hex(quote(concat(char(224),char(227),char(230),char(231),char(232),char(234),char(235))));
hex(quote(concat(char(224),char(227),char(230),char(231),char(232),char(234),char(235))))
27E0E3E6E7E8EAEB27
select unhex(hex("foobar")), hex(unhex("1234567890ABCDEF")), unhex("345678");
unhex(hex("foobar")) hex(unhex("1234567890ABCDEF")) unhex("345678")
foobar 1234567890ABCDEF 4Vx
select unhex(hex("foobar")), hex(unhex("1234567890ABCDEF")), unhex("345678")
, unhex(NULL)
;
unhex(hex("foobar")) hex(unhex("1234567890ABCDEF")) unhex("345678")
unhex(NULL)
foobar 1234567890ABCDEF 4Vx
NULL
select hex(unhex("1")), hex(unhex("12")), hex(unhex("123")), hex(unhex("1234")), hex(unhex("12345")), hex(unhex("123456"));
hex(unhex("1")) hex(unhex("12")) hex(unhex("123")) hex(unhex("1234")) hex(unhex("12345")) hex(unhex("123456"))
01 12 0123 1234 012345 123456
...
...
mysql-test/t/func_str.test
View file @
fe57b750
...
...
@@ -78,7 +78,7 @@ select quote(concat('abc\'', '\\cba'));
select
quote
(
1
/
0
),
quote
(
'\0\Z'
);
select
length
(
quote
(
concat
(
char
(
0
),
"test"
)));
select
hex
(
quote
(
concat
(
char
(
224
),
char
(
227
),
char
(
230
),
char
(
231
),
char
(
232
),
char
(
234
),
char
(
235
))));
select
unhex
(
hex
(
"foobar"
)),
hex
(
unhex
(
"1234567890ABCDEF"
)),
unhex
(
"345678"
);
select
unhex
(
hex
(
"foobar"
)),
hex
(
unhex
(
"1234567890ABCDEF"
)),
unhex
(
"345678"
)
,
unhex
(
NULL
)
;
select
hex
(
unhex
(
"1"
)),
hex
(
unhex
(
"12"
)),
hex
(
unhex
(
"123"
)),
hex
(
unhex
(
"1234"
)),
hex
(
unhex
(
"12345"
)),
hex
(
unhex
(
"123456"
));
select
length
(
unhex
(
md5
(
"abrakadabra"
)));
...
...
sql/item_strfunc.cc
View file @
fe57b750
...
...
@@ -2298,15 +2298,18 @@ String *Item_func_unhex::val_str(String *str)
{
DBUG_ASSERT
(
fixed
==
1
);
/* Convert given hex string to a binary string */
String
*
res
=
args
[
0
]
->
val_str
(
str
);
const
char
*
from
=
res
->
ptr
(),
*
end
;
char
*
to
;
int
r
;
if
(
!
res
||
tmp_value
.
alloc
((
1
+
res
->
length
())
/
2
))
{
null_value
=
1
;
return
0
;
}
const
char
*
from
=
res
->
ptr
(),
*
end
;
char
*
to
;
int
r
;
null_value
=
0
;
tmp_value
.
length
((
1
+
res
->
length
())
/
2
);
to
=
(
char
*
)
tmp_value
.
ptr
();
...
...
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