From f3bf41f80747bde04b6374f59d76bb1b65a4f86c Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Sat, 14 Jan 2017 23:36:59 +0100 Subject: [PATCH] Fixed bug #50018: --dburl without table dies. --- src/parallel | 4 ++ testsuite/tests-to-run/parallel-local-sql.sh | 11 ++++++ testsuite/wanted-results/parallel-local-sql | 40 ++++++++++++++++++++ 3 files changed, 55 insertions(+) diff --git a/src/parallel b/src/parallel index 4dfe8622..11123572 100755 --- a/src/parallel +++ b/src/parallel @@ -10384,6 +10384,10 @@ sub new { $dbh->{'ShowErrorStatement'} = 1; $dbh->{'HandleError'} = sub {}; + if(not defined $options{'table'}) { + ::error("The DBURL ($dburl) must contain a table."); + ::wait_and_exit(255); + } return bless { 'dbh' => $dbh, diff --git a/testsuite/tests-to-run/parallel-local-sql.sh b/testsuite/tests-to-run/parallel-local-sql.sh index fb662c16..13d91473 100755 --- a/testsuite/tests-to-run/parallel-local-sql.sh +++ b/testsuite/tests-to-run/parallel-local-sql.sh @@ -130,6 +130,17 @@ par_sql_joblog() { # TODO --sqlandworker --wait } +par_no_table() { + echo 'bug #50018: --dburl without table dies' + parallel --sqlworker $SERVERURL + echo $? + parallel --sqlandworker $SERVERURL echo ::: no_output + echo $? + parallel --sqlmaster $SERVERURL echo ::: no_output + echo $? + # For p_wrapper to remove table + parallel --sqlandworker $DBURL true ::: dummy ::: dummy +} export -f $(compgen -A function | egrep 'p_|par_') # Tested that -j0 in parallel is fastest (up to 15 jobs) diff --git a/testsuite/wanted-results/parallel-local-sql b/testsuite/wanted-results/parallel-local-sql index fb67ccbb..a773c48b 100644 --- a/testsuite/wanted-results/parallel-local-sql +++ b/testsuite/wanted-results/parallel-local-sql @@ -264,6 +264,46 @@ par_append_different_cmd $SQLITE :|sleep .3;echo D-15|15|D|D-15 par_append_different_cmd $SQLITE | par_append_different_cmd $SQLITE :|sleep .3;echo E-15|15|E|E-15 par_append_different_cmd $SQLITE | +p_wrapper par_no_table \$MYSQL +par_no_table $MYSQL bug #50018: --dburl without table dies +par_no_table $MYSQL 255 +par_no_table $MYSQL 255 +par_no_table $MYSQL 255 +par_no_table $MYSQL Exit=0 +par_no_table $MYSQL Exit=0 +par_no_table $MYSQL Host Command V1 V2 Stdout Stderr +par_no_table $MYSQL : true dummy dummy dummy dummy +par_no_table $MYSQL parallel: Error: The DBURL (mysql://tange:tange@lo/tange) must contain a table. +par_no_table $MYSQL parallel: Error: The DBURL (mysql://tange:tange@lo/tange) must contain a table. +par_no_table $MYSQL parallel: Error: The DBURL (mysql://tange:tange@lo/tange) must contain a table. +par_no_table $MYSQL mysql: [Warning] Using a password on the command line interface can be insecure. +p_wrapper par_no_table \$PG +par_no_table $PG bug #50018: --dburl without table dies +par_no_table $PG 255 +par_no_table $PG 255 +par_no_table $PG 255 +par_no_table $PG Exit=0 +par_no_table $PG Exit=0 +par_no_table $PG host | command | v1 | v2 | stdout | stderr +par_no_table $PG ------+------------------+-------+-------+--------+-------- +par_no_table $PG : | true dummy dummy | dummy | dummy | | +par_no_table $PG (1 row) +par_no_table $PG +par_no_table $PG parallel: Error: The DBURL (pg://tange:tange@lo/tange) must contain a table. +par_no_table $PG parallel: Error: The DBURL (pg://tange:tange@lo/tange) must contain a table. +par_no_table $PG parallel: Error: The DBURL (pg://tange:tange@lo/tange) must contain a table. +p_wrapper par_no_table \$SQLITE +par_no_table $SQLITE bug #50018: --dburl without table dies +par_no_table $SQLITE 255 +par_no_table $SQLITE 255 +par_no_table $SQLITE 255 +par_no_table $SQLITE Exit=0 +par_no_table $SQLITE Exit=0 +par_no_table $SQLITE Host|Command|V1|V2|Stdout|Stderr +par_no_table $SQLITE :|true dummy dummy|dummy|dummy|| +par_no_table $SQLITE parallel: Error: The DBURL (sqlite3:///%2Frun%2Fshm%2Fparallel.db) must contain a table. +par_no_table $SQLITE parallel: Error: The DBURL (sqlite3:///%2Frun%2Fshm%2Fparallel.db) must contain a table. +par_no_table $SQLITE parallel: Error: The DBURL (sqlite3:///%2Frun%2Fshm%2Fparallel.db) must contain a table. p_wrapper par_shuf \$MYSQL par_shuf $MYSQL 1 a par_shuf $MYSQL 1 b