Mantis - Quercus
Viewing Issue Advanced Details
3796 major always 12-02-09 01:52 12-02-09 01:52
new 4.0.2  
0003796: pg_query_params doesn't return true value on non-select statements
When using update/insert/delete statements with pg_query_params, quercus returns a false value, even if the query was successful. It is therefore not possible to test the correctness of the query and the following code fails:

$sqlsentence =
          'UPDATE Sessions SET sessionstate = $1, accesstime = $2 ' .
          'WHERE sessionid = $3';
$result = pg_query_params($mmDbConnection, $sqlsentence, array($s1, $AccessTime, $mmSessionId));
if (!$result) {
   ...handle error...
} [^]

Return Values

A query result resource on success or FALSE on failure.

/com/caucho/quercus/lib/db/ #executeInternal:
      if (pstmt.getStatementType().equals("SELECT")) {
        PostgresResult result = new PostgresResult(env, null, pstmt.getResultSet(), null);
        return result;
      } else {
        // XXX: ??? return type?
        return null;
        // return pstmt;

There are no notes attached to this issue.