From d84e4ca8b1faf8a64592611860bd3649e5f810fd Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Wed, 20 Feb 2013 16:07:02 +0000 Subject: [PATCH] Support old style "TYPE BTREE" in table index code. See http://www.heidisql.com/forum.php?t=12150 --- source/dbconnection.pas | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/dbconnection.pas b/source/dbconnection.pas index 4e87846f..ee308383 100644 --- a/source/dbconnection.pas +++ b/source/dbconnection.pas @@ -3285,7 +3285,7 @@ begin // Detect keys // PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY `id_2` (`id`) USING BTREE, // KEY `Text` (`Text`(100)), FULLTEXT KEY `Email` (`Email`,`Text`) - rx.Expression := '^\s+((\w+)\s+)?KEY\s+([`"]?([^`"]+)[`"]?\s+)?(USING\s+(\w+)\s+)?\((.+)\)(\s+USING\s+(\w+))?,?$'; + rx.Expression := '^\s+((\w+)\s+)?KEY\s+([`"]?([^`"]+)[`"]?\s+)?((USING|TYPE)\s+(\w+)\s+)?\((.+)\)(\s+USING\s+(\w+))?,?$'; if rx.Exec(CreateTable) then while true do begin if not Assigned(Keys) then break; @@ -3297,11 +3297,11 @@ begin Key.IndexType := rx.Match[2]; Key.OldIndexType := Key.IndexType; if rx.Match[6] <> '' then // 5.0 and below show USING ... before column list - Key.Algorithm := rx.Match[6] + Key.Algorithm := rx.Match[7] else - Key.Algorithm := rx.Match[9]; + Key.Algorithm := rx.Match[10]; if Key.IndexType = '' then Key.IndexType := 'KEY'; // KEY - Key.Columns := Explode(',', rx.Match[7]); + Key.Columns := Explode(',', rx.Match[8]); for i:=0 to Key.Columns.Count-1 do begin rxCol.Expression := '^[`"]?([^`"]+)[`"]?(\((\d+)\))?$'; if rxCol.Exec(Key.Columns[i]) then begin