Skip to content
Permalink
Browse files

Support spaces in definer of a view. Closes #571.

  • Loading branch information...
ansgarbecker committed Mar 14, 2019
1 parent 16afa3c commit d6dc4cde2e02aa16eb27c8da133c587b3271ffb3
Showing with 3 additions and 2 deletions.
  1. +3 −2 source/dbconnection.pas
@@ -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
@@ -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+)?'+

0 comments on commit d6dc4cd

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