mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-14 01:56:36 +08:00
When getting CREATE code of all database objects in completion proposal, skip triggers when SHOW CREATE TRIGGER is not yet supported. Closes #111.
This commit is contained in:
@ -3143,13 +3143,19 @@ procedure TDBConnection.PrefetchCreateCode(Objects: TDBObjectList);
|
|||||||
var
|
var
|
||||||
Queries: TStringList;
|
Queries: TStringList;
|
||||||
Obj: TDBObject;
|
Obj: TDBObject;
|
||||||
|
UseIt: Boolean;
|
||||||
begin
|
begin
|
||||||
// Cache some queries used in GetCreateCode for mass operations. See TMainForm.SynCompletionProposalExecute
|
// Cache some queries used in GetCreateCode for mass operations. See TMainForm.SynCompletionProposalExecute
|
||||||
Queries := TStringList.Create;
|
Queries := TStringList.Create;
|
||||||
for Obj in Objects do begin
|
for Obj in Objects do begin
|
||||||
case Parameters.NetTypeGroup of
|
case Parameters.NetTypeGroup of
|
||||||
ngMySQL: begin
|
ngMySQL: begin
|
||||||
if Obj.NodeType <> lntView then
|
UseIt := Obj.NodeType <> lntView;
|
||||||
|
// SHOW CREATE TRIGGER was introduced in MySQL 5.1.21
|
||||||
|
// See #111
|
||||||
|
if Obj.NodeType = lntTrigger then
|
||||||
|
UseIt := UseIt and (ServerVersionInt >= 50121);
|
||||||
|
if UseIt then
|
||||||
Queries.Add('SHOW CREATE '+UpperCase(Obj.ObjType)+' '+QuoteIdent(Obj.Database)+'.'+QuoteIdent(Obj.Name));
|
Queries.Add('SHOW CREATE '+UpperCase(Obj.ObjType)+' '+QuoteIdent(Obj.Database)+'.'+QuoteIdent(Obj.Name));
|
||||||
end;
|
end;
|
||||||
ngMSSQL: begin
|
ngMSSQL: begin
|
||||||
|
Reference in New Issue
Block a user