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

wrong error message when dropping an un-existing view with the same as an existent table. #2713

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: 2010-11-04 17:25:17 +0100
From: @romulogoncalves
To: SQL devs <>
Version: 2.40.1 (Oct2010) [obsolete]
CC: @njnes

Last updated: 2011-03-28 17:31:29 +0200

Comment 15171

Date: 2010-11-04 17:25:17 +0100
From: @romulogoncalves

User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.9.1.15) Gecko/20101027 Fedora/3.5.15-1.fc12 Firefox/3.5.15
Build Identifier:

The following SQL statement gives a wrong error message:
create table t1(id int);
drop view t1;
drop table t1;

MAPI = monetdb@localhost:55000
QUERY = drop view t1;
ERROR = !SQLException:sql.catalog:DROP VIEW: unable to drop view 't1'

It should be:
QUERY = drop view t1;
ERROR = !SQLException:sql.catalog:DROP VIEW: unknown view 't1'

The right error happens once the table t1 is dropped.

Reproducible: Always

Steps to Reproduce:

1.Follow the instructions in "Details"
2.
3.

Actual Results:

QUERY = drop view t1;
ERROR = !SQLException:sql.catalog:DROP VIEW: unable to drop view 't1'

Expected Results:

QUERY = drop view t1;
ERROR = !SQLException:sql.catalog:DROP VIEW: unknown view 't1'

Comment 15172

Date: 2010-11-04 18:10:25 +0100
From: @grobian

would
DROP VIEW: unable to drop view 't1': is a table
be sufficient for you, too?

If so, I think this patch will do it:

diff --git a/sql/src/backends/monet5/sql.mx b/sql/src/backends/monet5/sql.mx
--- a/sql/src/backends/monet5/sql.mx
+++ b/sql/src/backends/monet5/sql.mx
@@ -1817,7 +1817,7 @@
} else if (!t) {
return sql_message("DROP VIEW: unknown view '%s'", tname);
} else if (!isView(t)) {

  •           return sql_message("DROP VIEW: unable to drop view '%s'", tname);
    
  •           return sql_message("DROP VIEW: unable to drop view '%s': is a table", tname);
      } else if (t->system) {
              return sql_message("DROP VIEW: cannot drop system view '%s'", tname);
      } else if (! drop_action && mvc_check_dependency(sql, t->base.id, VIEW_DEPENDENCY, NULL)) {
    

Comment 15284

Date: 2010-12-05 13:35:17 +0100
From: @njnes

sounds fine to me..

Comment 15335

Date: 2010-12-10 22:27:27 +0100
From: @njnes

applied patch

Comment 15336

Date: 2010-12-10 22:29:10 +0100
From: @njnes

Changeset f022c1b3925f 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=f022c1b3925f

Changeset description:

fixed bug #2713 and added test using patch from fabian.

Comment 15627

Date: 2011-03-28 17:31:29 +0200
From: @sjoerdmullender

The Mar2011 version 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 Nov 9, 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