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
7ca1538b
Commit
7ca1538b
authored
May 16, 2008
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge host.loc:/work/bugs/5.0-bugteam-36488
into host.loc:/work/bk/5.0-bugteam
parents
21c07eb7
66367aee
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
0 deletions
+23
-0
mysql-test/r/func_concat.result
mysql-test/r/func_concat.result
+7
-0
mysql-test/t/func_concat.test
mysql-test/t/func_concat.test
+10
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+6
-0
No files found.
mysql-test/r/func_concat.result
View file @
7ca1538b
...
...
@@ -82,3 +82,10 @@ a
1234562
x
drop table t1;
CREATE TABLE t1 (c1 varchar(100), c2 varchar(100));
INSERT INTO t1 VALUES ('',''), ('','First'), ('Random','Random');
SELECT * FROM t1 WHERE CONCAT(c1,' ',c2) REGEXP 'First.*';
c1 c2
First
DROP TABLE t1;
# End of 5.0 tests
mysql-test/t/func_concat.test
View file @
7ca1538b
...
...
@@ -68,3 +68,13 @@ create table t1(f1 varchar(6)) charset=utf8;
insert
into
t1
values
(
"123456"
);
select
concat
(
f1
,
2
)
a
from
t1
union
select
'x'
a
from
t1
;
drop
table
t1
;
#
# Bug #36488: regexp returns false matches, concatenating with previous rows
#
CREATE
TABLE
t1
(
c1
varchar
(
100
),
c2
varchar
(
100
));
INSERT
INTO
t1
VALUES
(
''
,
''
),
(
''
,
'First'
),
(
'Random'
,
'Random'
);
SELECT
*
FROM
t1
WHERE
CONCAT
(
c1
,
' '
,
c2
)
REGEXP
'First.*'
;
DROP
TABLE
t1
;
--
echo
# End of 5.0 tests
sql/item_strfunc.cc
View file @
7ca1538b
...
...
@@ -294,6 +294,12 @@ String *Item_func_concat::val_str(String *str)
{
if
(
!
(
res
=
args
[
i
]
->
val_str
(
str
)))
goto
null
;
/*
CONCAT accumulates its result in the result of its the first
non-empty argument. Because of this we need is_const to be
evaluated only for it.
*/
is_const
=
args
[
i
]
->
const_item
()
||
!
args
[
i
]
->
used_tables
();
}
else
{
...
...
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