Debian Codegraph @

mysql-test/suite/funcs_1/datadict/datadict.pre

raw
1 #### suite/funcs_1/datadict/datadict.pre
2 #
3 # Auxiliary script which loads prerequisites
4 # (variables needed for --replace_result ...)
5 # in datadictionary tests.
6 #
7 # Author:
8 # 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
9 # testsuite funcs_1
10 # Create this script based on older scripts and new code.
11 #
12 --disable_query_log
13
14 # Bug#12777 Different size shown for VARCHAR(n) columns (with n> 64)
15 # in INFORMATION_SCHEMA
16 # This bug was unfortunately (for testers) declared to be no bug.
17 # So CHARACTER_MAXIMUM_LENGTH of several <whatever>_CATALOG columns within
18 # the INFORMATION_SCHEMA depends on PATH_MAX of the operating system.
19 # Workaround for this problem:
20 # Get the size of ONE known colum and check the size against some values to
21 # be able to use the correct --replace_result statement. Using this only the
22 # one pair of 'wrong' values is replaced and not all occurrencies of all
23 # possible pairs of values. See bug #12777 for details.
24 --disable_cursor_protocol
25 SELECT character_maximum_length INTO @CML
26 FROM information_schema.columns
27 WHERE table_schema = 'information_schema'
28 AND table_name = 'columns'
29 AND column_name = 'table_catalog';
30 --enable_cursor_protocol
31
32 let $bug_12777_0512= `SELECT @CML = 512`;
33 let $bug_12777_1023= `SELECT @CML = 1023`;
34 let $bug_12777_1024= `SELECT @CML = 1024`;
35 let $bug_12777_2048= `SELECT @CML = 2048`;
36 # 4096 is the value used in the files with expected results.
37 let $bug_12777_4095= `SELECT @CML = 4095`;
38 if (0)
39 {
40 # enable this for debugging only, but NOT in a pushed version, as then the
41 # result changes from OS to OS ...
42 eval SELECT @CML AS 'CML',
43 $bug_12777_0512 AS '512',
44 $bug_12777_1023 AS '1023',
45 $bug_12777_1024 AS '1024',
46 $bug_12777_2048 AS '2048',
47 $bug_12777_4095 AS '4095';
48 }
49
50
51 # Prepare a variable to be able to suppress machine dependant diffs
52 # this can be used in: --replace_result $SERVER_NAME <SERVER_NAME>
53 let $SERVER_NAME= `SELECT DISTINCT host FROM mysql.user
54 WHERE host NOT In ("localhost", "127.0.0.1", "%")`;
55 --enable_query_log
56