I swear gmail sent the email below without my permission -- patch is now
attached.

Kerry

On Wed, Dec 9, 2009 at 4:28 PM, Kerry Sainsbury <[email protected]> wrote:

> Hey Thomas,
>
> My experimenting with H2 continues, so I've attached a patch that fixes
> this problem.
>
> In summary:
>
> - Changed "CompareLike" to escape any escape characters that aren't
> followed by wildcard characters
> - Added test SQL to testSimple.in.txt
>
> A patch is attached.
>
> Cheers
> Kerry
>
> PS: Let me know if I should stop sending these -- you are strangely quiet
> about them... (perhaps you are just very polite, and can't find a nice way
> to tell me how horrible they are?)
>
>
>
>
>
>
> On Tue, Dec 8, 2009 at 12:18 PM, shrestha <[email protected]> wrote:
>
>> I have:
>>
>> statement = "SELECT * FROM JOB_STATUS WHERE (ASSIGNED_TO = ? OR
>> ASSIGNED_TO LIKE ? OR ASSIGNED_TO LIKE ?)
>> ....
>> pstmt.setString(2, technician.toLowerCase() + "%");
>> ...
>> if value of technician = "abc\mike"
>>
>> I get this error:
>>
>> org.h2.jdbc.JdbcSQLException: Error in LIKE ESCAPE: abc\[*]mike%; SQL
>> statement:
>> SELECT * FROM JOB_STATUS WHERE (ASSIGNED_TO = ? OR ASSIGNED_TO LIKE ?
>> OR ASSIGNED_TO LIKE ?)
>>
>> The same works in HSQL, Oracle, MySQL, and MSSQL.
>>
>> Thanks
>> Roshan
>>
>> --
>>
>> You received this message because you are subscribed to the Google Groups
>> "H2 Database" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected]<h2-database%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/h2-database?hl=en.
>>
>>
>>
>

--

You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.


Attachment: CompareLike.patch
Description: Binary data

Reply via email to