| 1 |
--source include/have_ndb.inc |
| 2 |
--source include/have_binlog_format_mixed_or_row.inc |
| 3 |
--source suite/ndb_rpl/ndb_master-slave.inc |
| 4 |
|
| 5 |
--disable_warnings |
| 6 |
DROP TABLE IF EXISTS t1; |
| 7 |
--enable_warnings |
| 8 |
|
| 9 |
# |
| 10 |
# Basic test of disk tables for NDB |
| 11 |
# |
| 12 |
|
| 13 |
# |
| 14 |
# Start by creating a logfile group |
| 15 |
# |
| 16 |
|
| 17 |
CREATE LOGFILE GROUP lg1 |
| 18 |
ADD UNDOFILE 'undofile.dat' |
| 19 |
INITIAL_SIZE 16M |
| 20 |
UNDO_BUFFER_SIZE = 1M |
| 21 |
ENGINE=NDB; |
| 22 |
|
| 23 |
alter logfile group lg1 |
| 24 |
add undofile 'undofile02.dat' |
| 25 |
initial_size 4M engine=ndb; |
| 26 |
|
| 27 |
# |
| 28 |
# Create a tablespace connected to the logfile group |
| 29 |
# |
| 30 |
|
| 31 |
CREATE TABLESPACE ts1 |
| 32 |
ADD DATAFILE 'datafile.dat' |
| 33 |
USE LOGFILE GROUP lg1 |
| 34 |
INITIAL_SIZE 12M |
| 35 |
ENGINE NDB; |
| 36 |
|
| 37 |
alter tablespace ts1 |
| 38 |
add datafile 'datafile02.dat' |
| 39 |
initial_size 4M; |
| 40 |
|
| 41 |
# |
| 42 |
# Create a table using this tablespace |
| 43 |
# |
| 44 |
|
| 45 |
CREATE TABLE t1 |
| 46 |
(pk1 int not null primary key, b int not null, c int not null) |
| 47 |
tablespace ts1 storage disk |
| 48 |
engine ndb; |
| 49 |
|
| 50 |
# |
| 51 |
# insert some data |
| 52 |
# |
| 53 |
|
| 54 |
insert into t1 values (1,2,3); |
| 55 |
select * from t1 order by pk1; |
| 56 |
|
| 57 |
# |
| 58 |
# check that the data is also on the slave |
| 59 |
# |
| 60 |
|
| 61 |
--sync_slave_with_master |
| 62 |
--connection slave |
| 63 |
select * from t1 order by pk1; |
| 64 |
|
| 65 |
# |
| 66 |
# view the binlog |
| 67 |
# |
| 68 |
|
| 69 |
--connection master |
| 70 |
-- source include/show_binlog_events.inc |
| 71 |
|
| 72 |
# |
| 73 |
# cleanup |
| 74 |
# |
| 75 |
|
| 76 |
drop table t1; |
| 77 |
alter tablespace ts1 |
| 78 |
drop datafile 'datafile.dat'; |
| 79 |
alter tablespace ts1 |
| 80 |
drop datafile 'datafile02.dat'; |
| 81 |
DROP TABLESPACE ts1; |
| 82 |
DROP LOGFILE GROUP lg1 ENGINE=NDB; |
| 83 |
--source include/rpl_end.inc |