Debian Codegraph @

mysql-test/suite/funcs_1/datadict/datadict_load.inc

raw
1 #### suite/funcs_1/datadict/datadict_load.inc
2 #
3 # The sub testcases are nearly independend. That is the reason why we do not
4 # want to abort after the first error.
5 --disable_abort_on_error
6
7 ################################################################################
8 #
9 # prepare variables for --replace_result
10 #
11 ################################################################################
12 --disable_query_log
13
14 # ------------------------------------------------------------------------------
15 # Get the size of ONE known colum and check the size against some values to
16 # be able to use the correct --replace_result statement. Using this only the
17 # one pair of 'wrong' values is replaced and not all occurrencies of all
18 # possible pairs of values. See bug #12777 for details.
19 SELECT character_maximum_length INTO @CML
20 FROM information_schema.columns
21 WHERE table_schema = 'information_schema'
22 AND table_name = 'COLUMNS'
23 AND column_name = 'table_catalog';
24
25 let $bug_12777_0512= `SELECT @CML = 512`;
26 let $bug_12777_1023= `SELECT @CML = 1023`;
27 let $bug_12777_1024= `SELECT @CML = 1024`;
28 let $bug_12777_2048= `SELECT @CML = 2048`;
29 # 4096 is the value used in the .results
30 let $bug_12777_4095= `SELECT @CML = 4095`;
31
32 if (0)
33 {
34 # enable this for debugging only, but NOT in a pushed version, as then the
35 # result changes from OS to OS ...
36 eval SELECT @CML AS 'CML',
37 $bug_12777_0512 AS '512',
38 $bug_12777_1023 AS '1023',
39 $bug_12777_1024 AS '1024',
40 $bug_12777_2048 AS '2048',
41 $bug_12777_4095 AS '4095';
42 }
43
44 # ------------------------------------------------------------------------------
45 # prepare a variable to be able to suppress machine dependant diffs
46 # this can be used in: --replace_result $SERVER_NAME <SERVER_NAME>
47 # let $SERVER_NAME= `SELECT DISTINCT host FROM mysql.user WHERE host LIKE "%\%" AND host NOT In ("localhost", "127.0.0.1", "%")`;
48 let $SERVER_NAME= `SELECT DISTINCT host FROM mysql.user WHERE host NOT In ("localhost", "127.0.0.1", "%")`;
49
50
51 ################################################################################
52 #
53 # load tables
54 # -----------
55 #
56 # this was part of the 4 files $<engine>_datadict.test, but it has been moved
57 # here to have only one place where all preparation for the test is done.
58 #
59 ################################################################################
60
61 eval SET @ENGINE_INNODB = IF( '$engine_type' = 'innodb', 1, 0);
62 eval SET @ENGINE_MEMORY = IF( '$engine_type' = 'memory', 1, 0);
63 eval SET @ENGINE_MYISAM = IF( '$engine_type' = 'myisam', 1, 0);
64 eval SET @ENGINE_NDB = IF( '$engine_type' = 'ndb', 1, 0);
65 --enable_query_log
66
67 let $engine_myisam= `SELECT @ENGINE_MYISAM = 1`;
68 let $engine_innodb= `SELECT @ENGINE_INNODB = 1`;
69 let $engine_memory= `SELECT @ENGINE_MEMORY = 1`;
70 let $engine_ndb= `SELECT @ENGINE_NDB = 1`;
71 # Note: The NDB variant with their own tb1 - tb4 tables is not ready for use.
72 let $engine_ndb= 0;
73
74 --disable_warnings
75 DROP DATABASE IF EXISTS test1;
76 --enable_warnings
77 CREATE DATABASE test1 charset latin1;
78 USE test;
79
80 if ($engine_innodb)
81 {
82 --source suite/funcs_1/include/innodb_tb1.inc
83 --source suite/funcs_1/include/innodb_tb2.inc
84 --source suite/funcs_1/include/innodb_tb3.inc
85 --source suite/funcs_1/include/innodb_tb4.inc
86 USE test1;
87 --source suite/funcs_1/include/innodb_tb2.inc
88 }
89
90 if ($engine_memory)
91 {
92 --source suite/funcs_1/include/memory_tb1.inc
93 --source suite/funcs_1/include/memory_tb2.inc
94 --source suite/funcs_1/include/memory_tb3.inc
95 --source suite/funcs_1/include/memory_tb4.inc
96 USE test1;
97 --source suite/funcs_1/include/memory_tb2.inc
98 }
99
100 if ($engine_myisam)
101 {
102 --source suite/funcs_1/include/myisam_tb1.inc
103 --source suite/funcs_1/include/myisam_tb2.inc
104 --source suite/funcs_1/include/myisam_tb3.inc
105 --source suite/funcs_1/include/myisam_tb4.inc
106 USE test1;
107 --source suite/funcs_1/include/myisam_tb2.inc
108 }
109
110 if ($engine_ndb)
111 {
112 --source suite/funcs_1/include/ndb_tb1.inc
113 --source suite/funcs_1/include/ndb_tb2.inc
114 --source suite/funcs_1/include/ndb_tb3.inc
115 --source suite/funcs_1/include/ndb_tb4.inc
116 USE test1;
117 --source suite/funcs_1/include/ndb_tb2.inc
118 }
119
120 USE test;
121 --source suite/funcs_1/include/sp_tb.inc