Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004378 [Quercus] major always 02-07-11 09:12 08-30-11 07:45
Reporter geleont View Status public  
Assigned To
Priority normal Resolution open  
Status new   Product Version 4.0.14
Summary 0004378: pq_query_params Return false, in case query is not SELECT
Description Minimal code to reproduce
$res = pg_query_params($db,"INSERT INTO files (file, user, session_id, book) VALUES ($1,$2,$3,$4) RETURNING id",
                           "11", ));

should print id but returns false

I think that caused by this lines of quercus code:
if (!pstmt.execute(env))
        return null;

      if (pstmt.getStatementType().equals("SELECT")) {
        PostgresResult result = new PostgresResult(
            env, null, pstmt.getResultSet(), null);
        return result;
      } else {
        // XXX: ??? return type?
        return null;
        // return pstmt;

As we can see if query type is not SELECT method every time return null.
Additional Information
Attached Files

- Relationships

- Notes
02-09-11 03:54

Hi, I have fixed this bug by my self. How can I send solution to you?
08-30-11 07:45

I am able to confirm this issue.

The only workaround I've found so far is to check pg_last_notice on all non-SELECTs.

- Issue History
Date Modified Username Field Change
02-07-11 09:12 geleont New Issue
02-09-11 03:54 geleont Note Added: 0005030
08-30-11 07:45 tokeefe Note Added: 0005481

Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
31 total queries executed.
27 unique queries executed.
Powered by Mantis Bugtracker