You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hawq.apache.org by od...@apache.org on 2016/04/11 21:24:49 UTC
incubator-hawq git commit: HAWQ-628. Return -1 instead of error.
Repository: incubator-hawq
Updated Branches:
refs/heads/HAWQ-628 [created] c2e19b725
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/c2e19b72
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/c2e19b72
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/c2e19b72
Branch: refs/heads/HAWQ-628
Commit: c2e19b7252718020feebacf3e76bb46c91a31a3b
Parents: 3ab82d7
Author: Oleksandr Diachenko <od...@pivotal.io>
Authored: Mon Apr 11 12:24:37 2016 -0700
Committer: Oleksandr Diachenko <od...@pivotal.io>
Committed: Mon Apr 11 12:24:37 2016 -0700
----------------------------------------------------------------------
src/backend/utils/adt/dbsize.c | 4 +---
src/test/regress/output/hcatalog_lookup.source | 12 ++++++++++--
2 files changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/c2e19b72/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/c2e19b72/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..1440481 100644
--- a/src/test/regress/output/hcatalog_lookup.source
+++ b/src/test/regress/output/hcatalog_lookup.source
@@ -277,9 +277,17 @@ alter table test_schema.p exchange partition p1 with table hcatalog.test_schema.
ERROR: reference to hcatalog table "hcatalog.test_schema.r" is not allowed in this context
-- negative test: cannot run pg_database_size on 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"