Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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 authored February 10, 2012
38  system/database/drivers/cubrid/cubrid_result.php
@@ -9,7 +9,7 @@
9 9
  * @copyright	Copyright (c) 2008 - 2011, EllisLab, Inc.
10 10
  * @license		http://codeigniter.com/user_guide/license.html
11 11
  * @link		http://codeigniter.com
12  
- * @since		Version 2.0.2
  12
+ * @since		Version 2.1
13 13
  * @filesource
14 14
  */
15 15
 
@@ -88,41 +88,7 @@ function field_data()
88 88
 			$F->type		= $field->type;
89 89
 			$F->default		= $field->def;
90 90
 			$F->max_length	= $field->max_length;
91  
-
92  
-			// At this moment primary_key property is not returned when
93  
-			// cubrid_fetch_field is called. The following code will
94  
-			// provide a patch for it. primary_key property will be added
95  
-			// in the next release.
96  
-
97  
-			// TODO: later version of CUBRID will provide primary_key
98  
-			// property.
99  
-			// When PK is defined in CUBRID, an index is automatically
100  
-			// created in the db_index system table in the form of
101  
-			// pk_tblname_fieldname. So the following will count how many
102  
-			// columns are there which satisfy this format.
103  
-			// The query will search for exact single columns, thus
104  
-			// compound PK is not supported.
105  
-			$res = cubrid_query($this->conn_id,
106  
-				"SELECT COUNT(*) FROM db_index WHERE class_name = '" . $field->table .
107  
-				"' AND is_primary_key = 'YES' AND index_name = 'pk_" .
108  
-				$field->table . "_" . $field->name . "'"
109  
-			);
110  
-
111  
-			if ($res)
112  
-			{
113  
-				$row = cubrid_fetch_array($res, CUBRID_NUM);
114  
-				$F->primary_key = ($row[0] > 0 ? 1 : null);
115  
-			}
116  
-			else
117  
-			{
118  
-				$F->primary_key = null;
119  
-			}
120  
-
121  
-			if (is_resource($res))
122  
-			{
123  
-				cubrid_close_request($res);
124  
-				$this->result_id = FALSE;
125  
-			}
  91
+            $F->primary_key = $field->primary_key;
126 92
 
127 93
 			$retval[] = $F;
128 94
 		}

0 notes on commit 4a1a776

Please sign in to comment.
Something went wrong with that request. Please try again.