Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 1 | <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 2 | /** |
| 3 | * CodeIgniter |
| 4 | * |
| 5 | * An open source application development framework for PHP 5.1.6 or newer |
| 6 | * |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 7 | * NOTICE OF LICENSE |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 8 | * |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 9 | * Licensed under the Open Software License version 3.0 |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 10 | * |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 11 | * This source file is subject to the Open Software License (OSL 3.0) that is |
| 12 | * bundled with this package in the files license.txt / license.rst. It is |
| 13 | * also available through the world wide web at this URL: |
| 14 | * http://opensource.org/licenses/OSL-3.0 |
| 15 | * If you did not receive a copy of the license and are unable to obtain it |
| 16 | * through the world wide web, please send an email to |
| 17 | * licensing@ellislab.com so we can send you a copy immediately. |
| 18 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 19 | * @package CodeIgniter |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 20 | * @author EllisLab Dev Team |
Greg Aker | 0defe5d | 2012-01-01 18:46:41 -0600 | [diff] [blame] | 21 | * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/) |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 22 | * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 23 | * @link http://codeigniter.com |
| 24 | * @since Version 2.0.2 |
| 25 | * @filesource |
| 26 | */ |
| 27 | |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 28 | /** |
| 29 | * CUBRID Database Adapter Class |
| 30 | * |
| 31 | * Note: _DB is an extender class that the app controller |
| 32 | * creates dynamically based on whether the active record |
| 33 | * class is being used or not. |
| 34 | * |
| 35 | * @package CodeIgniter |
| 36 | * @subpackage Drivers |
| 37 | * @category Database |
Esen Sagynov | 2ab2b1e | 2011-08-11 00:41:16 -0700 | [diff] [blame] | 38 | * @author Esen Sagynov |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 39 | * @link http://codeigniter.com/user_guide/database/ |
| 40 | */ |
Esen Sagynov | 2ab2b1e | 2011-08-11 00:41:16 -0700 | [diff] [blame] | 41 | class CI_DB_cubrid_driver extends CI_DB { |
| 42 | |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 43 | public $dbdriver = 'cubrid'; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 44 | |
| 45 | // The character used for escaping - no need in CUBRID |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 46 | protected $_escape_char = ''; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 47 | |
| 48 | // clause and character used for LIKE escape sequences - not used in CUBRID |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 49 | protected $_like_escape_str = ''; |
| 50 | protected $_like_escape_chr = ''; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 51 | |
| 52 | /** |
| 53 | * The syntax to count rows is slightly different across different |
| 54 | * database engines, so this string appears in each driver and is |
| 55 | * used for the count_all() and count_all_results() functions. |
| 56 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 57 | protected $_count_string = 'SELECT COUNT(*) AS '; |
| 58 | protected $_random_keyword = ' RAND()'; // database specific random keyword |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 59 | |
Andrey Andreev | ca7e5f1 | 2012-01-26 17:58:28 +0200 | [diff] [blame^] | 60 | public function __construct($params) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 61 | { |
Andrey Andreev | ca7e5f1 | 2012-01-26 17:58:28 +0200 | [diff] [blame^] | 62 | parent::__construct($params); |
| 63 | |
Esen Sagynov | 2ab2b1e | 2011-08-11 00:41:16 -0700 | [diff] [blame] | 64 | // If no port is defined by the user, use the default value |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 65 | if ($this->port == '') |
| 66 | { |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 67 | // Default CUBRID broker port |
| 68 | $this->port = 33000; |
Esen Sagynov | 2ab2b1e | 2011-08-11 00:41:16 -0700 | [diff] [blame] | 69 | } |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 70 | } |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 71 | |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 72 | /** |
| 73 | * Non-persistent database connection |
| 74 | * |
| 75 | * @return resource |
| 76 | */ |
| 77 | public function db_connect() |
| 78 | { |
Esen Sagynov | 2ab2b1e | 2011-08-11 00:41:16 -0700 | [diff] [blame] | 79 | $conn = cubrid_connect($this->hostname, $this->port, $this->database, $this->username, $this->password); |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 80 | |
Esen Sagynov | 2ab2b1e | 2011-08-11 00:41:16 -0700 | [diff] [blame] | 81 | if ($conn) |
| 82 | { |
| 83 | // Check if a user wants to run queries in dry, i.e. run the |
| 84 | // queries but not commit them. |
| 85 | if (isset($this->auto_commit) && ! $this->auto_commit) |
| 86 | { |
| 87 | cubrid_set_autocommit($conn, CUBRID_AUTOCOMMIT_FALSE); |
| 88 | } |
| 89 | else |
| 90 | { |
| 91 | cubrid_set_autocommit($conn, CUBRID_AUTOCOMMIT_TRUE); |
| 92 | $this->auto_commit = TRUE; |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | return $conn; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 97 | } |
| 98 | |
| 99 | // -------------------------------------------------------------------- |
| 100 | |
| 101 | /** |
| 102 | * Persistent database connection |
| 103 | * In CUBRID persistent DB connection is supported natively in CUBRID |
| 104 | * engine which can be configured in the CUBRID Broker configuration |
| 105 | * file by setting the CCI_PCONNECT parameter to ON. In that case, all |
| 106 | * connections established between the client application and the |
| 107 | * server will become persistent. This is calling the same |
| 108 | * @cubrid_connect function will establish persisten connection |
| 109 | * considering that the CCI_PCONNECT is ON. |
| 110 | * |
| 111 | * @access private called by the base class |
| 112 | * @return resource |
| 113 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 114 | public function db_pconnect() |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 115 | { |
| 116 | return $this->db_connect(); |
| 117 | } |
| 118 | |
| 119 | // -------------------------------------------------------------------- |
| 120 | |
| 121 | /** |
| 122 | * Reconnect |
| 123 | * |
| 124 | * Keep / reestablish the db connection if no queries have been |
| 125 | * sent for a length of time exceeding the server's idle timeout |
| 126 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 127 | * @return void |
| 128 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 129 | public function reconnect() |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 130 | { |
| 131 | if (cubrid_ping($this->conn_id) === FALSE) |
| 132 | { |
| 133 | $this->conn_id = FALSE; |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | // -------------------------------------------------------------------- |
| 138 | |
| 139 | /** |
| 140 | * Select the database |
| 141 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 142 | * @return resource |
| 143 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 144 | public function db_select() |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 145 | { |
| 146 | // In CUBRID there is no need to select a database as the database |
| 147 | // is chosen at the connection time. |
| 148 | // So, to determine if the database is "selected", all we have to |
Esen Sagynov | 2ab2b1e | 2011-08-11 00:41:16 -0700 | [diff] [blame] | 149 | // do is ping the server and return that value. |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 150 | return cubrid_ping($this->conn_id); |
| 151 | } |
| 152 | |
| 153 | // -------------------------------------------------------------------- |
| 154 | |
| 155 | /** |
| 156 | * Set client character set |
| 157 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 158 | * @param string |
| 159 | * @param string |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 160 | * @return bool |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 161 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 162 | public function db_set_charset($charset, $collation) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 163 | { |
| 164 | // In CUBRID, there is no need to set charset or collation. |
| 165 | // This is why returning true will allow the application continue |
| 166 | // its normal process. |
| 167 | return TRUE; |
| 168 | } |
| 169 | |
| 170 | // -------------------------------------------------------------------- |
Esen Sagynov | 2ab2b1e | 2011-08-11 00:41:16 -0700 | [diff] [blame] | 171 | |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 172 | /** |
| 173 | * Version number query string |
| 174 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 175 | * @return string |
| 176 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 177 | protected function _version() |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 178 | { |
| 179 | return cubrid_get_server_info($this->conn_id); |
| 180 | } |
| 181 | |
| 182 | // -------------------------------------------------------------------- |
| 183 | |
| 184 | /** |
| 185 | * Execute the query |
| 186 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 187 | * @param string an SQL query |
| 188 | * @return resource |
| 189 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 190 | protected function _execute($sql) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 191 | { |
| 192 | $sql = $this->_prep_query($sql); |
| 193 | return @cubrid_query($sql, $this->conn_id); |
| 194 | } |
| 195 | |
| 196 | // -------------------------------------------------------------------- |
| 197 | |
| 198 | /** |
| 199 | * Prep the query |
| 200 | * |
| 201 | * If needed, each database adapter can prep the query string |
| 202 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 203 | * @param string an SQL query |
| 204 | * @return string |
| 205 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 206 | protected function _prep_query($sql) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 207 | { |
Esen Sagynov | 2ab2b1e | 2011-08-11 00:41:16 -0700 | [diff] [blame] | 208 | // No need to prepare |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 209 | return $sql; |
| 210 | } |
| 211 | |
| 212 | // -------------------------------------------------------------------- |
| 213 | |
| 214 | /** |
| 215 | * Begin Transaction |
| 216 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 217 | * @return bool |
| 218 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 219 | public function trans_begin($test_mode = FALSE) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 220 | { |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 221 | // When transactions are nested we only begin/commit/rollback the outermost ones |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 222 | if ( ! $this->trans_enabled OR $this->_trans_depth > 0) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 223 | { |
| 224 | return TRUE; |
| 225 | } |
| 226 | |
| 227 | // Reset the transaction failure flag. |
| 228 | // If the $test_mode flag is set to TRUE transactions will be rolled back |
| 229 | // even if the queries produce a successful result. |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 230 | $this->_trans_failure = ($test_mode === TRUE); |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 231 | |
Esen Sagynov | 2ab2b1e | 2011-08-11 00:41:16 -0700 | [diff] [blame] | 232 | if (cubrid_get_autocommit($this->conn_id)) |
| 233 | { |
| 234 | cubrid_set_autocommit($this->conn_id, CUBRID_AUTOCOMMIT_FALSE); |
| 235 | } |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 236 | |
| 237 | return TRUE; |
| 238 | } |
| 239 | |
| 240 | // -------------------------------------------------------------------- |
| 241 | |
| 242 | /** |
| 243 | * Commit Transaction |
| 244 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 245 | * @return bool |
| 246 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 247 | public function trans_commit() |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 248 | { |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 249 | // When transactions are nested we only begin/commit/rollback the outermost ones |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 250 | if ( ! $this->trans_enabled OR $this->_trans_depth > 0) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 251 | { |
| 252 | return TRUE; |
| 253 | } |
| 254 | |
| 255 | cubrid_commit($this->conn_id); |
| 256 | |
Esen Sagynov | 2ab2b1e | 2011-08-11 00:41:16 -0700 | [diff] [blame] | 257 | if ($this->auto_commit && ! cubrid_get_autocommit($this->conn_id)) |
| 258 | { |
| 259 | cubrid_set_autocommit($this->conn_id, CUBRID_AUTOCOMMIT_TRUE); |
| 260 | } |
| 261 | |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 262 | return TRUE; |
| 263 | } |
| 264 | |
| 265 | // -------------------------------------------------------------------- |
| 266 | |
| 267 | /** |
| 268 | * Rollback Transaction |
| 269 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 270 | * @return bool |
| 271 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 272 | public function trans_rollback() |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 273 | { |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 274 | // When transactions are nested we only begin/commit/rollback the outermost ones |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 275 | if ( ! $this->trans_enabled OR $this->_trans_depth > 0) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 276 | { |
| 277 | return TRUE; |
| 278 | } |
| 279 | |
| 280 | cubrid_rollback($this->conn_id); |
| 281 | |
Esen Sagynov | 2ab2b1e | 2011-08-11 00:41:16 -0700 | [diff] [blame] | 282 | if ($this->auto_commit && ! cubrid_get_autocommit($this->conn_id)) |
| 283 | { |
| 284 | cubrid_set_autocommit($this->conn_id, CUBRID_AUTOCOMMIT_TRUE); |
| 285 | } |
| 286 | |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 287 | return TRUE; |
| 288 | } |
| 289 | |
| 290 | // -------------------------------------------------------------------- |
| 291 | |
| 292 | /** |
| 293 | * Escape String |
| 294 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 295 | * @param string |
| 296 | * @param bool whether or not the string will be used in a LIKE condition |
| 297 | * @return string |
| 298 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 299 | public function escape_str($str, $like = FALSE) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 300 | { |
| 301 | if (is_array($str)) |
| 302 | { |
| 303 | foreach ($str as $key => $val) |
Esen Sagynov | 2ab2b1e | 2011-08-11 00:41:16 -0700 | [diff] [blame] | 304 | { |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 305 | $str[$key] = $this->escape_str($val, $like); |
Esen Sagynov | 2ab2b1e | 2011-08-11 00:41:16 -0700 | [diff] [blame] | 306 | } |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 307 | |
Esen Sagynov | 2ab2b1e | 2011-08-11 00:41:16 -0700 | [diff] [blame] | 308 | return $str; |
| 309 | } |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 310 | |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 311 | if (function_exists('cubrid_real_escape_string') && is_resource($this->conn_id)) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 312 | { |
| 313 | $str = cubrid_real_escape_string($str, $this->conn_id); |
| 314 | } |
| 315 | else |
| 316 | { |
| 317 | $str = addslashes($str); |
| 318 | } |
| 319 | |
| 320 | // escape LIKE condition wildcards |
| 321 | if ($like === TRUE) |
| 322 | { |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 323 | return str_replace(array('%', '_'), array('\\%', '\\_'), $str); |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 324 | } |
| 325 | |
| 326 | return $str; |
| 327 | } |
| 328 | |
| 329 | // -------------------------------------------------------------------- |
| 330 | |
| 331 | /** |
| 332 | * Affected Rows |
| 333 | * |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 334 | * @return int |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 335 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 336 | public function affected_rows() |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 337 | { |
| 338 | return @cubrid_affected_rows($this->conn_id); |
| 339 | } |
| 340 | |
| 341 | // -------------------------------------------------------------------- |
| 342 | |
| 343 | /** |
| 344 | * Insert ID |
| 345 | * |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 346 | * @return int |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 347 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 348 | public function insert_id() |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 349 | { |
| 350 | return @cubrid_insert_id($this->conn_id); |
| 351 | } |
| 352 | |
| 353 | // -------------------------------------------------------------------- |
| 354 | |
| 355 | /** |
| 356 | * "Count All" query |
| 357 | * |
| 358 | * Generates a platform-specific query string that counts all records in |
| 359 | * the specified table |
| 360 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 361 | * @param string |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 362 | * @return int |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 363 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 364 | public function count_all($table = '') |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 365 | { |
| 366 | if ($table == '') |
| 367 | { |
| 368 | return 0; |
| 369 | } |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 370 | $query = $this->query($this->_count_string.$this->_protect_identifiers('numrows').' FROM '.$this->_protect_identifiers($table, TRUE, NULL, FALSE)); |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 371 | if ($query->num_rows() == 0) |
| 372 | { |
| 373 | return 0; |
| 374 | } |
| 375 | |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 376 | $query = $query->row(); |
Greg Aker | 90248ab | 2011-08-20 14:23:14 -0500 | [diff] [blame] | 377 | $this->_reset_select(); |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 378 | return (int) $query->numrows; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 379 | } |
| 380 | |
| 381 | // -------------------------------------------------------------------- |
| 382 | |
| 383 | /** |
| 384 | * List table query |
| 385 | * |
| 386 | * Generates a platform-specific query string so that the table names can be fetched |
| 387 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 388 | * @param boolean |
| 389 | * @return string |
| 390 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 391 | protected function _list_tables($prefix_limit = FALSE) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 392 | { |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 393 | $sql = 'SHOW TABLES'; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 394 | |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 395 | if ($prefix_limit !== FALSE && $this->dbprefix != '') |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 396 | { |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 397 | return $sql." LIKE '".$this->escape_like_str($this->dbprefix)."%'"; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 398 | } |
| 399 | |
| 400 | return $sql; |
| 401 | } |
| 402 | |
| 403 | // -------------------------------------------------------------------- |
| 404 | |
| 405 | /** |
| 406 | * Show column query |
| 407 | * |
| 408 | * Generates a platform-specific query string so that the column names can be fetched |
| 409 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 410 | * @param string the table name |
| 411 | * @return string |
| 412 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 413 | protected function _list_columns($table = '') |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 414 | { |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 415 | return 'SHOW COLUMNS FROM '.$this->_protect_identifiers($table, TRUE, NULL, FALSE); |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 416 | } |
| 417 | |
| 418 | // -------------------------------------------------------------------- |
| 419 | |
| 420 | /** |
| 421 | * Field data query |
| 422 | * |
| 423 | * Generates a platform-specific query so that the column data can be retrieved |
| 424 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 425 | * @param string the table name |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 426 | * @return string |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 427 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 428 | protected function _field_data($table) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 429 | { |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 430 | return 'SELECT * FROM '.$table.' LIMIT 1'; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 431 | } |
| 432 | |
| 433 | // -------------------------------------------------------------------- |
| 434 | |
| 435 | /** |
| 436 | * The error message string |
| 437 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 438 | * @return string |
| 439 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 440 | protected function _error_message() |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 441 | { |
| 442 | return cubrid_error($this->conn_id); |
| 443 | } |
| 444 | |
| 445 | // -------------------------------------------------------------------- |
| 446 | |
| 447 | /** |
| 448 | * The error message number |
| 449 | * |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 450 | * @return int |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 451 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 452 | protected function _error_number() |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 453 | { |
| 454 | return cubrid_errno($this->conn_id); |
| 455 | } |
| 456 | |
| 457 | // -------------------------------------------------------------------- |
| 458 | |
| 459 | /** |
| 460 | * Escape the SQL Identifiers |
| 461 | * |
| 462 | * This function escapes column and table names |
| 463 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 464 | * @param string |
| 465 | * @return string |
| 466 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 467 | public function _escape_identifiers($item) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 468 | { |
| 469 | if ($this->_escape_char == '') |
| 470 | { |
| 471 | return $item; |
| 472 | } |
| 473 | |
| 474 | foreach ($this->_reserved_identifiers as $id) |
| 475 | { |
| 476 | if (strpos($item, '.'.$id) !== FALSE) |
| 477 | { |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 478 | $item = str_replace('.', $this->_escape_char.'.', $item); |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 479 | |
| 480 | // remove duplicates if the user already included the escape |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 481 | return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $this->_escape_char.$item); |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 482 | } |
| 483 | } |
| 484 | |
| 485 | if (strpos($item, '.') !== FALSE) |
| 486 | { |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 487 | $item = str_replace('.', $this->_escape_char.'.'.$this->_escape_char, $item); |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 488 | } |
| 489 | |
| 490 | // remove duplicates if the user already included the escape |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 491 | return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $this->_escape_char.$item.$this->_escape_char); |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 492 | } |
| 493 | |
| 494 | // -------------------------------------------------------------------- |
| 495 | |
| 496 | /** |
| 497 | * From Tables |
| 498 | * |
| 499 | * This function implicitly groups FROM tables so there is no confusion |
| 500 | * about operator precedence in harmony with SQL standards |
| 501 | * |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 502 | * @param string the table name |
| 503 | * @return string |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 504 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 505 | protected function _from_tables($tables) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 506 | { |
| 507 | if ( ! is_array($tables)) |
| 508 | { |
| 509 | $tables = array($tables); |
| 510 | } |
| 511 | |
| 512 | return '('.implode(', ', $tables).')'; |
| 513 | } |
| 514 | |
| 515 | // -------------------------------------------------------------------- |
| 516 | |
| 517 | /** |
| 518 | * Insert statement |
| 519 | * |
| 520 | * Generates a platform-specific insert string from the supplied data |
| 521 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 522 | * @param string the table name |
| 523 | * @param array the insert keys |
| 524 | * @param array the insert values |
| 525 | * @return string |
| 526 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 527 | protected function _insert($table, $keys, $values) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 528 | { |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 529 | return 'INSERT INTO '.$table.' ("'.implode('", "', $keys).'") VALUES ('.implode(', ', $values).')'; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 530 | } |
| 531 | |
| 532 | // -------------------------------------------------------------------- |
| 533 | |
| 534 | |
| 535 | /** |
| 536 | * Replace statement |
| 537 | * |
| 538 | * Generates a platform-specific replace string from the supplied data |
| 539 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 540 | * @param string the table name |
| 541 | * @param array the insert keys |
| 542 | * @param array the insert values |
| 543 | * @return string |
| 544 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 545 | protected function _replace($table, $keys, $values) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 546 | { |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 547 | return 'REPLACE INTO '.$table.' ("'.implode('", "', $keys).'") VALUES ('.implode(', ', $values).')'; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 548 | } |
| 549 | |
| 550 | // -------------------------------------------------------------------- |
| 551 | |
| 552 | /** |
| 553 | * Insert_batch statement |
| 554 | * |
| 555 | * Generates a platform-specific insert string from the supplied data |
| 556 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 557 | * @param string the table name |
| 558 | * @param array the insert keys |
| 559 | * @param array the insert values |
| 560 | * @return string |
| 561 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 562 | protected function _insert_batch($table, $keys, $values) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 563 | { |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 564 | return 'INSERT INTO '.$table.' ("'.implode('", "', $keys).'") VALUES '.implode(', ', $values); |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 565 | } |
| 566 | |
| 567 | // -------------------------------------------------------------------- |
| 568 | |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 569 | /** |
| 570 | * Update statement |
| 571 | * |
| 572 | * Generates a platform-specific update string from the supplied data |
| 573 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 574 | * @param string the table name |
| 575 | * @param array the update data |
| 576 | * @param array the where clause |
| 577 | * @param array the orderby clause |
| 578 | * @param array the limit clause |
| 579 | * @return string |
| 580 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 581 | protected function _update($table, $values, $where, $orderby = array(), $limit = FALSE) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 582 | { |
| 583 | foreach ($values as $key => $val) |
| 584 | { |
Esen Sagynov | ee3e594 | 2011-08-10 03:22:58 -0700 | [diff] [blame] | 585 | $valstr[] = sprintf('"%s" = %s', $key, $val); |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 586 | } |
| 587 | |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 588 | return 'UPDATE '.$table.' SET '.implode(', ', $valstr) |
| 589 | .(($where != '' && count($where) > 0) ? ' WHERE '.implode(' ', $where) : '') |
| 590 | .(count($orderby) > 0 ? ' ORDER BY '.implode(', ', $orderby) : '') |
| 591 | .( ! $limit ? '' : ' LIMIT '.$limit); |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 592 | } |
| 593 | |
| 594 | // -------------------------------------------------------------------- |
| 595 | |
| 596 | |
| 597 | /** |
| 598 | * Update_Batch statement |
| 599 | * |
| 600 | * Generates a platform-specific batch update string from the supplied data |
| 601 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 602 | * @param string the table name |
| 603 | * @param array the update data |
| 604 | * @param array the where clause |
| 605 | * @return string |
| 606 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 607 | protected function _update_batch($table, $values, $index, $where = NULL) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 608 | { |
| 609 | $ids = array(); |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 610 | $where = ($where != '' && count($where) > 0) ? implode(' ', $where).' AND ' : ''; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 611 | |
| 612 | foreach ($values as $key => $val) |
| 613 | { |
| 614 | $ids[] = $val[$index]; |
| 615 | |
| 616 | foreach (array_keys($val) as $field) |
| 617 | { |
| 618 | if ($field != $index) |
| 619 | { |
Esen Sagynov | 2ab2b1e | 2011-08-11 00:41:16 -0700 | [diff] [blame] | 620 | $final[$field][] = 'WHEN '.$index.' = '.$val[$index].' THEN '.$val[$field]; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 621 | } |
| 622 | } |
| 623 | } |
| 624 | |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 625 | $sql = 'UPDATE '.$table.' SET '; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 626 | $cases = ''; |
| 627 | |
| 628 | foreach ($final as $k => $v) |
| 629 | { |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 630 | $cases .= $k." = CASE \n" |
| 631 | .implode("\n", $v) |
| 632 | .'ELSE '.$k.' END, '; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 633 | } |
| 634 | |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 635 | return $sql.substr($cases, 0, -2) |
| 636 | .' WHERE '.(($where != '' && count($where) > 0) ? implode(' ', $where).' AND ' : '') |
| 637 | .$index.' IN ('.implode(',', $ids).')'; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 638 | } |
| 639 | |
| 640 | // -------------------------------------------------------------------- |
| 641 | |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 642 | /** |
| 643 | * Truncate statement |
| 644 | * |
| 645 | * Generates a platform-specific truncate string from the supplied data |
| 646 | * If the database does not support the truncate() command |
| 647 | * This function maps to "DELETE FROM table" |
| 648 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 649 | * @param string the table name |
| 650 | * @return string |
| 651 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 652 | protected function _truncate($table) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 653 | { |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 654 | return 'TRUNCATE '.$table; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 655 | } |
| 656 | |
| 657 | // -------------------------------------------------------------------- |
| 658 | |
| 659 | /** |
| 660 | * Delete statement |
| 661 | * |
| 662 | * Generates a platform-specific delete string from the supplied data |
| 663 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 664 | * @param string the table name |
| 665 | * @param array the where clause |
| 666 | * @param string the limit clause |
| 667 | * @return string |
| 668 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 669 | protected function _delete($table, $where = array(), $like = array(), $limit = FALSE) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 670 | { |
| 671 | $conditions = ''; |
| 672 | |
| 673 | if (count($where) > 0 OR count($like) > 0) |
| 674 | { |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 675 | $conditions = "\nWHERE ".implode("\n", $this->ar_where); |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 676 | |
| 677 | if (count($where) > 0 && count($like) > 0) |
| 678 | { |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 679 | $conditions .= ' AND '; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 680 | } |
| 681 | $conditions .= implode("\n", $like); |
| 682 | } |
| 683 | |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 684 | return 'DELETE FROM '.$table.$conditions.( ! $limit ? '' : ' LIMIT '.$limit); |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 685 | } |
| 686 | |
| 687 | // -------------------------------------------------------------------- |
| 688 | |
| 689 | /** |
| 690 | * Limit string |
| 691 | * |
| 692 | * Generates a platform-specific LIMIT clause |
| 693 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 694 | * @param string the sql query string |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 695 | * @param int the number of rows to limit the query to |
| 696 | * @param int the offset value |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 697 | * @return string |
| 698 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 699 | protected function _limit($sql, $limit, $offset) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 700 | { |
Andrey Andreev | c6953f4 | 2012-01-26 14:43:16 +0200 | [diff] [blame] | 701 | return $sql.'LIMIT '.($offset == 0 ? '' : $offset.', ').$limit; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 702 | } |
| 703 | |
| 704 | // -------------------------------------------------------------------- |
| 705 | |
| 706 | /** |
| 707 | * Close DB Connection |
| 708 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 709 | * @param resource |
| 710 | * @return void |
| 711 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 712 | protected function _close($conn_id) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 713 | { |
| 714 | @cubrid_close($conn_id); |
| 715 | } |
| 716 | |
| 717 | } |
| 718 | |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 719 | /* End of file cubrid_driver.php */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame] | 720 | /* Location: ./system/database/drivers/cubrid/cubrid_driver.php */ |