forked from extern/egroupware
fix for bool columns:
- work around some "magic" in ADODB's datadict - MySQL4.1 allows the standard true/false for inserts only and not as default value
This commit is contained in:
parent
66d3af7013
commit
68d0668328
@ -1085,7 +1085,7 @@
|
||||
case 'auto':
|
||||
return (int) $value;
|
||||
case 'bool':
|
||||
if ($this->Type == 'mysql' && $this->ServerInfo['version'] < 4.1)
|
||||
if ($this->Type == 'mysql') // maybe it's not longer necessary with mysql5
|
||||
{
|
||||
return $value ? 1 : 0;
|
||||
}
|
||||
|
@ -961,7 +961,8 @@
|
||||
}
|
||||
if (isset($col_data['default']))
|
||||
{
|
||||
$ado_col .= ' DEFAULT '.$this->m_odb->quote($col_data['default'],$col_data['type']);
|
||||
$ado_col .= (in_array($col_data['type'],array('bool','int','decimal','float','double')) && $col_data['default'] != 'NULL' ? ' NOQUOTE' : '').
|
||||
' DEFAULT '.$this->m_odb->quote($col_data['default'],$col_data['type']);
|
||||
}
|
||||
if (in_array($col,$aTableDef['pk']))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user