Re: Error in like operator - works with HSQL, Oracle, MySQL

2009-12-12 Thread Thomas Mueller
Hi, The same works in HSQL, Oracle, MySQL, and MSSQL. Yes, but those databases don't return the same rows (see also my test case below). H2 uses \ as the default escape character (like PostgreSQL and MySQL). However H2 throws an exception if the escape character is not followed by \, % or _

Re: Error in like operator - works with HSQL, Oracle, MySQL

2009-12-08 Thread Kerry Sainsbury
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

Re: Error in like operator - works with HSQL, Oracle, MySQL

2009-12-08 Thread Kerry Sainsbury
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 ke...@fidelma.com wrote: Hey Thomas, My experimenting with H2 continues, so I've attached a patch that fixes this problem. In summary: - Changed

Error in like operator - works with HSQL, Oracle, MySQL

2009-12-07 Thread shrestha
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