BIND 10 #2837: MySQL STRICT mode causes libdhcpsrv unit tests t fail when MySQL STRICT mode is enabled

BIND 10 Development do-not-reply at isc.org
Sat Mar 16 12:30:14 UTC 2013


#2837: MySQL STRICT mode causes libdhcpsrv unit tests t fail when MySQL STRICT
mode is enabled
-------------------------------------+-------------------------------------
            Reporter:  tmark         |                        Owner:
                Type:  defect        |  UnAssigned
            Priority:  medium        |                       Status:
           Component:  libdhcp       |  reviewing
            Keywords:                |                    Milestone:
           Sensitive:  0             |  Sprint-DHCP-20130328
         Sub-Project:  DNS           |                   Resolution:
Estimated Difficulty:  0             |                 CVSS Scoring:
         Total Hours:  0             |              Defect Severity:  N/A
                                     |  Feature Depending on Ticket:
                                     |          Add Hours to Ticket:  0
                                     |                    Internal?:  0
-------------------------------------+-------------------------------------
Changes (by tmark):

 * owner:  tmark => UnAssigned
 * status:  accepted => reviewing


Comment:

 >1. Ensure that STRICT mode is always enabled.

 Modified mysql_lease_mgr to set STRICT_ALL_TABLES SQL mode:
 Done. Other modes available, such as NO_ZERO_DATE do not seem to be
 applicable
 at this time.  As to making this configurable, ensuring that we have
 predictable rules governing what constitutes valid data is paramount to
 accurate
 lease behavior.  I can't see nay real benefit from making the
 configurable. They
 are not likely to be set differently from customer to customer.  So for
 the time
 being, only the STRICT_ALL_TABLES SQL mode option is set.

 >2. Alter the tests such that they expect an exception.

 Modified mysql_lease_mgr_unittest.cc to expect exception throws on db
 inserts
 (addLease) with too large a value of hardware address.

 >3. Lease4::HWADDR_MAX should be defined in "hwaddr" class, not in Lease4
 class

 Moved Lease4::HWAddr to HWAddr::MAX_HWADDR_LEN, (changed name in keeping
 with
 apparent convention).

 >4. An attempt to create a hwaddr object should fail - probably with an
 >InvalidParameter? exception - if the passed-in length of the hardware
 address
 >is too large.

 Modified HWAddr constructors to throw InvalidParameter if hardware address
 is
 too big.

 Added tests to hwaddr_unittest.cc to verify new constructor logic.

 ---------------------------------------------------------------------------

 Test artifacts are in attached tar ball.

 ----------------------------------------------------------------------------


 ChangeLog entry:

 [5xx]   [bug]       tmark

     Changed mysql_lease_mgr to set the SQL mode option to STRICT.  This
     causes mysql it to treat invalid input data as an error.  Rather than
     "successfully" inserting a too large value by truncating it, the
     insert will fail, and the lease manager will throw an exception.
     Attempts to create HWAddrs with too large a value for hardware address
     now throws an exception.
     (Trac #2387, git 02fb3337a339f2043183ae66062a774ae6375e83)
     (Trac #2387, git ab624f466e084edecb4a6299a56f8d33282a1ba0)

-- 
Ticket URL: <http://bind10.isc.org/ticket/2837#comment:3>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list