mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2026-03-13 09:24:25 +08:00
Support old style "TYPE BTREE" in table index code. See http://www.heidisql.com/forum.php?t=12150
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user