hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odiache...@apache.org
Subject incubator-hawq git commit: HAWQ-628. Return -1 instead of error. [Forced Update!]
Date Tue, 12 Apr 2016 22:03:57 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/HAWQ-628 c2e19b725 -> 1a8d51fee (forced update)


HAWQ-628. Return -1 instead of error.


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/1a8d51fe
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/1a8d51fe
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/1a8d51fe

Branch: refs/heads/HAWQ-628
Commit: 1a8d51feec54c71f6a09907472f81b8280070597
Parents: 3ab82d7
Author: Oleksandr Diachenko <odiachenko@pivotal.io>
Authored: Mon Apr 11 12:24:37 2016 -0700
Committer: Oleksandr Diachenko <odiachenko@pivotal.io>
Committed: Tue Apr 12 15:03:47 2016 -0700

----------------------------------------------------------------------
 src/backend/utils/adt/dbsize.c                 |  4 +---
 src/test/regress/input/hcatalog_lookup.source  |  2 +-
 src/test/regress/output/hcatalog_lookup.source | 14 +++++++++++---
 3 files changed, 13 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1a8d51fe/src/backend/utils/adt/dbsize.c
----------------------------------------------------------------------
diff --git a/src/backend/utils/adt/dbsize.c b/src/backend/utils/adt/dbsize.c
index 12f70b9..82ff1a8 100644
--- a/src/backend/utils/adt/dbsize.c
+++ b/src/backend/utils/adt/dbsize.c
@@ -180,9 +180,7 @@ calculate_database_size(Oid dbOid)
 	Assert(Gp_role != GP_ROLE_EXECUTE);
 
 	if (dbOid == HcatalogDbOid)
-		ereport(ERROR,
-			(ERRCODE_UNDEFINED_DATABASE,
-			errmsg("database hcatalog (OID 6120) is reserved")));
+		return -1;
 
 	/* User must have connect privilege for target database */
 	aclresult = pg_database_aclcheck(dbOid, GetUserId(), ACL_CONNECT);

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1a8d51fe/src/test/regress/input/hcatalog_lookup.source
----------------------------------------------------------------------
diff --git a/src/test/regress/input/hcatalog_lookup.source b/src/test/regress/input/hcatalog_lookup.source
index 239494a..2e3b5ea 100644
--- a/src/test/regress/input/hcatalog_lookup.source
+++ b/src/test/regress/input/hcatalog_lookup.source
@@ -142,7 +142,7 @@ select r1.*, r2.* from hcatalog.test_schema.r r1, test_schema.r r2;
 -- negative test: partitioned tables and hcatalog
 alter table test_schema.p exchange partition p1 with table hcatalog.test_schema.r;
 
--- negative test: cannot run pg_database_size on hcatalog
+-- negative test: return -1 as a size for hcatalog
 select pg_catalog.pg_database_size('hcatalog');
 select pg_catalog.pg_database_size(6120);
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1a8d51fe/src/test/regress/output/hcatalog_lookup.source
----------------------------------------------------------------------
diff --git a/src/test/regress/output/hcatalog_lookup.source b/src/test/regress/output/hcatalog_lookup.source
index 609c6d8..8eefb49 100644
--- a/src/test/regress/output/hcatalog_lookup.source
+++ b/src/test/regress/output/hcatalog_lookup.source
@@ -275,11 +275,19 @@ select r1.*, r2.* from hcatalog.test_schema.r r1, test_schema.r r2;
 -- negative test: partitioned tables and hcatalog
 alter table test_schema.p exchange partition p1 with table hcatalog.test_schema.r;
 ERROR:  reference to hcatalog table "hcatalog.test_schema.r" is not allowed in this context
--- negative test: cannot run pg_database_size on hcatalog
+-- negative test: return -1 as a size for hcatalog
 select pg_catalog.pg_database_size('hcatalog');
-ERROR:  database hcatalog (OID 6120) is reserved (SOMEFILE:SOMEFUNC)
+ pg_database_size 
+------------------
+               -1
+(1 row)
+
 select pg_catalog.pg_database_size(6120);
-ERROR:  database hcatalog (OID 6120) is reserved (SOMEFILE:SOMEFUNC)
+ pg_database_size 
+------------------
+               -1
+(1 row)
+
 --positive test: should be able to create table named "hcatalog"
 CREATE TABLE hcatalog(a int);
 --negative test: cannot create database named "hcatalog"


Mime
View raw message