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

Adding and dropping a non existing tablename to/from a merge table is accepted without an error #3718

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

Comments

@monetdb-team
Copy link

@monetdb-team monetdb-team commented Nov 30, 2020

Date: 2015-05-07 18:14:16 +0200
From: Martin van Dinther <<martin.van.dinther>>
To: SQL devs <>
Version: 11.19.11 (Oct2014-SP3)
CC: @njnes

Last updated: 2015-06-22 22:32:26 +0200

Comment 20850

Date: 2015-05-07 18:14:16 +0200
From: Martin van Dinther <<martin.van.dinther>>

User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:37.0) Gecko/20100101 Firefox/37.0
Build Identifier:

Using SQL:
CREATE merge TABLE mt (i int);
ALTER TABLE mt ADD TABLE blablah;
ALTER TABLE mt DROP TABLE blablah;
is a accepted without an error when the table blablah does not exist.
I expect an error to be returned.

Also when using a fully qualified table name (with schema name prefix) the
ALTER TABLE mt DROP TABLE myschema.mytable
is NOT supported (returns an error).

Reproducible: Always

Steps to Reproduce:

  1. start mserver5 (MonetDB 5 server v11.19.11 "Oct2014-SP3")
  2. start mclient
  3. execute SQL:
    CREATE merge TABLE mt (i int);
    ALTER TABLE mt ADD TABLE blablah;
    ALTER TABLE mt ADD TABLE blablah;
    -- both are accepted without an error
    ALTER TABLE mt DROP TABLE blablah;
    ALTER TABLE mt DROP TABLE blablah;
    -- both are accepted without an error

ALTER TABLE mt ADD TABLE bam.t2;
ALTER TABLE mt ADD TABLE bam.t2;
-- both are accepted without an error
ALTER TABLE mt DROP TABLE bam.t2;
-- this returns: Error: syntax error, unexpected '.', expecting SCOLON in: "alter table mt drop table bam."
DROP TABLE mt;

Actual Results:

bash-4.2$ ./start_mserver5.sh
builtin opt gdk_dbpath = /export/scratch1/dinther/Downloads/INSTALL/var/monetdb5/dbfarm/demo
builtin opt gdk_debug = 0
builtin opt gdk_vmtrim = no
builtin opt monet_prompt = >
builtin opt monet_daemon = no
builtin opt mapi_port = 50000
builtin opt mapi_open = false
builtin opt mapi_autosense = false
builtin opt sql_optimizer = default_pipe
builtin opt sql_debug = 0
cmdline opt gdk_debug = 10
MonetDB 5 server v11.19.11 "Oct2014-SP3"
Serving database 'demo', using 8 threads
Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically linked
Found 15.590 GiB available main-memory.
Copyright (c) 1993-July 2008 CWI.
Copyright (c) August 2008-2015 MonetDB B.V., all rights reserved
Visit http://www.monetdb.org/ for further information
Listening for connection requests on mapi:monetdb://127.0.0.1:50000/
MonetDB/GIS module loaded
MonetDB/SQL module loaded

bash-4.2$ mclient
Welcome to mclient, the MonetDB/SQL interactive terminal (unreleased)
Database: MonetDB v11.19.11 (Oct2014-SP3), 'demo'
Type \q to quit, ? for a list of available commands
auto commit mode: on
sql>CREATE merge TABLE mt (i int);
operation successful (1.446ms)
sql>ALTER TABLE mt ADD TABLE blablah;
operation successful (0.449ms)
sql>ALTER TABLE mt ADD TABLE blablah;
operation successful (0.260ms)
sql>-- both are accepted without an error
sql>ALTER TABLE mt DROP TABLE blablah;
operation successful (0.206ms)
sql>ALTER TABLE mt DROP TABLE blablah;
operation successful (0.207ms)
sql>-- both are accepted without an error
sql>
sql>ALTER TABLE mt ADD TABLE bam.t2;
operation successful (0.225ms)
sql>ALTER TABLE mt ADD TABLE bam.t2;
operation successful (0.213ms)
sql>-- both are accepted without an error
sql>ALTER TABLE mt DROP TABLE bam.t2;
syntax error, unexpected '.', expecting SCOLON in: "alter table mt drop table bam."
sql>-- this returns: Error: syntax error, unexpected '.', expecting SCOLON in: "alter table mt drop table bam."
sql>DROP TABLE mt;
operation successful (0.594ms)
sql>

Expected Results:

An error msg for all
ALTER TABLE ADD TABLE
and
ALTER TABLE DROP TABLE
statements where the does not exist in current or specified schema.

Also it should support (and test on existance) fully qualified table names (so with schema name prefix) for both the merge table and the data table names.

Comment 20867

Date: 2015-05-15 12:45:17 +0200
From: @njnes

added extra check for non existing tables.

Comment 20869

Date: 2015-05-15 12:50:13 +0200
From: MonetDB Mercurial Repository <>

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

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=7fe602576cf5

Changeset description:

added tests for bug #3715, 3718 and also output for 3720

fixed bug #3718 (ie check for unknown tables)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant