-
Notifications
You must be signed in to change notification settings - Fork 12
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
Support MySQL5.7 #124
Comments
OK I fixed the Now, we have another much harder problem: update `table_test`
inner join `table_test` as `_target_table`
on (`table_test`.`_db_tools_id` = `_target_table`.`_db_tools_id`)
left outer join (
select `value`,
ROW_NUMBER() OVER (ORDER BY rand()) as `rownum`
from `_db_tools_sample_662910cfef262`
limit 3
) as `_db_tools_sample_662910cfef262_value`
on (`_target_table`.`_db_tools_id` % 3 + 1 = `_db_tools_sample_662910cfef262_value`.`rownum`
and `_target_table`.`value` is not null)
left outer join (
select `iban`, `bic`,
ROW_NUMBER() OVER (ORDER BY rand()) as `rownum`
from `_db_tools_sample_662910d0090ed`
limit 3
) as `_db_tools_sample_662910d0090ed_foo` on (
`_target_table`.`_db_tools_id` % 3 + 1 = `_db_tools_sample_662910d0090ed_foo`.`rownum`)
set
`table_test`.`value` = `_db_tools_sample_662910cfef262_value`.`value`,
`table_test`.`my_iban` = `_db_tools_sample_662910d0090ed_foo`.`iban`,
`table_test`.`my_bic` = `_db_tools_sample_662910d0090ed_foo`.`bic
; This cannot work because MySQL 5.7 has not implemented the WINDOW functions yet. We could probably emulate it using this trick: https://stackoverflow.com/questions/1895110/row-number-in-mysql which would give then: update `table_test`
inner join `table_test` as `_target_table`
on (`table_test`.`_db_tools_id` = `_target_table`.`_db_tools_id`)
left outer join (
select `value`,
@rownum := @rownum + 1 AS `rownum`
from `_db_tools_sample_662910cfef262`
limit 3
) as `_db_tools_sample_662910cfef262_value`
on (`_target_table`.`_db_tools_id` % 3 + 1 = `_db_tools_sample_662910cfef262_value`.`rownum`
and `_target_table`.`value` is not null)
left outer join (
select `iban`, `bic`,
@rownum := @rownum + 1 AS `rownum`
from `_db_tools_sample_662910d0090ed`
limit 3
) as `_db_tools_sample_662910d0090ed_foo` on (
`_target_table`.`_db_tools_id` % 3 + 1 = `_db_tools_sample_662910d0090ed_foo`.`rownum`)
set
`table_test`.`value` = `_db_tools_sample_662910cfef262_value`.`value`,
`table_test`.`my_iban` = `_db_tools_sample_662910d0090ed_foo`.`iban`,
`table_test`.`my_bic` = `_db_tools_sample_662910d0090ed_foo`.`bic
; Which would require to hack for MySQL 5.7 only. Before we had one problem, now we have two, because the WINDOW function used here is generated by I guess we can target the exact place where we instanciate this expression in |
OK that should be easier than I thought, giving it a try now. |
Well, all done! PR is waiting for approval. |
For now the DbToolsBundle does not work properly with MySQL5.7.
But as it is still common to encounter this version in the wild, it could be nice to fix issues we have and officially support this version.
For example for now, when I launch tests with this version I get this kind of errors:
The text was updated successfully, but these errors were encountered: