94
# NOTE: We disable this ORDERING bit as it
95
# was causing fits for drizzledump_restore.test
96
# The returned ORDINAL_POSITION value was 0 instead of 1 as we
97
# expect in MySQL and things didn't work out
98
# As the only test that uses this include file is
99
# drizzledump_restore, it doesn't cause any problems
100
# Leaving the code here at the moment in case someone should need
101
# it, but recommend removing this entirely ~1 year from commit
104
# We need the output files to be sorted (so that diff_files does not
105
# think the files are different just because they are differently
106
# ordered). To this end, we first generate a query that sorts the
107
# table by all columns. Since ORDER BY accept column indices, we
108
# just generate a comma-separated list of all numbers from 1 to the
109
# number of columns in the table.
110
let $_diff_column_index=`SELECT MAX(ordinal_position)
111
FROM data_dictionary.columns
112
WHERE CONCAT(table_schema, '.', table_name) =
115
# The content of $_diff_column_index must be an integer >= 0.
116
# If not the following might happen:
117
# Result of SELECT | $_diff_column_index | dec $_diff_column_index
118
# NULL | empty string | -1
119
# '' | empty string | -1
122
# ........................
123
# (Bug#51057 Weak code in diff_tables.inc can lead to 100% CPU consumption)
124
# In case $i = 1 the soone following loop
129
# will never terminate.
130
#if (`SELECT CAST(CAST('$_diff_column_index' AS UNSIGNED) AS CHAR(65))
131
# <> '$_diff_column_index'
132
# OR CAST('$_diff_column_index' AS UNSIGNED) < 1`) {
133
# --echo !!!ERROR IN TEST: \$_diff_column_index is '$_diff_column_index'
134
# --echo but must be an unsigned integer > 0
138
95
#let $_diff_column_list=$_diff_column_index;
139
96
#dec $_diff_column_index;