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

Exception "unknown table" should be raised instead of "unknown columns" on attempt to create index for non-existent table [CORE5738] #6002

Open
firebird-issue-importer opened this issue Feb 2, 2018 · 0 comments

Comments

@firebird-issue-importer
Copy link

@firebird-issue-importer firebird-issue-importer commented Feb 2, 2018

Submitted by: @pavel-zotov

There is something strange in error message when i want to create index for NON-existent table.
Consider following script (doing it on empty database):

SQL> create index no_such_index on no_such_table( some_fantastic_column );
Statement failed, SQLSTATE = 42000
unsuccessful metadata update
-Unknown columns in index NO_SUCH_INDEX
SQL>

Why "unknown COLUMNS" are mentioned here ? I just used wrong name of TABLE rather than column(s) of it.

IMO, much better to raise SQLSTATE = 42S02 ("-Table unknown"), similar to this case:
SQL> select * from no_such_table;
Statement failed, SQLSTATE = 42S02
Dynamic SQL Error
-SQL error code = -204
-Table unknown
-NO_SUCH_TABLE

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