2932 Bjorn Munch 2010-09-20
Bug #55426 mysqltest crashes when trying to unlock not acquired mutex
Follow-up: don't call pthread_join() on Windows
This change only valid for 5.1
modified:
client/mysqltest.cc
2931 Bjorn Munch 2010-09-15
Bug #56753 mtr silently ignores junk after backticks
When stepping backward to end of `` expression, check for illegal chars
modified:
client/mysqltest.cc
mysql-test/include/setup_fake_relay_log.inc
mysql-test/r/mysqltest.result
mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test
mysql-test/t/mysqltest.test
2930 Bjorn Munch 2010-09-14
Bug #55426 mysqltest crashes when trying to unlock not acquired mutex
Bug #55546 mysqltest fails to create a new thread on HPUX
Missing call to pthread_join(), in embedded mode
This independently solves both problems, see 55426 for details.
Addendum: cannot test against a pthread_t, adds boolean flag instead
modified:
client/mysqltest.cc
=== modified file 'client/mysqltest.cc'
--- a/client/mysqltest.cc 2010-09-14 12:04:37 +0000
+++ b/client/mysqltest.cc 2010-09-20 09:21:27 +0000
@@ -763,7 +763,10 @@ static void wait_query_thread_end(struct
}
if (con->has_thread)
{
+#ifndef __WIN__
+ /* May hang on Windows, but the problem it solves is not seen there */
pthread_join(con->tid, NULL);
+#endif
con->has_thread= FALSE;
}
}
@@ -2181,8 +2184,14 @@ void var_query_set(VAR *var, const char
DBUG_ENTER("var_query_set");
LINT_INIT(res);
+ /* Only white space or ) allowed past ending ` */
while (end > query && *end != '`')
+ {
+ if (*end && (*end != ' ' && *end != '\t' && *end != '\n' && *end != ')'))
+ die("Spurious text after `query` expression");
--end;
+ }
+
if (query == end)
die("Syntax error in query, missing '`'");
++query;
=== modified file 'mysql-test/include/setup_fake_relay_log.inc'
--- a/mysql-test/include/setup_fake_relay_log.inc 2010-02-02 15:16:47 +0000
+++ b/mysql-test/include/setup_fake_relay_log.inc 2010-09-15 12:56:22 +0000
@@ -72,7 +72,7 @@ copy_file $fake_relay_log $_fake_relay_l
if (`SELECT LENGTH(@@secure_file_priv) > 0`)
{
- -- let $_file_priv_dir= `SELECT @@secure_file_priv`;
+ -- let $_file_priv_dir= `SELECT @@secure_file_priv`
-- let $_suffix= `SELECT UUID()`
-- let $_tmp_file= $_file_priv_dir/fake-index.$_suffix
=== modified file 'mysql-test/r/mysqltest.result'
--- a/mysql-test/r/mysqltest.result 2010-08-10 10:13:58 +0000
+++ b/mysql-test/r/mysqltest.result 2010-09-15 12:56:22 +0000
@@ -177,6 +177,9 @@ mysqltest: At line 1: End of line junk d
"
mysqltest: At line 1: Extra delimiter ";" found
mysqltest: At line 1: Extra delimiter ";" found
+mysqltest: At line 1: Spurious text after `query` expression
+mysqltest: At line 1: Spurious text after `query` expression
+mysqltest: At line 2: Spurious text after `query` expression
mysqltest: At line 1: Missing argument(s) to 'error'
mysqltest: At line 1: Missing argument(s) to 'error'
mysqltest: At line 1: The sqlstate definition must start with an uppercase S
=== modified file 'mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test'
--- a/mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test 2010-01-14 10:49:40 +0000
+++ b/mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test 2010-09-15 12:56:22 +0000
@@ -205,7 +205,7 @@ DROP TABLE `t1`;
-- echo === Using mysqlbinlog to detect failure. Before the patch mysqlbinlog would find a corrupted event, thence would fail.
--- let $MYSQLD_DATADIR= `SELECT @@datadir`;
+-- let $MYSQLD_DATADIR= `SELECT @@datadir`
-- exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug42749.binlog
-- remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug42749.binlog
@@ -330,7 +330,7 @@ while($ntables)
-- echo ### assertion: check that binlog is not corrupt. Using mysqlbinlog to
-- echo ### detect failure. Before the patch mysqlbinlog would find
-- echo ### a corrupted event, thence would fail.
--- let $MYSQLD_DATADIR= `SELECT @@datadir`;
+-- let $MYSQLD_DATADIR= `SELECT @@datadir`
-- exec $MYSQL_BINLOG -v --hex $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug50018.binlog
## clean up
=== modified file 'mysql-test/t/mysqltest.test'
--- a/mysql-test/t/mysqltest.test 2010-08-10 10:13:58 +0000
+++ b/mysql-test/t/mysqltest.test 2010-09-15 12:56:22 +0000
@@ -494,6 +494,23 @@ remove_file $MYSQLTEST_VARDIR/tmp/mysqlt
--error 1
--exec echo "--disable_query_log;" | $MYSQL_TEST 2>&1
+#
+# Extra text after ``
+#
+--error 1
+-- exec echo "let \$x= \`select 1\` BOO ;" | $MYSQL_TEST 2>&1
+--error 1
+-- exec echo "--let \$x= \`select 1\`;" | $MYSQL_TEST 2>&1
+--write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
+# Missing ; in next line should be detected and cause failure
+let $x= `select 1`
+let $x= 2;
+echo $x;
+EOF
+--error 1
+--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
+remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql;
+
# Allow trailing # comment
--sleep 1 # Wait for insert delayed to be executed.
Attachment: [text/bzr-bundle] bzr/bjorn.munch@oracle.com-20100920092127-yvo3rjg9o8swiyml.bundle
| Thread |
|---|
| • bzr push into mysql-5.1-mtr branch (bjorn.munch:2930 to 2932) Bug#55426 | Bjorn Munch | 20 Sep |