Skip to content
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

Add all missing MariaDB keywords to the MySQL platform #2768

Merged
merged 1 commit into from
Jul 22, 2017

Conversation

roelvanduijnhoven
Copy link

Version 10.2.4 introduced rows as a keyword. As doctrine does not escape non-keyword column names; this breaks stuff. And thus this prevents us from upgrading to the lastest MariaDb version.

You connect to MariaDb using the MySql connectors from Doctrine. Thus I think it would be wise to add the new keywords to this file.

I added all missing keywords from https://mariadb.com/kb/en/mariadb/reserved-words/ and resorted the table in this PR.

@Ocramius Ocramius self-assigned this Jul 7, 2017
@Ocramius Ocramius requested a review from deeky666 July 7, 2017 12:06
@Ocramius Ocramius removed their assignment Jul 7, 2017
Copy link
Member

@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@deeky666 can you check this? Do we have a way to test this properly?

@leofeyer
Copy link
Contributor

Also see: https://jira.mariadb.org/browse/MDEV-13339

According to the MariaDV devs, rows will be a reserved keyword in MySQL 8.0. @Ocramius There is a MySQLKeywords and and MySQL57Keywords class. Do we need a MySQL80Keywords class?

@Ocramius
Copy link
Member

@leofeyer sadly yes, although we don't have a platform for it yet

@roelvanduijnhoven
Copy link
Author

@Ocramius Isn't it much simpler to simply escape all column names in an upcoming version? I see there is already some work done on that area: #1592. Better investment of time than manually updating those keyword files I'd say.

@Ocramius
Copy link
Member

Ocramius commented Jul 21, 2017 via email

@roelvanduijnhoven
Copy link
Author

What if we simply make the quoting behaviour configurable per engine? We can then already land this in the next minor increment of this repo. For MySQL (and other engines that support this) we can remove the keywords altogether; and simply enable quoting for that engine

@Ocramius
Copy link
Member

Ocramius commented Jul 21, 2017 via email

@Ocramius Ocramius self-assigned this Jul 22, 2017
@Ocramius Ocramius added this to the 2.6 milestone Jul 22, 2017
@Ocramius
Copy link
Member

🚢

Thanks @roelvanduijnhoven!

@Ocramius Ocramius merged commit 4758f42 into doctrine:master Jul 22, 2017
@Ocramius Ocramius changed the title Add all missing MariaDb keywords to MySQL Add all missing MariaDb keywords to the MySQL platform Jul 22, 2017
@Ocramius Ocramius changed the title Add all missing MariaDb keywords to the MySQL platform Add all missing MariaDB keywords to the MySQL platform Jul 22, 2017
@ausi
Copy link
Contributor

ausi commented Aug 25, 2017

@Ocramius is it possible to merge this into the 2.5 branch too and release a 2.5.14 version?

Currently it is not possible to use MariaDB 10.2.4 together with PHP 5.6 or 7.0 because doctrine/dbal 2.6 requires at least PHP 7.1.

@Ocramius
Copy link
Member

@ausi no, this is an improvement on the API. If you want to use a newer version of MariaDB, then upgrade also DBAL and consequently PHP.

@ausi
Copy link
Contributor

ausi commented Aug 25, 2017

OK, thanks for checking!

@roelvanduijnhoven
Copy link
Author

I just migrated, and it failed.

Turns out the rows keywords is not escaped if used within an UPDATE statement 🤔. Not sure why. the MysqlKeywords file isn't even used when generating an update query it seems.

rows is properly escaped for alter and create statements.

Is this intended behaviour? Not sure if I should open an issue here.

@xcy7e
Copy link

xcy7e commented Jun 2, 2019

Manually fixed this in 4.4 LTS and it worked. Why not change the 4.4 globally? Any reason?

@fritzmg
Copy link

fritzmg commented Jun 2, 2019

@xcy7e what exactly are you referring to?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants