| 1 |
--source include/have_ndb.inc |
| 2 |
--source include/have_debug.inc |
| 3 |
|
| 4 |
# Test to check the atomicity of disk data DDL statements. |
| 5 |
# |
| 6 |
# There are two types of failures tested for LOGFILE GROUP by setting the following debug options: |
| 7 |
# 1. ndb_dd_client_*_fail - Causes the storage of the logfile group object in DD to fail |
| 8 |
# 2. ndb_schema_trans_commit_fail - Causes the storage of the logfile group object in NDB to fail |
| 9 |
# |
| 10 |
# TABLESPACE failures in NDB alone are tested below using the ndb_schema_trans_commit_fail |
| 11 |
# debug option |
| 12 |
|
| 13 |
SET @save_debug = @@global.debug; |
| 14 |
|
| 15 |
SET GLOBAL debug = '+d,ndb_dd_client_install_logfile_group_fail,ndb_schema_trans_commit_fail'; |
| 16 |
|
| 17 |
--error ER_CREATE_FILEGROUP_FAILED |
| 18 |
CREATE LOGFILE GROUP lg1 |
| 19 |
ADD UNDOFILE 'lg1_undofile.dat' |
| 20 |
INITIAL_SIZE 1M |
| 21 |
UNDO_BUFFER_SIZE 1M |
| 22 |
ENGINE NDB; |
| 23 |
SHOW WARNINGS; |
| 24 |
|
| 25 |
SET GLOBAL debug = '-d,ndb_dd_client_install_logfile_group_fail'; |
| 26 |
|
| 27 |
--error ER_CREATE_FILEGROUP_FAILED |
| 28 |
CREATE LOGFILE GROUP lg1 |
| 29 |
ADD UNDOFILE 'lg1_undofile.dat' |
| 30 |
INITIAL_SIZE 1M |
| 31 |
UNDO_BUFFER_SIZE 1M |
| 32 |
ENGINE NDB; |
| 33 |
SHOW WARNINGS; |
| 34 |
|
| 35 |
SET GLOBAL debug = '-d,ndb_schema_trans_commit_fail'; |
| 36 |
|
| 37 |
CREATE LOGFILE GROUP lg1 |
| 38 |
ADD UNDOFILE 'lg1_undofile.dat' |
| 39 |
INITIAL_SIZE 1M |
| 40 |
UNDO_BUFFER_SIZE 1M |
| 41 |
ENGINE NDB; |
| 42 |
|
| 43 |
SET GLOBAL debug = '+d,ndb_dd_client_install_undo_file_fail,ndb_schema_trans_commit_fail'; |
| 44 |
|
| 45 |
--error ER_ALTER_FILEGROUP_FAILED |
| 46 |
ALTER LOGFILE GROUP lg1 |
| 47 |
ADD UNDOFILE 'lg1_undofile2.dat' |
| 48 |
ENGINE NDB; |
| 49 |
SHOW WARNINGS; |
| 50 |
|
| 51 |
SET GLOBAL debug = '-d,ndb_dd_client_install_undo_file_fail'; |
| 52 |
|
| 53 |
--error ER_ALTER_FILEGROUP_FAILED |
| 54 |
ALTER LOGFILE GROUP lg1 |
| 55 |
ADD UNDOFILE 'lg1_undofile2.dat' |
| 56 |
ENGINE NDB; |
| 57 |
SHOW WARNINGS; |
| 58 |
|
| 59 |
SET GLOBAL debug = '-d,ndb_schema_trans_commit_fail'; |
| 60 |
|
| 61 |
ALTER LOGFILE GROUP lg1 |
| 62 |
ADD UNDOFILE 'lg1_undofile2.dat' |
| 63 |
ENGINE NDB; |
| 64 |
|
| 65 |
SET GLOBAL debug = '+d,ndb_schema_trans_commit_fail'; |
| 66 |
|
| 67 |
--error ER_CREATE_FILEGROUP_FAILED |
| 68 |
CREATE TABLESPACE ts1 |
| 69 |
ADD DATAFILE 'ts1_datafile.dat' |
| 70 |
USE LOGFILE GROUP lg1 |
| 71 |
INITIAL_SIZE 2M |
| 72 |
ENGINE NDB; |
| 73 |
SHOW WARNINGS; |
| 74 |
|
| 75 |
SET GLOBAL debug = '-d,ndb_schema_trans_commit_fail'; |
| 76 |
|
| 77 |
CREATE TABLESPACE ts1 |
| 78 |
ADD DATAFILE 'ts1_datafile.dat' |
| 79 |
USE LOGFILE GROUP lg1 |
| 80 |
INITIAL_SIZE 2M |
| 81 |
ENGINE NDB; |
| 82 |
|
| 83 |
SET GLOBAL debug = '+d,ndb_schema_trans_commit_fail'; |
| 84 |
|
| 85 |
--error ER_ALTER_FILEGROUP_FAILED |
| 86 |
ALTER TABLESPACE ts1 |
| 87 |
ADD DATAFILE 'ts1_datafile2.dat'; |
| 88 |
SHOW WARNINGS; |
| 89 |
|
| 90 |
SET GLOBAL debug = '-d,ndb_schema_trans_commit_fail'; |
| 91 |
|
| 92 |
ALTER TABLESPACE ts1 |
| 93 |
ADD DATAFILE 'ts1_datafile2.dat'; |
| 94 |
|
| 95 |
SET GLOBAL debug = '+d,ndb_schema_trans_commit_fail'; |
| 96 |
|
| 97 |
--error ER_ALTER_FILEGROUP_FAILED |
| 98 |
ALTER TABLESPACE ts1 |
| 99 |
DROP DATAFILE 'ts1_datafile2.dat'; |
| 100 |
SHOW WARNINGS; |
| 101 |
|
| 102 |
SET GLOBAL debug = '-d,ndb_schema_trans_commit_fail'; |
| 103 |
|
| 104 |
ALTER TABLESPACE ts1 |
| 105 |
DROP DATAFILE 'ts1_datafile2.dat'; |
| 106 |
|
| 107 |
ALTER TABLESPACE ts1 |
| 108 |
DROP DATAFILE 'ts1_datafile.dat'; |
| 109 |
|
| 110 |
SET GLOBAL debug = '+d,ndb_schema_trans_commit_fail'; |
| 111 |
|
| 112 |
--error ER_DROP_FILEGROUP_FAILED |
| 113 |
DROP TABLESPACE ts1; |
| 114 |
SHOW WARNINGS; |
| 115 |
|
| 116 |
SET GLOBAL debug = '-d,ndb_schema_trans_commit_fail'; |
| 117 |
|
| 118 |
DROP TABLESPACE ts1; |
| 119 |
|
| 120 |
SET GLOBAL debug = '+d,ndb_dd_client_drop_logfile_group_fail,ndb_schema_trans_commit_fail'; |
| 121 |
|
| 122 |
--error ER_DROP_FILEGROUP_FAILED |
| 123 |
DROP LOGFILE GROUP lg1 |
| 124 |
ENGINE NDB; |
| 125 |
SHOW WARNINGS; |
| 126 |
|
| 127 |
SET GLOBAL debug = '-d,ndb_dd_client_drop_logfile_group_fail'; |
| 128 |
|
| 129 |
--error ER_DROP_FILEGROUP_FAILED |
| 130 |
DROP LOGFILE GROUP lg1 |
| 131 |
ENGINE NDB; |
| 132 |
SHOW WARNINGS; |
| 133 |
|
| 134 |
SET GLOBAL debug = '-d,ndb_schema_trans_commit_fail'; |
| 135 |
|
| 136 |
DROP LOGFILE GROUP lg1 |
| 137 |
ENGINE NDB; |
| 138 |
|
| 139 |
SET @@global.debug = @save_debug; |