summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mnogosearch.org>2015-02-25 14:13:32 +0400
committerAlexander Barkov <bar@mnogosearch.org>2015-02-25 14:13:32 +0400
commitf825b5a4ee1a9d40cff2f065fd7ea5cd8895ee60 (patch)
treeabb4e3f2f868dd09ddd979e674122b4007fab1f4
parent723be516780930cc9c206dff6821b3ddebf62ec6 (diff)
downloadmariadb-git-f825b5a4ee1a9d40cff2f065fd7ea5cd8895ee60.tar.gz
MDEV-7629 Regression: Bit and hex string literals changed column names in 10.0.14
-rw-r--r--mysql-test/r/ctype_binary.result6
-rw-r--r--mysql-test/r/ctype_latin1.result6
-rw-r--r--mysql-test/r/ctype_utf8.result6
-rw-r--r--mysql-test/t/ctype_binary.test5
-rw-r--r--mysql-test/t/ctype_latin1.test5
-rw-r--r--mysql-test/t/ctype_utf8.test5
-rw-r--r--sql/item.h5
-rw-r--r--sql/sql_yacc.yy7
8 files changed, 42 insertions, 3 deletions
diff --git a/mysql-test/r/ctype_binary.result b/mysql-test/r/ctype_binary.result
index f35e6fd8265..aead73b3090 100644
--- a/mysql-test/r/ctype_binary.result
+++ b/mysql-test/r/ctype_binary.result
@@ -3008,5 +3008,11 @@ Warnings:
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ('%' = concat(`test`.`t1`.`c1`))
DROP TABLE t1;
#
+# MDEV-7629 Regression: Bit and hex string literals changed column names in 10.0.14
+#
+SELECT _binary 0x7E, _binary X'7E', _binary B'01111110';
+_binary 0x7E _binary X'7E' _binary B'01111110'
+~ ~ ~
+#
# End of 10.0 tests
#
diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result
index 970c067b25c..383ea3ca8f2 100644
--- a/mysql-test/r/ctype_latin1.result
+++ b/mysql-test/r/ctype_latin1.result
@@ -7907,5 +7907,11 @@ HEX(a) a
3F23 ?#
DROP TABLE t1;
#
+# MDEV-7629 Regression: Bit and hex string literals changed column names in 10.0.14
+#
+SELECT _latin1 0x7E, _latin1 X'7E', _latin1 B'01111110';
+_latin1 0x7E _latin1 X'7E' _latin1 B'01111110'
+~ ~ ~
+#
# End of 10.0 tests
#
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index c752024ec7f..40854183a92 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -6259,6 +6259,12 @@ EXECUTE stmt USING @b,@b;
ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation 'concat'
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
+#
+# MDEV-7629 Regression: Bit and hex string literals changed column names in 10.0.14
+#
+SELECT _utf8 0x7E, _utf8 X'7E', _utf8 B'01111110';
+_utf8 0x7E _utf8 X'7E' _utf8 B'01111110'
+~ ~ ~
# Start of ctype_unescape.inc
SET @query=_binary'SELECT CHARSET(\'test\'),@@character_set_client,@@character_set_connection';
PREPARE stmt FROM @query;
diff --git a/mysql-test/t/ctype_binary.test b/mysql-test/t/ctype_binary.test
index 4a2646d1db5..3d3f90b444b 100644
--- a/mysql-test/t/ctype_binary.test
+++ b/mysql-test/t/ctype_binary.test
@@ -20,5 +20,10 @@ SET NAMES binary;
--source include/ctype_like_cond_propagation.inc
--echo #
+--echo # MDEV-7629 Regression: Bit and hex string literals changed column names in 10.0.14
+--echo #
+SELECT _binary 0x7E, _binary X'7E', _binary B'01111110';
+
+--echo #
--echo # End of 10.0 tests
--echo #
diff --git a/mysql-test/t/ctype_latin1.test b/mysql-test/t/ctype_latin1.test
index 336d8ca761d..aeaad2cc026 100644
--- a/mysql-test/t/ctype_latin1.test
+++ b/mysql-test/t/ctype_latin1.test
@@ -241,5 +241,10 @@ SELECT HEX(a),a FROM t1;
DROP TABLE t1;
--echo #
+--echo # MDEV-7629 Regression: Bit and hex string literals changed column names in 10.0.14
+--echo #
+SELECT _latin1 0x7E, _latin1 X'7E', _latin1 B'01111110';
+
+--echo #
--echo # End of 10.0 tests
--echo #
diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test
index 1e9047cca8e..af5f4b8ccf8 100644
--- a/mysql-test/t/ctype_utf8.test
+++ b/mysql-test/t/ctype_utf8.test
@@ -1744,6 +1744,11 @@ EXECUTE stmt USING @b,@b;
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
+--echo #
+--echo # MDEV-7629 Regression: Bit and hex string literals changed column names in 10.0.14
+--echo #
+SELECT _utf8 0x7E, _utf8 X'7E', _utf8 B'01111110';
+
let $ctype_unescape_combinations=selected;
--source include/ctype_unescape.inc
diff --git a/sql/item.h b/sql/item.h
index 13e80639657..7c61c5fc65f 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -2931,8 +2931,9 @@ public:
{
set_cs_specified(true);
}
- Item_string_with_introducer(const String *str, CHARSET_INFO *tocs)
- :Item_string(str->ptr(), str->length(), tocs)
+ Item_string_with_introducer(const char *name,
+ const char *str, uint length, CHARSET_INFO *tocs)
+ :Item_string(name, str, length, tocs)
{
set_cs_specified(true);
}
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 74426f88a69..bcc74b4a710 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -13398,7 +13398,12 @@ literal:
| UNDERSCORE_CHARSET hex_or_bin_String
{
Item_string_with_introducer *item_str;
- item_str= new (thd->mem_root) Item_string_with_introducer($2, $1);
+ /*
+ Pass NULL as name. Name will be set in the "select_item" rule and
+ will include the introducer and the original hex/bin notation.
+ */
+ item_str= new (thd->mem_root)
+ Item_string_with_introducer(NULL, $2->ptr(), $2->length(), $1);
if (!item_str || !item_str->check_well_formed_result(true))
MYSQL_YYABORT;