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

Using a literal comparison that resolves to FALSE throws exception (e.g., WHERE 3 > 4) [BUG] #508

Open
sophia-bq opened this issue Feb 27, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@sophia-bq
Copy link

Environment

  • DocumentDB JDBC driver version: 1.4.4
  • DocumentDB server version: MongoDB v6.0.3
  • OS: MacOS Ventura 13.1
  • BI Tool or client name: DBeaver
  • BI Tool or client version: 22.3.5

Problem Description

  1. Steps to reproduce: any query that has a WHERE clause that evaluates to a contradiction
  2. Expected behaviour: Returns no results
  3. Actual behaviour: Throws an exception
  4. Error message/stack `trace:
org.jkiss.dbeaver.model.sql.DBSQLException: SQL Error: Unsupported SQL syntax 'SELECT "key", "val" FROM test_table where val <> val'. Please refer to the list of the supported features.
	at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.executeStatement(JDBCStatementImpl.java:133)
	at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.executeStatement(SQLQueryJob.java:582)
	at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.lambda$1(SQLQueryJob.java:491)
	at org.jkiss.dbeaver.model.exec.DBExecUtils.tryExecuteRecover(DBExecUtils.java:173)
	at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.executeSingleQuery(SQLQueryJob.java:498)
	at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.extractData(SQLQueryJob.java:924)
	at org.jkiss.dbeaver.ui.editors.sql.SQLEditor$QueryResultsContainer.readData(SQLEditor.java:3805)
	at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.lambda$0(ResultSetJobDataRead.java:123)
	at org.jkiss.dbeaver.model.exec.DBExecUtils.tryExecuteRecover(DBExecUtils.java:173)
	at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.run(ResultSetJobDataRead.java:121)
	at org.jkiss.dbeaver.ui.controls.resultset.ResultSetViewer$ResultSetDataPumpJob.run(ResultSetViewer.java:5073)
	at org.jkiss.dbeaver.model.runtime.AbstractJob.run(AbstractJob.java:105)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.sql.SQLFeatureNotSupportedException: Unsupported SQL syntax 'SELECT "key", "val"FROM test_table where val <> val'. Please refer to the list of the supported features.
	at software.amazon.documentdb.jdbc.common.utilities.SqlError.createSQLFeatureNotSupportedException(SqlError.java:220)
	at software.amazon.documentdb.jdbc.query.DocumentDbQueryMappingService.get(DocumentDbQueryMappingService.java:161)
	at software.amazon.documentdb.jdbc.DocumentDbQueryExecutor.runQuery(DocumentDbQueryExecutor.java:172)
	at software.amazon.documentdb.jdbc.DocumentDbQueryExecutor.executeQuery(DocumentDbQueryExecutor.java:125)
	at software.amazon.documentdb.jdbc.DocumentDbStatement.executeQuery(DocumentDbStatement.java:98)
	at software.amazon.documentdb.jdbc.common.Statement.execute(Statement.java:107)
	at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.execute(JDBCStatementImpl.java:329)
	at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.lambda$0(JDBCStatementImpl.java:131)
	at org.jkiss.dbeaver.utils.SecurityManagerUtils.wrapDriverActions(SecurityManagerUtils.java:96)
	at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.executeStatement(JDBCStatementImpl.java:131)
	... 12 more
  1. Any other details that can be helpful: This exception is thrown for any contradiction ex. val <> val, val = 1 and val <> 1, 1 > 2 etc.

This has been noted in Known Issues but we were hoping to increase the priority of this issue as it is preventing some queries from running that are important to our development of a connector using this driver.

@sophia-bq sophia-bq added the bug Something isn't working label Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant