Fix issue #1236 Wrong DEFAULT value detection in table editor

This commit is contained in:
Ansgar Becker
2009-06-21 12:24:19 +00:00
parent 468b6ac3f8
commit ce155c1a98

View File

@ -345,12 +345,15 @@ begin
if UpperCase(Copy(ColSpec, 1, 8)) = 'NOT NULL' then begin if UpperCase(Copy(ColSpec, 1, 8)) = 'NOT NULL' then begin
Props[3] := BoolToStr(False); Props[3] := BoolToStr(False);
Delete(ColSpec, 1, 9); Delete(ColSpec, 1, 9);
end else ColDefaultType := cdtText;
ColDefaultText := '';
end else begin
Props[3] := BoolToStr(True); Props[3] := BoolToStr(True);
ColDefaultType := cdtNull;
ColDefaultText := 'NULL';
end;
// Default value // Default value
ColDefaultType := cdtNull;
ColDefaultText := 'NULL';
if UpperCase(Copy(ColSpec, 1, 14)) = 'AUTO_INCREMENT' then begin if UpperCase(Copy(ColSpec, 1, 14)) = 'AUTO_INCREMENT' then begin
ColDefaultType := cdtAutoInc; ColDefaultType := cdtAutoInc;
ColDefaultText := 'AUTO_INCREMENT'; ColDefaultText := 'AUTO_INCREMENT';