summaryrefslogtreecommitdiff
path: root/mysql-test/t/mysql_client.test
blob: 2a7f4a935bbc61b06c1b7e35cfce2f72e5c5049e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# This test should work in embedded server after we fix mysqltest
-- source include/not_embedded.inc

#
# Bug #20432: mysql client interprets commands in comments
#

# if the client sees the 'use' within the comment, we haven't fixed
--exec echo "/*"          >  $MYSQLTEST_VARDIR/tmp/bug20432.sql
--exec echo "use"         >> $MYSQLTEST_VARDIR/tmp/bug20432.sql
--exec echo "*/"          >> $MYSQLTEST_VARDIR/tmp/bug20432.sql
--exec $MYSQL              < $MYSQLTEST_VARDIR/tmp/bug20432.sql 2>&1

# SQL can have embedded comments => workie
--exec echo "select /*"   >  $MYSQLTEST_VARDIR/tmp/bug20432.sql
--exec echo "use"         >> $MYSQLTEST_VARDIR/tmp/bug20432.sql
--exec echo "*/ 1"        >> $MYSQLTEST_VARDIR/tmp/bug20432.sql
--exec $MYSQL              < $MYSQLTEST_VARDIR/tmp/bug20432.sql 2>&1

# client commands on the other hand must be at BOL => error
--exec echo "/*"          >  $MYSQLTEST_VARDIR/tmp/bug20432.sql
--exec echo "xxx"         >> $MYSQLTEST_VARDIR/tmp/bug20432.sql
--exec echo "*/ use"      >> $MYSQLTEST_VARDIR/tmp/bug20432.sql
--error 1
--exec $MYSQL              < $MYSQLTEST_VARDIR/tmp/bug20432.sql 2>&1

# client comment recognized, but parameter missing => error
--exec echo "use"         >  $MYSQLTEST_VARDIR/tmp/bug20432.sql
--exec $MYSQL              < $MYSQLTEST_VARDIR/tmp/bug20432.sql 2>&1

#
# Bug #20328: mysql client: dumb about trailing spaces on 'help' command
#
--exec echo 'help' | $MYSQL   >  $MYSQLTEST_VARDIR/tmp/bug20328.tmp
--exec echo 'help ' | $MYSQL  >  $MYSQLTEST_VARDIR/tmp/bug20328.tmp

#
# Bug#17583: mysql drops connection when stdout is not writable
#
create table t17583 (a int);
insert into t17583 (a) values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
insert into t17583 select a from t17583;
insert into t17583 select a from t17583;
insert into t17583 select a from t17583;
insert into t17583 select a from t17583;
insert into t17583 select a from t17583;
insert into t17583 select a from t17583;
insert into t17583 select a from t17583;
# Close to the minimal data needed to exercise bug.
select count(*) from t17583;
--exec echo "select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; select count(*) from t17583; " |$MYSQL test >&-
drop table t17583;

--echo End of 4.1 tests.