BIND 10 #1181: SQLite3Database should differentiate SQLITE_DONE & other errors

BIND 10 Development do-not-reply at isc.org
Tue Aug 16 22:13:38 UTC 2011


#1181: SQLite3Database should differentiate SQLITE_DONE & other errors
-------------------------------------+-------------------------------------
            Reporter:  jinmei        |                        Owner:
                Type:  defect        |                       Status:  new
            Priority:  major         |                    Milestone:  Next-
           Component:  data source   |  Sprint-Proposed
           Sensitive:  0             |                     Keywords:
         Sub-Project:  DNS           |              Defect Severity:  N/A
Estimated Difficulty:  0             |  Feature Depending on Ticket:
         Total Hours:  0             |          Add Hours to Ticket:  0
                                     |                    Internal?:  0
-------------------------------------+-------------------------------------
 I suspect this code in SQLite3Database::getZone() is not entirely correct:
 {{{
     if (rc == SQLITE_ROW) {
         result = std::pair<bool, int>(true,
                                       sqlite3_column_int(dbparameters_->
                                                          q_zone_, 0));
     } else {
         result = std::pair<bool, int>(false, 0);
     }
 }}}

 It has the same problem as #851.  To be more accurate, it should look
 like something like this:

 {{{
     if (rc == SQLITE_ROW) {
         search succeeds;
     } else if (rc == SQLITE_DONE) {
         no match find;
     } else {
         some unexpected error (such as conflict with write attempt).
         maybe throw an exception in this case.
     }
 }}}

-- 
Ticket URL: <http://bind10.isc.org/ticket/1181>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list