@robocoder opened this Issue on April 13th 2011 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 commented on April 13th 2011 Contributor

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 commented on April 13th 2011 Member

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 commented on April 13th 2011 Contributor


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 on April 13th 2011
Powered by GitHub Issue Mirror