Bug #57036 Add checks in mysqltest that variables treated as ints are in fact ints

Submitted: 27 Sep 2010 12:25 Modified: 14 Nov 2010 2:51
Reporter: Bjørn Munch Email Updates:
Status: Closed Impact on me:
None 
Category:Tools: MTR / mysql-test-run Severity:S3 (Non-critical)
Version:5.5+ OS:Any
Assigned to: Bjørn Munch CPU Architecture:Any

[27 Sep 2010 12:25] Bjørn Munch
Description:
This is actually in preparation for allowing compare expressions like > in if or while. For that, we need to distinguish numeric from string values.

Internally, mysqltest should know whether a variable was assigned a numeric value. It's not enough to check against 0, because 0 is also a valid int.

inc and dec commands should only be allowed if the variable has a numeric value.

How to repeat:
Observe that e.g. inc on a variable which has been assigned some non-numeric strings results in the variable getting the value 1.
[27 Sep 2010 12:38] 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/119164

3093 Bjorn Munch	2010-09-27
      Bug #57036 Add checks in mysqltest that variables treated as ints are in fact ints
      Adds boolean flag is_int and a separete function to check for int value
      Added tests to mysqltest.test
[28 Sep 2010 8:05] Bjørn Munch
Somewhat to my surprise, no tests other than mysqltest.test (as expected) needed to be changed. Added appropriate test cases to mysqltest.test
[28 Sep 2010 9:48] Magnus Blåudd
OK.
Don't remember what the "dirty" thing was, but you only changed datatype.
[28 Sep 2010 15:01] Bjørn Munch
Pushed to 5.5-mtr, trunk-mtr, next-mr-mtr
[7 Oct 2010 22:58] Paul DuBois
Changes to test suite. No changelog entry needed.
[9 Nov 2010 19:43] 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:17] 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:32] 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)

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.061 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.