summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--system/database/drivers/cubrid/cubrid_forge.php6
-rw-r--r--system/database/drivers/interbase/interbase_forge.php4
-rw-r--r--system/database/drivers/mssql/mssql_forge.php4
-rw-r--r--system/database/drivers/mysql/mysql_forge.php6
-rw-r--r--system/database/drivers/mysqli/mysqli_forge.php4
-rw-r--r--system/database/drivers/oci8/oci8_forge.php5
-rw-r--r--system/database/drivers/odbc/odbc_forge.php4
-rw-r--r--system/database/drivers/pdo/pdo_forge.php5
-rw-r--r--system/database/drivers/postgre/postgre_forge.php2
-rw-r--r--system/database/drivers/sqlite/sqlite_forge.php4
-rw-r--r--system/database/drivers/sqlite3/sqlite3_forge.php5
-rw-r--r--system/database/drivers/sqlsrv/sqlsrv_forge.php4
12 files changed, 25 insertions, 28 deletions
diff --git a/system/database/drivers/cubrid/cubrid_forge.php b/system/database/drivers/cubrid/cubrid_forge.php
index 1379e6d3a..8434cd2e2 100644
--- a/system/database/drivers/cubrid/cubrid_forge.php
+++ b/system/database/drivers/cubrid/cubrid_forge.php
@@ -63,7 +63,7 @@ class CI_DB_cubrid_forge extends CI_DB_forge {
$sql .= "\n\t".$this->db->escape_identifiers($field);
- empty($attributes['NAME']) OR $sql .= $this->db->escape_identifiers($attributes['NAME']).' ';
+ empty($attributes['NAME']) OR $sql .= ' '.$this->db->escape_identifiers($attributes['NAME']).' ';
if ( ! empty($attributes['TYPE']))
{
@@ -158,7 +158,7 @@ class CI_DB_cubrid_forge extends CI_DB_forge {
if (count($primary_keys) > 0)
{
$key_name = $this->db->escape_identifiers('pk_'.$table.'_'.implode('_', $primary_keys));
- $sql .= ",\n\tCONSTRAINT ".$key_name.' PRIMARY KEY('.implode(', ', $this->db->escape_identifiers($primary_keys)).')';
+ $sql .= ",\n\tCONSTRAINT ".$key_name.' PRIMARY KEY('.implode(', ', $this->db->protect_identifiers($primary_keys)).')';
}
if (is_array($keys) && count($keys) > 0)
@@ -168,7 +168,7 @@ class CI_DB_cubrid_forge extends CI_DB_forge {
if (is_array($key))
{
$key_name = $this->db->escape_identifiers('idx_'.$table.implode('_', $key));
- $key = $this->db->escape_identifiers($key);
+ $key = $this->db->protect_identifiers($key);
}
else
{
diff --git a/system/database/drivers/interbase/interbase_forge.php b/system/database/drivers/interbase/interbase_forge.php
index 166f3875a..4e6a60c72 100644
--- a/system/database/drivers/interbase/interbase_forge.php
+++ b/system/database/drivers/interbase/interbase_forge.php
@@ -135,7 +135,7 @@ class CI_DB_interbase_forge extends CI_DB_forge {
if (count($primary_keys) > 0)
{
- $primary_keys = $this->db->escape_identifiers($primary_keys);
+ $primary_keys = $this->db->protect_identifiers($primary_keys);
$sql .= ",\n\tPRIMARY KEY (".implode(', ', $primary_keys).')';
}
@@ -144,7 +144,7 @@ class CI_DB_interbase_forge extends CI_DB_forge {
foreach ($keys as $key)
{
$key = is_array($key)
- ? $this->db->escape_identifiers($key)
+ ? $this->db->protect_identifiers($key)
: array($this->db->escape_identifiers($key));
$sql .= ",\n\tUNIQUE (".implode(', ', $key).')';
diff --git a/system/database/drivers/mssql/mssql_forge.php b/system/database/drivers/mssql/mssql_forge.php
index 3a3528f7b..4d98221e9 100644
--- a/system/database/drivers/mssql/mssql_forge.php
+++ b/system/database/drivers/mssql/mssql_forge.php
@@ -103,7 +103,7 @@ class CI_DB_mssql_forge extends CI_DB_forge {
if (count($primary_keys) > 0)
{
- $sql .= ",\n\tPRIMARY KEY (".implode(', ', $this->db->escape_identifiers($primary_keys)).')';
+ $sql .= ",\n\tPRIMARY KEY (".implode(', ', $this->db->protect_identifiers($primary_keys)).')';
}
if (is_array($keys) && count($keys) > 0)
@@ -111,7 +111,7 @@ class CI_DB_mssql_forge extends CI_DB_forge {
foreach ($keys as $key)
{
$key = is_array($key)
- ? $this->db->escape_identifiers($key)
+ ? $this->db->protect_identifiers($key)
: array($this->db->escape_identifiers($key));
$sql .= ",\n\tFOREIGN KEY (".implode(', ', $key).')';
diff --git a/system/database/drivers/mysql/mysql_forge.php b/system/database/drivers/mysql/mysql_forge.php
index 0279b9dfa..7656c289c 100644
--- a/system/database/drivers/mysql/mysql_forge.php
+++ b/system/database/drivers/mysql/mysql_forge.php
@@ -62,7 +62,7 @@ class CI_DB_mysql_forge extends CI_DB_forge {
$sql .= "\n\t".$this->db->escape_identifiers($field);
- empty($attributes['NAME']) OR ' '.$this->db->protect_identifiers($attributes['NAME']).' ';
+ empty($attributes['NAME']) OR ' '.$this->db->escape_identifiers($attributes['NAME']).' ';
if ( ! empty($attributes['TYPE']))
{
@@ -142,7 +142,7 @@ class CI_DB_mysql_forge extends CI_DB_forge {
if (count($primary_keys) > 0)
{
$key_name = $this->db->escape_identifiers(implode('_', $primary_keys));
- $sql .= ",\n\tPRIMARY KEY ".$key_name.' ('.implode(', ', $this->db->escape_identifiers($primary_keys)).')';
+ $sql .= ",\n\tPRIMARY KEY ".$key_name.' ('.implode(', ', $this->db->protect_identifiers($primary_keys)).')';
}
if (is_array($keys) && count($keys) > 0)
@@ -152,7 +152,7 @@ class CI_DB_mysql_forge extends CI_DB_forge {
if (is_array($key))
{
$key_name = $this->db->escape_identifiers(implode('_', $key));
- $key = $this->db->escape_identifiers($key);
+ $key = $this->db->protect_identifiers($key);
}
else
{
diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php
index a1f58f0f7..e0e98f151 100644
--- a/system/database/drivers/mysqli/mysqli_forge.php
+++ b/system/database/drivers/mysqli/mysqli_forge.php
@@ -62,7 +62,7 @@ class CI_DB_mysqli_forge extends CI_DB_forge {
$sql .= "\n\t".$this->db->escape_identifiers($field);
- empty($attributes['NAME']) OR $sql .= ' '.$this->db->protect_identifiers($attributes['NAME']).' ';
+ empty($attributes['NAME']) OR $sql .= ' '.$this->db->escape_identifiers($attributes['NAME']).' ';
if ( ! empty($attributes['TYPE']))
{
@@ -152,7 +152,7 @@ class CI_DB_mysqli_forge extends CI_DB_forge {
if (is_array($key))
{
$key_name = $this->db->escape_identifiers(implode('_', $key));
- $key = $this->db->escape_identifiers($key);
+ $key = $this->db->protect_identifiers($key);
}
else
{
diff --git a/system/database/drivers/oci8/oci8_forge.php b/system/database/drivers/oci8/oci8_forge.php
index 4fd3dc4a5..be093750b 100644
--- a/system/database/drivers/oci8/oci8_forge.php
+++ b/system/database/drivers/oci8/oci8_forge.php
@@ -100,8 +100,7 @@ class CI_DB_oci8_forge extends CI_DB_forge {
if (count($primary_keys) > 0)
{
- $primary_keys = $this->db->escape_identifiers($primary_keys);
- $sql .= ",\n\tCONSTRAINT ".$table.' PRIMARY KEY ('.implode(', ', $primary_keys).')';
+ $sql .= ",\n\tCONSTRAINT ".$table.' PRIMARY KEY ('.implode(', ', $this->db->protect_identifiers($primary_keys)).')';
}
if (is_array($keys) && count($keys) > 0)
@@ -109,7 +108,7 @@ class CI_DB_oci8_forge extends CI_DB_forge {
foreach ($keys as $key)
{
$key = is_array($key)
- ? $this->db->escape_identifiers($key)
+ ? $this->db->protect_identifiers($key)
: array($this->db->escape_identifiers($key));
$sql .= ",\n\tUNIQUE COLUMNS (".implode(', ', $key).')';
diff --git a/system/database/drivers/odbc/odbc_forge.php b/system/database/drivers/odbc/odbc_forge.php
index b074c5884..5c0b200eb 100644
--- a/system/database/drivers/odbc/odbc_forge.php
+++ b/system/database/drivers/odbc/odbc_forge.php
@@ -104,7 +104,7 @@ class CI_DB_odbc_forge extends CI_DB_forge {
if (count($primary_keys) > 0)
{
- $sql .= ",\n\tPRIMARY KEY (".implode(', ', $this->escape_identifiers($primary_keys)).')';
+ $sql .= ",\n\tPRIMARY KEY (".implode(', ', $this->protect_identifiers($primary_keys)).')';
}
if (is_array($keys) && count($keys) > 0)
@@ -112,7 +112,7 @@ class CI_DB_odbc_forge extends CI_DB_forge {
foreach ($keys as $key)
{
$key = is_array($key)
- ? $this->db->escape_identifiers($key)
+ ? $this->db->protect_identifiers($key)
: array($this->db->escape_identifiers($key));
$sql .= ",\n\tFOREIGN KEY (".implode(', ', $key).')';
diff --git a/system/database/drivers/pdo/pdo_forge.php b/system/database/drivers/pdo/pdo_forge.php
index 8ce4513dc..56457505c 100644
--- a/system/database/drivers/pdo/pdo_forge.php
+++ b/system/database/drivers/pdo/pdo_forge.php
@@ -112,8 +112,7 @@ class CI_DB_pdo_forge extends CI_DB_forge {
if (count($primary_keys) > 0)
{
- $primary_keys = $this->db->escape_identifiers($primary_keys);
- $sql .= ",\n\tPRIMARY KEY (".implode(', ', $primary_keys).')';
+ $sql .= ",\n\tPRIMARY KEY (".implode(', ', $this->db->protect_identifiers($primary_keys)).')';
}
if (is_array($keys) && count($keys) > 0)
@@ -121,7 +120,7 @@ class CI_DB_pdo_forge extends CI_DB_forge {
foreach ($keys as $key)
{
$key = is_array($key)
- ? $this->db->escape_identifiers($key)
+ ? $this->db->protect_identifiers($key)
: array($this->db->escape_identifiers($key));
$sql .= ",\n\tFOREIGN KEY (".implode(', ', $key).')';
diff --git a/system/database/drivers/postgre/postgre_forge.php b/system/database/drivers/postgre/postgre_forge.php
index 98b484bcf..fc1124568 100644
--- a/system/database/drivers/postgre/postgre_forge.php
+++ b/system/database/drivers/postgre/postgre_forge.php
@@ -174,7 +174,7 @@ class CI_DB_postgre_forge extends CI_DB_forge {
foreach ($keys as $key)
{
$key = is_array($key)
- ? $this->db->escape_identifiers($key)
+ ? $this->db->protect_identifiers($key)
: array($this->db->escape_identifiers($key));
foreach ($key as $field)
diff --git a/system/database/drivers/sqlite/sqlite_forge.php b/system/database/drivers/sqlite/sqlite_forge.php
index 71eed7df4..ba7dc902b 100644
--- a/system/database/drivers/sqlite/sqlite_forge.php
+++ b/system/database/drivers/sqlite/sqlite_forge.php
@@ -136,7 +136,7 @@ class CI_DB_sqlite_forge extends CI_DB_forge {
if (count($primary_keys) > 0)
{
- $sql .= ",\n\tPRIMARY KEY (".implode(', ', $this->db->escape_identifiers($primary_keys)).')';
+ $sql .= ",\n\tPRIMARY KEY (".implode(', ', $this->db->protect_identifiers($primary_keys)).')';
}
if (is_array($keys) && count($keys) > 0)
@@ -144,7 +144,7 @@ class CI_DB_sqlite_forge extends CI_DB_forge {
foreach ($keys as $key)
{
$key = is_array($key)
- ? $this->db->escape_identifiers($key)
+ ? $this->db->protect_identifiers($key)
: array($this->db->escape_identifiers($key));
$sql .= ",\n\tUNIQUE (".implode(', ', $key).')';
diff --git a/system/database/drivers/sqlite3/sqlite3_forge.php b/system/database/drivers/sqlite3/sqlite3_forge.php
index 6df361444..84651abd2 100644
--- a/system/database/drivers/sqlite3/sqlite3_forge.php
+++ b/system/database/drivers/sqlite3/sqlite3_forge.php
@@ -143,8 +143,7 @@ class CI_DB_sqlite3_forge extends CI_DB_forge {
if (count($primary_keys) > 0)
{
- $primary_keys = $this->db->escape_identifiers($primary_keys);
- $sql .= ",\n\tPRIMARY KEY (".implode(', ', $primary_keys).')';
+ $sql .= ",\n\tPRIMARY KEY (".implode(', ', $this->db->protect_identifiers($primary_keys)).')';
}
if (is_array($keys) && count($keys) > 0)
@@ -152,7 +151,7 @@ class CI_DB_sqlite3_forge extends CI_DB_forge {
foreach ($keys as $key)
{
$key = is_array($key)
- ? $this->db->escape_identifiers($key)
+ ? $this->db->protect_identifiers($key)
: array($this->db->escape_identifiers($key));
$sql .= ",\n\tUNIQUE (".implode(', ', $key).')';
diff --git a/system/database/drivers/sqlsrv/sqlsrv_forge.php b/system/database/drivers/sqlsrv/sqlsrv_forge.php
index e6f7e1ac1..559746e87 100644
--- a/system/database/drivers/sqlsrv/sqlsrv_forge.php
+++ b/system/database/drivers/sqlsrv/sqlsrv_forge.php
@@ -103,7 +103,7 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge {
if (count($primary_keys) > 0)
{
- $sql .= ",\n\tPRIMARY KEY (".implode(', ', $this->db->escape_identifiers($primary_keys)).')';
+ $sql .= ",\n\tPRIMARY KEY (".implode(', ', $this->db->protect_identifiers($primary_keys)).')';
}
if (is_array($keys) && count($keys) > 0)
@@ -111,7 +111,7 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge {
foreach ($keys as $key)
{
$key = is_array($key)
- ? $this->db->escape_identifiers($key)
+ ? $this->db->protect_identifiers($key)
: array($this->escape_identifiers($key));
$sql .= ",\n\tFOREIGN KEY (".implode(', ', $key).')';