Permalink
Browse files

(Fixes issue 3166) Fixed the bug that CDbColumnSchema typecasted to N…

…ULL even for NOT NULL columns
  • Loading branch information...
alexander.makarow
alexander.makarow committed Feb 9, 2012
1 parent 9e9e43e commit c1538e5d047dcbb163fb591021380250d4f609da
Showing with 2 additions and 1 deletion.
  1. +1 −0 CHANGELOG
  2. +1 −1 framework/db/schema/CDbColumnSchema.php
View
@@ -11,6 +11,7 @@ Version 1.1.10 work in progress
- Bug #3071: Fixed the bug that afterValidateAttribute was not called properly (mdomba)
- Bug #3096: Fixed the bug when reporting an error and CHtml is not loaded (mdomba)
- Bug #3103: Fixed the bug that CActiveForm->error() was not overloading htmlOptions (mdomba)
+- Bug #3166: Fixed the bug that CDbColumnSchema typecasted to NULL even for NOT NULL columns (Sam Dark)
- Enh #3063: Gii, when generating models, tableNames will be checked against reserved PHP keywords when '*' is used (mdomba)
- Enh #3097: Added CHttpRequest::decodePathInfo() (Y!!)
- Enh #3101: The methods of CSecurityManager do now work correctly for the case that mbstring.func_overload is in effect (Y!!)
@@ -134,7 +134,7 @@ public function typecast($value)
{
if(gettype($value)===$this->type || $value===null || $value instanceof CDbExpression)
return $value;
- if($value==='')
+ if($value==='' && $this->allowNull)
return $this->type==='string' ? '' : null;
switch($this->type)
{

0 comments on commit c1538e5

Please sign in to comment.