I just released a new minor version of PEAR::MDB2.
Now DECIMAL and NUMERIC data types are first-class citizens just like the others: you can specify (and retrieve) both the precision and the scale values on a per-field basis, so you don't have to resort to the 'decimal_places' option which is global to all the fields.
A similar fix is included in MDB2_Schema already, so you can use something like this in your XML schema definition:
<field> <name>revenue</name> <type>decimal</type> <length>10,4</length> <notnull>false</notnull> </field>
The MDB2 v.2.4.1 release also features a number of important fixes (including a patch for a regression bug in MySQL and MySQLi transaction support, and a patch for a memory leak in the prepare/execute statements), so I warmly recommend you to upgrade.
Thanks to a nice feature of the PEAR installer, since MDB2 v.2.4.0 you can install/upgrade the drivers in this simple way:
$ pear install MDB2#mysql $ pear upgrade MDB2#pgsql
How nice is that?
As usual, many thanks to all the contributors and bug reporters.
Have fun!
Lorenzo
Leave a reply