Skip to content
Permalink
Browse files

Issue #640: fix crash in table editor with DESC/ASC in a key

  • Loading branch information...
ansgarbecker committed May 6, 2019
1 parent 97043d3 commit 3a4578e67b2a787e5e7969f5ad3593417c6fdc82
Showing with 3 additions and 2 deletions.
  1. +3 −2 source/dbconnection.pas
@@ -5270,10 +5270,11 @@ procedure TDBConnection.ParseTableStructure(CreateTable: String; Columns: TTable
Key.Algorithm := rx.Match[7]
else
Key.Algorithm := rx.Match[10];
if Key.IndexType = '' then Key.IndexType := 'KEY'; // KEY
if Key.IndexType = '' then
Key.IndexType := 'KEY'; // KEY
Key.Columns := Explode(',', rx.Match[8]);
for i:=0 to Key.Columns.Count-1 do begin
rxCol.Expression := '^['+Quotes+']?([^'+Quotes+']+)['+Quotes+']?(\((\d+)\))?$';
rxCol.Expression := '^['+Quotes+']?([^'+Quotes+']+)['+Quotes+']?(\((\d+)\))?(\s+(DESC|ASC))?$';
if rxCol.Exec(Key.Columns[i]) then begin
Key.Columns[i] := rxCol.Match[1];
Key.SubParts.Add(rxCol.Match[3]);

0 comments on commit 3a4578e

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