diff options
author | Phil Sturgeon <email@philsturgeon.co.uk> | 2011-08-09 23:55:39 +0200 |
---|---|---|
committer | Phil Sturgeon <email@philsturgeon.co.uk> | 2011-08-09 23:55:39 +0200 |
commit | 7988beaab1f68c84f8d444aa037f621e107fd7e0 (patch) | |
tree | 59cc75e56a2a0b1727807e13cbd7c6bab96b151f | |
parent | c8cbff7c6b380321418f377130e5e25cf4a6f524 (diff) | |
parent | 03a9599befa5c8967f70960eda40b5f2a65f75cb (diff) |
Merge branch 'develop' of github.com:philsturgeon/codeigniter-reactor into develop
-rw-r--r-- | system/database/drivers/mysql/mysql_forge.php | 8 | ||||
-rw-r--r-- | system/database/drivers/mysqli/mysqli_forge.php | 8 | ||||
-rw-r--r-- | user_guide/changelog.html | 1 |
3 files changed, 13 insertions, 4 deletions
diff --git a/system/database/drivers/mysql/mysql_forge.php b/system/database/drivers/mysql/mysql_forge.php index 529ec980d..c1cae136c 100644 --- a/system/database/drivers/mysql/mysql_forge.php +++ b/system/database/drivers/mysql/mysql_forge.php @@ -119,9 +119,13 @@ class CI_DB_mysql_forge extends CI_DB_forge { $sql .= ' DEFAULT \''.$attributes['DEFAULT'].'\''; } - if (array_key_exists('NULL', $attributes)) + if (array_key_exists('NULL', $attributes) && $attributes['NULL'] === TRUE) { - $sql .= ($attributes['NULL'] === TRUE) ? ' NULL' : ' NOT NULL'; + $sql .= ' NULL'; + } + else + { + $sql .= ' NOT NULL'; } if (array_key_exists('AUTO_INCREMENT', $attributes) && $attributes['AUTO_INCREMENT'] === TRUE) diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index d5097335e..260549457 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -104,9 +104,13 @@ class CI_DB_mysqli_forge extends CI_DB_forge { $sql .= ' DEFAULT \''.$attributes['DEFAULT'].'\''; } - if (array_key_exists('NULL', $attributes)) + if (array_key_exists('NULL', $attributes) && $attributes['NULL'] === TRUE) { - $sql .= ($attributes['NULL'] === TRUE) ? ' NULL' : ' NOT NULL'; + $sql .= ' NULL'; + } + else + { + $sql .= ' NOT NULL'; } if (array_key_exists('AUTO_INCREMENT', $attributes) && $attributes['AUTO_INCREMENT'] === TRUE) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 4cf40a153..8d9ca1390 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -106,6 +106,7 @@ Change Log <li>Fixed a bug (Reactor #229) where the Sessions Library example SQL in the documentation contained incorrect SQL.</li> <li>Fixed a bug (Core #340) where when passing in the second parameter to $this->db->select(), column names in subsequent queries would not be properly escaped.</li> <li class="reactor">Fixed a bug where the method <kbd>$this->cart->total_items()</kbd> from <a href="libraries/cart.html">Cart Library</a> now returns the sum of the quantity of all items in the cart instead of your total count.</li> + <li>Fixed a bug where not setting 'null' when adding fields in db_forge for mysql and mysqli drivers would default to NULL instead of NOT NULL as the docs suggest.</li> </ul> <h2>Version 2.0.2</h2> |