Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Applying a fix for #150.

  • Loading branch information...
commit 167d2f7668886c2c5bbb4de0339931f4ffd1f700 1 parent 977c5e4
@kadishmal kadishmal authored
Showing with 12 additions and 6 deletions.
  1. +12 −6 system/database/drivers/cubrid/cubrid_result.php
View
18 system/database/drivers/cubrid/cubrid_result.php
@@ -79,13 +79,19 @@ function field_data()
{
$retval = array();
- while ($field = cubrid_fetch_field($this->result_id))
+ while ($field = @cubrid_fetch_field($this->result_id))
{
- $F = new stdClass();
- $F->name = $field->name;
- $F->type = $field->type;
- $F->default = $field->def;
- $F->max_length = $field->max_length;
+ preg_match('/([a-zA-Z]+)(\((\d+)\))?/', $field->type, $matches);
+
+ $length = isset($matches[2]) ? (int)$matches[3] : false;
+
+ $F = new stdClass();
+ $F->name = $field->name;
+ $F->type = $matches[1];
+ $F->default = $field->def;
+ // if length is not specified like in case of TIMESTAMP
+ // fall back to what API returns.
+ $F->max_length = $length ? $length : $field->max_length;
$F->primary_key = $field->primary_key;
$retval[] = $F;
Please sign in to comment.
Something went wrong with that request. Please try again.