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

SQL: select * from sys.sys.table_name; is accepted but should return an error #3948

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

Comments

@monetdb-team
Copy link

Date: 2016-03-10 15:43:23 +0100
From: Martin van Dinther <<martin.van.dinther>>
To: SQL devs <>
Version: 11.21.13 (Jul2015-SP2)
CC: @njnes

Last updated: 2016-03-25 09:59:29 +0100

Comment 21873

Date: 2016-03-10 15:43:23 +0100
From: Martin van Dinther <<martin.van.dinther>>

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

When using an third qualifier in a table name (such as sys.sys.table_name) this is accepted by the SQL parser. It should return an error as we do not support a 3-level table name qualifier (as in catalog.schema.table).

Reproducible: Always

Steps to Reproduce:

  1. Start mserver5
  2. Start mclient
  3. Issue SQL commands:
    select * from dependency_types;
    -- returns table ouput, so ok
    select * from sys.dependency_types;
    -- returns table ouput, so ok

select * from sys.sys.dependency_types;
-- returns table output! It should return an error such as next query
select * from sys.sys.sys.dependency_types;
-- returns an error

Actual Results:

bash-4.3$ mclient
Welcome to mclient, the MonetDB/SQL interactive terminal (unreleased)
Database: MonetDB v11.22.0 (unreleased), 'demo'
Type \q to quit, ? for a list of available commands
auto commit mode: on
sql>select * from dependency_types;
+--------------------+----------------------+
| dependency_type_id | dependency_type_name |
+====================+======================+
| 1 | SCHEMA |
| 2 | TABLE |
| 3 | COLUMN |
| 4 | KEY |
| 5 | VIEW |
| 6 | USER |
| 7 | FUNCTION |
| 8 | TRIGGER |
| 9 | OWNER |
| 10 | INDEX |
| 11 | FKEY |
| 12 | SEQUENCE |
| 13 | PROCEDURE |
| 14 | BE_DROPPED |
+--------------------+----------------------+
14 tuples (0.905ms)
sql>-- returns table ouput, so ok
sql>select * from sys.dependency_types;
+--------------------+----------------------+
| dependency_type_id | dependency_type_name |
+====================+======================+
| 1 | SCHEMA |
| 2 | TABLE |
| 3 | COLUMN |
| 4 | KEY |
| 5 | VIEW |
| 6 | USER |
| 7 | FUNCTION |
| 8 | TRIGGER |
| 9 | OWNER |
| 10 | INDEX |
| 11 | FKEY |
| 12 | SEQUENCE |
| 13 | PROCEDURE |
| 14 | BE_DROPPED |
+--------------------+----------------------+
14 tuples (0.560ms)
sql>-- returns table ouput, so ok
sql>
sql>select * from sys.sys.dependency_types;
+--------------------+----------------------+
| dependency_type_id | dependency_type_name |
+====================+======================+
| 1 | SCHEMA |
| 2 | TABLE |
| 3 | COLUMN |
| 4 | KEY |
| 5 | VIEW |
| 6 | USER |
| 7 | FUNCTION |
| 8 | TRIGGER |
| 9 | OWNER |
| 10 | INDEX |
| 11 | FKEY |
| 12 | SEQUENCE |
| 13 | PROCEDURE |
| 14 | BE_DROPPED |
+--------------------+----------------------+
14 tuples (0.654ms)
sql>-- returns table output! It should return an error such as next query
sql>select * from sys.sys.sys.dependency_types;
syntax error, unexpected '.', expecting SCOLON in: "select * from sys.sys.sys."
sql>-- returns an error
sql>

Expected Results:

query:
select * from sys.sys.dependency_types;
should return an error instead.

See also Bug #2526 (for adding support of: schema.table.column name usage in SQL)

Comment 21882

Date: 2016-03-13 14:27:23 +0100
From: @njnes

Martin could you add the test? The code now returns an error.

Comment 21925

Date: 2016-03-17 12:14:53 +0100
From: MonetDB Mercurial Repository <>

Changeset c3f2ee09cf31 made by Martin van Dinther martin.van.dinther@monetdbsolutions.com in the MonetDB repo, refers to this bug.

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

Changeset description:

Adding tests for Bug #3948

Comment 21968

Date: 2016-03-25 09:59:29 +0100
From: @sjoerdmullender

Jul2015-SP3 has been released.

@monetdb-team monetdb-team added bug Something isn't working normal SQL labels Nov 30, 2020
@sjoerdmullender sjoerdmullender added this to the Ancient Release milestone Feb 7, 2022
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