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:
Ralf Becker 2005-11-29 07:52:18 +00:00
parent 66d3af7013
commit 68d0668328
2 changed files with 3 additions and 2 deletions

View File

@ -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;
}

View File

@ -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']))
{