# Can't run with embedded server -- source include/not_embedded.inc # Test buildin commands --disable_warnings drop table if exists t1; --enable_warnings create table t1 (a int); # delimiter uses rest of line --write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql select 1 as a; # delimter with space. there are single s in the query, but we want s-space-s delimiter s s select 2 s from DUAL s s # delimter in quotes. # TODO should the quotes be part of the delimter? delimiter 's s' select 3 qs_space_sq from DUAL s s # delimiter as part of a word (normal "DUAL;", now "DUALx") delimiter x select 5 as b from DUALx # delimiter consists of 1 spaces # TODO decide, this only works if quotes are not part of the delimiter # Note: the 1st select has a space on the line, the 2nd has a space on the next line delimiter ' ' select'space' # select'space' # #delimiter is quote # TODO should the dbl quotes around the quote be needed, should they be part ofthe delimiter? delimiter "'" select 6 as quote' # the other quote # TODO again surrounding quotes? delimiter '"' select 7 as dblquote" delimiter ; select 9; EOF --exec $MYSQL test <$MYSQLTEST_VARDIR/tmp/mysqltest.sql # use should fail, if there are trailing arguments after the db name # we expect to see tables in test on the forst show, tables in mysql on the 2nd --write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql use mysql xxx show tables; select 'attempt 2'; use mysql show tables; EOF --exec $MYSQL test <$MYSQLTEST_VARDIR/tmp/mysqltest.sql # now see what charset does # ONLY mysql 5.x --write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql charset latin1 select @@character_set_client; charset utf8 select @@character_set_client; # next should fail charset latin1 x select @@character_set_client; EOF --exec $MYSQL test <$MYSQLTEST_VARDIR/tmp/mysqltest.sql drop table t1;