summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/r/view.result9
-rw-r--r--mysql-test/t/view.test16
-rw-r--r--sql/sql_string.cc4
3 files changed, 26 insertions, 3 deletions
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 4fbe0176c57..13c310c4df2 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -3014,6 +3014,15 @@ i j
6 3
DROP VIEW v1, v2;
DROP TABLE t1;
+DROP VIEW IF EXISTS v1;
+CREATE VIEW v1 AS SELECT 'The\ZEnd';
+SELECT * FROM v1;
+TheEnd
+TheEnd
+SHOW CREATE VIEW v1;
+View Create View
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select _latin1'The\ZEnd' AS `TheEnd`
+DROP VIEW v1;
End of 5.0 tests.
DROP DATABASE IF EXISTS `d-1`;
CREATE DATABASE `d-1`;
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 7175db1db4e..10ebfcfb697 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -2906,6 +2906,7 @@ DROP FUNCTION f1;
DROP VIEW v1;
DROP TABLE t1;
+#
# Bug #16813 (WITH CHECK OPTION doesn't work with UPDATE)
#
CREATE TABLE t1(id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, val INT UNSIGNED NOT NULL);
@@ -2919,7 +2920,6 @@ UPDATE v1 SET val=6 WHERE id=2;
DROP VIEW v1;
DROP TABLE t1;
-
#
# BUG#22584: last_insert_id not updated after inserting a record
# through a updatable view
@@ -2957,6 +2957,20 @@ SELECT * FROM t1;
DROP VIEW v1, v2;
DROP TABLE t1;
+#
+# BUG#24293: '\Z' token is not handled correctly in views
+#
+
+--disable_warnings
+DROP VIEW IF EXISTS v1;
+--enable_warnings
+
+CREATE VIEW v1 AS SELECT 'The\ZEnd';
+SELECT * FROM v1;
+
+SHOW CREATE VIEW v1;
+
+DROP VIEW v1;
--echo End of 5.0 tests.
diff --git a/sql/sql_string.cc b/sql/sql_string.cc
index b307953addc..2aaab83796f 100644
--- a/sql/sql_string.cc
+++ b/sql/sql_string.cc
@@ -1022,8 +1022,8 @@ void String::print(String *str)
case '\r':
str->append(STRING_WITH_LEN("\\r"));
break;
- case 26: //Ctrl-Z
- str->append(STRING_WITH_LEN("\\z"));
+ case '\032': // Ctrl-Z
+ str->append(STRING_WITH_LEN("\\Z"));
break;
default:
str->append(c);