MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
have_ndb_error_insert.inc
1 #
2 # Check if the binaries are compiled with error insert support
3 # by running ndb_mgm and check if it support the command "all error" which
4 # is only available when error insert is suppoerted.
5 #
6 
7 --disable_query_log
8 let $dump_file = $MYSQLTEST_VARDIR/tmp/ndb_mgm_error.txt;
9 
10 # Dump the output of ndb_mgm "all error 0" to file
11 --error 0,255
12 --exec $NDB_MGM --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -e "all error 0" > $dump_file
13 
14 # Load the file into a temporary table
15 CREATE TEMPORARY TABLE t37 (a varchar(512)) ENGINE = HEAP;
16 
17 # needed for embedded
18 --chmod 0777 $dump_file
19 --replace_result $dump_file DUMP_FILE
20 eval LOAD DATA INFILE '$dump_file' INTO TABLE t37;
21 --remove_file $dump_file
22 
23 # Query the temporary table
24 let $invalid_command_error =
25  `SELECT count(*) FROM t37 WHERE a REGEXP 'Invalid command: error'`;
26 
27 DROP TABLE t37;
28 
29 if ($invalid_command_error)
30 {
31  skip No error insert support;
32 }
33 
34 --enable_query_log