Bug #47218 mysqltest ignores "error" command inside if inside loop
Submitted: 9 Sep 2009 12:16 Modified: 18 Dec 2009 23:52
Reporter: Sven Sandberg Email Updates:
Status: Closed Impact on me:
None 
Category:Tools Severity:S2 (Serious)
Version:5.1+ OS:Any
Assigned to: Bjørn Munch CPU Architecture:Any
Tags: mysqltest

[9 Sep 2009 12:16] Sven Sandberg
Description:
When mysqltest executes a while loop, and the body of the while loop contains an if statement, and the body of the if statement contains an "error" command, and the if evaluates to "false" the first iteration, and the if evaluates to "true" later, then the "error" command has no effect. The test fails on the following statement even if it fails with the expected error code.

How to repeat:
CREATE TABLE t1 (a INT PRIMARY KEY);
let $x= 2;
while ($x) {
  dec $x;
  if (!$x) {
    --error ER_DUP_ENTRY
    --eval INSERT INTO t1 VALUES (1), (1)
  }
}
[7 Oct 2009 14:34] 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/86029

2841 Bjorn Munch	2009-10-07
      Bug #47218 mysqltest ignores "error" command inside if inside loop
      This was affected by same problem as append_file etc.
      Added Q_ERROR to special handling, and added small test
[8 Oct 2009 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/86109

2843 Bjorn Munch	2009-10-08
      Bug #47218 mysqltest ignores "error" command inside if inside loop
      This was affected by same problem as append_file etc.
      Added Q_ERROR to special handling, and added small test
[8 Oct 2009 9:32] Bjørn Munch
Approved on IRC
[8 Oct 2009 13:03] Bjørn Munch
Pushed to 5.1-mtr, trunk-mtr, next-mr-mtr, 6.0-codebase-mtr
[22 Oct 2009 20:17] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20091022201524-0efl2fzebfuuf0vk) (version source revid:bjorn.munch@sun.com-20091008122436-bqmy3lmr9iaw4d4s) (merge vers: 6.0.14-alpha) (pib:13)
[22 Oct 2009 20:18] Bugs System
Pushed into 5.5.0-beta (revid:alik@sun.com-20091022201318-jfvtrzd6lb07cwp5) (version source revid:bjorn.munch@sun.com-20091008093442-or0trmzmb2pqcyk7) (merge vers: 5.4.5-beta) (pib:13)
[22 Oct 2009 23:14] Paul DuBois
Test suite change. No changelog entry needed.

Setting report to NDI pending push into 5.1.x.
[23 Oct 2009 7:33] Bugs System
Pushed into 5.1.41 (revid:bjorn.munch@sun.com-20091021073307-ummbh6668hvfxqjv) (version source revid:bjorn.munch@sun.com-20091021073307-ummbh6668hvfxqjv) (merge vers: 5.1.41) (pib:13)
[23 Oct 2009 15:01] Paul DuBois
Test suite change. No changelog entry needed.
[18 Dec 2009 10:39] Bugs System
Pushed into 5.1.41-ndb-7.1.0 (revid:jonas@mysql.com-20091218102229-64tk47xonu3dv6r6) (version source revid:jonas@mysql.com-20091218095730-26gwjidfsdw45dto) (merge vers: 5.1.41-ndb-7.1.0) (pib:15)
[18 Dec 2009 10:54] Bugs System
Pushed into 5.1.41-ndb-6.2.19 (revid:jonas@mysql.com-20091218100224-vtzr0fahhsuhjsmt) (version source revid:jonas@mysql.com-20091217101452-qwzyaig50w74xmye) (merge vers: 5.1.41-ndb-6.2.19) (pib:15)
[18 Dec 2009 11:09] Bugs System
Pushed into 5.1.41-ndb-6.3.31 (revid:jonas@mysql.com-20091218100616-75d9tek96o6ob6k0) (version source revid:jonas@mysql.com-20091217154335-290no45qdins5bwo) (merge vers: 5.1.41-ndb-6.3.31) (pib:15)
[18 Dec 2009 11:23] Bugs System
Pushed into 5.1.41-ndb-7.0.11 (revid:jonas@mysql.com-20091218101303-ga32mrnr15jsa606) (version source revid:jonas@mysql.com-20091218064304-ezreonykd9f4kelk) (merge vers: 5.1.41-ndb-7.0.11) (pib:15)