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

trunk: turn off pdo_mysql's emulate prepared statements #2306

Closed
robocoder opened this issue Apr 13, 2011 · 3 comments
Closed

trunk: turn off pdo_mysql's emulate prepared statements #2306

robocoder opened this issue Apr 13, 2011 · 3 comments
Labels
Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change. wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.
Milestone

Comments

@robocoder
Copy link
Contributor

This is a follow-up to [4424].

Have been advised that the source of the difference in float output between mysqli and pdo_mysql is because emulated prepares means pdo_mysql uses a text protocol (instead of binary) communicating with the mysql server.

IIRC we had to use emulated prepares because we (previously) used a query that binds parameters even for DDL statements. After adding mysqli support, DDL statements instead used Piwik_Exec().

@robocoder
Copy link
Contributor Author

Refreshing my memory...

As previously statement, this should be doable because of the change to use Piwik_Exec() in [1480].

In [it was noted that server-side prepares couldn't take advantage of MySQL's query cache for MySQL 5.0 and early versions of 5.1.x. This would seem to be mitigated by the caching of prepared statements in 3716 and [3717].

@mattab
Copy link
Member

mattab commented Apr 13, 2011

wont fix, this issue is not a problem (now that the tests are passing after the quick clean hack), and tricky to modify these core SQL things for a non problem ;)

Thanks for the research though because this helps understand what was going on!

@robocoder
Copy link
Contributor Author

Ok.

But for future reference:

  • the line to remove from core/Db/Adapter/Pdo/Mysql.php is:
$this->_connection->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
  • Piwik's documented minimum requirement is MySQL 4.1
  • server-side prepares was added in MySQL 4.1
  • query cache support for server-side prepared statements was added in 5.1.17

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change. wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.
Projects
None yet
Development

No branches or pull requests

2 participants