Bug #661 v3.0.8 stable updaterow error with key data containing char '
Submitted: 16 Jun 2003 15:20 Modified: 17 Jun 2003 7:35
Reporter: Chris Compton Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S2 (Serious)
Version:3.0.8 stable OS:Microsoft Windows (W2K)
Assigned to: Mark Matthews CPU Architecture:Any

[16 Jun 2003 15:20] Chris Compton
Description:
Calling updateRow on an updatable result set where the table key column is text and the key data contains the ' (apos) character causes SQLException : refreshRow called on row that has been deleted or key column has changed. This occurs even though the key column field was not updated. This does not happen with version 2.0.18. 

How to repeat:
NDC will not allow source release, please contact ccompton@pdxinc.com. will write test program after hours and send db backup if you cannot reproduce.
Primary (and only) key col is varchar(128), rs opened with:

protected ResultSet execSQL(String sSql) throws SQLException{
    Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
        ResultSet.CONCUR_UPDATABLE);
    return stmt.executeQuery(sSql);
  }

any data in the key col with the ' character causes exception on update ("ARLAN'S", "BOB's", etc.). Key column data is never updated in our code.

Suggested fix:
character escaping issue?
[17 Jun 2003 6:19] Chris Compton
exists in 3.1 alpha as well
[17 Jun 2003 7:35] Mark Matthews
This is now fixed and will be in 3.0.9. The code in refreshRow() ended up double-escaping the string. 

If you want to test the fix now, please see the nightly snapshot (after 00:00 GMT, June 18, 2003) at http://mmmysql.sourceforge.net/snapshots/stable/

Thank you for your bug report!