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:07:41 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/HAWQ-628 1a8d51fee -> c30af7e98 (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/c30af7e9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/c30af7e9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/c30af7e9

Branch: refs/heads/HAWQ-628
Commit: c30af7e989ea858769d1c33a262a571054f7f2b6
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:07:36 2016 -0700

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


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/c30af7e9/src/backend/utils/adt/dbsize.c
----------------------------------------------------------------------
diff --git a/src/backend/utils/adt/dbsize.c b/src/backend/utils/adt/dbsize.c
index 12f70b9..a997cac 100644
--- a/src/backend/utils/adt/dbsize.c
+++ b/src/backend/utils/adt/dbsize.c
@@ -179,10 +179,9 @@ calculate_database_size(Oid dbOid)
 
 	Assert(Gp_role != GP_ROLE_EXECUTE);
 
+    /* Do not error out because it would break some existing client calls*/
 	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/c30af7e9/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/c30af7e9/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