~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to mysql-test/suite/ndb/t/ndb_restore_compat.test

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
-- source include/have_ndb.inc
 
2
-- source include/not_embedded.inc
 
3
-- source include/have_case_sensitive_file_system.inc
 
4
 
 
5
# This test currently requires case sensitive file system as the tables
 
6
# are originally stored with uppercase
 
7
 
 
8
#
 
9
# Bug #18594 ndb_restore log boken in 5.1
 
10
#
 
11
 
 
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;
 
25
 
 
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
 
32
 
 
33
#
 
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
 
37
#
 
38
TRUNCATE GL;
 
39
TRUNCATE ACCOUNT;
 
40
TRUNCATE TRANSACTION;
 
41
TRUNCATE SYSTEM_VALUES;
 
42
TRUNCATE ACCOUNT_TYPE;
 
43
 
 
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
 
50
 
 
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
 
54
 
 
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
 
66
 
 
67
DROP DATABASE BANK;