forked from extern/egroupware
fix for update-bug: NULL values where written back as '', which is not ok for int-columns
This commit is contained in:
parent
3782e0c397
commit
5ee6f04fd0
@ -392,8 +392,14 @@
|
||||
$sSQL .= ',';
|
||||
}
|
||||
|
||||
if($oProc->m_odb->f($name) != null)
|
||||
// !isset($arraydef['nullable']) means nullable !!!
|
||||
if($oProc->m_odb->f($name) == NULL && (!isset($arraydef['nullable']) || $arraydef['nullable']))
|
||||
{
|
||||
$sSQL .= 'NULL';
|
||||
}
|
||||
else
|
||||
{
|
||||
$value = $oProc->m_odb->f($name) != NULL ? $oProc->m_odb->f($name) : @$arraydef['default'];
|
||||
switch($arraydef['type'])
|
||||
{
|
||||
case 'blob':
|
||||
@ -408,17 +414,6 @@
|
||||
$sSQL .= (int)$oProc->m_odb->f($name);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(isset($arraydef['nullable']) && $arraydef['nullable'])
|
||||
{
|
||||
$sSQL .= 'null';
|
||||
}
|
||||
else
|
||||
{
|
||||
$sSQL .= "''";
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$sSQL .= ')';
|
||||
|
Loading…
Reference in New Issue
Block a user