Skip to content

Conversation

@kamil-tekiela
Copy link

This PR changes the MysqliDriver to use exception mode just like PDO does. I tried not to make too many changes and stick to the previous style. There was some dead code in executeUnpreparedQuery which I removed to make the change easier.

@HLeithner
Copy link
Contributor

thanks, maybe we can remove the warning suppression (@) now too? other question is can we get the state before we set it and set it back after connecting?

It also seems that MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT is the default since php 8.1, that would mean we already get exceptions in this driver but doesn't catch them?

@kamil-tekiela
Copy link
Author

thanks, maybe we can remove the warning suppression (@) now too? other question is can we get the state before we set it and set it back after connecting?

Thanks for pointing this out. I removed the error suppression.
We can get the state from mysqli_driver->report_mode but I don't see why we would need to do that.

It also seems that MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT is the default since php 8.1, that would mean we already get exceptions in this driver but doesn't catch them?

Yes, that would be true. Hence, why the current code needs to be changed because it doesn't work as intended. I still like to set the error mode explicitly though.

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

Successfully merging this pull request may close these issues.

3 participants