summaryrefslogtreecommitdiff
path: root/mysql-test/t/mysql_client.test
blob: 7953e0b6550c3e721cb919cde85fc6b5a38eecac (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
# 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 interprets commands in comments
#
--exec echo 'help' | $MYSQL
--exec echo 'help ' | $MYSQL

#
# Bug #20103: Escaping with backslash does not work
#
--exec echo "SET SQL_MODE = 'NO_BACKSLASH_ESCAPES';"  > $MYSQLTEST_VARDIR/tmp/bug20103.sql
--exec echo "SELECT '\';" >> $MYSQLTEST_VARDIR/tmp/bug20103.sql
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug20103.sql 2>&1

--exec echo "SET SQL_MODE = '';"  > $MYSQLTEST_VARDIR/tmp/bug20103.sql
--exec echo "SELECT '\';';" >> $MYSQLTEST_VARDIR/tmp/bug20103.sql
--exec $MYSQL              < $MYSQLTEST_VARDIR/tmp/bug20103.sql 2>&1