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

Escape character not updated when switching database driver #417

Open
tenzap opened this issue Jan 1, 2025 · 0 comments
Open

Escape character not updated when switching database driver #417

tenzap opened this issue Jan 1, 2025 · 0 comments

Comments

@tenzap
Copy link

tenzap commented Jan 1, 2025

I have a test that uses a phpunit dataprovider having 3 values, each being the database driver to use. The 3 engines are PostgreSQL, MySQL, and sqlite.

It appears that when the test is run with 2nd case, MySQL, the escape char used to build the queries it's not updated to the one for MySQL which is `. It still is the one of PostgreSQL wich is ".

The cause is in this line of ci3.
https://github.com/bcit-ci/CodeIgniter/blob/3.1.13/system/database/DB_driver.php#L1417
If I remove the static from the $preg_ec variable, the escape char is correctly set for MySQL.

@tenzap tenzap changed the title issue with ezcape5 har w escape character when switching database driver Jan 1, 2025
@tenzap tenzap changed the title w escape character when switching database driver Escape character not updated when switching database driver Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant