Apparently someone at Sun agreed with my sentiments about moving to a more closed-source model for MySQL.
While my original comments are self serving, apparently Sun believes that it will make better business sense in the long term to keep these components open-source. Hopefully this is a vote of confidence for the quality of product the open-source model has helped MySQL create.
Related posts
Sun to begin developing features only for Enterprise server. While I’m glad Sun will continue development of MySQL, there are many things other than not having access to these advanced features. Mainly the splintering of development, the idea of paying for less-tested software, and whether it’s a trend.
Related posts
Memcache is an extension written by Danga for simple Key/Value pair caching for use with your favorite programming language. In this talk I demonstrate how to install, integrate, and leverage Memcache in PHP (using MySQL for a database). I build a sample application, demonstrate less than desirable performance and finally, return performance with a 100x improvement.
The whole talk and its supporting files can also be downloaded.
Related posts
I’ve been working with the Zend Framework a bit and in working with MySQL through PDO_MYSQL. I’ve run into a few problems trying to use parameters of queries.
I’ve narrowed the issue down to PDO itself and not the Zend Framework.
$dbh = new PDO("mysql:host=localhost;dbname=db","user","pw");
$query = "insert into silo_test_data (record_id, fieldname, value)
values (3,'stufftest', :value )";
$handle = $dbh->prepare($query);
$handle->execute(array(":value" => 'crap'));
$dbh = null;
The value gets inserted into the database as an empty string, or sometimes some low-value bytes. I’ve managed to work around this temporarily thanks to some help from this post. By setting PDO to emulate prepared statements, everything seems to work okay.
$dbh->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
The problem is, the Zend framework encapsulates the actual db connection and connects lazily. So, for now I’m running a query and then set the parameter on the encapsulated connection object.
$db_connect = array( 'host' => $config->db->hostname,
'username' => $config->db->username,
'password' => $config->db->password,
'dbname' => $config->db->database );
$db = Zend_Db::factory('PDO_MYSQL', $db_connect);
$db->query('select 1');//HACK HACK HACK HACK to initiate connection. Can't I make this a plugin? or extend the class?
$db->getConnection()->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
Zend::register('db',$db);
Related posts