MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ndb_backup_id.inc
1 # there is no neat way to find the backupid, this is a hack to find it...
2 --let $dump_file= $MYSQLTEST_VARDIR/tmp/select_all.txt
3 --exec $NDB_SELECT_ALL --no-defaults -d sys --delimiter=, SYSTAB_0 > $dump_file
4 
5 CREATE TEMPORARY TABLE test.backup_info(
6  a BIGINT,
7  b BIGINT
8 ) ENGINE = HEAP;
9 
10 # needed for embedded
11 --chmod 0777 $dump_file
12 --disable_warnings
13 --replace_result $dump_file DUMP_FILE
14 eval LOAD DATA INFILE '$dump_file' INTO TABLE test.backup_info
15  FIELDS TERMINATED BY ',' IGNORE 1 LINES;
16 --remove_file $dump_file
17 --enable_warnings
18 
19 # Load backup id into environment variable
20 let $_exists = `SELECT a from test.backup_info where a = 520093696`;
21 if (!$_exists)
22 {
23  # Failed to read the value, dump table and report error
24  select * from test.backup_info;
25  die Could not read backup id from backup_info table;
26 }
27 let $the_backup_id = `SELECT b from test.backup_info where a = 520093696`;
28 
29 DROP TABLE test.backup_info;
30 
31