| 1 |
# Test that changes to column properties |
| 2 |
# are backward compatible |
| 3 |
|
| 4 |
-- source include/have_ndb.inc |
| 5 |
-- source include/have_case_sensitive_file_system.inc |
| 6 |
-- source suite/ndb/include/backup_restore_setup.inc |
| 7 |
|
| 8 |
CREATE DATABASE BANK default charset=latin1 default collate=latin1_bin; |
| 9 |
--exec $NDB_RESTORE $NDB_RESTORE_NO_ENCR -b 1 -n 1 -p 1 -m -r $NDB_SAVED_BACKUPS/51 >> $NDB_TOOLS_OUTPUT |
| 10 |
--exec $NDB_RESTORE $NDB_RESTORE_NO_ENCR -e -b 1 -n 2 -p 1 -r $NDB_SAVED_BACKUPS/51 >> $NDB_TOOLS_OUTPUT |
| 11 |
USE BANK; |
| 12 |
|
| 13 |
# Check for warnings of implicit conversion of COLUMN_FORMAT |
| 14 |
# after default has changed to DYNAMIC |
| 15 |
|
| 16 |
ALTER TABLE ACCOUNT MODIFY`OWNER` int(11) unsigned NOT NULL COLUMN_FORMAT FIXED; |
| 17 |
--echo Now there should be two warnings of implicit COLUMN_FORMAT conversion |
| 18 |
SHOW WARNINGS; |
| 19 |
ALTER TABLE BANK.ACCOUNT RENAME test.t1; |
| 20 |
source show_attributes.inc; |
| 21 |
DROP TABLE test.t1; |
| 22 |
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON |
| 23 |
ALTER TABLE ACCOUNT_TYPE algorithm=inplace, MODIFY `DESCRIPTION` char(65); |
| 24 |
ALTER TABLE ACCOUNT_TYPE DROP `DESCRIPTION`; |
| 25 |
--echo Now there should be no warning |
| 26 |
SHOW WARNINGS; |
| 27 |
ALTER TABLE SYSTEM_VALUES MODIFY `VALUE` bigint(21); |
| 28 |
--echo Now there should be one warning of implicit COLUMN_FORMAT conversion |
| 29 |
SHOW WARNINGS; |
| 30 |
ALTER TABLE SYSTEM_VALUES MODIFY `VALUE` bigint(22); |
| 31 |
--echo Now there should be no warning |
| 32 |
SHOW WARNINGS; |
| 33 |
ALTER TABLE SYSTEM_VALUES MODIFY `VALUE` bigint(23); |
| 34 |
set @old_acat = @@session.ndb_allow_copying_alter_table; |
| 35 |
set @@session.ndb_allow_copying_alter_table = off; |
| 36 |
# Changing bigint display width can be done without copying |
| 37 |
ALTER TABLE SYSTEM_VALUES MODIFY `VALUE` bigint(24); |
| 38 |
--echo Now there should be no warning |
| 39 |
SHOW WARNINGS; |
| 40 |
set @@session.ndb_allow_copying_alter_table = @old_acat; |
| 41 |
set @old_ndcf = @@global.ndb_default_column_format; |
| 42 |
|
| 43 |
set @@global.ndb_default_column_format = FIXED; |
| 44 |
ALTER TABLE TRANSACTION MODIFY `ACCOUNT_TYPE` int(11) unsigned NOT NULL; |
| 45 |
--echo Now there should be no warning |
| 46 |
SHOW WARNINGS; |
| 47 |
ALTER TABLE BANK.TRANSACTION RENAME test.t1; |
| 48 |
source show_attributes.inc; |
| 49 |
DROP TABLE test.t1; |
| 50 |
set @@global.ndb_default_column_format = @old_ndcf; |
| 51 |
DROP DATABASE BANK; |
| 52 |
|
| 53 |
--remove_file $NDB_TOOLS_OUTPUT |