Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated the version number of CodeInginer since which CUBRID support …

…is available. Updated the field_data() function. Since 8.4.0.0004 cubbrid_fetch_field() now returns primary_key propery as well.
  • Loading branch information...
commit 4a1a7766c155c6f9dc8b51bdcd1b69c8feb99cc3 1 parent b1388db
Esen Sagynov kadishmal authored
Showing with 2 additions and 36 deletions.
  1. +2 −36 system/database/drivers/cubrid/cubrid_result.php
38 system/database/drivers/cubrid/cubrid_result.php
View
@@ -9,7 +9,7 @@
* @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
* @license http://codeigniter.com/user_guide/license.html
* @link http://codeigniter.com
- * @since Version 2.0.2
+ * @since Version 2.1
* @filesource
*/
@@ -88,41 +88,7 @@ function field_data()
$F->type = $field->type;
$F->default = $field->def;
$F->max_length = $field->max_length;
-
- // At this moment primary_key property is not returned when
- // cubrid_fetch_field is called. The following code will
- // provide a patch for it. primary_key property will be added
- // in the next release.
-
- // TODO: later version of CUBRID will provide primary_key
- // property.
- // When PK is defined in CUBRID, an index is automatically
- // created in the db_index system table in the form of
- // pk_tblname_fieldname. So the following will count how many
- // columns are there which satisfy this format.
- // The query will search for exact single columns, thus
- // compound PK is not supported.
- $res = cubrid_query($this->conn_id,
- "SELECT COUNT(*) FROM db_index WHERE class_name = '" . $field->table .
- "' AND is_primary_key = 'YES' AND index_name = 'pk_" .
- $field->table . "_" . $field->name . "'"
- );
-
- if ($res)
- {
- $row = cubrid_fetch_array($res, CUBRID_NUM);
- $F->primary_key = ($row[0] > 0 ? 1 : null);
- }
- else
- {
- $F->primary_key = null;
- }
-
- if (is_resource($res))
- {
- cubrid_close_request($res);
- $this->result_id = FALSE;
- }
+ $F->primary_key = $field->primary_key;
$retval[] = $F;
}
Please sign in to comment.
Something went wrong with that request. Please try again.