Skip to content

Commit d33aeca

Browse files
Merge 7.0 -> 5.5-cluster
2 parents 00f6755 + 59a3b63 commit d33aeca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+4694
-1502
lines changed

CMakeLists.txt

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -381,19 +381,3 @@ IF(NOT INSTALL_LAYOUT MATCHES "RPM")
381381
)
382382
ENDIF()
383383

384-
# Dump cmake's output and error log to help diagnosing
385-
# platform checks
386-
MACRO(DUMP_FILE filename)
387-
IF(EXISTS ${filename})
388-
FILE(READ ${filename} content)
389-
MESSAGE(STATUS "=vvvv= Dumping ${filename} ")
390-
MESSAGE(STATUS "${content}")
391-
MESSAGE(STATUS "=^^^^=")
392-
ELSE()
393-
MESSAGE(STATUS "'${filename}' does not exist")
394-
ENDIF()
395-
ENDMACRO()
396-
397-
DUMP_FILE("${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log")
398-
DUMP_FILE("${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log")
399-

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
MYSQL_VERSION_MAJOR=5
22
MYSQL_VERSION_MINOR=5
33
MYSQL_VERSION_PATCH=12
4-
MYSQL_VERSION_EXTRA=-ndb-7.0.25
4+
MYSQL_VERSION_EXTRA=-ndb-7.0.26
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
CREATE LOGFILE GROUP lg1
2+
ADD UNDOFILE 'undofile.dat'
3+
INITIAL_SIZE 16M
4+
UNDO_BUFFER_SIZE = 1M
5+
ENGINE NDB;
6+
CREATE TABLESPACE ts1
7+
ADD DATAFILE 'datafile.dat'
8+
USE LOGFILE GROUP lg1
9+
INITIAL_SIZE 12M
10+
ENGINE NDB;
11+
alter tablespace ts1
12+
drop datafile 'datafile.dat'
13+
engine ndb;
14+
drop tablespace ts1
15+
engine ndb;
16+
drop logfile group lg1
17+
engine ndb;

mysql-test/suite/ndb/r/ndbinfo.result

Lines changed: 116 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ Variable_name Value
136136
ndbinfo_database ndbinfo
137137
ndbinfo_max_bytes 0
138138
ndbinfo_max_rows 10
139+
ndbinfo_offline OFF
139140
ndbinfo_show_hidden OFF
140141
ndbinfo_table_prefix ndb$
141142
ndbinfo_version NDB_VERSION_D
@@ -179,20 +180,55 @@ node_id != 0
179180
1
180181
Warnings:
181182
Note 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'
182-
183-
## 2) Column does not exist in NDB -> error, with warning
184183
DROP TABLE ndb$test;
184+
185+
## 2) Column does not exist in NDB -> allowed, with warning, non existing
186+
## column(s) return NULL
187+
## 2a) Extra column at end
185188
CREATE TABLE ndb$test (node_id int, non_existing int) ENGINE = ndbinfo;
186-
SELECT * FROM ndb$test;
187-
ERROR HY000: Got error 40001 'Incompatible table definitions' from NDBINFO
188-
SHOW WARNINGS;
189-
Level Code Message
189+
SELECT DISTINCT node_id, non_existing FROM ndb$test;
190+
node_id non_existing
191+
1 NULL
192+
2 NULL
193+
Warnings:
190194
Warning 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'
191-
Error 1296 Got error 40001 'Incompatible table definitions' from NDBINFO
195+
Note 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'
196+
DROP TABLE ndb$test;
197+
198+
## 2b) Extra column(s) in middle
199+
CREATE TABLE ndb$test (
200+
node_id int unsigned,
201+
non_existing int unsigned,
202+
block_number int unsigned,
203+
block_instance int unsigned,
204+
counter int unsigned,
205+
counter2 bigint unsigned
206+
) ENGINE = ndbinfo;
207+
SELECT DISTINCT node_id, non_existing, block_number FROM ndb$test;
208+
node_id non_existing block_number
209+
1 NULL 249
210+
2 NULL 249
211+
Warnings:
212+
Warning 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'
213+
DROP TABLE ndb$test;
214+
215+
## 2c) Extra column first
216+
CREATE TABLE ndb$test (non_existing int, node_id int) ENGINE = ndbinfo;
217+
SELECT DISTINCT node_id, non_existing FROM ndb$test;
218+
node_id non_existing
219+
1 NULL
220+
2 NULL
221+
Warnings:
222+
Warning 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'
223+
Note 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'
224+
SELECT DISTINCT non_existing, node_id FROM ndb$test;
225+
non_existing node_id
226+
NULL 1
227+
NULL 2
228+
DROP TABLE ndb$test;
192229

193230
## 3) Incompatible column type -> error, with warning
194231
## 3a) int instead of bigint
195-
DROP TABLE ndb$test;
196232
CREATE TABLE ndb$test (counter2 int) ENGINE = ndbinfo;
197233
SELECT * FROM ndb$test;
198234
ERROR HY000: Got error 40001 'Incompatible table definitions' from NDBINFO
@@ -219,6 +255,26 @@ Level Code Message
219255
Warning 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'
220256
Error 1296 Got error 40001 'Incompatible table definitions' from NDBINFO
221257
DROP TABLE ndb$test;
258+
## 3d) column which is NOT NULL
259+
CREATE TABLE ndb$test (node_id int unsigned NOT NULL) ENGINE = ndbinfo;
260+
SELECT * FROM ndb$test;
261+
ERROR HY000: Got error 40001 'Incompatible table definitions' from NDBINFO
262+
SHOW WARNINGS;
263+
Level Code Message
264+
Warning 40001 Table 'ndb$test' is defined differently in NDB, column 'node_id' is NOT NULL. 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'
265+
Error 1296 Got error 40001 'Incompatible table definitions' from NDBINFO
266+
DROP TABLE ndb$test;
267+
## 3e) non existing column which is NOT NULL
268+
CREATE TABLE ndb$test (
269+
block_number int unsigned,
270+
non_existing int NOT NULL) ENGINE = ndbinfo;
271+
SELECT * FROM ndb$test;
272+
ERROR HY000: Got error 40001 'Incompatible table definitions' from NDBINFO
273+
SHOW WARNINGS;
274+
Level Code Message
275+
Warning 40001 Table 'ndb$test' is defined differently in NDB, column 'non_existing' is NOT NULL. 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'
276+
Error 1296 Got error 40001 'Incompatible table definitions' from NDBINFO
277+
DROP TABLE ndb$test;
222278

223279
## 4) Table with primary key/indexes not supported
224280
CREATE TABLE ndb$test (node_id int, block_number int PRIMARY KEY) ENGINE = ndbinfo;
@@ -238,3 +294,55 @@ node_id
238294
1
239295
2
240296

297+
set @@ndbinfo_offline=1;
298+
ERROR HY000: Variable 'ndbinfo_offline' is a GLOBAL variable and should be set with SET GLOBAL
299+
300+
SELECT DISTINCT(node_id) FROM ndbinfo.counters ORDER BY node_id;
301+
node_id
302+
1
303+
2
304+
305+
set @@global.ndbinfo_offline=TRUE;
306+
select @@ndbinfo_offline;
307+
@@ndbinfo_offline
308+
1
309+
310+
CREATE TABLE ndb$does_not_exist_in_ndb(
311+
node_id int,
312+
message varchar(255)
313+
) ENGINE = ndbinfo;
314+
315+
CREATE VIEW view_on_table_which_does_not_exist_in_ndb AS
316+
SELECT node_id, message
317+
FROM ndbinfo.ndb$does_not_exist_in_ndb;
318+
319+
SHOW CREATE TABLE ndb$does_not_exist_in_ndb;
320+
Table Create Table
321+
ndb$does_not_exist_in_ndb CREATE TABLE `ndb$does_not_exist_in_ndb` (
322+
`node_id` int(11) DEFAULT NULL,
323+
`message` varchar(255) DEFAULT NULL
324+
) ENGINE=NDBINFO DEFAULT CHARSET=latin1
325+
326+
SELECT * FROM view_on_table_which_does_not_exist_in_ndb;
327+
node_id message
328+
Warnings:
329+
Note 1 'NDBINFO' has been started in offline mode since the 'NDBCLUSTER' engine is disabled or @@global.ndbinfo_offline is turned on - no rows can be returned
330+
SELECT * FROM ndb$does_not_exist_in_ndb;
331+
node_id message
332+
Warnings:
333+
Note 1 'NDBINFO' has been started in offline mode since the 'NDBCLUSTER' engine is disabled or @@global.ndbinfo_offline is turned on - no rows can be returned
334+
SELECT DISTINCT(node_id) FROM ndbinfo.counters ORDER BY node_id;
335+
node_id
336+
Warnings:
337+
Note 1 'NDBINFO' has been started in offline mode since the 'NDBCLUSTER' engine is disabled or @@global.ndbinfo_offline is turned on - no rows can be returned
338+
339+
DROP VIEW view_on_table_which_does_not_exist_in_ndb;
340+
DROP TABLE ndb$does_not_exist_in_ndb;
341+
342+
set @@global.ndbinfo_offline = FALSE;
343+
344+
SELECT DISTINCT(node_id) FROM ndbinfo.counters ORDER BY node_id;
345+
node_id
346+
1
347+
2
348+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
!include suite/ndb/my.cnf
2+
3+
[cluster_config.1]
4+
ndbd=
5+
NoOfReplicas=1
6+
MaxNoOfOpenFiles=27
7+
InitialNoOfOpenFiles=26
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
-- source include/have_ndb.inc
2+
3+
CREATE LOGFILE GROUP lg1
4+
ADD UNDOFILE 'undofile.dat'
5+
INITIAL_SIZE 16M
6+
UNDO_BUFFER_SIZE = 1M
7+
ENGINE NDB;
8+
9+
CREATE TABLESPACE ts1
10+
ADD DATAFILE 'datafile.dat'
11+
USE LOGFILE GROUP lg1
12+
INITIAL_SIZE 12M
13+
ENGINE NDB;
14+
15+
alter tablespace ts1
16+
drop datafile 'datafile.dat'
17+
engine ndb;
18+
19+
drop tablespace ts1
20+
engine ndb;
21+
22+
drop logfile group lg1
23+
engine ndb;

mysql-test/suite/ndb/t/ndbinfo.test

Lines changed: 87 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,17 +98,35 @@ SELECT count(*) >= 20 FROM blocks;
9898
DROP TABLE ndb$test;
9999
CREATE TABLE ndb$test (node_id int unsigned) ENGINE = ndbinfo;
100100
SELECT node_id != 0 FROM ndb$test LIMIT 1;
101-
102-
## 2) Column does not exist in NDB -> error, with warning
103101
DROP TABLE ndb$test;
102+
103+
## 2) Column does not exist in NDB -> allowed, with warning, non existing
104+
## column(s) return NULL
105+
## 2a) Extra column at end
104106
CREATE TABLE ndb$test (node_id int, non_existing int) ENGINE = ndbinfo;
105-
--error ER_GET_ERRMSG
106-
SELECT * FROM ndb$test;
107-
SHOW WARNINGS;
107+
SELECT DISTINCT node_id, non_existing FROM ndb$test;
108+
DROP TABLE ndb$test;
109+
110+
## 2b) Extra column(s) in middle
111+
CREATE TABLE ndb$test (
112+
node_id int unsigned,
113+
non_existing int unsigned,
114+
block_number int unsigned,
115+
block_instance int unsigned,
116+
counter int unsigned,
117+
counter2 bigint unsigned
118+
) ENGINE = ndbinfo;
119+
SELECT DISTINCT node_id, non_existing, block_number FROM ndb$test;
120+
DROP TABLE ndb$test;
121+
122+
## 2c) Extra column first
123+
CREATE TABLE ndb$test (non_existing int, node_id int) ENGINE = ndbinfo;
124+
SELECT DISTINCT node_id, non_existing FROM ndb$test;
125+
SELECT DISTINCT non_existing, node_id FROM ndb$test;
126+
DROP TABLE ndb$test;
108127

109128
## 3) Incompatible column type -> error, with warning
110129
## 3a) int instead of bigint
111-
DROP TABLE ndb$test;
112130
CREATE TABLE ndb$test (counter2 int) ENGINE = ndbinfo;
113131
--error ER_GET_ERRMSG
114132
SELECT * FROM ndb$test;
@@ -126,6 +144,21 @@ CREATE TABLE ndb$test (node_id varchar(255)) ENGINE = ndbinfo;
126144
SELECT * FROM ndb$test;
127145
SHOW WARNINGS;
128146
DROP TABLE ndb$test;
147+
## 3d) column which is NOT NULL
148+
CREATE TABLE ndb$test (node_id int unsigned NOT NULL) ENGINE = ndbinfo;
149+
--error ER_GET_ERRMSG
150+
SELECT * FROM ndb$test;
151+
SHOW WARNINGS;
152+
DROP TABLE ndb$test;
153+
## 3e) non existing column which is NOT NULL
154+
CREATE TABLE ndb$test (
155+
block_number int unsigned,
156+
non_existing int NOT NULL) ENGINE = ndbinfo;
157+
--error ER_GET_ERRMSG
158+
SELECT * FROM ndb$test;
159+
SHOW WARNINGS;
160+
DROP TABLE ndb$test;
161+
129162

130163
## 4) Table with primary key/indexes not supported
131164
--error ER_TOO_MANY_KEYS
@@ -148,4 +181,52 @@ CREATE TABLE ndb$test (node_id int AUTO_INCREMENT) ENGINE = ndbinfo;
148181
select distinct node_id
149182
from ndbinfo.diskpagebuffer;
150183

184+
185+
#
186+
# BUG#11885602
187+
# - It was allowed to CREATE TABLE which was not in NDB, but
188+
# creating a view on that table failed. Implement ndbinfo_offline
189+
# mode which allows tables to be created and opened although they
190+
# don't exists or have different table definition.
191+
# This is exactly the same behaviour as when NDBCLUSTER
192+
# is disabled
193+
#
194+
195+
# Check ndbinfo_offline is GLOBAL variable
196+
--error ER_GLOBAL_VARIABLE
197+
set @@ndbinfo_offline=1;
198+
199+
# Query used to check that open tables are closed
200+
# when offline mode is turned on and off
201+
let $q1 = SELECT DISTINCT(node_id) FROM ndbinfo.counters ORDER BY node_id;
202+
eval $q1;
203+
204+
# Turn on ndbinfo_offline
205+
set @@global.ndbinfo_offline=TRUE;
206+
select @@ndbinfo_offline;
207+
208+
CREATE TABLE ndb$does_not_exist_in_ndb(
209+
node_id int,
210+
message varchar(255)
211+
) ENGINE = ndbinfo;
212+
213+
CREATE VIEW view_on_table_which_does_not_exist_in_ndb AS
214+
SELECT node_id, message
215+
FROM ndbinfo.ndb$does_not_exist_in_ndb;
216+
217+
SHOW CREATE TABLE ndb$does_not_exist_in_ndb;
218+
219+
# SELECTs return no rows in offline mode
220+
SELECT * FROM view_on_table_which_does_not_exist_in_ndb;
221+
SELECT * FROM ndb$does_not_exist_in_ndb;
222+
eval $q1;
223+
224+
DROP VIEW view_on_table_which_does_not_exist_in_ndb;
225+
DROP TABLE ndb$does_not_exist_in_ndb;
226+
227+
# Restore original value
228+
set @@global.ndbinfo_offline = FALSE;
229+
230+
eval $q1;
231+
151232
--source ndbinfo_drop.inc

0 commit comments

Comments
 (0)