45
45
# Bug#16859 -- NULLs in columns must not truncate data as if a C-language "string".
47
--exec $MYSQL -t test -e "create table t1 (col1 binary(4), col2 varchar(10), col3 int); insert into t1 values ('a', 'b', 123421),('a ', '0123456789', 4), ('abcd', '', 4); select concat('>',col1,'<'), col2, col3 from t1; drop table t1;" 2>&1
47
#--exec $MYSQL -t test -e "create table t1 (col1 binary(4), col2 varchar(10), col3 int); insert into t1 values ('a', 'b', 123421),('a ', '0123456789', 4), ('abcd', '', 4); select concat('>',col1,'<'), col2, col3 from t1; drop table t1;" 2>&1
50
50
# Bug#17939 Wrong table format when using UTF8 strings
88
88
# Bug#21042 mysql client segfaults on importing a mysqldump export
91
--exec $MYSQL test -e "connect verylongdatabasenamethatshouldblowthe256byteslongbufferincom_connectfunctionxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxendcccccccdxxxxxxxxxxxxxxxxxkskskskskkskskskskskskskskskskkskskskskkskskskskskskskskskend" 2>&1
91
#--exec $MYSQL test -e "connect verylongdatabasenamethatshouldblowthe256byteslongbufferincom_connectfunctionxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxendcccccccdxxxxxxxxxxxxxxxxxkskskskskkskskskskskskskskskskkskskskskkskskskskskskskskskend" 2>&1
123
123
# Bug #20328: mysql client interprets commands in comments
125
--exec $MYSQL -e "help" > $MYSQLTEST_VARDIR/tmp/bug20328_1.result
126
--exec $MYSQL -e "help " > $MYSQLTEST_VARDIR/tmp/bug20328_2.result
127
--diff_files $MYSQLTEST_VARDIR/tmp/bug20328_1.result $MYSQLTEST_VARDIR/tmp/bug20328_2.result
125
#--exec $MYSQL -e "help" > $MYSQLTEST_VARDIR/tmp/bug20328_1.result
126
#--exec $MYSQL -e "help " > $MYSQLTEST_VARDIR/tmp/bug20328_2.result
127
#--diff_files $MYSQLTEST_VARDIR/tmp/bug20328_1.result $MYSQLTEST_VARDIR/tmp/bug20328_2.result
130
130
# Bug #19216: Client crashes on long SELECT
133
133
# - 3400 * 20 makes 68000 columns that is more than the
134
134
# max number that can fit in a 16 bit number.
137
open(FILE,">","$ENV{'MYSQLTEST_VARDIR'}/tmp/b19216.tmp") or die;
138
print FILE "select\n";
139
print FILE "'a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a',\n" x 3400;
145
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/b19216.tmp >/dev/null
148
--remove_file $MYSQLTEST_VARDIR/tmp/b19216.tmp
151
# Bug #20103: Escaping with backslash does not work
153
--exec echo "SET SQL_MODE = 'NO_BACKSLASH_ESCAPES';" > $MYSQLTEST_VARDIR/tmp/bug20103.sql
154
--exec echo "SELECT '\';" >> $MYSQLTEST_VARDIR/tmp/bug20103.sql
155
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug20103.sql 2>&1
157
--exec echo "SET SQL_MODE = '';" > $MYSQLTEST_VARDIR/tmp/bug20103.sql
158
--exec echo "SELECT '\';';" >> $MYSQLTEST_VARDIR/tmp/bug20103.sql
159
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug20103.sql 2>&1
137
#open(FILE,">","$ENV{'MYSQLTEST_VARDIR'}/tmp/b19216.tmp") or die;
138
#print FILE "select\n";
139
#print FILE "'a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a',\n" x 3400;
140
#print FILE "'b';\n";
145
#--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/b19216.tmp >/dev/null
148
#--remove_file $MYSQLTEST_VARDIR/tmp/b19216.tmp
162
151
# Bug#17583: mysql drops connection when stdout is not writable
204
193
--echo Test connect with dbname + _invalid_ hostname
205
194
# Mask the errno of the error message
206
--replace_regex /\([0-9]*\)/(errno)/
208
--exec $MYSQL test -e "\r test invalid_hostname" 2>&1
209
--replace_regex /\([0-9]*\)/(errno)/
211
--exec $MYSQL test -e "connect test invalid_hostname" 2>&1
213
--echo The commands reported in the bug report
214
--replace_regex /\([0-9]*\)/(errno)/
216
--exec $MYSQL test -e "\r\r\n\r\n cyril\ has\ found\ a\ bug\ :)XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" 2>&1
218
#--replace_regex /\([0-9]*\)/(errno)/
220
#--exec echo '\r\r\n\r\n cyril\ has\ found\ a\ bug\ :)XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' | $MYSQL 2>&1
222
--echo Too long dbname
224
--exec $MYSQL test -e "\r test_really_long_dbnamexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx localhost" 2>&1
226
--echo Too long hostname
227
--replace_regex /\([0-9]*\)/(errno)/
229
--exec $MYSQL test -e "\r test cyrils_superlonghostnameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" 2>&1
195
#--replace_regex /\([0-9]*\)/(errno)/
197
#--exec $MYSQL test -e "\r test invalid_hostname" 2>&1
198
#--replace_regex /\([0-9]*\)/(errno)/
200
#--exec $MYSQL test -e "connect test invalid_hostname" 2>&1
202
#--echo The commands reported in the bug report
203
#--replace_regex /\([0-9]*\)/(errno)/
205
#--exec $MYSQL test -e "\r\r\n\r\n cyril\ has\ found\ a\ bug\ :)XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" 2>&1
207
##--replace_regex /\([0-9]*\)/(errno)/
209
##--exec echo '\r\r\n\r\n cyril\ has\ found\ a\ bug\ :)XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' | $MYSQL 2>&1
211
#--echo Too long dbname
213
#--exec $MYSQL test -e "\r test_really_long_dbnamexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx localhost" 2>&1
215
#--echo Too long hostname
216
#--replace_regex /\([0-9]*\)/(errno)/
218
#--exec $MYSQL test -e "\r test cyrils_superlonghostnameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" 2>&1
237
226
# This should work just fine...
238
--write_file $MYSQLTEST_VARDIR/tmp/bug21412.sql
242
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug21412.sql 2>&1
243
remove_file $MYSQLTEST_VARDIR/tmp/bug21412.sql;
245
# This should give an error...
246
--write_file $MYSQLTEST_VARDIR/tmp/bug21412.sql
249
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug21412.sql 2>&1
250
remove_file $MYSQLTEST_VARDIR/tmp/bug21412.sql;
253
--write_file $MYSQLTEST_VARDIR/tmp/bug21412.sql
256
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug21412.sql 2>&1
257
remove_file $MYSQLTEST_VARDIR/tmp/bug21412.sql;
227
#--write_file $MYSQLTEST_VARDIR/tmp/bug21412.sql
231
#--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug21412.sql 2>&1
232
#remove_file $MYSQLTEST_VARDIR/tmp/bug21412.sql;
234
## This should give an error...
235
#--write_file $MYSQLTEST_VARDIR/tmp/bug21412.sql
238
#--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug21412.sql 2>&1
239
#remove_file $MYSQLTEST_VARDIR/tmp/bug21412.sql;
242
#--write_file $MYSQLTEST_VARDIR/tmp/bug21412.sql
245
#--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug21412.sql 2>&1
246
#remove_file $MYSQLTEST_VARDIR/tmp/bug21412.sql;
260
249
# Some coverage of not normally used parts
284
273
# Bug#29323 mysql client only accetps ANSI encoded files
286
--write_file $MYSQLTEST_VARDIR/tmp/bug29323.sql
287
select "This is a file starting with UTF8 BOM 0xEFBBBF";
289
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug29323.sql 2>&1
290
remove_file $MYSQLTEST_VARDIR/tmp/bug29323.sql;
275
#--write_file $MYSQLTEST_VARDIR/tmp/bug29323.sql
276
#select "This is a file starting with UTF8 BOM 0xEFBBBF";
278
#--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug29323.sql 2>&1
279
#remove_file $MYSQLTEST_VARDIR/tmp/bug29323.sql;
292
281
--echo End of 5.0 tests
295
# Bug #29903: The CMake build method does not produce the embedded library.
298
--exec $MYSQL --server-arg=no-defaults test -e "quit"
302
284
# Bug#26780: patch to add auto vertical output option to the cli.
304
286
# Make this wide enough that it will wrap almost everywhere.
306
288
# Too short to wrap.
307
289
--exec $MYSQL test --auto-vertical-output --table -e "SELECT 1;"
310
# Bug #25146: Some warnings/errors not shown when using --show-warnings
313
# This one should succeed with no warnings
314
--exec $MYSQL --show-warnings test -e "create table t1 (id int)"
316
# This should succeed, with warnings about conversion from nonexistent engine
317
--exec $MYSQL --show-warnings test -e "create table t2 (id int) engine=nonexistent"
319
# This should fail, with warnings as well
321
--exec $MYSQL --show-warnings test -e "create table t2 (id int) engine=nonexistent2"
325
291
--echo End of tests