phpcr / phpcr-utils

A set of helper classes and command line commands you want to use with phpcr, but that are not part of the API itself
phpcr.github.io
Other
72 stars 30 forks source link

Fix: Sql2Scanner Delimiter Regex #194

Closed ghost closed 3 years ago

ghost commented 3 years ago

Perhaps related to: https://github.com/phpcr/phpcr-utils/pull/104

The generated regular expression in the Sql2Scanner does not take into account that there may be no character between two tokens. In our case the fallback to " " then broke the whole query.

Old variant: https://regex101.com/r/4EkOyI/1

Corrected variant: https://regex101.com/r/v61vHK/1

dbu commented 3 years ago

thanks for the merge request!

i am a bit worried that this could have side effects. have you tried in your project if things still work fine or anything breaks?

dbu commented 3 years ago

or, could you do a pull request on https://github.com/jackalope/jackalope-doctrine-dbal where you make it install your version of phpcr-utils? then we can see if the whole phpcr-api-tests test suite is happy. that one does a lot of things so chances are good we would notice if there are any issues.

ghost commented 3 years ago

We are currently using this fix in a Sulu project. We have not encountered any problems there.

ghost commented 3 years ago

@dbu see https://github.com/jackalope/jackalope-doctrine-dbal/pull/379

dbu commented 3 years ago

i merged on the cli and will tag as 1.5.2

thanks a lot!