diff --git a/Release_(3.0)/pgAdmin3.exe b/Release_(3.0)/pgAdmin3.exe index bd0cf59..4e3e259 100644 Binary files a/Release_(3.0)/pgAdmin3.exe and b/Release_(3.0)/pgAdmin3.exe differ diff --git a/dlg/dlgTable.cpp b/dlg/dlgTable.cpp index a4b755b..c02e9c9 100644 --- a/dlg/dlgTable.cpp +++ b/dlg/dlgTable.cpp @@ -181,6 +181,9 @@ dlgProperty *pgPartitionFactory::CreateDialog(frmMain *frame, pgObject *node, pg break; } parent=parentNode; + pgPartition *n=(pgPartition *)node; + pgSchema *p=(pgSchema *)parent; + if (n->GetSchema()->GetName()!=p->GetName()) parent=n->GetSchema(); return new dlgTable(this, frame, (pgPartition *)node, (pgSchema *)parent); } diff --git a/schema/pgPartition.cpp b/schema/pgPartition.cpp index 710957f..f94d0d5 100644 --- a/schema/pgPartition.cpp +++ b/schema/pgPartition.cpp @@ -76,11 +76,12 @@ wxString pgPartition::GetSql(ctlTree *browser) sql += pgTable::GetSql(browser); return sql; } - +ctlTree *tmp_br; pgObject *pgPartition::Refresh(ctlTree *browser, const wxTreeItemId item) { pgPartition *partition = 0; pgCollection *coll = browser->GetParentCollection(item); + tmp_br=browser; if (coll) partition = (pgPartition *)pg_partitionFactory.CreateObjects(coll, 0, wxT("\n AND rel.oid=") + GetOidStr()); @@ -197,7 +198,8 @@ pgObject *pgPartitionFactory::CreateObjects(pgCollection *coll, ctlTree *browser pgPartitionCollection *collection = (pgPartitionCollection *)coll; wxString query; pgPartition *table = 0; - + ctlTree *br=browser; + if (!br) br=tmp_br; // Greenplum returns reltuples and relpages as tuples per segmentDB and pages per segmentDB, // so we need to multiply them by the number of segmentDBs to get reasonable values. long gp_segments = 1; @@ -206,7 +208,7 @@ pgObject *pgPartitionFactory::CreateObjects(pgCollection *coll, ctlTree *browser //gp_segments = StrToLong(collection->GetDatabase()->ExecuteScalar(query)); //if (gp_segments <= 1) // gp_segments = 1; - + pgSet *tables; @@ -287,10 +289,10 @@ pgObject *pgPartitionFactory::CreateObjects(pgCollection *coll, ctlTree *browser wxTreeItemId currentItem = collection->GetSchema()->GetId(); pgCollection *collsch; wxTreeItemId scItem; - if (currentItem) scItem = browser->GetItemParent(currentItem); - collsch = (pgCollection *) browser->GetObject(scItem); + if (currentItem) scItem = br->GetItemParent(currentItem); + collsch = (pgCollection *) br->GetObject(scItem); if (!collsch) continue; - treeObjectIterator schemaIterator(browser, collsch); + treeObjectIterator schemaIterator(br, collsch); pgSchema *s; while ((s = (pgSchema *)schemaIterator.GetNextObject()) != 0) schemaArr.push_back(s);