Zend Framework

Zend_Db_Adapter_Pdo_Sqlite::describeTable() bugs

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 1.0.3
  • Fix Version/s: 1.0.4
  • Component/s: Zend_Db
  • Labels:
    None
  • Fix Version Priority:
    Must Have

Description

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

Activity

Hide
Fabrizio Balliano added a comment -

what about this issue?

Show
Fabrizio Balliano added a comment - what about this issue?
Hide
Darby Felton added a comment -

Care to contribute a patch?

Show
Darby Felton added a comment - Care to contribute a patch?
Hide
Fabrizio Balliano added a comment -

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

Show
Fabrizio Balliano added a comment - 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
Hide
Darby Felton added a comment -

Resolved for 1.5.0 RC1 with SVN r7686.

Show
Darby Felton added a comment - Resolved for 1.5.0 RC1 with SVN r7686.
Hide
Darby Felton added a comment -

Resolved for 1.0.4 with SVN r7687.

Show
Darby Felton added a comment - Resolved for 1.0.4 with SVN r7687.
Hide
Fabrizio Balliano added a comment -

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

Show
Fabrizio Balliano added a comment - 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
Hide
Fabrizio Balliano added a comment -

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

Show
Fabrizio Balliano added a comment - ok reading the sqlite3 documentation it seems that it doesn't have unsigned data thus the "unsigned" index of the describetable could remain NULL
Hide
Fabrizio Balliano added a comment -

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

Show
Fabrizio Balliano added a comment - 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
Hide
Fabrizio Balliano added a comment -

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

Show
Fabrizio Balliano added a comment - attaching the patch as a file: diff Sqlite.php Sqlite.php.old
Hide
Darby Felton added a comment -

Reopening issue

Show
Darby Felton added a comment - Reopening issue
Hide
Darby Felton added a comment -

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.

Show
Darby Felton added a comment - 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.
Hide
Fabrizio Balliano added a comment -

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

Show
Fabrizio Balliano added a comment - 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
Hide
Darby Felton added a comment -

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

Show
Darby Felton added a comment - Please check out SVN r7728, and let me know if this resolves the issue for you. Thanks!
Hide
Fabrizio Balliano added a comment -

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

Show
Fabrizio Balliano added a comment - ok thank you, seems to work fine! i think you can close the bug
Hide
Darby Felton added a comment -

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.

Show
Darby Felton added a comment - 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.
Hide
Darby Felton added a comment -

Fixed for 1.0.4 with SVN 7730.

Show
Darby Felton added a comment - Fixed for 1.0.4 with SVN 7730.

People

Vote (1)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: