summaryrefslogtreecommitdiff
path: root/mysql-test/suite/rpl_ndb/t/rpl_ndb_load.test
blob: 75fe2688b4a819f459830206f2a62d625f1c2b08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#
# Currently this test only runs in the source tree with the 
# ndb/test programs compiled.
# invoke with:  ./mysql-test-run --ndb-extra-test --do-test=rpl_ndb_load
#

--source include/have_ndb.inc
--source include/have_ndb_extra.inc
--source include/have_binlog_format_row.inc
--source include/ndb_master-slave.inc

--disable_warnings
# reset master
connection master;
DROP DATABASE IF EXISTS TEST_DB;
CREATE DATABASE TEST_DB;
--enable_warnings

#
# These tables should correspond to the table definitions in
# storage/ndb/test/ndbapi/bench/
#
connection master;
USE TEST_DB;
CREATE TABLE SUBSCRIBER
                ( NUMBER       CHAR(12) BINARY NOT NULL,
                  NAME         CHAR(32) BINARY NOT NULL,
                  GROUP_ID     INT UNSIGNED NOT NULL,
                  LOCATION     INT UNSIGNED NOT NULL,
                  SESSIONS     INT UNSIGNED NOT NULL,
                  CHANGED_BY   CHAR(32) BINARY NOT NULL,
                  CHANGED_TIME CHAR(32) BINARY NOT NULL,
                  PRIMARY KEY USING HASH (NUMBER))
   ENGINE = NDB;

CREATE TABLE GROUP_T
                ( GROUP_ID     INT UNSIGNED NOT NULL,
                  GROUP_NAME   CHAR(32) BINARY NOT NULL,
                  ALLOW_READ   CHAR(1)  BINARY NOT NULL,
                  ALLOW_INSERT INT UNSIGNED NOT NULL,
                  ALLOW_DELETE INT UNSIGNED NOT NULL,
                  PRIMARY KEY USING HASH (GROUP_ID))
   ENGINE = NDB;

CREATE TABLE SESSION
                ( NUMBER    CHAR(12)   BINARY NOT NULL,
                  SERVER_ID INT UNSIGNED NOT NULL,
                  DATA      VARBINARY(1998) NOT NULL,
                  PRIMARY KEY USING HASH (NUMBER,SERVER_ID))
   ENGINE = NDB;

CREATE TABLE SERVER
                ( SUFFIX       CHAR(2)  BINARY NOT NULL,
                  SERVER_ID    INT UNSIGNED NOT NULL,
                  NAME         CHAR(32) BINARY NOT NULL,
                  NO_OF_READ   INT UNSIGNED NOT NULL,
                  NO_OF_INSERT INT UNSIGNED NOT NULL,
                  NO_OF_DELETE INT UNSIGNED NOT NULL,
                  PRIMARY KEY USING HASH (SUFFIX, SERVER_ID))
   ENGINE = NDB;

#
# start "load" application
#
--exec NDB_CONNECTSTRING=$NDB_CONNECTSTRING ../storage/ndb/test/ndbapi/DbCreate >> $NDB_TOOLS_OUTPUT
--exec NDB_CONNECTSTRING=$NDB_CONNECTSTRING ../storage/ndb/test/ndbapi/DbAsyncGenerator  >> $NDB_TOOLS_OUTPUT