Skip to content

Commit

Permalink
Support spaces in definer of a view. Closes #571.
Browse files Browse the repository at this point in the history
  • Loading branch information
ansgarbecker committed Mar 14, 2019
1 parent 16afa3c commit d6dc4cd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions source/dbconnection.pas
Expand Up @@ -5307,7 +5307,7 @@ procedure TDBConnection.ParseViewStructure(CreateCode: String; DBObj: TDBObject;
rx: TRegExpr;
Col: TTableColumn;
Results: TDBQuery;
SchemaClause, DataType: String;
SchemaClause, DataType, EscQuote: String;
begin
if CreateCode <> '' then begin
// CREATE
Expand All @@ -5321,9 +5321,10 @@ procedure TDBConnection.ParseViewStructure(CreateCode: String; DBObj: TDBObject;
rx := TRegExpr.Create;
rx.ModifierG := False;
rx.ModifierI := True;
EscQuote := QuoteRegExprMetaChars(FQuoteChar);
rx.Expression := 'CREATE\s+(OR\s+REPLACE\s+)?'+
'(ALGORITHM\s*=\s*(\w*)\s*)?'+
'(DEFINER\s*=\s*(\S+)\s+)?'+
'(DEFINER\s*=\s*(\S+|'+EscQuote+'[^@'+EscQuote+']+'+EscQuote+'@'+EscQuote+'[^'+EscQuote+']+'+EscQuote+')\s+)?'+
'(SQL\s+SECURITY\s+(\S+)\s+)?'+
'VIEW\s+[^\(]+\s+'+
'(\([^\)]+\)\s+)?'+
Expand Down

0 comments on commit d6dc4cd

Please sign in to comment.