2012-09-05 17:39:38 +00:00
|
|
|
# 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)
|
|
|
|
{
|
2012-09-06 15:57:04 +00:00
|
|
|
--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/
|
|
|
|
--error ER_UNSUPPORTED_EXTENSION
|
2012-09-05 17:39:38 +00:00
|
|
|
EVAL ALTER TABLE t CHANGE COLUMN a a VARBINARY($i);
|
|
|
|
dec $i;
|
|
|
|
}
|
|
|
|
|
|
|
|
DROP TABLE t;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|