Skip to content
Permalink
Browse files

Detect MySQL fulltext keys, and fix wrong USING <algorithm>. See http…

  • Loading branch information
ansgarbecker committed Feb 6, 2020
1 parent 56e541a commit c6ee86e6dc958500702c03d86352d0a24877111d
Showing with 5 additions and 2 deletions.
  1. +5 −2 source/dbconnection.pas
@@ -4846,11 +4846,14 @@ function TMySQLConnection.GetTableKeys(Table: TDBObject): TTableKeyList;
NewKey.IndexType := 'PRIMARY'
else if KeyQuery.Col('Non_unique') = '0' then
NewKey.IndexType := 'UNIQUE'
else if KeyQuery.Col('Index_type').ToLowerInvariant = 'fulltext' then
NewKey.IndexType := 'FULLTEXT'
else
NewKey.IndexType := 'KEY';
// Todo: fulltext and spatial keys
// Todo: spatial keys
NewKey.OldIndexType := NewKey.IndexType;
NewKey.Algorithm := KeyQuery.Col('Index_type');
if ExecRegExpr('(BTREE|HASH)', KeyQuery.Col('Index_type')) then
NewKey.Algorithm := KeyQuery.Col('Index_type');
NewKey.Comment := KeyQuery.Col('Index_comment', True);
end;
NewKey.Columns.Add(KeyQuery.Col('Column_name'));

0 comments on commit c6ee86e

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