New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disabling default escape character (ESCAPE ''
) causes no results in Oracle compatibility mode
#3745
Comments
The SQL Standard allows only null value and strings with exactly one character (or octet for binary version) to be specified here. If null value is specified, this predicate must return Oracle allows only strings with length of 1, it doesn't allow |
That makes sense, thanks!
May I suggest that H2 then throws an error when attempting to use |
You cannot use H2 to check correctness of your queries for other database systems. H2 doesn't know whether |
Okay, that changes things a bit then. Thanks for your insights! |
The documentation for
LIKE
states the following:This works fine with default settings. However, in Oracle compatibility mode the query always returns an empty result. Possibly because:
My test setup:
start a h2 in docker using
docker run -d -p 1521:1521 -e H2_OPTIONS=-ifNotExists --name=MyH2Instance oscarfonts/h2
(This runs a H2 in version2.1.210
). Connect to it usingjdbc:h2:tcp://localhost:1521/test
with usernamesa
and no password.create some test data:
Then perform these queries:
Both return this result:
If I connect using the jdbc string
jdbc:h2:tcp://localhost:1522/test;mode=Oracle
(note the;mode=Oracle
) instead, Only the first query returns the expected result. The second query returns an empty result.The text was updated successfully, but these errors were encountered: