mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-26 21:01:30 +02:00
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 .= ',';
|
$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'])
|
switch($arraydef['type'])
|
||||||
{
|
{
|
||||||
case 'blob':
|
case 'blob':
|
||||||
@ -408,17 +414,6 @@
|
|||||||
$sSQL .= (int)$oProc->m_odb->f($name);
|
$sSQL .= (int)$oProc->m_odb->f($name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
if(isset($arraydef['nullable']) && $arraydef['nullable'])
|
|
||||||
{
|
|
||||||
$sSQL .= 'null';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$sSQL .= "''";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$sSQL .= ')';
|
$sSQL .= ')';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user