Commit f825b5a4 authored by Alexander Barkov's avatar Alexander Barkov

MDEV-7629 Regression: Bit and hex string literals changed column names in 10.0.14

parent 723be516
...@@ -3008,5 +3008,11 @@ Warnings: ...@@ -3008,5 +3008,11 @@ Warnings:
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ('%' = concat(`test`.`t1`.`c1`)) Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ('%' = concat(`test`.`t1`.`c1`))
DROP TABLE t1; 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 # End of 10.0 tests
# #
...@@ -7907,5 +7907,11 @@ HEX(a) a ...@@ -7907,5 +7907,11 @@ HEX(a) a
3F23 ?# 3F23 ?#
DROP TABLE t1; 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 # End of 10.0 tests
# #
...@@ -6259,6 +6259,12 @@ EXECUTE stmt USING @b,@b; ...@@ -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' ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation 'concat'
DEALLOCATE PREPARE stmt; DEALLOCATE PREPARE stmt;
DROP TABLE t1; 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 # Start of ctype_unescape.inc
SET @query=_binary'SELECT CHARSET(\'test\'),@@character_set_client,@@character_set_connection'; SET @query=_binary'SELECT CHARSET(\'test\'),@@character_set_client,@@character_set_connection';
PREPARE stmt FROM @query; PREPARE stmt FROM @query;
......
...@@ -19,6 +19,11 @@ set names binary; ...@@ -19,6 +19,11 @@ set names binary;
SET NAMES binary; SET NAMES binary;
--source include/ctype_like_cond_propagation.inc --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 #
--echo # End of 10.0 tests --echo # End of 10.0 tests
--echo # --echo #
...@@ -240,6 +240,11 @@ SHOW WARNINGS; ...@@ -240,6 +240,11 @@ SHOW WARNINGS;
SELECT HEX(a),a FROM t1; SELECT HEX(a),a FROM t1;
DROP TABLE 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 #
--echo # End of 10.0 tests --echo # End of 10.0 tests
--echo # --echo #
...@@ -1744,6 +1744,11 @@ EXECUTE stmt USING @b,@b; ...@@ -1744,6 +1744,11 @@ EXECUTE stmt USING @b,@b;
DEALLOCATE PREPARE stmt; DEALLOCATE PREPARE stmt;
DROP TABLE t1; 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; let $ctype_unescape_combinations=selected;
--source include/ctype_unescape.inc --source include/ctype_unescape.inc
......
...@@ -2931,8 +2931,9 @@ public: ...@@ -2931,8 +2931,9 @@ public:
{ {
set_cs_specified(true); set_cs_specified(true);
} }
Item_string_with_introducer(const String *str, CHARSET_INFO *tocs) Item_string_with_introducer(const char *name,
:Item_string(str->ptr(), str->length(), tocs) const char *str, uint length, CHARSET_INFO *tocs)
:Item_string(name, str, length, tocs)
{ {
set_cs_specified(true); set_cs_specified(true);
} }
......
...@@ -13398,7 +13398,12 @@ literal: ...@@ -13398,7 +13398,12 @@ literal:
| UNDERSCORE_CHARSET hex_or_bin_String | UNDERSCORE_CHARSET hex_or_bin_String
{ {
Item_string_with_introducer *item_str; 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)) if (!item_str || !item_str->check_well_formed_result(true))
MYSQL_YYABORT; MYSQL_YYABORT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment