Ensure we don't run dependency/dependent queries with random OID values [Ashesh Vashi]
authordpage <dpage@a7884b65-44f6-0310-8a51-81a127f17b15>
Thu, 18 Jun 2009 09:36:00 +0000 (09:36 +0000)
committerdpage <dpage@a7884b65-44f6-0310-8a51-81a127f17b15>
Thu, 18 Jun 2009 09:36:00 +0000 (09:36 +0000)
git-svn-id: svn://svn.pgadmin.org/trunk/pgadmin3@7937 a7884b65-44f6-0310-8a51-81a127f17b15

pgadmin/schema/pgObject.cpp

index b8af98db68140ec1c479911a2c16be58666c763c..f42fee8fcd90ed695409a50a65f6eef40ce3a916 100644 (file)
@@ -97,7 +97,7 @@ int pgObject::GetTypeId(const wxString &typname)
 
 
 pgObject::pgObject(pgaFactory &_factory, const wxString& newName)
-: wxTreeItemData()
+: wxTreeItemData(), oid(0)
 {
     factory=&_factory;
 
@@ -114,7 +114,7 @@ pgObject::pgObject(pgaFactory &_factory, const wxString& newName)
 
 
 pgObject::pgObject(int newType, const wxString& newName)
-: wxTreeItemData()
+: wxTreeItemData(), oid(0)
 {
     factory=pgaFactory::GetFactory(newType);
 
@@ -347,7 +347,12 @@ void pgObject::ShowDependencies(frmMain *form, ctlListView *Dependencies, const
 {
     wxString where;
     if (wh.IsEmpty())
-        where = wxT(" WHERE dep.objid=") + GetOidStr();
+    {
+        if(!GetOidStr().IsSameAs(wxT("0")))
+            where = wxT(" WHERE dep.objid=") + GetOidStr();
+        else
+            return;
+    }
     else
         where = wh;
     /*