1
# suite/funcs_1/datadict/is_columns.inc
3
# Auxiliary script to be sourced by
9
# Check the content of information_schema.columns about tables within certain
13
# The variable $my_where has to
14
# - be set before sourcing this script.
15
# - contain the first part of the WHERE qualification
17
# let $my_where = WHERE table_schema = 'information_schema'
18
# AND table_name <> 'profiling';
19
# --source suite/funcs_1/datadict/is_columns.inc
22
# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
24
# Create this script based on older scripts and new code.
27
--source suite/funcs_1/datadict/datadict_bug_12777.inc
29
SELECT * FROM information_schema.columns
31
ORDER BY table_schema, table_name, column_name;
33
--echo ##########################################################################
34
--echo # Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
35
--echo ##########################################################################
38
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
42
FROM information_schema.columns
44
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH = 1
45
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
47
#FIXME 3.2.6.2: check the value 2.0079 tinytext ucs2 ucs2_general_ci
50
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
54
FROM information_schema.columns
56
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
57
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
61
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
65
FROM information_schema.columns
67
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH IS NULL
68
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
70
echo --> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values;
71
echo --> are 0, which is intended behavior, and the result of 0 / 0 IS NULL;
72
--source suite/funcs_1/datadict/datadict_bug_12777.inc
74
SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
79
CHARACTER_MAXIMUM_LENGTH,
80
CHARACTER_OCTET_LENGTH,
84
FROM information_schema.columns
86
ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION;