Bug #44922 mysqltest's query_get_value function can't work with queries containing ','
Submitted: 18 May 2009 1:09 Modified: 18 Jun 2009 15:31
Reporter: Patrick Crews Email Updates:
Status: Closed Impact on me:
None 
Category:Tools: MTR / mysql-test-run Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: Bjørn Munch CPU Architecture:Any

[18 May 2009 1:09] Patrick Crews
Description:
MTR's query_get_value function can't work with queries that contain commas such as `SELECT CONCAT(a,b)`

How to repeat:
Place the following in a .test file and try to record it with: ./mtr --record <whatever_you_named_it>.test

let $a = query_get_value(`SELECT CONCAT(a,b) AS col1`,1,1);
eval SELECT $a;

You will see the following message
CURRENT_TEST: main.exp
mysqltest: At line 2: Extra argument ',1' passed to 'query_get_value'

Suggested fix:
Make the parsing of arguments smarter to allow more complex queries in this function.
[25 May 2009 9:05] 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/74875

2794 Bjorn Munch	2009-05-25
      Bug #44922 MTR's query_get_value function can't work with queries containing ','
      check_command_args() always looks for the first , (or whatever)
      Extended check_command_args() to let arguments be quoted
      modified:
        client/mysqltest.cc
[25 May 2009 9:07] Bjørn Munch
Note that my patch would allow quoting arguments also in other commands
[25 May 2009 15: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/74896

2794 Bjorn Munch	2009-05-25
      Bug #44922 mysqltest's query_get_value function can't work with queries containing ','
      check_command_args() always looks for the first , (or whatever)
      Extended check_command_args() to let arguments be quoted
      Added test in mysqltest.test
      modified:
        client/mysqltest.cc
        mysql-test/r/mysqltest.result
        mysql-test/t/connect.test
        mysql-test/t/mysqltest.test
[26 May 2009 10:25] Bjørn Munch
Pushed to 5.1-mtr
[5 Jun 2009 8:04] Bugs System
Pushed into 5.1.36 (revid:bjorn.munch@sun.com-20090605074215-1d7l2reqdb9a0t0t) (version source revid:bjorn.munch@sun.com-20090605074215-1d7l2reqdb9a0t0t) (merge vers: 5.1.36) (pib:6)
[5 Jun 2009 15:32] Paul DuBois
Test suite changes. No changelog entry needed.

Setting report to NDI pending push into 6.0.x.
[17 Jun 2009 19:22] Bugs System
Pushed into 5.4.4-alpha (revid:alik@sun.com-20090616183122-chjzbaa30qopdra9) (version source revid:matthias.leich@sun.com-20090609174954-3ao9iz97nzrfg9yl) (merge vers: 5.4.4-alpha) (pib:11)
[18 Jun 2009 15:31] Paul DuBois
Test suite changes. No changelog entry needed.
[26 Aug 2009 13:46] Bugs System
Pushed into 5.1.37-ndb-7.0.8 (revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l) (version source revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l) (merge vers: 5.1.37-ndb-7.0.8) (pib:11)
[26 Aug 2009 13:46] Bugs System
Pushed into 5.1.37-ndb-6.3.27 (revid:jonas@mysql.com-20090826105955-bkj027t47gfbamnc) (version source revid:jonas@mysql.com-20090826105955-bkj027t47gfbamnc) (merge vers: 5.1.37-ndb-6.3.27) (pib:11)
[26 Aug 2009 13:48] Bugs System
Pushed into 5.1.37-ndb-6.2.19 (revid:jonas@mysql.com-20090825194404-37rtosk049t9koc4) (version source revid:jonas@mysql.com-20090825194404-37rtosk049t9koc4) (merge vers: 5.1.37-ndb-6.2.19) (pib:11)
[27 Aug 2009 16:32] Bugs System
Pushed into 5.1.35-ndb-7.1.0 (revid:magnus.blaudd@sun.com-20090827163030-6o3kk6r2oua159hr) (version source revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l) (merge vers: 5.1.37-ndb-7.0.8) (pib:11)