mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / suite / ndb / t / ndb_restore_compat.test
blob8e5b30aa6fdab22b08d3dc305090fecc2c587800
1 -- source include/have_ndb.inc
2 -- source include/not_embedded.inc
3 -- source include/have_case_sensitive_file_system.inc
5 # This test currently requires case sensitive file system as the tables
6 # are originally stored with uppercase
9 # Bug #18594 ndb_restore log boken in 5.1
12 --disable_warnings
13 DROP DATABASE IF EXISTS BANK;
14 --enable_warnings
15 CREATE DATABASE BANK default charset=latin1 default collate=latin1_bin;
16 --exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 1 -n 1 -p 1 -m -r $MYSQL_TEST_DIR/std_data/ndb_backup51 >> $NDB_TOOLS_OUTPUT
17 --exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -e -b 1 -n 2 -p 1 -r $MYSQL_TEST_DIR/std_data/ndb_backup51 >> $NDB_TOOLS_OUTPUT
18 USE BANK;
19 SHOW TABLES;
20 SELECT * FROM GL            ORDER BY TIME,ACCOUNT_TYPE;
21 SELECT * FROM ACCOUNT       ORDER BY ACCOUNT_ID;
22 SELECT COUNT(*) FROM TRANSACTION;
23 SELECT * FROM SYSTEM_VALUES ORDER BY SYSTEM_VALUES_ID;
24 SELECT * FROM mysql.ndb_apply_status WHERE server_id=0;
26 # Check that force varpart is set by ndb_restore
27 --exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d BANK GL | grep ForceVarPart
28 --exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d BANK ACCOUNT | grep ForceVarPart
29 --exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d BANK TRANSACTION | grep ForceVarPart
30 --exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d BANK SYSTEM_VALUES | grep ForceVarPart
31 --exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d BANK ACCOUNT_TYPE | grep ForceVarPart
34 # verify restore of 5.0 backup
35 # here we must use the already created tables as restoring the old
36 # table definitions will not work
38 TRUNCATE GL;
39 TRUNCATE ACCOUNT;
40 TRUNCATE TRANSACTION;
41 TRUNCATE SYSTEM_VALUES;
42 TRUNCATE ACCOUNT_TYPE;
44 # Check that force varpart is not changed by truncate
45 --exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d BANK GL | grep ForceVarPart
46 --exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d BANK ACCOUNT | grep ForceVarPart
47 --exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d BANK TRANSACTION | grep ForceVarPart
48 --exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d BANK SYSTEM_VALUES | grep ForceVarPart
49 --exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d BANK ACCOUNT_TYPE | grep ForceVarPart
51 # Restore data
52 --exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 1 -n 1 -p 1 -r $MYSQL_TEST_DIR/std_data/ndb_backup50 >> $NDB_TOOLS_OUTPUT
53 --exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -e -b 1 -n 2 -p 1 -r $MYSQL_TEST_DIR/std_data/ndb_backup50 >> $NDB_TOOLS_OUTPUT
55 # Check data
56 SELECT * FROM GL            ORDER BY TIME,ACCOUNT_TYPE;
57 SELECT * FROM ACCOUNT       ORDER BY ACCOUNT_ID;
58 SELECT COUNT(*) FROM TRANSACTION;
59 SELECT * FROM SYSTEM_VALUES ORDER BY SYSTEM_VALUES_ID;
60 SELECT * FROM mysql.ndb_apply_status WHERE server_id=0;
61 --exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 2 -n 1 -m -p 1 -s -r $MYSQL_TEST_DIR/std_data/ndb_backup50 >> $NDB_TOOLS_OUTPUT
62 --exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 2 -n 2 -p 1 -s -r $MYSQL_TEST_DIR/std_data/ndb_backup50 >> $NDB_TOOLS_OUTPUT
63 SELECT * FROM DESCRIPTION ORDER BY USERNAME;
64 --exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d BANK DESCRIPTION | grep SHORT_VAR
65 --exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d BANK DESCRIPTION | grep MEDIUM_VAR
67 DROP DATABASE BANK;