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

Fix double quote used wrongly for literal value in SqliteSchemaManager #6325

Conversation

mvorisek
Copy link
Contributor

@mvorisek mvorisek commented Mar 4, 2024

Q A
Type bug
Fixed issues

Summary

It seems PHP SQLite drivers allows " to be used to escape literal values, but natively such syntax produces an sqlite parse error [1].

I have discovered this when analysing SQLite log, it is otherwise tested.

I checked all other " in SQLite platform and manager and all of them seems correct otherwise.

[1] https://dbfiddle.uk/KQAGp9Ea (notice the 2nd query is the same, but uses " instead of ')

@mvorisek
Copy link
Contributor Author

mvorisek commented Mar 4, 2024

It seems PHP SQLite drivers allows " to be used to escape literal values, but natively such syntax produces an sqlite parse error [1].

Out of curiosity, does anyone have any idea why php does that and if it can be potentionally disabled - to improve testing quality and reject such unwanted syntax in general.

@derrabus derrabus merged commit e33f663 into doctrine:3.8.x Mar 5, 2024
90 checks passed
@derrabus
Copy link
Member

derrabus commented Mar 5, 2024

Thank you!

@derrabus derrabus added this to the 3.8.4 milestone Mar 5, 2024
@mvorisek mvorisek deleted the fix_sqlitemanager_wrong_literal_value_quotes branch March 5, 2024 10:34
@mvorisek
Copy link
Contributor Author

mvorisek commented Mar 5, 2024

@derrabus thank you, may I ask you if you have any idea about #6325 (comment)?

@derrabus
Copy link
Member

derrabus commented Mar 5, 2024

You may and my answer is "no". 🙂

derrabus added a commit to derrabus/dbal that referenced this pull request Mar 21, 2024
* 3.8.x:
  Add MariaDB 11.3 to the test matrix (doctrine#6342)
  Spell which properly
  Fix double quote used wrongly for literal value in SqliteSchemaManager (doctrine#6325)
derrabus added a commit that referenced this pull request Mar 21, 2024
* 4.0.x:
  Add MariaDB 11.3 to the test matrix (#6342)
  [Documentation] Fixing markup (#6340)
  Remove older versions from the docs
  [Documentation] Adding "versionadded" (#6336)
  Update UPGRADE.md
  Spell which properly
  Fix double quote used wrongly for literal value in SqliteSchemaManager (#6325)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants