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: errors when MariaDB/MySQL has ANSI_QUOTES enabled #5425

Merged
merged 1 commit into from Dec 8, 2021

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Dec 2, 2021

Description
Fixes #5423

A string is a sequence of bytes or characters, enclosed within either single quote (') or double quote (") characters.
...
If the ANSI_QUOTES SQL mode is enabled, string literals can be quoted only within single quotation marks because a string quoted within double quotation marks is interpreted as an identifier.
https://dev.mysql.com/doc/refman/8.0/en/string-literals.html

ANSI_QUOTES
Treat " as an identifier quote character (like the ` quote character) and not as a string quote character. You can still use ` to quote identifiers with this mode enabled. With ANSI_QUOTES enabled, you cannot use double quotation marks to quote literal strings because they are interpreted as identifiers.
https://dev.mysql.com/doc/refman/8.0/en/sql-mode.html#sqlmode_ansi_quotes

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • [] User guide updated
  • Conforms to style guide

@kenjis kenjis added bug Verified issues on the current code behavior or pull requests that will fix them database Issues or pull requests that affect the database layer labels Dec 2, 2021
@kenjis kenjis merged commit 262cf0b into codeigniter4:develop Dec 8, 2021
@kenjis kenjis deleted the fix-mysql-ANSI_QUOTES branch December 8, 2021 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them database Issues or pull requests that affect the database layer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: CodeIgniter4 shows errors when MariaDB/MySQL has 'ANSI_QUOTES' enabled in sql_mode.
2 participants