diff options
Diffstat (limited to 'mysql-test/include/weight_string.inc')
| -rw-r--r-- | mysql-test/include/weight_string.inc | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/mysql-test/include/weight_string.inc b/mysql-test/include/weight_string.inc index d8621a19687..1ae8801c560 100644 --- a/mysql-test/include/weight_string.inc +++ b/mysql-test/include/weight_string.inc @@ -1,4 +1,39 @@ select @@collation_connection; + +# +# MDEV-5180 Data type for WEIGHT_STRING is too short in some cases +# +CREATE TABLE t1 AS SELECT 'a' AS a; +SHOW CREATE TABLE t1; +CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1; +SHOW CREATE TABLE t2; +SELECT HEX(WEIGHT_STRING(a)) FROM t1; +SELECT HEX(ws) FROM t2; +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a; +SHOW CREATE TABLE t1; +CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1; +SHOW CREATE TABLE t2; +SELECT HEX(WEIGHT_STRING(a)) FROM t1; +SELECT HEX(ws) FROM t2; +DROP TABLE t2; +CREATE TABLE t2 AS SELECT WEIGHT_STRING(a AS CHAR(3)) AS ws FROM t1; +SHOW CREATE TABLE t2; +SELECT HEX(WEIGHT_STRING(a AS CHAR(3))) FROM t1; +SELECT HEX(ws) FROM t2; +DROP TABLE t2; +CREATE TABLE t2 AS SELECT WEIGHT_STRING(a AS CHAR(10)) AS ws FROM t1; +SHOW CREATE TABLE t2; +SELECT HEX(WEIGHT_STRING(a AS CHAR(10))) FROM t1; +SELECT HEX(ws) FROM t2; +DROP TABLE t2; +DROP TABLE t1; +# +# End of MDEV-5180 +# + select hex(weight_string('a')); select hex(weight_string('A')); select hex(weight_string('abc')); |
