Bug #20304 mysqltest: reap with no preceding statement hangs forever
Submitted: 6 Jun 2006 19:17 Modified: 13 Nov 2010 16:57
Reporter: Paul DuBois Email Updates:
Status: Closed Impact on me:
None 
Category:Tools: MTR / mysql-test-run Severity:S7 (Test Cases)
Version:4.1 and up OS:Any
Assigned to: Bjørn Munch CPU Architecture:Any

[6 Jun 2006 19:17] Paul DuBois
Description:
The reap command for mysqltest receives the result of the
statement most recently sent to the server.

But if no statement has been sent, mysqltest hangs forever.

How to repeat:
Invoke mysqltest:

mysqltest test

Then enter this line:

reap;

Then wait a long time. :-)
[7 Jun 2006 10:19] Valeriy Kravchuk
Thank you for a problem report. I see similar hang even with preceding statement:

openxs@suse:~/dbs/5.0> echo 'select 1 from t1;' | bin/mysqltest test
select 1 from t1;
1
1
1
1
1
1
1
ok
openxs@suse:~/dbs/5.0> echo 'select 1 from t1; reap;' | bin/mysqltest test

Where is that "reap" officially documented, by the way?
[31 Jul 2006 8:45] Magnus Blåudd
This is actually a problem with MySQL C 
API - it allows calling 'mysql_read_query_result' without a previous 'mysql_send_query' call. That should not be allowed and an error CR_COMMANDS_OUT_OF_SYNC be returned immediatley.

Increasing priority and severity.
[14 Nov 2007 4:35] Jeffrey Pugh
Changed Category and Lead according to bug comments
[30 Sep 2010 19:26] Konstantin Osipov
This is not a C API bug.
mysqltest is using an undocumented and not officially supported C API function mysql_advanced_command/cli_advanced_command().
We're not going to change it to check for misuse, it's an internal command.
The fix has to lay in the space of the test tool.
[1 Oct 2010 7:27] Bjørn Munch
OK I'm not familiar with the fine details of the API, I should be able to fix this in mysqltest.
[1 Oct 2010 9:30] 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/119603

2939 Bjorn Munch	2010-10-01
      Bug #20304 mysqltest: reap with no preceding statement hangs forever
      Added sanity check, similar to the one preventing send without reap
[1 Oct 2010 14:03] Bjørn Munch
Pushed to -mtr branches from 5.1 up
[6 Oct 2010 19:42] Paul DuBois
Changes to test suite. No changelog entry needed.
[1 Nov 2010 19:02] Bugs System
Pushed into mysql-5.1 5.1.53 (revid:build@mysql.com-20101101184443-o2olipi8vkaxzsqk) (version source revid:build@mysql.com-20101101184443-o2olipi8vkaxzsqk) (merge vers: 5.1.53) (pib:21)
[9 Nov 2010 19:49] Bugs System
Pushed into mysql-5.5 5.5.7-rc (revid:sunanda.menon@sun.com-20101109182959-otkxq8vo2dcd13la) (version source revid:sunanda.menon@sun.com-20101109182959-otkxq8vo2dcd13la) (merge vers: 5.5.7-rc) (pib:21)
[13 Nov 2010 16:16] Bugs System
Pushed into mysql-trunk 5.6.99-m5 (revid:alexander.nozdrin@oracle.com-20101113155825-czmva9kg4n31anmu) (version source revid:alexander.nozdrin@oracle.com-20101113152450-2zzcm50e7i4j35v7) (merge vers: 5.6.1-m4) (pib:21)
[13 Nov 2010 16:41] Bugs System
Pushed into mysql-next-mr (revid:alexander.nozdrin@oracle.com-20101113160336-atmtmfb3mzm4pz4i) (version source revid:vasil.dimov@oracle.com-20100629074804-359l9m9gniauxr94) (pib:21)