summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorBjorn Munch <bjorn.munch@oracle.com>2010-09-22 10:57:10 +0200
committerBjorn Munch <bjorn.munch@oracle.com>2010-09-22 10:57:10 +0200
commit7b216d7625301901a8296868d9a4c34bfec8b08a (patch)
treefd03ea91262c663c9298da7e7a6b7dd7efedaf55 /mysql-test
parentee6f8ae1bd0f4821bf806b3721877400ede0e848 (diff)
downloadmariadb-git-7b216d7625301901a8296868d9a4c34bfec8b08a.tar.gz
Bug #56921 It should be possible to log connection statements in mysqltest
Added --enable-connect-log, somewhet similar to --enable-query-log If query log is disabled, disable connect log too Also some related cleanup in mysqltest.test: removing duplicate test loop
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/mysqltest.result8
-rw-r--r--mysql-test/t/mysqltest.test32
2 files changed, 23 insertions, 17 deletions
diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result
index 650cc069b7f..8afef65b66f 100644
--- a/mysql-test/r/mysqltest.result
+++ b/mysql-test/r/mysqltest.result
@@ -452,12 +452,16 @@ mysqltest: At line 1: Missing required argument 'host' to command 'connect'
mysqltest: At line 1: query 'connect con2,localhost,root,,illegal_db' failed: 1049: Unknown database 'illegal_db'
mysqltest: At line 1: Illegal argument for port: 'illegal_port'
mysqltest: At line 1: Illegal option to connect: SMTP
-OK
-mysqltest: The test didn't produce any output
+200 connects succeeded
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql": At line 3: connection 'test_con1' not found in connection pool
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql": At line 2: Connection test_con1 already exists
show tables;
ERROR 3D000: No database selected
+connect con1,localhost,root,,;
+connection default;
+connection con1;
+disconnect con1;
+connection default;
Output from mysqltest-x.inc
Output from mysqltest-x.inc
Output from mysqltest-x.inc
diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test
index c054b163c0c..caadce44dcf 100644
--- a/mysql-test/t/mysqltest.test
+++ b/mysql-test/t/mysqltest.test
@@ -1467,19 +1467,6 @@ eval select "$long_rep" as x;
# Repeat connect/disconnect
--write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
-let $i=100;
-while ($i)
-{
- connect (test_con1,localhost,root,,);
- disconnect test_con1;
- dec $i;
-}
-EOF
---exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest.sql; echo OK; exit;" | $MYSQL_TEST 2>&1
-remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql;
-
-# Repeat connect/disconnect
---write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
let $i=200;
while ($i)
{
@@ -1487,9 +1474,8 @@ while ($i)
disconnect test_con1;
dec $i;
}
+echo 200 connects succeeded;
EOF
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
---error 1
--exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest.sql;" | $MYSQL_TEST 2>&1
remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql;
@@ -1530,6 +1516,22 @@ show tables;
disconnect con2;
connection default;
+# Test enable_connect_log
+--enable_connect_log
+connect (con1,localhost,root,,);
+connection default;
+connection con1;
+--disable_query_log
+# These should not be logged
+connect (con2,localhost,root,,*NO-ONE*);
+connection con2;
+disconnect con2;
+connection con1;
+--enable_query_log
+disconnect con1;
+connection default;
+--disable_connect_log
+
# ----------------------------------------------------------------------------
# Test mysqltest arguments
# ----------------------------------------------------------------------------