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
273591df
Commit
273591df
authored
7 years ago
by
Oleksandr Byelkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-14619: VIEW and GROUP_CONCAT
Correctly print separator string in single quotes.
parent
20089f5a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
1 deletion
+27
-1
mysql-test/r/view.result
mysql-test/r/view.result
+14
-0
mysql-test/t/view.test
mysql-test/t/view.test
+12
-0
sql/item_sum.cc
sql/item_sum.cc
+1
-1
No files found.
mysql-test/r/view.result
View file @
273591df
...
...
@@ -5629,6 +5629,20 @@ PREPARE stmt FROM 'REPLACE INTO v2 SELECT a FROM t3';
ERROR HY000: Can not insert into join view 'test.v2' without fields list
drop view v1,v2;
drop table t3;
#
# MDEV-14619: VIEW and GROUP_CONCAT
#
CREATE TABLE t1 (str text);
INSERT INTO t1 VALUES ("My"),("SQL");
CREATE VIEW v1 AS SELECT GROUP_CONCAT(str SEPARATOR '\\') FROM t1;
SELECT * FROM v1;
GROUP_CONCAT(str SEPARATOR '\\')
My\SQL
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select group_concat(`t1`.`str` separator '\\') AS `GROUP_CONCAT(str SEPARATOR '\\')` from `t1` latin1 latin1_swedish_ci
drop view v1;
drop table t1;
# -----------------------------------------------------------------
# -- End of 5.5 tests.
# -----------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
mysql-test/t/view.test
View file @
273591df
...
...
@@ -5578,6 +5578,18 @@ PREPARE stmt FROM 'REPLACE INTO v2 SELECT a FROM t3';
drop view v1,v2;
drop table t3;
--echo #
--echo # MDEV-14619: VIEW and GROUP_CONCAT
--echo #
CREATE TABLE t1 (str text);
INSERT INTO t1 VALUES ("My"),("SQL");
CREATE VIEW v1 AS SELECT GROUP_CONCAT(str SEPARATOR '
\\'
)
FROM
t1
;
SELECT
*
FROM
v1
;
SHOW
CREATE
VIEW
v1
;
drop
view
v1
;
drop
table
t1
;
--
echo
# -----------------------------------------------------------------
--
echo
# -- End of 5.5 tests.
--
echo
# -----------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
sql/item_sum.cc
View file @
273591df
...
...
@@ -3656,7 +3656,7 @@ void Item_func_group_concat::print(String *str, enum_query_type query_type)
}
}
str
->
append
(
STRING_WITH_LEN
(
" separator
\'
"
));
str
->
append
(
*
separator
);
str
->
append
_for_single_quote
(
separator
->
ptr
(),
separator
->
length
()
);
str
->
append
(
STRING_WITH_LEN
(
"
\'
)"
));
}
...
...
This diff is collapsed.
Click to expand it.
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