Bug #21970 mysql-test-run has bad 'expr' at line 2048
Submitted: 1 Sep 2006 15:05 Modified: 10 Jul 2007 12:25
Reporter: David Hisel Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.24 OS:Linux (Linux)
Assigned to: Jay Pipes CPU Architecture:Any

[1 Sep 2006 15:05] David Hisel
Description:
when I ran mysql-test-run under bash -x, I found that the --port= value was "9306+1" where it should have been "9307"

How to repeat:
run mysql-test-run using "bash -x mysql-test-run 2> test.log"

search the log for something like the following...

+ /usr/src/mysql-5.0.24/client/mysqladmin --no-defaults --host=MYHOST --port=9306+1 -u root -O connect_timeout=5 -O shutdown_time
out=20 shutdown

notice the "--port=9306+1" is incorrect.

Suggested fix:
in line 2048 of mysql-test-run, change the expr...

--port=`expr $MASTER_MYPORT+1`

...to...

--port=`expr $MASTER_MYPORT + 1`

add spaces around the '+' sign.
[4 Sep 2006 12:03] Sveta Smirnova
Thank you for the report.

Verified as described using last 5.0 BK sources.
[14 Dec 2006 19:49] Jay Pipes
Also verified in 4.1 mysql-test-run-shell.sh script.
[14 Dec 2006 19:55] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/16980

ChangeSet@1.2582, 2006-12-14 14:54:59-05:00, jpipes@shakedown.(none) +1 -0
  Fix for Bug#21970.  
  
  The mysql-test-run-shell.sh script was improperly evaluating an expression for setting up multiple masters.
  
  This fix adds the `expr $MASTER_MYPORT + 1` construct to the offending line in order for the expression to evaluate properly and produce 9307 instead of the string "9306+1"
[14 Dec 2006 20:00] Chad MILLER
This is one reason we replaced the shell version with the Perl version.  The patch is okay, but expect the shell version to be removed from the repository very soon.
[14 Dec 2006 23:21] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/17012

ChangeSet@1.2354, 2006-12-14 18:21:41-05:00, jpipes@shakedown.(none) +1 -0
  Fix for Bug#21970.
  
  Added a space between $MASTER_MYPORT and "+ 1" to ensure that the script correctly output 9307 instead of the string "9306+1"
  MERGE: 1.1616.2875.4
[10 Jul 2007 12:25] Daniel Fischer
Like Magnus wrote, the shell version of mysql-test-run is not supported anymore. Please use the perl version.