Skip to content
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

Crash on double equal in MySQL #2673

Closed
PhilipDukhov opened this issue Nov 12, 2021 · 0 comments · Fixed by #3063
Closed

Crash on double equal in MySQL #2673

PhilipDukhov opened this issue Nov 12, 2021 · 0 comments · Fixed by #3063
Labels
Milestone

Comments

@PhilipDukhov
Copy link
Contributor

SQLDelight Version

1.6.5

Application Operating System

JVM

Describe the Bug

MySQL doesn't supports ==. Sometimes after not wring SQL requests for long, I'm using == instead of =. For example like this:

CREATE TABLE TestTable (
    id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
);

testRequest:
SELECT * FROM TestTable WHERE id == ?;

Neither in the IDE, nor during the build, does the error show up, and I get the following crash:

org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "SELECT * FROM TESTTABLE WHERE ID[*] == ?"; SQL statement:
SELECT * FROM TestTable WHERE id == ? [42000-200]

Stacktrace

at org.h2.message.DbException.getJdbcSQLException(DbException.java:453)
at org.h2.message.DbException.getJdbcSQLException(DbException.java:429)
at org.h2.message.DbException.get(DbException.java:205)
at org.h2.message.DbException.get(DbException.java:181)
at org.h2.message.DbException.getSyntaxError(DbException.java:229)
at org.h2.command.Parser.getSyntaxError(Parser.java:1051)
at org.h2.command.Parser.getSpecialType2(Parser.java:5663)
at org.h2.command.Parser.read(Parser.java:5125)
at org.h2.command.Parser.readTerm(Parser.java:4303)
at org.h2.command.Parser.readFactor(Parser.java:3343)
at org.h2.command.Parser.readSum(Parser.java:3330)
at org.h2.command.Parser.readConcat(Parser.java:3305)
at org.h2.command.Parser.readCondition(Parser.java:3108)
at org.h2.command.Parser.readExpressionWithGlobalConditions(Parser.java:3046)
at org.h2.command.Parser.parseSelect(Parser.java:2962)
at org.h2.command.Parser.parseQuerySub(Parser.java:2817)
at org.h2.command.Parser.parseSelectUnion(Parser.java:2649)
at org.h2.command.Parser.parseQuery(Parser.java:2620)
at org.h2.command.Parser.parsePrepared(Parser.java:868)
at org.h2.command.Parser.parse(Parser.java:843)
at org.h2.command.Parser.parse(Parser.java:819)
at org.h2.command.Parser.prepareCommand(Parser.java:738)
at org.h2.engine.Session.prepareLocal(Session.java:657)
at org.h2.engine.Session.prepareCommand(Session.java:595)
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1235)
at org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:76)
at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:352)
at com.zaxxer.hikari.pool.ProxyConnection.prepareStatement(ProxyConnection.java:337)
at com.zaxxer.hikari.pool.HikariProxyConnection.prepareStatement(HikariProxyConnection.java)
at com.squareup.sqldelight.sqlite.driver.JdbcDriver.executeQuery(JdbcDriver.kt:124)
at com.well.modules.db.server.serverDb.AvailabilitiesQueriesImpl$GetByOwnerIdQueryQuery.execute(DatabaseImpl.kt:1398)
at com.squareup.sqldelight.Query.executeAsList(Query.kt:134)
at com.well.modules.db.server.QueryExtensionsKt.getByOwnerId(queryExtensions.kt:75)
@PhilipDukhov PhilipDukhov changed the title Crash on double equal Crash on double equal in MySQL Nov 12, 2021
@AlecKazakova AlecKazakova added this to the 2.0 milestone Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants