mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 23:04:20 +01:00
f66e34d0d7
git-svn-id: file:///svn/mysql/tests/mysql-test@55031 c7de825b-a66e-492c-adef-691d508d4ae1
43 lines
842 B
Text
43 lines
842 B
Text
# test that varbinary expansion is done inplace while varbinary shrinkage is not
|
|
|
|
--disable_warnings
|
|
DROP TABLE IF EXISTS t;
|
|
--enable_warnings
|
|
|
|
SET SESSION TOKUDB_DISABLE_SLOW_ALTER=ON;
|
|
|
|
CREATE TABLE t (a VARBINARY(1)) ENGINE=TokuDB;
|
|
SHOW CREATE TABLE t;
|
|
|
|
# 1->1
|
|
let $i=1
|
|
EVAL ALTER TABLE t CHANGE COLUMN a a VARBINARY($i);
|
|
|
|
# 1->2 ... 1023->1024 is supported
|
|
# 1024 is an arbitrary limit >= 256
|
|
let $i=2;
|
|
while ($i <= 1024)
|
|
{
|
|
# $i-1 -> $i
|
|
EVAL ALTER TABLE t CHANGE COLUMN a a VARBINARY($i);
|
|
# $i -> $i
|
|
EVAL ALTER TABLE t CHANGE COLUMN a a VARBINARY($i);
|
|
inc $i;
|
|
}
|
|
|
|
# shrink from 1024->$i where $i < 1024 is not supported
|
|
let $i=1023;
|
|
while ($i > 0)
|
|
{
|
|
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
|
|
--error ER_UNSUPPORTED_EXTENSION
|
|
EVAL ALTER TABLE t CHANGE COLUMN a a VARBINARY($i);
|
|
dec $i;
|
|
}
|
|
|
|
DROP TABLE t;
|
|
|
|
|
|
|
|
|
|
|