Skip to content

Commit 9e5d0cb

Browse files
committed
Do not check existence of IS.routines before querying it. See http://www.heidisql.com/forum.php?t=20456#p20487
1 parent d0613c0 commit 9e5d0cb

1 file changed

Lines changed: 8 additions & 12 deletions

File tree

‎source/tabletools.pas‎

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -869,18 +869,14 @@ procedure TfrmTableTools.DoFind(DBObj: TDBObject);
869869
end;
870870

871871
lntProcedure, lntFunction: begin
872-
if DBObj.Connection.InformationSchemaObjects.IndexOf('routines') > -1 then begin
873-
SQL := 'SELECT '+
874-
esc(DBObj.Database)+' AS '+DBObj.Connection.QuoteIdent('Database')+', '+
875-
esc(DBObj.Name)+' AS '+DBObj.Connection.QuoteIdent('Table')+', '+
876-
DBObj.Connection.GetSQLSpecifity(spFuncCeil)+'(('+DBObj.Connection.GetSQLSpecifity(spFuncLength)+'('+RoutineDefinitionColumn+') - '+DBObj.Connection.GetSQLSpecifity(spFuncLength)+'(REPLACE('+RoutineDefinitionColumn+', '+esc(FindText)+', '+esc('')+'))) / '+DBObj.Connection.GetSQLSpecifity(spFuncLength)+'('+esc(FindText)+')) AS '+DBObj.Connection.QuoteIdent('Found rows')+', '+
877-
'0 AS '+DBObj.Connection.QuoteIdent('Relevance')+
878-
'FROM '+DBObj.Connection.QuoteIdent('information_schema')+'.'+DBObj.Connection.QuoteIdent('routines')+' '+
879-
'WHERE '+DBObj.Connection.QuoteIdent(RoutineSchemaColumn)+'='+esc(DBObj.Database)+' AND '+DBObj.Connection.QuoteIdent('routine_name')+'='+esc(DBObj.Name);
880-
AddResults(SQL, DBObj.Connection);
881-
end else begin
882-
AddNotes(DBObj, f_('%s%s missing.', [STRSKIPPED, 'information_schema.routines']), '');
883-
end;
872+
SQL := 'SELECT '+
873+
esc(DBObj.Database)+' AS '+DBObj.Connection.QuoteIdent('Database')+', '+
874+
esc(DBObj.Name)+' AS '+DBObj.Connection.QuoteIdent('Table')+', '+
875+
DBObj.Connection.GetSQLSpecifity(spFuncCeil)+'(('+DBObj.Connection.GetSQLSpecifity(spFuncLength)+'('+RoutineDefinitionColumn+') - '+DBObj.Connection.GetSQLSpecifity(spFuncLength)+'(REPLACE('+RoutineDefinitionColumn+', '+esc(FindText)+', '+esc('')+'))) / '+DBObj.Connection.GetSQLSpecifity(spFuncLength)+'('+esc(FindText)+')) AS '+DBObj.Connection.QuoteIdent('Found rows')+', '+
876+
'0 AS '+DBObj.Connection.QuoteIdent('Relevance')+
877+
'FROM '+DBObj.Connection.QuoteIdent('information_schema')+'.'+DBObj.Connection.QuoteIdent('routines')+' '+
878+
'WHERE '+DBObj.Connection.QuoteIdent(RoutineSchemaColumn)+'='+esc(DBObj.Database)+' AND '+DBObj.Connection.QuoteIdent('routine_name')+'='+esc(DBObj.Name);
879+
AddResults(SQL, DBObj.Connection);
884880
end;
885881

886882
end;

0 commit comments

Comments
 (0)