mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 20:50:20 +08:00
Fix issue #1033: wrong bit field default syntax
This commit is contained in:
@ -202,8 +202,12 @@ begin
|
||||
createQuery := createQuery + ' UNSIGNED'; // Unsigned
|
||||
if FieldType.HasZerofill and cols[i].Zerofill then
|
||||
createQuery := createQuery + ' ZEROFILL'; // Zerofill
|
||||
if cols[i].Default <> '' then
|
||||
createQuery := createQuery + ' DEFAULT ''' + cols[i].Default + ''''; // Default
|
||||
if cols[i].Default <> '' then begin
|
||||
createQuery := createQuery + ' DEFAULT ';
|
||||
if cols[i].FieldType = tpBIT then
|
||||
createQuery := createQuery + ' b';
|
||||
createQuery := createQuery + '''' + cols[i].Default + ''''; // Default
|
||||
end;
|
||||
if cols[i].NotNull then
|
||||
createQuery := createQuery + ' NOT NULL'; // Not null
|
||||
if cols[i].AutoIncrement then
|
||||
|
@ -535,7 +535,11 @@ begin
|
||||
case comboDefault.ItemIndex of
|
||||
DEFAULT_NULL: strDefault := 'NULL';
|
||||
DEFAULT_CURTS: strDefault := 'CURRENT_TIMESTAMP';
|
||||
DEFAULT_CUSTOM: strDefault := esc(editDefault.Text);
|
||||
DEFAULT_CUSTOM: begin
|
||||
strDefault := esc(editDefault.Text);
|
||||
if IndexToType(ComboBoxType.ItemIndex) = tpBIT then
|
||||
strDefault := 'b' + strDefault;
|
||||
end;
|
||||
end;
|
||||
if strDefault <> '' then
|
||||
strDefault := ' DEFAULT '+strDefault;
|
||||
|
Reference in New Issue
Block a user