You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Add tests for incompatible table definitions between
MySQL Server and NDB
- Add detection of incompatible table definitions in open
- Fix mismatch in table def for the hardcoded
table "columns" in NdbApi
- Add 'ha_ndbinfo::get_error_message' so that proper error
messages are given in case of an error
- Add some more table flags for two features that you
have to 'opt-out' of - blobs and auto increment
Copy file name to clipboardExpand all lines: mysql-test/suite/ndb/r/ndbinfo.result
+64Lines changed: 64 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -104,6 +104,9 @@ ERROR HY000: Table 'ndb$tables' is read only
104
104
DELETE FROM ndb$tables WHERE table_id > 1;
105
105
ERROR HY000: Table 'ndb$tables' is read only
106
106
107
+
ALTER TABLE ndb$test ADD COLUMN another_col varchar(255);
108
+
ERROR HY000: Table 'ndb$test' is read only
109
+
107
110
FLUSH TABLES;
108
111
SELECT table_id FROM ndb$tables;
109
112
table_id
@@ -164,3 +167,64 @@ SELECT count(*) >= 20 FROM blocks;
164
167
count(*) >= 20
165
168
1
166
169
170
+
## 1) More columns in NDB -> allowed, with warning
171
+
DROP TABLE ndb$test;
172
+
CREATE TABLE ndb$test (node_id int unsigned) ENGINE = ndbinfo;
173
+
SELECT node_id != 0 FROM ndb$test LIMIT 1;
174
+
node_id != 0
175
+
1
176
+
Warnings:
177
+
Warning 40001 Table 'ndb$test' is defined differently in NDB, there are more columns available. The SQL to regenerate is: 'CREATE TABLE `ndbinfo`.`ndb$test` (`node_id` INT UNSIGNED, `block_number` INT UNSIGNED, `block_instance` INT UNSIGNED, `counter` INT UNSIGNED, `counter2` BIGINT UNSIGNED) ENGINE=NDBINFO'
178
+
179
+
## 2) Column does not exist in NDB -> error, with warning
ERROR HY000: Got error 40001 'Incompatible table definitions' from NDBINFO
184
+
SHOW WARNINGS;
185
+
Level Code Message
186
+
Error 40001 Table 'ndb$test' is defined differently in NDB, column 'non_existing' does not exist. The SQL to regenerate is: 'CREATE TABLE `ndbinfo`.`ndb$test` (`node_id` INT UNSIGNED, `block_number` INT UNSIGNED, `block_instance` INT UNSIGNED, `counter` INT UNSIGNED, `counter2` BIGINT UNSIGNED) ENGINE=NDBINFO'
187
+
Error 1296 Got error 40001 'Incompatible table definitions' from NDBINFO
188
+
189
+
## 3) Incompatible column type -> error, with warning
ERROR HY000: Got error 40001 'Incompatible table definitions' from NDBINFO
195
+
SHOW WARNINGS;
196
+
Level Code Message
197
+
Error 40001 Table 'ndb$test' is defined differently in NDB, column 'counter2' is not compatible. The SQL to regenerate is: 'CREATE TABLE `ndbinfo`.`ndb$test` (`node_id` INT UNSIGNED, `block_number` INT UNSIGNED, `block_instance` INT UNSIGNED, `counter` INT UNSIGNED, `counter2` BIGINT UNSIGNED) ENGINE=NDBINFO'
198
+
Error 1296 Got error 40001 'Incompatible table definitions' from NDBINFO
ERROR HY000: Got error 40001 'Incompatible table definitions' from NDBINFO
204
+
SHOW WARNINGS;
205
+
Level Code Message
206
+
Error 40001 Table 'ndb$test' is defined differently in NDB, column 'node_id' is not compatible. The SQL to regenerate is: 'CREATE TABLE `ndbinfo`.`ndb$test` (`node_id` INT UNSIGNED, `block_number` INT UNSIGNED, `block_instance` INT UNSIGNED, `counter` INT UNSIGNED, `counter2` BIGINT UNSIGNED) ENGINE=NDBINFO'
207
+
Error 1296 Got error 40001 'Incompatible table definitions' from NDBINFO
ERROR HY000: Got error 40001 'Incompatible table definitions' from NDBINFO
213
+
SHOW WARNINGS;
214
+
Level Code Message
215
+
Error 40001 Table 'ndb$test' is defined differently in NDB, column 'node_id' is not compatible. The SQL to regenerate is: 'CREATE TABLE `ndbinfo`.`ndb$test` (`node_id` INT UNSIGNED, `block_number` INT UNSIGNED, `block_instance` INT UNSIGNED, `counter` INT UNSIGNED, `counter2` BIGINT UNSIGNED) ENGINE=NDBINFO'
216
+
Error 1296 Got error 40001 'Incompatible table definitions' from NDBINFO
217
+
DROP TABLE ndb$test;
218
+
219
+
## 4) Table with primary key/indexes not supported
0 commit comments