-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
'USE' doesn't return an error if a keyspace doesn't exist #3060
Comments
This sounds good. |
Adding a minor note here to support as well system schemas:
the last query works fine if |
We could add support for It will become very powerful if vitess could show a consolidated view. Then this will become a powerful feature. It's something we can keep in mind. |
I think this is important to fix, because in general Vitess is quite strict about how it handles edge-cases. This makes it easier to validate that it is working correctly (vs. MySQL's traditional behavior of parse but ignore etc.) |
There is another use-case why this is important. In MySQL (depending on platform) the schema name may be case-insensitive. So when you move to vitess, you may get this error.. which won't make sense to you. The semantics are much clearer if the initial selecting of the database fails. |
I had commented on the wrong issue and have deleted the message. Please disregard :) |
I was looking debugging this issue and looking at query logs , this query does not invoke |
@saifalharthi can you document the full list of commands generated by |
These are the commands I logged
|
Can this be closed? |
do you know which PR fixed it? Then we can refer to it here and close it. |
If someone issues use |
I don't think it's fixed. We might even have a regression of some sort. From the local example:
|
That is a regression, it used to error out on the select, now it silently uses a keyspace. |
Right now if we execute a
USE
against a keyspace/db that doesn't exist, we don't return any error to the client (we only do that after failing a query):vtgate
only logs an error:E0814 13:47:41.481496 24441 resilient_srv_topo_server.go:280] WatchSrvKeyspace failed for test/this_db_doesnt_exist: node doesn't exist
My proposal is to align Vitess to what MySQL already offers:
The text was updated successfully, but these errors were encountered: