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 AA139184B1 for ; Sat, 30 Jan 2016 01:46:54 +0000 (UTC) Received: (qmail 31502 invoked by uid 500); 30 Jan 2016 01:46:54 -0000 Delivered-To: apmail-hawq-commits-archive@hawq.apache.org Received: (qmail 31457 invoked by uid 500); 30 Jan 2016 01:46:54 -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 31448 invoked by uid 99); 30 Jan 2016 01:46:54 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 30 Jan 2016 01:46:54 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 2AA8018060F for ; Sat, 30 Jan 2016 01:46:54 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.227 X-Spam-Level: * X-Spam-Status: No, score=1.227 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.554, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 8wVwXCHr7Czk for ; Sat, 30 Jan 2016 01:46:45 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with SMTP id 6E338205F5 for ; Sat, 30 Jan 2016 01:46:45 +0000 (UTC) Received: (qmail 31413 invoked by uid 99); 30 Jan 2016 01:46:45 -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; Sat, 30 Jan 2016 01:46:45 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1323BE006B; Sat, 30 Jan 2016 01:46:45 +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: <68f099a75bc94e8283c7b809d5de1018@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: incubator-hawq git commit: HAWQ-369. Hcatalog as reserved name need regression tests. Date: Sat, 30 Jan 2016 01:46:45 +0000 (UTC) Repository: incubator-hawq Updated Branches: refs/heads/HAWQ-369 cafee60ec -> 609c586de HAWQ-369. Hcatalog as reserved name need regression tests. Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/609c586d Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/609c586d Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/609c586d Branch: refs/heads/HAWQ-369 Commit: 609c586de1dd69a3265395af11dfd2e1aa714022 Parents: cafee60 Author: Oleksandr Diachenko Authored: Fri Jan 29 17:46:35 2016 -0800 Committer: Oleksandr Diachenko Committed: Fri Jan 29 17:46:35 2016 -0800 ---------------------------------------------------------------------- src/backend/commands/schemacmds.c | 19 +++++++++++++++++++ src/test/regress/input/hcatalog_lookup.source | 3 +++ src/test/regress/output/hcatalog_lookup.source | 4 +--- 3 files changed, 23 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/609c586d/src/backend/commands/schemacmds.c ---------------------------------------------------------------------- diff --git a/src/backend/commands/schemacmds.c b/src/backend/commands/schemacmds.c index 4ce2fe1..45efafd 100644 --- a/src/backend/commands/schemacmds.c +++ b/src/backend/commands/schemacmds.c @@ -92,6 +92,15 @@ CreateSchemaCommand(CreateSchemaStmt *stmt, const char *queryString) owner_uid = saved_uid; /* + * Make sure schema name is not "hcatalog" + */ + if (strcmp(schemaName, "hcatalog") == 0) + { + ereport(ERROR, + (errcode(ERRCODE_RESERVED_HCATALOG_NAME), + errmsg("hcatalog is a reserved name for hcatalog feature integration"))); + } + /* * If we are creating a temporary schema then we can skip a * bunch of checks that we would otherwise make. */ @@ -388,6 +397,16 @@ RenameSchema(const char *oldname, const char *newname) errdetail("Schema %s is reserved for system use.", oldname))); } + /* + * Make sure new schema name is not "hcatalog" + */ + if (strcmp(newname, "hcatalog") == 0) + { + ereport(ERROR, + (errcode(ERRCODE_RESERVED_HCATALOG_NAME), + errmsg("hcatalog is a reserved name for hcatalog feature integration"))); + } + if (!allowSystemTableModsDDL && (IsReservedName(newname) || strcmp(newname, "madlib") == 0)) { http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/609c586d/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 04585d1..164c7ae 100644 --- a/src/test/regress/input/hcatalog_lookup.source +++ b/src/test/regress/input/hcatalog_lookup.source @@ -141,6 +141,9 @@ select pg_catalog.pg_database_size(6120); --negative test: cannot create database named "hcatalog" CREATE DATABASE hcatalog; +--negative test: cannot create schema named "hcatalog" +CREATE SCHEMA hcatalog; + --negative test: cannot rename exiting database to "hcatalog" SET gp_called_by_pgdump = true; ALTER DATABASE regression RENAME TO hcatalog; http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/609c586d/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 d980d77..2f45e17 100644 --- a/src/test/regress/output/hcatalog_lookup.source +++ b/src/test/regress/output/hcatalog_lookup.source @@ -268,14 +268,12 @@ select pg_catalog.pg_database_size(6120); ERROR: database hcatalog (OID 6120) is reserved (SOMEFILE:SOMEFUNC) --negative test: cannot create database named "hcatalog" CREATE DATABASE hcatalog; -ERROR: hcatalog is a reserved name for hcatalog feature integration +ERROR: hcatalog is a reserved name for hcatalog feature integration --negative test: cannot rename exiting database to "hcatalog" SET gp_called_by_pgdump = true; -SET ALTER DATABASE regression RENAME TO hcatalog; ERROR: hcatalog is a reserved name for hcatalog feature integration SET gp_called_by_pgdump = false; -SET -- cleanup DROP schema test_schema cascade; NOTICE: drop cascades to append only table test_schema.r