Bug #10155 | PreparedStatement detects question marks inside double quotes | ||
---|---|---|---|
Submitted: | 25 Apr 2005 18:43 | Modified: | 2 Aug 2005 18:13 |
Reporter: | Paul Bonfanti | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / J | Severity: | S2 (Serious) |
Version: | 3.1.8 | OS: | Windows (Windows XP) |
Assigned to: | Mark Matthews | CPU Architecture: | Any |
[25 Apr 2005 18:43]
Paul Bonfanti
[25 Apr 2005 19:09]
Paul Bonfanti
In the constructor of the inner class ParseInfo of the class PreparedStatement, I changed the following code: if (!inQuotedId) { if ((c == '\'') && (pre1 == '\\') && (pre2 == '\\')) { inQuotes = !inQuotes; } else if ((c == '\'') && (pre1 != '\\')) { inQuotes = !inQuotes; } } to: if (!inQuotedId) { if (((c == '\'') || (c == '"')) && (pre1 == '\\') && (pre2 == '\\')) { inQuotes = !inQuotes; } else if (((c == '\'') || (c == '"')) && (pre1 != '\\')) { inQuotes = !inQuotes; } } and this solved the problem.
[26 Apr 2005 12:54]
Paul Bonfanti
Updated version of PreparedStatement with fix for this bug.
Attachment: PreparedStatement.java (text/java), 105.21 KiB.
[26 Apr 2005 12:56]
Paul Bonfanti
The fix in my last comment didn't take into account a single quote within double quotes and a double quote within single quotes. I've attached a PreparedStatement.java file to this bug that contains a fix that takes this into account.
[2 Aug 2005 18:13]
Mark Matthews
Fixed in 3.1.10.