Github user hornn commented on a diff in the pull request:
https://github.com/apache/incubator-hawq/pull/1002#discussion_r86447937
--- Diff: src/backend/access/transam/varsup.c ---
@@ -474,73 +479,53 @@ ResetExternalObjectId(void)
/*
* master_highest_used_oid
- * Query the database to find the highest used Oid by
+ * Uses CAQL to find the highest used Oid by
* 1) Find all the relations that has Oids
* 2) Find max oid from those relations
*/
Oid
master_highest_used_oid(void)
{
Oid oidMax = InvalidOid;
+ Oid currentOid;
+ Form_pg_class classForm;
+ int fetchCount;
- if (SPI_OK_CONNECT != SPI_connect())
- {
- ereport(ERROR, (errcode(ERRCODE_CDB_INTERNAL_ERROR),
- errmsg("Unable to connect to execute internal
query for HCatalog.")));
- }
-
- int ret = SPI_execute("SELECT relname FROM pg_class where
relhasoids=true", true, 0);
+ cqContext *pcqOuterCtx = caql_beginscan(
+ NULL,
+ cql("SELECT * FROM pg_class where relhasoids = :1",
--- End diff --
shouldn't it be `SELECT relname ...` like it was in the previous query?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---