Skip to content

Commit b088609

Browse files
author
Alexander Barkov
committed
A clean-up for the previous patch
1 parent 1427e1d commit b088609

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

mysql-test/r/ctype_utf8.result

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5954,6 +5954,13 @@ SET @arg00=_binary 0xFF;
59545954
EXECUTE stmt USING @arg00;
59555955
ERROR HY000: Invalid utf8 character string: 'FF'
59565956
DEALLOCATE PREPARE stmt;
5957+
SET NAMES latin1;
5958+
PREPARE stmt FROM "SELECT CONCAT(_utf8'a' COLLATE utf8_unicode_ci, ?)";
5959+
EXECUTE stmt USING @no_such_var;
5960+
CONCAT(_utf8'a' COLLATE utf8_unicode_ci, ?)
5961+
NULL
5962+
DEALLOCATE PREPARE stmt;
5963+
SET NAMES utf8;
59575964
#
59585965
# End of 10.0 tests
59595966
#

mysql-test/t/ctype_utf8.test

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1675,6 +1675,11 @@ SET @arg00=_binary 0xFF;
16751675
--error ER_INVALID_CHARACTER_STRING
16761676
EXECUTE stmt USING @arg00;
16771677
DEALLOCATE PREPARE stmt;
1678+
SET NAMES latin1;
1679+
PREPARE stmt FROM "SELECT CONCAT(_utf8'a' COLLATE utf8_unicode_ci, ?)";
1680+
EXECUTE stmt USING @no_such_var;
1681+
DEALLOCATE PREPARE stmt;
1682+
SET NAMES utf8;
16781683

16791684
--echo #
16801685
--echo # End of 10.0 tests

sql/item.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,6 +1274,8 @@ Item *Item_param::safe_charset_converter(CHARSET_INFO *tocs)
12741274
*/
12751275
if (const_item())
12761276
{
1277+
if (state == NULL_VALUE)
1278+
return this;
12771279
uint cnv_errors;
12781280
String *ostr= val_str(&cnvstr);
12791281
if (!needs_charset_converter(tocs))

0 commit comments

Comments
 (0)