ZF-2293: Zend_Db_Adapter_Pdo_Sqlite::describeTable() bugs

Issue Type: Bug Created: 2007-12-11T12:20:12.000+0000 Last Updated: 2008-02-26T12:55:58.000+0000 Status: Resolved Fix version(s): - 1.0.4 (26/Feb/08)

Reporter: Fabrizio Balliano (balliano) Assignee: Darby Felton (darby) Tags: - Zend_Db

Related issues: Attachments: - sqlite.diff


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


Posted by Fabrizio Balliano (balliano) on 2007-12-28T02:53:16.000+0000

what about this issue?

Posted by Darby Felton (darby) on 2008-01-10T10:24:02.000+0000

Care to contribute a patch? :)

Posted by Fabrizio Balliano (balliano) on 2008-01-10T10:34:26.000+0000

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

Posted by Darby Felton (darby) on 2008-01-29T14:22:42.000+0000

Resolved for 1.5.0 RC1 with SVN r7686.

Posted by Darby Felton (darby) on 2008-01-29T14:25:15.000+0000

Resolved for 1.0.4 with SVN r7687.

Posted by Fabrizio Balliano (balliano) on 2008-01-30T02:19:33.000+0000

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

Posted by Fabrizio Balliano (balliano) on 2008-01-30T02:23:09.000+0000

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

Posted by Fabrizio Balliano (balliano) on 2008-01-30T02:38:43.000+0000

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

Posted by Fabrizio Balliano (balliano) on 2008-01-30T02:40:03.000+0000

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

Posted by Darby Felton (darby) on 2008-01-30T07:34:23.000+0000

Reopening issue

Posted by Darby Felton (darby) on 2008-01-31T08:49:29.000+0000

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. :)

Posted by Fabrizio Balliano (balliano) on 2008-01-31T08:51:14.000+0000

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

Posted by Darby Felton (darby) on 2008-01-31T08:58:37.000+0000

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

Posted by Fabrizio Balliano (balliano) on 2008-01-31T09:07:48.000+0000

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

Posted by Darby Felton (darby) on 2008-01-31T09:11:10.000+0000

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. :)

Posted by Darby Felton (darby) on 2008-01-31T09:43:07.000+0000

Fixed for 1.0.4 with SVN 7730.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.