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

Oct2020: PREPARE DDL statement silently fails #6981

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Closed

Oct2020: PREPARE DDL statement silently fails #6981

monetdb-team opened this issue Nov 30, 2020 · 0 comments
Labels
bug Something isn't working normal SQL

Comments

@monetdb-team
Copy link

Date: 2020-10-02 11:37:17 +0200
From: @swingbit
To: SQL devs <>
Version: -- development
CC: @njnes, @PedroTadim

Last updated: 2020-11-24 11:37:22 +0100

Comment 28145

Date: 2020-10-02 11:37:17 +0200
From: @swingbit

User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36
Build Identifier:

Before Oct2020 it was possible to prepare and execute a DDL statement:

sql>PREPARE create table t as select 3;
execute prepared statement using: EXEC 5(...)
+------+--------+-------+--------+-------+--------+
| type | digits | scale | schema | table | column |
+======+========+=======+========+=======+========+
+------+--------+-------+--------+-------+--------+
0 tuples
sql>EXEC 5();
operation successful

In Oct2020, this results in:

sql>PREPARE create table t as select 3;
execute prepared statement using: EXEC 0(...)
+------+--------+-------+--------+-------+--------+
| type | digits | scale | schema | table | column |
+======+========+=======+========+=======+========+
+------+--------+-------+--------+-------+--------+
0 tuples
sql>EXEC 0();
EXEC: PREPARED Statement missing '0'

The bug is either:

  • prepare DDL no longer works correctly
  • prepare DDL is no longer allowed, but no error is reported upon prepare

I hope it's the first.

Reproducible: Always

Comment 28146

Date: 2020-10-02 12:46:37 +0200
From: @PedroTadim

Hello Roberto,

DDL inside prepared statements is something that we never took care actually, because it's something difficult to manage altogether. Currently, whenever a schema change is made, the query cache is cleaned (e.g. drop column statement). There were changes on the query cache on Oct2020 which caused this issue, but it won't be worth to fix for now.

However I'm planning soon to work on a feature branch where prepared statements will be recompiled whenever a schema change is made.

Comment 28248

Date: 2020-11-03 08:59:20 +0100
From: @njnes

found a small improvement on this, ie don't clean the cache on prepare statements.

Comment 28249

Date: 2020-11-03 09:00:31 +0100
From: MonetDB Mercurial Repository <>

Changeset dc247c82fba7 made by Niels Nes niels@cwi.nl in the MonetDB repo, refers to this bug.

For complete details, see https//devmonetdborg/hg/MonetDB?cmd=changeset;node=dc247c82fba7

Changeset description:

fix bug #6981, ie don't clean the query cache on prepare statements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working normal SQL
Projects
None yet
Development

No branches or pull requests

2 participants