fix for update-bug: NULL values where written back as '', which is not ok for int-columns

This commit is contained in:
Ralf Becker 2004-02-08 20:59:32 +00:00
parent 3782e0c397
commit 5ee6f04fd0

View File

@ -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 .= ')';