Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0005187 [Quercus] minor always 08-24-12 00:53 08-30-12 03:23
Reporter nam View Status public  
Assigned To
Priority normal Resolution open  
Status new   Product Version
Summary 0005187: oci_fetch_array() with OCI_RETURN_LOBS not implemented
Description (rep by Kiarash)

At the moment, We are having some technical difficulties regarding implemented methods (for Oracle Database) in Quercus. We are unable to retrieve CLOB values from database (all others work fine).following is the exception we get:
 
com.caucho.quercus.UnimplementedException: `oci_fetch_array with OCI_RETURN_LOBS'
Additional Information
Attached Files

- Relationships

- Notes
(0006026)
kiarash
08-30-12 03:23

Quercus implementation of oci_fetch_array eventually tries to retrieve all values in a string format (refer to JdbcResultResource class). in getColumnString() function, for performance purposes, data is being retrieved using getByte() method and converted to string. this will not work for CLOB values. therefore for CLOB data, getString() method should be used instead of getByte().
in addition, the code to return UnimplementedException for OCI_RETURN_LOB can be removed since the overall implementation should always follow this mode.

following fix can be applied to com.caucho.quercus.lib.db.JdbcResultResource

...
protected Value getColumnString(Env env,
                                  ResultSet rs,
                                  ResultSetMetaData md,
                                  int column)
    throws SQLException
  {
    // php/1464, php/144f, php/144g
    // php/144b

    // calling getString() will decode using the database encoding, so
    // get bytes directly. Also, getBytes is faster for MySQL since
    // getString converts from bytes to string.
    byte []bytes = rs.getBytes(column);

    if (bytes == null)
      return NullValue.NULL;

    StringValue bb = env.createUnicodeBuilder();

    //enhanced for retrieving CLOB Type: CLOB values should be retrieved
    //using getString() method for data to be decoded correctly --kk
    if (md.getColumnType(column) == Types.CLOB)
        bb.append(rs.getString(column));
    else
        bb.append(bytes);
    
    return bb;
  }
 

- Issue History
Date Modified Username Field Change
08-24-12 00:53 nam New Issue
08-30-12 03:23 kiarash Note Added: 0006026


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