summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/mssql
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-01-27 20:13:52 +0100
committerAndrey Andreev <narf@bofh.bg>2012-01-27 20:13:52 +0100
commit7a189e81c0335f0d3667c1e8270f06137177d9b0 (patch)
tree082299080d2364538de758d05b49b15a89938aa9 /system/database/drivers/mssql
parentfb86295d7d49e7ddfba266fe9f7305fb44708d4f (diff)
parent0c4fb6a578d23e5a0fa5c8ce41a75d2b2b1310e7 (diff)
Merge upstream branch
Diffstat (limited to 'system/database/drivers/mssql')
-rw-r--r--system/database/drivers/mssql/mssql_driver.php2
-rw-r--r--system/database/drivers/mssql/mssql_forge.php14
2 files changed, 8 insertions, 8 deletions
diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php
index 4d29920d6..611a4afba 100644
--- a/system/database/drivers/mssql/mssql_driver.php
+++ b/system/database/drivers/mssql/mssql_driver.php
@@ -300,7 +300,7 @@ class CI_DB_mssql_driver extends CI_DB {
* @param string $version
* @return int major version number
*/
- private function _parse_major_version($version)
+ protected function _parse_major_version($version)
{
preg_match('/([0-9]+)\.([0-9]+)\.([0-9]+)/', $version, $ver_info);
return $ver_info[1]; // return the major version b/c that's all we're interested in.
diff --git a/system/database/drivers/mssql/mssql_forge.php b/system/database/drivers/mssql/mssql_forge.php
index 231284c7c..59b930c2f 100644
--- a/system/database/drivers/mssql/mssql_forge.php
+++ b/system/database/drivers/mssql/mssql_forge.php
@@ -80,7 +80,7 @@ class CI_DB_mssql_forge extends CI_DB_forge {
* @param array the fields
* @param mixed primary key(s)
* @param mixed key(s)
- * @param boolean should 'IF NOT EXISTS' be added to the SQL
+ * @param bool should 'IF NOT EXISTS' be added to the SQL
* @return string
*/
public function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists)
@@ -110,11 +110,11 @@ class CI_DB_mssql_forge extends CI_DB_forge {
$sql .= "\n\t".$this->db->protect_identifiers($field)
.' '.$attributes['TYPE']
- .(isset($attributes['CONSTRAINT']) ? '('.$attributes['CONSTRAINT'].')' : '')
- .((isset($attributes['UNSIGNED']) && $attributes['UNSIGNED'] === TRUE) ? ' UNSIGNED' : '')
+ .( ! empty($attributes['CONSTRAINT']) ? '('.$attributes['CONSTRAINT'].')' : '')
+ .(( ! empty($attributes['UNSIGNED']) && $attributes['UNSIGNED'] === TRUE) ? ' UNSIGNED' : '')
.(isset($attributes['DEFAULT']) ? ' DEFAULT \''.$attributes['DEFAULT'].'\'' : '')
- .((isset($attributes['NULL']) && $attributes['NULL'] === TRUE) ? ' NULL' : ' NOT NULL')
- .((isset($attributes['AUTO_INCREMENT']) && $attributes['AUTO_INCREMENT'] === TRUE) ? ' AUTO_INCREMENT' : '');
+ .(( ! empty($attributes['NULL']) && $attributes['NULL'] === TRUE) ? ' NULL' : ' NOT NULL')
+ .(( ! empty($attributes['AUTO_INCREMENT']) && $attributes['AUTO_INCREMENT'] === TRUE) ? ' AUTO_INCREMENT' : '');
}
// don't add a comma on the end of the last field
@@ -163,9 +163,9 @@ class CI_DB_mssql_forge extends CI_DB_forge {
* @param string the table name
* @param string the column definition
* @param string the default value
- * @param boolean should 'NOT NULL' be added
+ * @param bool should 'NOT NULL' be added
* @param string the field after which we should add the new field
- * @return object
+ * @return string
*/
public function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '')
{