Support old style "TYPE BTREE" in table index code. See http://www.heidisql.com/forum.php?t=12150

This commit is contained in:
Ansgar Becker
2013-02-20 16:07:02 +00:00
parent 3d6ab973d6
commit d84e4ca8b1

View File

@@ -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