Return-Path: X-Original-To: apmail-hawq-commits-archive@minotaur.apache.org Delivered-To: apmail-hawq-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B85261928F for ; Tue, 12 Apr 2016 22:07:45 +0000 (UTC) Received: (qmail 76453 invoked by uid 500); 12 Apr 2016 22:07:45 -0000 Delivered-To: apmail-hawq-commits-archive@hawq.apache.org Received: (qmail 76410 invoked by uid 500); 12 Apr 2016 22:07:45 -0000 Mailing-List: contact commits-help@hawq.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hawq.incubator.apache.org Delivered-To: mailing list commits@hawq.incubator.apache.org Received: (qmail 76398 invoked by uid 99); 12 Apr 2016 22:07:45 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Apr 2016 22:07:45 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 08801C2442 for ; Tue, 12 Apr 2016 22:07:45 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.216 X-Spam-Level: X-Spam-Status: No, score=-4.216 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.996] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id xAnO6U3vJrSq for ; Tue, 12 Apr 2016 22:07:43 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id 927EF5F239 for ; Tue, 12 Apr 2016 22:07:42 +0000 (UTC) Received: (qmail 76384 invoked by uid 99); 12 Apr 2016 22:07:41 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Apr 2016 22:07:41 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 72CF0DFC4F; Tue, 12 Apr 2016 22:07:41 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: odiachenko@apache.org To: commits@hawq.incubator.apache.org Message-Id: <9a689cd5766c45d285012759eab87e60@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: incubator-hawq git commit: HAWQ-628. Return -1 instead of error. [Forced Update!] Date: Tue, 12 Apr 2016 22:07:41 +0000 (UTC) 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 Authored: Mon Apr 11 12:24:37 2016 -0700 Committer: Oleksandr Diachenko 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"