Support backticks in column names. Fixes issue #2292.

This commit is contained in:
Ansgar Becker
2011-02-02 20:30:24 +00:00
parent 809236e534
commit ab21693b0d

View File

@ -1088,6 +1088,7 @@ begin
Result := Copy(Result, 2, Length(Result)-2);
if Glue <> #0 then
Result := StringReplace(Result, '`'+Glue+'`', Glue, [rfReplaceAll]);
Result := StringReplace(Result, '``', '`', [rfReplaceAll]);
end;
@ -1658,7 +1659,7 @@ begin
rx := TRegExpr.Create;
rx.ModifierS := False;
rx.ModifierM := True;
rx.Expression := '^\s+[`"]([^`"]+)[`"]\s(\w+)';
rx.Expression := '^\s+[`"](.+)[`"]\s(\w+)';
rxCol := TRegExpr.Create;
rxCol.ModifierI := True;
if rx.Exec(CreateTable) then while true do begin
@ -1677,7 +1678,7 @@ begin
Col := TTableColumn.Create;
Columns.Add(Col);
Col.Name := rx.Match[1];
Col.Name := DeQuoteIdent(rx.Match[1]);
Col.OldName := Col.Name;
Col.Status := esUntouched;
Col.LengthCustomized := True;