Check the the appropriate debugger plugin is loaded before offering debugging options.
authordpage <dpage@a7884b65-44f6-0310-8a51-81a127f17b15>
Wed, 8 Apr 2009 16:16:44 +0000 (16:16 +0000)
committerdpage <dpage@a7884b65-44f6-0310-8a51-81a127f17b15>
Wed, 8 Apr 2009 16:16:44 +0000 (16:16 +0000)
git-svn-id: svn://svn.pgadmin.org/trunk/pgadmin3@7805 a7884b65-44f6-0310-8a51-81a127f17b15

pgadmin/schema/pgDatabase.cpp

index ffa78d8e34fa2aed0b5700c7f0d7511c54feeac5..1e690d474a91435f62a8a874733ae3253d9fa222 100644 (file)
@@ -627,6 +627,13 @@ bool pgDatabase::CanDebugPlpgsql()
     else if (canDebugPlpgsql == 2)
         return true;
 
+    // Check the appropriate plugin is loaded
+    if (!ExecuteScalar(wxT("SHOW shared_preload_libraries;")).Contains(wxT("plugin_debugger.")))
+    {
+        canDebugPlpgsql = 1;
+        return false;
+    }
+
     if (ExecuteScalar(wxT("SELECT count(*) FROM pg_proc WHERE proname = 'pldbg_get_target_info';")) == wxT("0"))
     {
         canDebugPlpgsql = 1;
@@ -665,6 +672,13 @@ bool pgDatabase::CanDebugEdbspl()
     else if (canDebugEdbspl == 2)
         return true;
 
+    // Check the appropriate plugin is loaded
+    if (!ExecuteScalar(wxT("SHOW shared_preload_libraries;")).Contains(wxT("plugin_spl_debugger.")))
+    {
+        canDebugEdbspl = 1;
+        return false;
+    }
+
     if (ExecuteScalar(wxT("SELECT count(*) FROM pg_proc WHERE proname = 'pldbg_get_target_info';")) == wxT("0"))
     {
         canDebugEdbspl = 1;