hawq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hornn <...@git.apache.org>
Subject [GitHub] incubator-hawq pull request: HAWQ-405. Fix for handling of pg_temp...
Date Wed, 10 Feb 2016 21:53:29 GMT
Github user hornn commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/338#discussion_r52531944
  
    --- Diff: src/backend/catalog/namespace.c ---
    @@ -1495,18 +1495,34 @@ LookupInternalNamespaceId(const char *nspname)
     Oid
     LookupNamespaceId(const char *nspname, Oid dboid)
     {
    -    if(gp_upgrade_mode){
    +
    +	/* check for pg_temp alias */
    +	if (NSPDBOID_CURRENT == dboid && strcmp(nspname, "pg_temp") == 0)
    +	{
    +		if (TempNamespaceValid(true))
    +			return myTempNamespace;
    +		/*
    +		 * Since this is used only for looking up existing objects, there
    +		 * is no point in trying to initialize the temp namespace here;
    +		 * and doing so might create problems for some callers.
    +		 * Just fall through and give the "does not exist" error.
    +		 */
    +	}
    +
    +    if(gp_upgrade_mode)
    +    {
             // This code is only need at hawq2.0 upgrade, in this case the old pg_namespace
doesn't 
             // have column nspdboid, so we report error in else clause
    -        if(ObjectIdGetDatum(dboid)==NSPDBOID_CURRENT){
    +        if(ObjectIdGetDatum(dboid)==NSPDBOID_CURRENT)
    +        {
                 return caql_getoid(
     			NULL,
     			cql("SELECT oid FROM pg_namespace "
     				" WHERE nspname = :1",
     				CStringGetDatum((char *) nspname)));
    -        }else{
    -            elog(ERROR, "Upgrade cann't process the namespace: %s in dbid: %i", nspname,
dboid);
             }
    +        else
    +        	elog(ERROR, "Upgrade cann't process the namespace: %s in dbid: %i", nspname,
dboid);
    --- End diff --
    
    typo cannot


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message