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
4b55fbe0
Commit
4b55fbe0
authored
Jun 05, 2003
by
jani@ua126d19.elisa.omakaista.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a bug in concat_ws(), which did not add concat separator
in case of an empty string. Bug ID 586.
parent
aeb655e0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
mysql-test/r/func_str.result
mysql-test/r/func_str.result
+1
-1
sql/item_strfunc.cc
sql/item_strfunc.cc
+4
-4
No files found.
mysql-test/r/func_str.result
View file @
4b55fbe0
...
...
@@ -64,7 +64,7 @@ concat_ws(NULL,'a') concat_ws(',',NULL,'')
NULL
select concat_ws(',','',NULL,'a');
concat_ws(',','',NULL,'a')
a
,
a
SELECT CONCAT('"',CONCAT_WS('";"',repeat('a',60),repeat('b',60),repeat('c',60),repeat('d',100)), '"');
CONCAT('"',CONCAT_WS('";"',repeat('a',60),repeat('b',60),repeat('c',60),repeat('d',100)), '"')
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";"cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc";"dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd"
...
...
sql/item_strfunc.cc
View file @
4b55fbe0
...
...
@@ -495,18 +495,18 @@ String *Item_func_concat_ws::val_str(String *str)
str
->
length
(
0
);
// QQ; Should be removed
res
=
str
;
// Skip until non-null a
nd non-empty a
rgument is found.
// Skip until non-null argument is found.
// If not, return the empty string
for
(
i
=
0
;
i
<
arg_count
;
i
++
)
if
((
res
=
args
[
i
]
->
val_str
(
str
))
&&
res
->
length
()
)
if
((
res
=
args
[
i
]
->
val_str
(
str
)))
break
;
if
(
i
==
arg_count
)
return
&
empty_string
;
for
(
i
++
;
i
<
arg_count
;
i
++
)
{
if
(
!
(
res2
=
args
[
i
]
->
val_str
(
use_as_buff
))
||
!
res2
->
length
()
)
continue
;
// Skip NULL
and empty string
if
(
!
(
res2
=
args
[
i
]
->
val_str
(
use_as_buff
)))
continue
;
// Skip NULL
if
(
res
->
length
()
+
sep_str
->
length
()
+
res2
->
length
()
>
current_thd
->
variables
.
max_allowed_packet
)
...
...
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