From c5e7a56a782a837f56c80cf8a69874086739f08c Mon Sep 17 00:00:00 2001 From: mosmartin Date: Fri, 15 Apr 2011 14:50:34 +0000 Subject: [PATCH] #19690852 Added calls to cubrid_close_request everywhere. git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8316 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- classes/db/DBCubrid3.class.php | 36 ++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/classes/db/DBCubrid3.class.php b/classes/db/DBCubrid3.class.php index 899eda76e..651877b6e 100644 --- a/classes/db/DBCubrid3.class.php +++ b/classes/db/DBCubrid3.class.php @@ -91,7 +91,7 @@ function _connect() { // ignore if db information not exists - if (!$this->hostname || !$this->userid || !$this->password || !$this->database || !$this->port) return; + if (!$this->hostname || !$this->userid || !$this->password || !$this->database || !$this->port) return; // attempts to connect $this->fd = @cubrid_connect ($this->hostname, $this->port, $this->database, $this->userid, $this->password); @@ -284,7 +284,8 @@ // create sequence $query = sprintf('create serial "%ssequence" start with %s increment by 1 minvalue 1 maxvalue 10000000000000000000000000000000000000 nocycle;', $this->prefix, $start); - $this->_query($query); + $result = $this->_query($query); + if ($result) cubrid_close_request($result); } $_GLOBALS['XE_EXISTS_SEQUENCE'] = true; @@ -348,7 +349,8 @@ if ($notnull) $query .= "not null "; - $this->_query ($query); + $result = $this->_query($query); + if ($result) cubrid_close_request($result); } /** @@ -358,7 +360,8 @@ { $query = sprintf ("alter class \"%s%s\" drop \"%s\" ", $this->prefix, $table_name, $column_name); - $this->_query ($query); + $result = $this->_query($query); + if($result) cubrid_close_request($result); } /** @@ -390,7 +393,8 @@ $query = sprintf ("create %s index \"%s\" on \"%s%s\" (%s);", $is_unique?'unique':'', $this->prefix .$index_name, $this->prefix, $table_name, '"'.implode('","',$target_columns).'"'); - $this->_query ($query); + $result = $this->_query($query); + if($result) cubrid_close_request($result); } /** @@ -400,7 +404,8 @@ { $query = sprintf ("drop %s index \"%s\" on \"%s%s\"", $is_unique?'unique':'', $this->prefix .$index_name, $this->prefix, $table_name); - $this->_query($query); + $result = $this->_query($query); + if($result) cubrid_close_request($result); } /** @@ -463,14 +468,17 @@ ' minvalue 1 '. 'maxvalue 10000000000000000000000000000000000000'. ' nocycle;', $this->prefix.$table_name); - return $this->_query($query); + $result = $this->_query($query); + if($result) cubrid_close_request($result); + return; } $table_name = $this->prefix.$table_name; $query = sprintf ('create class "%s";', $table_name); - $this->_query ($query); + $result = $this->_query($query); + if($result) cubrid_close_request($result); if (!is_array ($xml_obj->table->column)) { $columns[] = $xml_obj->table->column; @@ -529,24 +537,28 @@ } $query .= implode (',', $column_schema).';'; - $this->_query ($query); + $result = $this->_query($query); + if($result) cubrid_close_request($result); if (count ($primary_list)) { $query = sprintf ("alter class \"%s\" add attribute constraint ". "\"pkey_%s\" PRIMARY KEY(%s);", $table_name, $table_name, '"'.implode('","',$primary_list).'"'); - $this->_query ($query); + $result = $this->_query($query); + if($result) cubrid_close_request($result); } if (count ($unique_list)) { foreach ($unique_list as $key => $val) { $query = sprintf ("create unique index \"%s\" on \"%s\" ". "(%s);", $this->prefix .$key, $table_name, '"'.implode('","', $val).'"'); - $this->_query ($query); + $result = $this->_query($query); + if($result) cubrid_close_request($result); } } if (count ($index_list)) { foreach ($index_list as $key => $val) { $query = sprintf ("create index \"%s\" on \"%s\" (%s);", $this->prefix .$key, $table_name, '"'.implode('","',$val).'"'); - $this->_query ($query); + $result = $this->_query($query); + if($result) cubrid_close_request($result); } } }