question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

limit is added to query even when none specified

See original GitHub issue

System information:

  • Operating system (distribution) and version: Ubuntu Linux 19.04
  • DBeaver version: Version 6.2.0.201909081341
  • Additional extensions: none

Connection specification:

  • Database name and version: Vertica 9.2.0-0
  • Driver name: vertica-jdbc-9.2.0-0.jar
  • Do you use tunnels or proxies (SSH, SOCKS, etc)? no local database

Describe the problem you’re observing:

previously I could execute this query without any problems, after DBeaver upgrade it does not work anymore (database is the same as before):

select set_config_parameter('AWSRegion','us-west-2');

when executing this query LIMIT <resultset fetch-size> is added to the query: image

Steps to reproduce, if exist:

  • execute above query
  • set result fetch-size to nothing (remove value)
  • execute query again
  • query fails again and result fetch-size is same as before…

Include any warning/errors/backtraces from the logs

org.jkiss.dbeaver.model.sql.DBSQLException: SQL Error [5297] [0A000]: [Vertica][VJDBC](5297) ERROR: Unsupported use of LIMIT/OFFSET clause
	at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.executeStatement(JDBCStatementImpl.java:134)
	at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.executeStatement(SQLQueryJob.java:473)
	at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.lambda$0(SQLQueryJob.java:412)
	at org.jkiss.dbeaver.model.exec.DBExecUtils.tryExecuteRecover(DBExecUtils.java:148)
	at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.executeSingleQuery(SQLQueryJob.java:405)
	at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.extractData(SQLQueryJob.java:865)
	at org.jkiss.dbeaver.ui.editors.sql.SQLEditor$QueryResultsContainer.readData(SQLEditor.java:2833)
	at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.lambda$0(ResultSetJobDataRead.java:98)
	at org.jkiss.dbeaver.model.exec.DBExecUtils.tryExecuteRecover(DBExecUtils.java:148)
	at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.run(ResultSetJobDataRead.java:96)
	at org.jkiss.dbeaver.ui.controls.resultset.ResultSetViewer$17.run(ResultSetViewer.java:3356)
	at org.jkiss.dbeaver.model.runtime.AbstractJob.run(AbstractJob.java:103)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.sql.SQLFeatureNotSupportedException: [Vertica][VJDBC](5297) ERROR: Unsupported use of LIMIT/OFFSET clause
	at com.vertica.util.ServerErrorData.buildException(Unknown Source)
	at com.vertica.dataengine.VQueryExecutor.executeSimpleProtocol(Unknown Source)
	at com.vertica.dataengine.VQueryExecutor.execute(Unknown Source)
	at com.vertica.jdbc.common.SStatement.executeNoParams(Unknown Source)
	at com.vertica.jdbc.common.SStatement.execute(Unknown Source)
	at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.execute(JDBCStatementImpl.java:338)
	at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.executeStatement(JDBCStatementImpl.java:131)
	... 12 more
Caused by: com.vertica.support.exceptions.FeatureNotSupportedException: [Vertica][VJDBC](5297) ERROR: Unsupported use of LIMIT/OFFSET clause
	... 19 more

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
oBoMBaYocommented, Sep 27, 2019

I found a workaround. You can just put select 1; right after your query and select the whole area then execute it. Example: select analyze_statistics('schema_name.table_name'); select 1; Screen Shot 2562-09-27 at 12 17 40

2reactions
rudmercommented, Sep 27, 2019

@serge-rider I just installed the latest version 6.2.1 and the problem was still there so I dug a little deeper and found the cause!

when going to version 6.something I was asked for conversion of my config (recommended) so I went ahead and said yes. After a couple of days things started to get weird since some settings were apparently not copied or applied and so I fixed those.

now today I found that while the general setting for the SQL data-editor Use SQL to limit fetch size = false the individual connection settings are true… 😱 this was never set by me and so I never checked…

So setting each connection not the use SQL for limits fixes this problem!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Selecting all records using SQL LIMIT and OFFSET query
LIMIT ALL is the same as omitting the LIMIT clause, as is LIMIT with a NULL argument. Snowflake LIMIT / FETCH. The values...
Read more >
8.2.1.19 LIMIT Query Optimization - MySQL :: Developer Zone
LIMIT 0 quickly returns an empty set. This can be useful for checking the validity of a query. It can also be employed...
Read more >
Documentation: 15: 7.6. LIMIT and OFFSET - PostgreSQL
LIMIT ALL is the same as omitting the LIMIT clause, as is LIMIT with a NULL argument. OFFSET says to skip that many...
Read more >
Using the SQL Limit Keyword - Navicat
The SQL LIMIT clause constrains the number of rows returned by a SELECT statement. For Microsoft databases like SQL Server or MSAccess, ...
Read more >
ORDER BY clause - Amazon Redshift - AWS Documentation
LIMIT 0 returns no rows. You can use this syntax for testing purposes: to check that a query runs (without displaying any rows)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found