-
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
Rails migrations fail with error "vtgate: two predicates for table_name not supported" #7119
Comments
The error appears to come from this code path: vitess/go/vt/vtgate/planbuilder/system_tables.go Lines 44 to 47 in 8b42614
I'm not familiar with this part of the code, but I wonder if we could allow multiple predicates if they happen to refer to the same value/bindvar anyway like they do in this query? |
@jordw can you provide the commit hash or release version on which you are seeing this error? |
This happened on a build made at bb32eaba6. |
There are two things that need to be handled to support this query. 1. |
We ran into this recently so it doesn't seem like this issue is completely resolved - we were still getting the "two predicates for table_name not supported" errors. It seems that |
Hmm... That error comes from the planner, as @enisoc showed when he shared where this errors is produced. I just created a PR adding a planner test for this exact query, and it passes without any issues. Would you mind capturing copy-pasting the exact query that is failing for you, preferably from a vtgate query log? Something must be different between the query I added and the one that is failing for you. Also, do you know which SHA you are using for your Vitess binaries? |
👋🏻 Thanks for the quick response, @systay. I chatted with our DB team and we're using a fork that was last updated in November last year (which is before the PRs linked above were morged) so I'm guessing once we're up to date this issue will go away. Sorry for the false alarm, and thanks again for the quick response! |
Overview of the Issue
Running a simple rails migration to create a table fails with the following error:
ActiveRecord::StatementInvalid: Mysql2::Error: vtgate: two predicates for table_name not supported
Rails is apparently issuing the following query, which is not yet supported by Vitess:
Reproduction Steps
1.) Create a standard Rails app using
rails new
, using Rails 6.0.4 and the mysql2 gem version 0.5.32.) Run a migration to create a basic table
The text was updated successfully, but these errors were encountered: