MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
have_multi_ndb.inc
1 # In general is should be equivalent to run 2 connections to
2 # different servers and 2 connections to th same server...
3 # So in general we should be able to run "multi tests" also on embedded
4 -- let have_embedded=`select version() like '%embedded%'`
5 if ($have_embedded)
6 {
7  # Setup 2 connections used in multi tests
8  connect (server1,localhost,root,,test);
9  connect (server2,localhost,root,,test);
10 }
11 if (!$have_embedded)
12 {
13  # Setup connections to both MySQL Servers connected to the cluster
14  connect (server1,127.0.0.1,root,,test,$MASTER_MYPORT,);
15  connect (server2,127.0.0.1,root,,test,$MASTER_MYPORT1,);
16 }
17 
18 # Check that server1 has NDB support
19 connection server1;
20 let $engines_table= query_get_value(SHOW TABLES FROM information_schema LIKE 'ENGINES', Tables_in_information_schema (ENGINES), 1);
21 disable_query_log;
22 if (`SELECT 1 FROM dual WHERE '$engines_table' = 'engines'`)
23 {
24 --require r/true.require
25 SELECT (support = 'YES' or support = 'DEFAULT' or support = 'ENABLED') as `TRUE` FROM information_schema.engines WHERE engine = 'ndbcluster';
26 }
27 enable_query_log;
28 
29 if (!$have_embedded)
30 {
31 # Check that server2 has NDB support
32 connection server2;
33 let $engines_table= query_get_value(SHOW TABLES FROM information_schema LIKE 'ENGINES', Tables_in_information_schema (ENGINES), 1);
34 disable_query_log;
35 if (`SELECT 1 FROM dual WHERE '$engines_table' = 'engines'`)
36 {
37 --require r/true.require
38 SELECT (support = 'YES' or support = 'DEFAULT' or support = 'ENABLED') as `TRUE` FROM information_schema.engines WHERE engine = 'ndbcluster';
39 }
40 enable_query_log;
41 }
42 
43 # cleanup
44 
45 connection server1;
46 disable_query_log;
47 disable_warnings;
48 --error 0,1051
49 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
50 flush tables;
51 flush status;
52 enable_warnings;
53 enable_query_log;
54 
55 if (!$have_embedded)
56 {
57 connection server2;
58 disable_query_log;
59 disable_warnings;
60 --error 0,1051
61 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
62 flush tables;
63 flush status;
64 enable_warnings;
65 enable_query_log;
66 }
67 
68 # Set the default connection
69 connection server1;
70 
71 --let NDB_BACKUPS=$NDB_BACKUP_DIR/BACKUP/BACKUP