7 messages in com.mysql.lists.javaBug Fix - I hope - in mm.mysql.jdbc-2...
FromSent OnAttachments
alec...@quantel.com04 May 2001 07:52 
Dirk Hillbrecht04 May 2001 08:06 
mmat...@thematthews.org04 May 2001 08:17 
alec...@quantel.com04 May 2001 08:19 
Dirk Hillbrecht04 May 2001 08:24 
mmat...@thematthews.org04 May 2001 08:53 
Mark Matthews13 May 2002 11:50 
Subject:Bug Fix - I hope - in mm.mysql.jdbc-2.0pre5
From:alec...@quantel.com (alec@quantel.com)
Date:05/04/2001 07:52:40 AM
List:com.mysql.lists.java

I have found and, I think, fixed a bug in mm.mysql.jdbc-2.0pre5. As well as sending this mail, is there anywhere else thet I should post this fact? I have _not_ thoroughly tested this change. It fixes the problem on the toy program I wrote to prove the bug and on the application in which I originally detected it. Beyond that, I do not have the tools or the competence to perform a full test.

Bug Description

After a row of a ResultSet had been updated by updateRow(), any columns in that row of the ResultSet which were originally null have been corrupted to the string "null". The underlying database is, as far as I can see, still correct.

Decription of fix.

Move the conversion of java null references into the string "null" from the point where data is inserted into _ParameterStrings[] to the point where it extracted and converted into text for the SQL command.This allows extractors for other purposes to see a null reference rather than the string "null".

Details of fix:

1. In PreparedStatement.setNull(int, int) replace set(parameterIndex, "null") ; by set(parameterIndex, null) ;

2. In Buffer.writeStringNoNull(String), insert at top if (S == null) S = "null" ;

3. in jdbc2.PreparedStatement.getBytes(int), after the line StringVal = _ParameterStrings[parameterIndex]; insert if (Stringval == null) return null ;

Alec Cawley