trinodb / trino

Official repository of Trino, the distributed SQL query engine for big data, formerly known as PrestoSQL (https://trino.io)
https://trino.io
Apache License 2.0
10.28k stars 2.96k forks source link

PreparedStatement dont support java.sql.Statement.NO_GENERATED_KEYS option #22100

Closed prrvchr closed 2 months ago

prrvchr commented 4 months ago

Hi all,

I just noticed that it is not possible to execute the java.sql.Connection.prepareStatement(String sql, int option) method with option on java.sql.Statement.NO_GENERATED_KEYS without getting the error:

java.sql.SQLFeatureNotSupportedException: Auto generated keys must be NO_GENERATED_KEYS

It is still possible to call this method without an option. But using the option java.sql.Statement.NO_GENERATED_KEYS should be the same as without the option.

findepi commented 4 months ago

Trino does not support generating keys (from engine perspective, even if some connectors do that under the hood), so I agree that NO_GENERATED_KEYS can currently be ignored (instead of rejecting).