Skip to content

Instantly share code, notes, and snippets.

@rdtr
Created May 19, 2022 12:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rdtr/4c8417c32da12a3125338087e4ad89a1 to your computer and use it in GitHub Desktop.
Save rdtr/4c8417c32da12a3125338087e4ad89a1 to your computer and use it in GitHub Desktop.
Test MDEV-28315
# Content of a test file
CREATE TABLE t1 (a VARBINARY(128)) CHARACTER SET utf32;
INSERT INTO t1 VALUES ('South Carolina, Vermont, New Jersey, New Mexico, Wisconsin, Missouri, Delaware');
CREATE TABLE t2 (b SET('South Carolina', 'Vermont', 'Texas', 'New Mexico', 'Wisconsin', 'Missouri', 'Delaware', 'Wyoming', 'New Jersey', 'Maryland', 'Illinois', 'New York')) CHARACTER SET utf32;
--error WARN_DATA_TRUNCATED
INSERT INTO t2 SELECT * FROM t1;
SELECT * FROM t2;
DROP TABLE t1;
DROP TABLE t2;
# Content of a result file
CREATE TABLE t1 (a VARBINARY(128)) CHARACTER SET utf32;
INSERT INTO t1 VALUES ('South Carolina, Vermont, New Jersey, New Mexico, Wisconsin, Missouri, Delaware');
CREATE TABLE t2 (b SET('South Carolina', 'Vermont', 'Texas', 'New Mexico', 'Wisconsin', 'Missouri', 'Delaware', 'Wyoming', 'New Jersey', 'Maryland', 'Illinois', 'New York')) CHARACTER SET utf32;
INSERT INTO t2 SELECT * FROM t1;
ERROR 01000: Data truncated for column 'b' at row 1
SELECT * FROM t2;
b
DROP TABLE t1;
DROP TABLE t2;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment