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
Regex did not match CREATE TABLE in all cases #37991
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @UlrichThomasGabor thanks for the PR, can you add a test for this behavior?
Hi @eileencodes, I am not sure how. I can provide the output of an |
There's a table options test here: https://github.com/rails/rails/blob/master/activerecord/test/cases/adapters/mysql2/table_options_test.rb. That's probably a good place to add a test for this. |
To make sure I understand you correctly, you want a test stubbing the |
@eugeneius Yes, these look like the same issue. From this site I understand that the I do not know of options to modify or configure the output of |
It seems like the https://dev.mysql.com/doc/refman/5.6/en/sql-mode.html#sqlmode_no_table_options
A test for this change could temporarily set that SQL mode on the connection. |
@eugeneius Yes, this option has an effect on the output of |
The Stubbing Other ideas anyone? |
Since nobody seems to have a better idea, I just added a comment hinting towards the sql mode. |
Since We support MySQL >= 5.5.8, it should have a regression test even if that is no longger issue on latest MySQL version. |
@kamipo One needs an old MySQL version to set the old SQL mode. If you tell me how to add a test, which requires a specific (range of) MySQL version(s), I am happy to add it. |
def test_no_table_options_sql_mode
skip "As of MySQL 5.7.22, NO_TABLE_OPTIONS is deprecated. It will be removed in a future version of MySQL." if ActiveRecord::Base.connection.database_version >= "5.7.22"
# ... please write a test below
end |
Can you squash commits into one? |
The regular expression did not match CREATE TABLE statements printed out by AWS Aurora MySQL 5.6 instances, because they lack the required space at that position.
@kamipo Done |
Regex did not match CREATE TABLE in all cases
The regular expression did not match CREATE TABLE statements printed out by AWS Aurora MySQL 5.6 instances, because they lack the required space at that position. Now it is optional.