Mantis - Quercus
Viewing Issue Advanced Details
3796 major always 12-02-09 01:52 12-02-09 01:52
Heiko  
 
normal  
new 4.0.2  
open  
none    
none  
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...
}
http://php.net/manual/en/function.pg-query-params.php: [^]

Return Values

A query result resource on success or FALSE on failure.


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

There are no notes attached to this issue.