Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id F0318200BDB for ; Mon, 12 Dec 2016 09:06:34 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id EECEF160B22; Mon, 12 Dec 2016 08:06:34 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 41D52160B0D for ; Mon, 12 Dec 2016 09:06:34 +0100 (CET) Received: (qmail 14632 invoked by uid 500); 12 Dec 2016 08:06:33 -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 14623 invoked by uid 99); 12 Dec 2016 08:06:33 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Dec 2016 08:06:33 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id EE2BF1A03CF for ; Mon, 12 Dec 2016 08:06:32 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -6.219 X-Spam-Level: X-Spam-Status: No, score=-6.219 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=-2.999] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id CvGwFeCZrL0D for ; Mon, 12 Dec 2016 08:06:31 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id DE0AB5FBAD for ; Mon, 12 Dec 2016 08:06:30 +0000 (UTC) Received: (qmail 13910 invoked by uid 99); 12 Dec 2016 08:06:30 -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; Mon, 12 Dec 2016 08:06:30 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 131CAE9411; Mon, 12 Dec 2016 08:06:30 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: mli@apache.org To: commits@hawq.incubator.apache.org Message-Id: <5538565033f34237aba06dc15d3badaf@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: incubator-hawq git commit: Revert "HAWQ-1195. Fixed error "Two or more external tables use the same error table "" Date: Mon, 12 Dec 2016 08:06:30 +0000 (UTC) archived-at: Mon, 12 Dec 2016 08:06:35 -0000 Repository: incubator-hawq Updated Branches: refs/heads/master 6b2a18e72 -> f27bbd0d1 Revert "HAWQ-1195. Fixed error "Two or more external tables use the same error table "" This reverts commit fad1b90505b3112d480cf1635f16edd8a957cc85. Because regression test failed. Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/f27bbd0d Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/f27bbd0d Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/f27bbd0d Branch: refs/heads/master Commit: f27bbd0d16fb676f568349be827262390b7608c2 Parents: 6b2a18e Author: Ming LI Authored: Mon Dec 12 16:04:59 2016 +0800 Committer: Ming LI Committed: Mon Dec 12 16:05:32 2016 +0800 ---------------------------------------------------------------------- src/backend/executor/execMain.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/f27bbd0d/src/backend/executor/execMain.c ---------------------------------------------------------------------- diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c index 27c1b15..578b9e8 100644 --- a/src/backend/executor/execMain.c +++ b/src/backend/executor/execMain.c @@ -258,6 +258,25 @@ SetupSegnoForErrorTable(Node *node, QueryCxtWalkerCxt *cxt) if (!OidIsValid(scan->fmterrtbl)) return false; + /* + * check if two external table use the same error table in a statement + */ + if (info->errTblOid) + { + ListCell *c; + Oid errtbloid; + foreach(c, info->errTblOid) + { + errtbloid = lfirst_oid(c); + if (errtbloid == scan->fmterrtbl) + { + Relation rel = heap_open(scan->fmterrtbl, AccessShareLock); + elog(ERROR, "Two or more external tables use the same error table \"%s\" in a statement", + RelationGetRelationName(rel)); + } + } + } + /* * Prepare error table for insert. */ @@ -266,12 +285,12 @@ SetupSegnoForErrorTable(Node *node, QueryCxtWalkerCxt *cxt) scan->errAosegnos = errSegnos; info->errTblOid = lcons_oid(scan->fmterrtbl, info->errTblOid); - Relation errRel = heap_open(scan->fmterrtbl, NoLock); + Relation errRel = heap_open(scan->fmterrtbl, RowExclusiveLock); CreateAppendOnlyParquetSegFileForRelationOnMaster(errRel, errSegnos); prepareDispatchedCatalogSingleRelation(info, scan->fmterrtbl, TRUE, errSegnos); scan->err_aosegfileinfos = fetchSegFileInfos(scan->fmterrtbl, errSegnos); - heap_close(errRel, NoLock); + heap_close(errRel, RowExclusiveLock); return false; default: