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

Feature Request: Support explicitly disabling PDO::ATTR_EMULATE_PREPARES at the connection level #1320

Closed
IMSoP opened this issue Oct 25, 2021 · 4 comments

Comments

@IMSoP
Copy link

IMSoP commented Oct 25, 2021

Hi,

Some libraries which wrap PDO try to ensure emulated prepares are off on newly created connections, e.g. EasyDB.

this->pdo->setAttribute(\PDO::ATTR_EMULATE_PREPARES, false);

However, this driver defines that variable as "statement-level only" so gives an error:

PDOException: SQLSTATE[IMSSP]: The given attribute is only supported on the PDOStatement object. in /srv/app-service-auth/vendor/paragonie/easydb/src/EasyDB.php:50

As I understand it, the setting is off by default anyway, so this line would be a no-op if accepted. Would it be possible to accept the attribute, but only accept a value of false? That way, libraries wouldn't need driver-specific workarounds.

@yitam
Copy link
Contributor

yitam commented Oct 25, 2021

Hi @IMSoP, we will get back to you on this.

@yitam
Copy link
Contributor

yitam commented Oct 28, 2021

Yes @IMSoP we are looking into implementing this as a legitimate connection attribute but the emulate prepare option the users set for the prepared statements still overrides it.

@yitam
Copy link
Contributor

yitam commented Dec 2, 2021

5.10.0-beta 2 is just released. Please give it a try, @IMSoP

@yitam
Copy link
Contributor

yitam commented Dec 7, 2021

Closing this now please feel free to ask us to reopen.

@yitam yitam closed this as completed Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants