Skip to content
Browse files

Detect static date/time values as text type, not expression. See http…

  • Loading branch information
ansgarbecker committed Jan 13, 2020
1 parent fe7101d commit 6f314a210e2b4a23caa5b8e8c285652a9365681e
Showing with 5 additions and 1 deletion.
  1. +5 −1 source/dbconnection.pas
@@ -4562,9 +4562,13 @@ function TDBConnection.GetTableColumns(Table: TDBObject): TTableColumnList;
Col.DefaultText := 'AUTO_INCREMENT';
end else if ColQuery.IsNull('COLUMN_DEFAULT') then begin
Col.DefaultType := cdtNothing;
end else if DefText.StartsWith('''') or DefText.IsEmpty then begin
end else if DefText.StartsWith('''') then begin
Col.DefaultType := cdtText;
Col.DefaultText := ExtractLiteral(DefText, '');
end else if DefText.IsEmpty or IsInt(DefText[1]) then begin
// Inexact detection, wrong if MySQL allows 0+1 as default value at some point
Col.DefaultType := cdtText;
Col.DefaultText := DefText;
end else begin
Col.DefaultType := cdtExpression;
Col.DefaultText := DefText;

0 comments on commit 6f314a2

Please sign in to comment.
You can’t perform that action at this time.