Debian Codegraph @

mysql-test/suite/ndb/t/ndbapi-examples.test

raw
1 -- source include/have_ndb.inc
2 -- source include/have_ndbapi_examples.inc
3
4 # Connect using socket to the MySQL Server which mysqltest currently
5 # is connected to
6 let MASTER_MYSOCK=`select @@socket`;
7
8 # Setup path for log file
9 let NDB_EXAMPLES_OUTPUT=$MYSQLTEST_VARDIR/log/ndbapi_examples.log;
10
11 --echo Running ndb_ndbapi_simple
12 --exec $NDB_EXAMPLES_DIR/ndb_ndbapi_simple $MASTER_MYSOCK "$NDB_CONNECTSTRING" > $NDB_EXAMPLES_OUTPUT
13
14 --echo Running ndb_ndbapi_simple_index
15 --exec $NDB_EXAMPLES_DIR/ndb_ndbapi_simple_index $MASTER_MYSOCK "$NDB_CONNECTSTRING" >> $NDB_EXAMPLES_OUTPUT
16
17 --echo Running ndb_ndbapi_scan
18 --exec $NDB_EXAMPLES_DIR/ndb_ndbapi_scan $MASTER_MYSOCK "$NDB_CONNECTSTRING" >> $NDB_EXAMPLES_OUTPUT
19
20 --echo Running ndb_ndbapi_retries
21 --exec $NDB_EXAMPLES_DIR/ndb_ndbapi_retries $MASTER_MYSOCK "$NDB_CONNECTSTRING" >> $NDB_EXAMPLES_OUTPUT
22
23 --echo Running ndb_ndbapi_async
24 --exec $NDB_EXAMPLES_DIR/ndb_ndbapi_async $MASTER_MYSOCK "$NDB_CONNECTSTRING" >> $NDB_EXAMPLES_OUTPUT
25
26 --echo Running ndb_ndbapi_async1
27 --exec $NDB_EXAMPLES_DIR/ndb_ndbapi_async1 $MASTER_MYSOCK "$NDB_CONNECTSTRING" >> $NDB_EXAMPLES_OUTPUT
28
29 # Drop database created by test programs
30 drop database ndb_examples;
31
32 create table t0(c0 int, c1 int, c2 char(4), c3 char(4), c4 text,
33 primary key(c0, c2)) engine ndb charset latin1;
34 #--echo Running ndb_ndbapi_event
35 #--exec $NDB_EXAMPLES_DIR/ndb_ndbapi_event "$NDB_CONNECTSTRING" 1 >> $NDB_EXAMPLES_OUTPUT
36 insert into t0 values (1, 2, 'a', 'b', null);
37 insert into t0 values (3, 4, 'c', 'd', null);
38 update t0 set c3 = 'e' where c0 = 1 and c2 = 'a'; # use pk
39 update t0 set c3 = 'f'; # use scan
40 update t0 set c3 = 'F'; # use scan update to 'same'
41 update t0 set c2 = 'g' where c0 = 1; # update pk part
42 update t0 set c2 = 'G' where c0 = 1; # update pk part to 'same'
43 update t0 set c0 = 5, c2 = 'H' where c0 = 3; # update full PK
44 delete from t0;
45 drop table t0;
46
47 --echo Running mgmapi_logevent
48 --exec $NDB_EXAMPLES_DIR/ndb_mgmapi_logevent "$NDB_CONNECTSTRING" 1 >> $NDB_EXAMPLES_OUTPUT
49
50 --echo Running ndb_ndbapi_array_simple
51 create table api_array_simple(
52 ATTR1 INT UNSIGNED NOT NULL PRIMARY KEY,
53 ATTR2 CHAR(20) NOT NULL,
54 ATTR3 VARCHAR(20) NOT NULL,
55 ATTR4 VARCHAR(500) NOT NULL,
56 ATTR5 BINARY(20),
57 ATTR6 VARBINARY(20),
58 ATTR7 VARBINARY(500)
59 ) engine ndb charset latin1;
60 --exec $NDB_EXAMPLES_DIR/ndb_ndbapi_array_simple "$NDB_CONNECTSTRING" test
61 drop table api_array_simple;
62
63 --echo Running ndb_ndbapi_array_using_adapter
64 CREATE TABLE api_array_using_adapter(
65 ATTR1 INT UNSIGNED NOT NULL PRIMARY KEY,
66 ATTR2 CHAR(20) NOT NULL,
67 ATTR3 VARCHAR(20) NOT NULL,
68 ATTR4 VARCHAR(500) NOT NULL,
69 ATTR5 BINARY(20) NOT NULL,
70 ATTR6 VARBINARY(20) NOT NULL,
71 ATTR7 VARBINARY(500)
72 ) engine ndb charset latin1;
73 --exec $NDB_EXAMPLES_DIR/ndb_ndbapi_array_using_adapter "$NDB_CONNECTSTRING" test
74 drop table api_array_using_adapter;
75