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
2b5ee94a
Commit
2b5ee94a
authored
Feb 23, 2005
by
gluh@gluh.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for bug#6317: string function CHAR, parameter is NULL, wrong result
parent
4996daec
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
0 deletions
+14
-0
mysql-test/r/func_str.result
mysql-test/r/func_str.result
+6
-0
mysql-test/t/func_str.test
mysql-test/t/func_str.test
+6
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+2
-0
No files found.
mysql-test/r/func_str.result
View file @
2b5ee94a
...
...
@@ -733,3 +733,9 @@ WHERE a = CONV('e251273eb74a8ee3', 16, 10);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1
DROP TABLE t1;
SELECT CHAR(NULL,121,83,81,'76') as my_column;
my_column
ySQL
SELECT CHAR_LENGTH(CHAR(NULL,121,83,81,'76')) as my_column;
my_column
4
mysql-test/t/func_str.test
View file @
2b5ee94a
...
...
@@ -476,3 +476,9 @@ EXPLAIN
WHERE
a
=
CONV
(
'e251273eb74a8ee3'
,
16
,
10
);
DROP
TABLE
t1
;
#
# Bug #6317: string function CHAR, parameter is NULL, wrong result
#
SELECT
CHAR
(
NULL
,
121
,
83
,
81
,
'76'
)
as
my_column
;
SELECT
CHAR_LENGTH
(
CHAR
(
NULL
,
121
,
83
,
81
,
'76'
))
as
my_column
;
sql/item_strfunc.cc
View file @
2b5ee94a
...
...
@@ -1868,6 +1868,7 @@ String *Item_func_char::val_str(String *str)
{
int32
num
=
(
int32
)
args
[
i
]
->
val_int
();
if
(
!
args
[
i
]
->
null_value
)
{
#ifdef USE_MB
if
(
use_mb
(
collation
.
collation
))
{
...
...
@@ -1883,6 +1884,7 @@ b1: str->append((char)(num>>8));
}
#endif
str
->
append
((
char
)
num
);
}
}
str
->
set_charset
(
collation
.
collation
);
str
->
realloc
(
str
->
length
());
// Add end 0 (for Purify)
...
...
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