From 14d21a9925373aa1cfc8a669134cdbfedfbf6b57 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Sun, 17 Apr 2011 08:50:31 +0000 Subject: [PATCH] Exclude text and blob columns for ALTER col DROP DEFAULT query. Fixes issue #2361. --- source/table_editor.pas | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/table_editor.pas b/source/table_editor.pas index 88b3e81b..2d706898 100644 --- a/source/table_editor.pas +++ b/source/table_editor.pas @@ -488,7 +488,10 @@ begin // ALTER TABLE ... CHANGE COLUMN query, as there is no "no default" clause, nor by // appending an ALTER COLUMN ... DROP DEFAULT, without getting an "unknown column" error for i:=0 to FColumns.Count-1 do begin - if (FColumns[i].FStatus = esModified) and (FColumns[i].DefaultType = cdtNothing) then + if (FColumns[i].FStatus = esModified) + and (FColumns[i].DefaultType = cdtNothing) + and (FColumns[i].DataType.HasDefault) + then Specs.Add('ALTER '+DBObject.Connection.QuoteIdent(FColumns[i].OldName)+' DROP DEFAULT'); end; AddQuery;