ZF-8360: wrong result with mysqli adapter

Description

The following code gives a wrong result using mysqli adapter, but works fine with pdo_mysql: Expected result is: string '2009111900005' (pdo_mysql) Given result is: double 2009111900000 (mysqli)

        /* SQL:
         * create table test (order_id char(13) charset ascii) engine=InnoDB;
         * insert into test values ('2009111900004');
         */
        $db = Zend_Registry::get('Zend_Db');

        // a workaround is:
        //          ->from('test', 'CONVERT(MAX(order_id) + 1, CHAR)')
        $query = $db->select()
                    ->from('test', 'MAX(order_id) + 1')
                    ->where('order_id LIKE ?', '20091119%');

        $order_id = $db->fetchOne($query);
        var_export($order_id);

Comments

Bulk change of all issues last updated before 1st January 2010 as "Won't Fix".

Feel free to re-open and provide a patch if you want to fix this issue.