You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating an index, if another object (say an index or table) with the same name exists, we throw an error as expected, but the error message is confusing. It talks about "Duplicate Table" even when the object that already exists might be an index.
InvalidRequest: Error from server: code=2200 [Invalid query] message="Query error: Duplicate Table. Already present: Target index already exists: 77e586b20dce4ee091b1000704b960a6
The message should be something like:
A table with the name <xyz> already exists
or An index with the name <xyz> already exists
Similarly, when dropping an non-existent index, the current error message could be improved. It should not say "Table Not Found".
cqlsh:k> drop index nonexisting_index_name;
InvalidRequest: Error from server: code=2200 [Invalid query] message="Query error: Table Not Found. Not found: The index does not exist: table_name: "nonexisting_index_name"
namespace {
name: "k"
}
The text was updated successfully, but these errors were encountered:
The error message string includes a few parts - a few different errors in fact. Any part can be updated but the message will include a few parts anyway.
Fixed version for duplicate index (checked a duplicate table and a duplicate index):
> create table t9 (id int primary key, name varchar);
InvalidRequest: Error from server: code=2200 [Invalid query] message="Query error: Duplicate Table. Already present: Target table already exists: 7370a0fcb46b4dd1975b636c61846188
create table t9 (id int primary key, name varchar);
^^
(error -202)"
cqlsh:q> create index i9 on t9(name);
InvalidRequest: Error from server: code=2200 [Invalid query] message="Query error: Duplicate Index. Already present: Target index already exists: f4524f6a02cf40709eb69fd5c401ed90
create index i9 on t9(name);
^^
(error -224)"
cqlsh:q> drop table tttt;
InvalidRequest: Error from server: code=2200 [Invalid query] message="Query error: Table Not Found. Not found: The table does not exist: table_name: "tttt"
namespace {
name: "q"
}
drop table tttt;
^^^^
(error -301)"
cqlsh:q> drop index iiii;
InvalidRequest: Error from server: code=2200 [Invalid query] message="Query error: Index Not Found. Not found: The index does not exist: table_name: "iiii"
namespace {
name: "q"
}
drop index iiii;
^^^^
(error -318)"
Summary:
Updated a few error codes and a set of error messages to rename Table/Index into Object.
Added appropriate tests.
Related doc: <doc-link>
Test Plan:
ybd --cxx-test ql-create-index-test
ybd --cxx-test ql-drop-stmt-test --gtest_filter TestQLDropStmt.TestQLDropIndex
Reviewers: robert, neha, neil
Reviewed By: neil
Subscribers: neha, bogdan, bharat, kannan, eng
Differential Revision: https://phabricator.dev.yugabyte.com/D6264
Two observations:
InvalidRequest: Error from server: code=2200 [Invalid query] message="Query error: Duplicate Table. Already present: Target index already exists: 77e586b20dce4ee091b1000704b960a6
The message should be something like:
A table with the name <xyz> already exists
or
An index with the name <xyz> already exists
The text was updated successfully, but these errors were encountered: