ZF-2293: Zend_Db_Adapter_Pdo_Sqlite::describeTable() bugs


if you've a varchar(50) field in a table, describeTable() method will return that the field type is "varchar(50)" instead of "varchar" width length = 50

in the code i can see some "@todo" comments but this task is very simple to complete because you can simply copy the code of the mysql adapter


what about this issue?

Care to contribute a patch? :)

if you lool at the same function for pdo_mysql you'll find that with a 5 min cut/paste this bug will be fixed

Resolved for 1.5.0 RC1 with SVN r7686.

Resolved for 1.0.4 with SVN r7687.

hi and thank for the fix but this is only partial, cause it doesn't care about

'SCALE' => null, // @todo 'PRECISION' => null, // @todo 'UNSIGNED' => null, // @todo

ok reading the sqlite3 documentation it seems that it doesn't have unsigned data thus the "unsigned" index of the describetable could remain NULL

i created a patch to solve the problems above, it's been created agains r7686 do you think it could be added soon?

225,227c225 < list($length, $scale, $precision, $unsigned, $primary, $primaryPosition, $identity) < = array(null, null, null, null, false, null, false);


        list($length, $primary, $primaryPosition, $identity) = array(null, false, null, false);

231,234d228 < } else if (preg_match('/^decimal((\d+),(\d+))/i', $row[$type], $matches)) { < $row[$type] = 'DECIMAL'; < $precision = $matches[1]; < $scale = $matches[2]; 254,256c248,250 < 'SCALE' => $scale, < 'PRECISION' => $precision,

< 'UNSIGNED' => $unsigned,

            'SCALE'            => null, // @todo
            'PRECISION'        => null, // @todo
            'UNSIGNED'         => null, // @todo

attaching the patch as a file: diff Sqlite.php Sqlite.php.old

Reopening issue

Unfortunately, I cannot use your patch until you have signed a Contributor License Agreement, but I think I can figure it out independently. Once you've signed the CLA, you can work on just about anything you like! Please consider it. :)

i didn't know about the CLA, i'll do that but it you can take a look at the patch cause anyway it's really simple

Please check out SVN r7728, and let me know if this resolves the issue for you. Thanks! :)

ok thank you, seems to work fine! :-) i think you can close the bug

Excellent! I'll mark this as fixed for the next minor release until I merge the changes over to the release-1.0 branch, so they can be in the upcoming 1.0.4 release, too. :)

Fixed for 1.0.4 with SVN 7730.