summaryrefslogtreecommitdiffstats
path: root/system/database/drivers
diff options
context:
space:
mode:
authorEsen Sagynov <kadishmal@gmail.com>2011-08-10 12:22:58 +0200
committerEsen Sagynov <kadishmal@gmail.com>2011-08-10 12:22:58 +0200
commitee3e594893d28ca6370d24d2a4406c1897959175 (patch)
tree2bd315780665c274734222d07613a950e947688a /system/database/drivers
parent2e08794d5de57d727abb2abe752a4479b3ec0242 (diff)
Added field name wrappers (") in insert/update/replace/_process_fields/_create_table functions to avoid reserved word conflicts.
Diffstat (limited to 'system/database/drivers')
-rw-r--r--system/database/drivers/cubrid/cubrid_driver.php8
-rw-r--r--system/database/drivers/cubrid/cubrid_forge.php4
2 files changed, 6 insertions, 6 deletions
diff --git a/system/database/drivers/cubrid/cubrid_driver.php b/system/database/drivers/cubrid/cubrid_driver.php
index ef0b5b451..9b5d86aa6 100644
--- a/system/database/drivers/cubrid/cubrid_driver.php
+++ b/system/database/drivers/cubrid/cubrid_driver.php
@@ -545,7 +545,7 @@ class CI_DB_cubrid_driver extends CI_DB
*/
function _insert($table, $keys, $values)
{
- return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")";
+ return "INSERT INTO ".$table." (\"".implode('\", \"', $keys)."\") VALUES (".implode(', ', $values).")";
}
// --------------------------------------------------------------------
@@ -564,7 +564,7 @@ class CI_DB_cubrid_driver extends CI_DB
*/
function _replace($table, $keys, $values)
{
- return "REPLACE INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")";
+ return "REPLACE INTO ".$table." (\"".implode('", "', $keys)."\") VALUES (".implode(', ', $values).")";
}
// --------------------------------------------------------------------
@@ -582,7 +582,7 @@ class CI_DB_cubrid_driver extends CI_DB
*/
function _insert_batch($table, $keys, $values)
{
- return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES ".implode(', ', $values);
+ return "INSERT INTO ".$table." (\"".implode('", "', $keys)."\") VALUES ".implode(', ', $values);
}
// --------------------------------------------------------------------
@@ -605,7 +605,7 @@ class CI_DB_cubrid_driver extends CI_DB
{
foreach ($values as $key => $val)
{
- $valstr[] = $key . ' = ' . $val;
+ $valstr[] = sprintf('"%s" = %s', $key, $val);
}
$limit = ( ! $limit) ? '' : ' LIMIT '.$limit;
diff --git a/system/database/drivers/cubrid/cubrid_forge.php b/system/database/drivers/cubrid/cubrid_forge.php
index c2c553f28..1de0db108 100644
--- a/system/database/drivers/cubrid/cubrid_forge.php
+++ b/system/database/drivers/cubrid/cubrid_forge.php
@@ -81,7 +81,7 @@ class CI_DB_cubrid_forge extends CI_DB_forge {
{
$attributes = array_change_key_case($attributes, CASE_UPPER);
- $sql .= "\n\t".$this->db->_protect_identifiers($field);
+ $sql .= "\n\t\"".$this->db->_protect_identifiers($field) . "\"";
if (array_key_exists('NAME', $attributes))
{
@@ -203,7 +203,7 @@ class CI_DB_cubrid_forge extends CI_DB_forge {
$key = array($key_name);
}
- $sql .= ",\n\tKEY {$key_name} (" . implode(', ', $key) . ")";
+ $sql .= ",\n\tKEY \"{$key_name}\" (" . implode(', ', $key) . ")";
}
}