• Alexander Barkov's avatar
    Backporting WL#1213 · 8994fad8
    Alexander Barkov authored
    config/ac-macros/character_sets.m4:
      - Adding configure definitions for utf8mb4, utf16, utf32
    include/config-win.h:
      - Enabling utf8mb4, utf16, utf32 in Windows build
    include/m_ctype.h:
      - Adding new flags
      - Adding new shared functions prototypes
    mysql-test/include/ctype_datetime.inc:
      - Adding test to check that datetime functions
        work with "real" multibyte character sets.
    mysql-test/include/ctype_like.inc:
      - Adding LIKE tests
    mysql-test/include/have_utf16.inc:
      New file
    mysql-test/include/have_utf32.inc:
      New file
    mysql-test/include/have_utf8mb4.inc:
      New file
    mysql-test/r/ctype_ldml.result:
      - Adding tests for utf8mb4, utf16, utf32
    mysql-test/r/ctype_many.result:
      - Adding tests to check superset/subset relations
        between all Unicode character sets.
    mysql-test/r/ctype_utf16.result:
      New file
    mysql-test/r/ctype_utf16_uca.result:
      New file
    mysql-test/r/ctype_utf32.result:
      New file
    mysql-test/r/ctype_utf32_uca.result:
      New file
    mysql-test/r/ctype_utf8.result:
      - Adding tests for utf8mn3 alias
    mysql-test/r/ctype_utf8mb4.result:
      - Adding tests for utf8mb4
    mysql-test/r/have_utf16.require:
      New file
    mysql-test/r/have_utf32.require:
      New file
    mysql-test/r/have_utf8mb4.require:
      New file
    mysql-test/std_data/Index.xml:
      - Adding tests for loadable utf8m4, utf16, utf32 collations
    mysql-test/suite/sys_vars/r/character_set_client_basic.result:
      - Adding tests for utf16, utf32.
      - Fixing new number of character sets
    mysql-test/suite/sys_vars/r/character_set_connection_basic.result:
      - Fixing new number of character sets
    mysql-test/suite/sys_vars/r/character_set_database_basic.result:
      - Fixing new number of character sets
    mysql-test/suite/sys_vars/r/character_set_filesystem_basic.result:
      - Fixing new number of character sets
    mysql-test/suite/sys_vars/r/character_set_results_basic.result:
      - Fixing new number of character sets
    mysql-test/suite/sys_vars/t/character_set_client_basic.test:
      - Adding tests for new character sets
    mysql-test/suite/sys_vars/t/character_set_connection_basic.test:
      - Adding dependency on utf8mb4, utf16, utf32
    mysql-test/suite/sys_vars/t/character_set_database_basic.test:
      - Adding dependency on utf8mb4, utf16, utf32
    mysql-test/suite/sys_vars/t/character_set_filesystem_basic.test:
      - Adding dependency on utf8mb4, utf16, utf32
    mysql-test/suite/sys_vars/t/character_set_results_basic.test:
      - Adding dependency on utf8mb4, utf16, utf32
    mysql-test/t/ctype_ldml.test:
      - Adding tests for dynamic utf8mb4, utf16, utf32 collations
    mysql-test/t/ctype_many.test:
      - Adding tests to check superset/subset relations
        between all Unicode character sets
    mysql-test/t/ctype_utf16.test:
      New file
    mysql-test/t/ctype_utf16_uca.test:
      New file
    mysql-test/t/ctype_utf32.test:
      New file
    mysql-test/t/ctype_utf32_uca.test:
      New file
    mysql-test/t/ctype_utf8.test:
      - Adding tests for utf8mb4 alias
    mysql-test/t/ctype_utf8mb4.test:
      New file
    mysys/charset-def.c:
      - Adding initialization of utf8mb4, utf16, utf32 built-int collations
    mysys/charset.c:
      - Adding initialization of utf8mb4, utf16, utf32 dynamic collations
    sql/field.cc:
      - Fixing "truncated" error with datetime functions:
        Force conversion in case of non-ascii character sets.
    sql/item.cc:
      - Adding superset/subset relation check for utf8mb4/utf8
    sql/item_strfunc.cc:
      - Fixing a problem with CHAR(x USING utf32)
    sql/sql_string.cc:
      - Fixing problems with zero padding for UTF32
    sql/sql_table.cc:
      - Fixing buffer size, to make utf32 comma fit.
    strings/ctype-mb.c:
      - Making handlers for multi-byte binary collations public
    strings/ctype-uca.c:
      - Adding definitions for utf8mb4, utf16, utf32 UCA collations
    strings/ctype-ucs2.c:
      - Adding functions which are shared between ucs2, utf16, utf32
      - Ading utf16 implementation
      - Adding utf32 implementation
    strings/ctype-utf8.c:
      - Adding functions shared between utf8 and utf8mb4
      - Adding implementation of utf8mb4
    8994fad8
character_set_client_basic.result 15.1 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511
SET @global_start_value = @@global.character_set_client;
SELECT @global_start_value;
@global_start_value
latin1
SET @session_start_value = @@character_set_client;
SELECT @session_start_value;
@session_start_value
latin1
SET @session_start_value = @@local.character_set_client;
SELECT @session_start_value;
@session_start_value
latin1
SET @session_start_value = @@session.character_set_client;
SELECT @session_start_value;
@session_start_value
latin1
'#--------------------FN_DYNVARS_010_01------------------#'
SELECT character_set_client;
ERROR 42S22: Unknown column 'character_set_client' in 'field list'
SET character_set_client=utf8;
SELECT @@session.character_set_client;
@@session.character_set_client
utf8
SET global.character_set_client=utf8;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'character_set_client=utf8' at line 1
SET session character_set_client=utf8;
SELECT session character_set_client;
ERROR 42S22: Unknown column 'session' in 'field list'
SET global character_set_client=utf8;
SELECT global character_set_client;
ERROR 42S22: Unknown column 'global' in 'field list'
'#--------------------FN_DYNVARS_010_02-------------------------#'
SET @@character_set_client = latin5;
SET @@character_set_client = DEFAULT;
SELECT @@character_set_client AS DEFAULT_VALUE;
DEFAULT_VALUE
utf8
SET @@global.character_set_client = latin5;
SET @@global.character_set_client = DEFAULT;
SELECT @@global.character_set_client;
@@global.character_set_client
latin1
'#--------------------FN_DYNVARS_010_03-------------------------#'
SET @@session.character_set_client = utf8;
SELECT @@session.character_set_client;
@@session.character_set_client
utf8
SET @@global.character_set_client = latin2;
SELECT @@global.character_set_client;
@@global.character_set_client
latin2
SELECT @@session.character_set_client AS res_is_utf8;
res_is_utf8
utf8
SET @@session.character_set_client = latin5;
SELECT @@session.character_set_client;
@@session.character_set_client
latin5
SELECT @@global.character_set_client AS res_is_latin2;
res_is_latin2
latin2
SELECT @@global.character_set_client=@@session.character_set_client 
AS res_is_false;
res_is_false
0
'#--------------------FN_DYNVARS_010_04-------------------------#'
SELECT @@character_set_client = @@session.character_set_client AS res;
res
1
SELECT @@character_set_client = @@local.character_set_client AS res;
res
1
'#--------------------FN_DYNVARS_010_05-------------------------#'
SET @@character_set_client = utf8 + latin2;
ERROR 42S22: Unknown column 'utf8' in 'field list'
'#--------------------FN_DYNVARS_010_06-------------------------#'
SET @@character_set_client = big5;
SELECT @@character_set_client;
@@character_set_client
big5
SET @@character_set_client = dec8;
SELECT @@character_set_client;
@@character_set_client
dec8
SET @@character_set_client = cp850;
SELECT @@character_set_client;
@@character_set_client
cp850
SET @@character_set_client = hp8;
SELECT @@character_set_client;
@@character_set_client
hp8
SET @@character_set_client = koi8r;
SELECT @@character_set_client;
@@character_set_client
koi8r
SET @@character_set_client = latin1;
SELECT @@character_set_client;
@@character_set_client
latin1
SET @@character_set_client = latin2;
SELECT @@character_set_client;
@@character_set_client
latin2
SET @@character_set_client = swe7;
SELECT @@character_set_client;
ÉÉcharacter_set_client
swe7
SET @@character_set_client = ascii;
SELECT @@character_set_client;
@@character_set_client
ascii
SET @@character_set_client = ujis;
SELECT @@character_set_client;
@@character_set_client
ujis
SET @@character_set_client = sjis;
SELECT @@character_set_client;
@@character_set_client
sjis
SET @@character_set_client = hebrew;
SELECT @@character_set_client;
@@character_set_client
hebrew
SET @@character_set_client = tis620;
SELECT @@character_set_client;
@@character_set_client
tis620
SET @@character_set_client = euckr;
SELECT @@character_set_client;
@@character_set_client
euckr
SET @@character_set_client = koi8u;
SELECT @@character_set_client;
@@character_set_client
koi8u
SET @@character_set_client = gb2312;
SELECT @@character_set_client;
@@character_set_client
gb2312
SET @@character_set_client = greek;
SELECT @@character_set_client;
@@character_set_client
greek
SET @@character_set_client = cp1250;
SELECT @@character_set_client;
@@character_set_client
cp1250
SET @@character_set_client = gbk;
SELECT @@character_set_client;
@@character_set_client
gbk
SET @@character_set_client = latin5;
SELECT @@character_set_client;
@@character_set_client
latin5
SET @@character_set_client = armscii8;
SELECT @@character_set_client;
@@character_set_client
armscii8
SET @@character_set_client = utf8;
SELECT @@character_set_client;
@@character_set_client
utf8
SET @@character_set_client = utf8mb4;
SELECT @@character_set_client;
@@character_set_client
utf8mb4
SET @@character_set_client = ucs2;
ERROR 42000: Variable 'character_set_client' can't be set to the value of 'ucs2'
SET @@character_set_client = utf16;
ERROR 42000: Variable 'character_set_client' can't be set to the value of 'utf16'
SET @@character_set_client = utf32;
ERROR 42000: Variable 'character_set_client' can't be set to the value of 'utf32'
SET @@character_set_client = cp866;
SELECT @@character_set_client;
@@character_set_client
cp866
SET @@character_set_client = keybcs2;
SELECT @@character_set_client;
@@character_set_client
keybcs2
SET @@character_set_client = macce;
SELECT @@character_set_client;
@@character_set_client
macce
SET @@character_set_client = macroman;
SELECT @@character_set_client;
@@character_set_client
macroman
SET @@character_set_client = cp852;
SELECT @@character_set_client;
@@character_set_client
cp852
SET @@character_set_client = latin7;
SELECT @@character_set_client;
@@character_set_client
latin7
SET @@character_set_client = cp1251;
SELECT @@character_set_client;
@@character_set_client
cp1251
SET @@character_set_client = cp1256;
SELECT @@character_set_client;
@@character_set_client
cp1256
SET @@character_set_client = cp1257;
SELECT @@character_set_client;
@@character_set_client
cp1257
SET @@character_set_client = binary;
SELECT @@character_set_client;
@@character_set_client
binary
SET @@character_set_client = geostd8;
SELECT @@character_set_client;
@@character_set_client
geostd8
SET @@character_set_client = cp932;
SELECT @@character_set_client;
@@character_set_client
cp932
SET @@character_set_client = eucjpms;
SELECT @@character_set_client;
@@character_set_client
eucjpms
'#--------------------FN_DYNVARS_010_07-------------------------#'
SET @@global.character_set_client = big5;
SELECT @@global.character_set_client;
@@global.character_set_client
big5
SET @@global.character_set_client = dec8;
SELECT @@global.character_set_client;
@@global.character_set_client
dec8
SET @@global.character_set_client = cp850;
SELECT @@global.character_set_client;
@@global.character_set_client
cp850
SET @@global.character_set_client = hp8;
SELECT @@global.character_set_client;
@@global.character_set_client
hp8
SET @@global.character_set_client = koi8r;
SELECT @@global.character_set_client;
@@global.character_set_client
koi8r
SET @@global.character_set_client = latin1;
SELECT @@global.character_set_client;
@@global.character_set_client
latin1
SET @@global.character_set_client = latin2;
SELECT @@global.character_set_client;
@@global.character_set_client
latin2
SET @@global.character_set_client = swe7;
SELECT @@global.character_set_client;
@@global.character_set_client
swe7
SET @@global.character_set_client = ascii;
SELECT @@global.character_set_client;
@@global.character_set_client
ascii
SET @@global.character_set_client = ujis;
SELECT @@global.character_set_client;
@@global.character_set_client
ujis
SET @@global.character_set_client = sjis;
SELECT @@global.character_set_client;
@@global.character_set_client
sjis
SET @@global.character_set_client = hebrew;
SELECT @@global.character_set_client;
@@global.character_set_client
hebrew
SET @@global.character_set_client = tis620;
SELECT @@global.character_set_client;
@@global.character_set_client
tis620
SET @@global.character_set_client = euckr;
SELECT @@global.character_set_client;
@@global.character_set_client
euckr
SET @@global.character_set_client = koi8u;
SELECT @@global.character_set_client;
@@global.character_set_client
koi8u
SET @@global.character_set_client = gb2312;
SELECT @@global.character_set_client;
@@global.character_set_client
gb2312
SET @@global.character_set_client = greek;
SELECT @@global.character_set_client;
@@global.character_set_client
greek
SET @@global.character_set_client = cp1250;
SELECT @@global.character_set_client;
@@global.character_set_client
cp1250
SET @@global.character_set_client = gbk;
SELECT @@global.character_set_client;
@@global.character_set_client
gbk
SET @@global.character_set_client = latin5;
SELECT @@global.character_set_client;
@@global.character_set_client
latin5
SET @@global.character_set_client = armscii8;
SELECT @@global.character_set_client;
@@global.character_set_client
armscii8
SET @@global.character_set_client = utf8;
SELECT @@global.character_set_client;
@@global.character_set_client
utf8
SET @@global.character_set_client = ucs2;
SELECT @@global.character_set_client;
@@global.character_set_client
utf8
SET @@global.character_set_client = cp866;
SELECT @@global.character_set_client;
@@global.character_set_client
cp866
SET @@global.character_set_client = keybcs2;
SELECT @@global.character_set_client;
@@global.character_set_client
keybcs2
SET @@global.character_set_client = macce;
SELECT @@global.character_set_client;
@@global.character_set_client
macce
SET @@global.character_set_client = macroman;
SELECT @@global.character_set_client;
@@global.character_set_client
macroman
SET @@global.character_set_client = cp852;
SELECT @@global.character_set_client;
@@global.character_set_client
cp852
SET @@global.character_set_client = latin7;
SELECT @@global.character_set_client;
@@global.character_set_client
latin7
SET @@global.character_set_client = cp1251;
SELECT @@global.character_set_client;
@@global.character_set_client
cp1251
SET @@global.character_set_client = cp1256;
SELECT @@global.character_set_client;
@@global.character_set_client
cp1256
SET @@global.character_set_client = cp1257;
SELECT @@global.character_set_client;
@@global.character_set_client
cp1257
SET @@global.character_set_client = binary;
SELECT @@global.character_set_client;
@@global.character_set_client
binary
SET @@global.character_set_client = geostd8;
SELECT @@global.character_set_client;
@@global.character_set_client
geostd8
SET @@global.character_set_client = cp932;
SELECT @@global.character_set_client;
@@global.character_set_client
cp932
SET @@global.character_set_client = eucjpms;
SELECT @@global.character_set_client;
@@global.character_set_client
eucjpms
'#--------------------FN_DYNVARS_010_08-------------------------#'
SET @@character_set_client = UTF8;
SELECT @@character_set_client;
@@character_set_client
utf8
SET @@character_set_client = utf8;
SELECT @@character_set_client;
@@character_set_client
utf8
SET @@global.character_set_client = uTf8;
SELECT @@global.character_set_client;
@@global.character_set_client
utf8
'#--------------------FN_DYNVARS_010_09-------------------------#'
SET @@character_set_client = 1;
SELECT @@character_set_client;
@@character_set_client
big5
SET @@character_set_client = 2;
SELECT @@character_set_client;
@@character_set_client
latin2
SET @@character_set_client = 3;
SELECT @@character_set_client;
@@character_set_client
dec8
SET @@character_set_client = 36;
SELECT @@character_set_client;
@@character_set_client
cp866
SET @@character_set_client = 99;
SELECT @@character_set_client;
@@character_set_client
cp1250
SET @@character_set_client = 100;
ERROR 42000: Unknown character set: '100'
SET @@global.character_set_client = 1;
SELECT @@global.character_set_client;
@@global.character_set_client
big5
SET @@global.character_set_client = 2;
SELECT @@global.character_set_client;
@@global.character_set_client
latin2
SET @@global.character_set_client = 3;
SELECT @@global.character_set_client;
@@global.character_set_client
dec8
SET @@global.character_set_client = 36;
SELECT @@global.character_set_client;
@@global.character_set_client
cp866
SET @@global.character_set_client = 99;
SELECT @@global.character_set_client;
@@global.character_set_client
cp1250
SET @@global.character_set_client = 100;
ERROR 42000: Unknown character set: '100'
SET @total_charset = (SELECT count(*) FROM INFORMATION_SCHEMA.CHARACTER_SETS);
SELECT @total_charset;
@total_charset
39
'#--------------------FN_DYNVARS_010_10-------------------------#'
SET @@character_set_client = abc;
ERROR 42000: Unknown character set: 'abc'
SET @@character_set_client = 1utf8;
ERROR 42000: Unknown character set: '1utf8'
SET @@character_set_client = 0;
ERROR 42000: Unknown character set: '0'
SET @@character_set_client = 1.1;
ERROR 42000: Incorrect argument type to variable 'character_set_client'
SET @@character_set_client = -1;
ERROR 42000: Unknown character set: '-1'
SET @@character_set_client = '';
ERROR 42000: Unknown character set: ''
SET @@character_set_client = 'utf';
ERROR 42000: Unknown character set: 'utf'
SET @@character_set_client = true;
SELECT @@character_set_client AS res_with_true;
res_with_true
big5
SET @@character_set_client = ON;
ERROR 42000: Unknown character set: 'ON'
'#--------------------FN_DYNVARS_010_11-------------------------#'
SET @@global.character_set_client = abc;
ERROR 42000: Unknown character set: 'abc'
SET @@global.character_set_client = 1utf8;
ERROR 42000: Unknown character set: '1utf8'
SET @@global.character_set_client = 0;
ERROR 42000: Unknown character set: '0'
SET @@global.character_set_client = 1.1;
ERROR 42000: Incorrect argument type to variable 'character_set_client'
SET @@global.character_set_client = -1;
ERROR 42000: Unknown character set: '-1'
SET @@global.character_set_client = '';
ERROR 42000: Unknown character set: ''
SET @@global.character_set_client = 'utf';
ERROR 42000: Unknown character set: 'utf'
SET @@global.character_set_client = true;
SET @@global.character_set_client = ON;
ERROR 42000: Unknown character set: 'ON'
'#--------------------FN_DYNVARS_010_12-------------------------#'
SELECT @@global.character_set_client =
(SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='character_set_client') AS res;
res
1
SET @@global.character_set_client = 1;
SELECT @@global.character_set_client;
@@global.character_set_client
big5
SELECT @@global.character_set_client =
(SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='character_set_client') AS res;
res
1
'#--------------------FN_DYNVARS_010_13-------------------------#'
SELECT @@character_set_client =
(SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='character_set_client') AS res;
res
1
SELECT @@local.character_set_client =
(SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='character_set_client') AS res;
res
1
SELECT @@session.character_set_client =
(SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='character_set_client') AS res;
res
1
SET @@global.character_set_client = @global_start_value;
SELECT @@global.character_set_client;
@@global.character_set_client
latin1
SET @@session.character_set_client = @session_start_value;
SELECT @@session.character_set_client;
@@session.character_set_client
latin1