You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@apr.apache.org by bu...@apache.org on 2010/07/25 17:44:38 UTC

DO NOT REPLY [Bug 49646] New: no data error in apr_dbd_pbquery with odbc driver

https://issues.apache.org/bugzilla/show_bug.cgi?id=49646

           Summary: no data error in apr_dbd_pbquery with odbc driver
           Product: APR
           Version: HEAD
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: APR-util
        AssignedTo: bugs@apr.apache.org
        ReportedBy: kappa@psilambda.com


Created an attachment (id=25800)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=25800)
patch that fixes the incorrect error handling

The odbc driver reports an error if the apr_dbd_pbquery is used.  This
precludes using it to query the database for empty data sets.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


[Bug 49646] no data error in apr_dbd_pbquery with odbc driver

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49646

--- Comment #2 from Tom Donovan <To...@acm.org> ---
It is an error for the underlying database driver to return SQL_NO_DATA in
response to a prepared SELECT statement, even if there are zero rows returned.  

In this case, the first call to SQLFetch (i.e. the first call to
apr_dbd_get_row) should return SQL_NO_DATA, and apr_dbd_get_row returns
APR_EGENERAL.

It is allowed for a searched UPDATE, INSERT, or DELETE statement that does not
affect any rows to return SQL_NO_DATA.  Not intuitive perhaps, but expected
behavior per  ISO/IEC 9075-3 SQL/CLI.  This is the only case where a call to
apr_dbd_pquery should get ever SQL_NO_DATA and return APR_EGENERAL.

Current ODBC driver code appears correct.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 49646] no data error in apr_dbd_pbquery with odbc driver

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49646

--- Comment #1 from Jeff Trawick <tr...@apache.org> 2010-09-24 17:36:34 EDT ---
should this have a compile-time check like

#ifdef SQL_NO_DATA

or 

#if ODBCVER >= 0x03

around it?

What does SQL_SUCCEEDED(SQL_NO_DATA) return?  If false, then APR would return
APR_EGENERAL from the function.

Can anyone state what other drivers return in this situation?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org