Bug Report #2363

New function _parse_type in database/clasess/kohana/database.php doesn't return the right length for decimal data type.

Added by Nano Documet about 2 years ago. Updated about 2 years ago.

Status:Closed Start date:11/22/2009
Priority:Normal Due date:
Assignee:Chris Bandy % Done:

0%

Category:Modules:Database
Target version:v3.0.3
Resolution:fixed Points:

Description

The decimal data type (tested with mysql) has a comma on the length definition (ie. decimal(6,3)), thus this line should not return only integers.

$length = (int) substr($type, $open + 1, $close - 1 - $open);

I think removing the (int) part fixes the issue:

$length = substr($type, $open + 1, $close - 1 - $open);

This bug triggers an error when the function list_columns (decimal case) is called at orm/classes/kohana/database.mysql.php because the offset 1 does not exist (only integer part was returned, no comma was returned).

case 'decimal':
list($column['numeric_precision'], $column['numeric_scale']) = explode(',', $length); 

Thanks,

Nano.

Associated revisions

History

Updated by Woody Gilk about 2 years ago

  • Category set to Modules:Database
  • Status changed from New to Assigned
  • Assignee set to Chris Bandy
  • Target version set to v3.0.3

Updated by John Heathco about 2 years ago

  • Status changed from Assigned to Closed

Also available in: Atom PDF