When copying a table, use a column for the INSERT..SELECT query only if it's not a virtual one. Closes #84.

This commit is contained in:
Ansgar Becker
2018-12-11 20:30:20 +01:00
parent 7a80ca8b9a
commit 1a032ef726

View File

@@ -440,7 +440,9 @@ begin
CreateCode := CreateCode + Format(ClausePattern, [Column.SQLCode]);
if AutoIncRemoved then
Column.DefaultType := cdtAutoInc;
DataCols := DataCols + FConnection.QuoteIdent(Column.Name) + ', ';
// Use this column for the INSERT..SELECT query only if it's not a virtual one
if Column.Virtuality.IsEmpty then
DataCols := DataCols + FConnection.QuoteIdent(Column.Name) + ', ';
end;
// Indexes code