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 19328200D41 for ; Wed, 22 Nov 2017 07:52:05 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 17A68160BFD; Wed, 22 Nov 2017 06:52:05 +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 858ED160BDA for ; Wed, 22 Nov 2017 07:52:04 +0100 (CET) Received: (qmail 76428 invoked by uid 500); 22 Nov 2017 06:52:03 -0000 Mailing-List: contact dev-help@phoenix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@phoenix.apache.org Delivered-To: mailing list dev@phoenix.apache.org Received: (qmail 76417 invoked by uid 99); 22 Nov 2017 06:52:03 -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; Wed, 22 Nov 2017 06:52:03 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4AB03DFF72; Wed, 22 Nov 2017 06:52:03 +0000 (UTC) From: ankitsinghal To: dev@phoenix.apache.org Reply-To: dev@phoenix.apache.org References: In-Reply-To: Subject: [GitHub] phoenix pull request #283: PHOENIX-672 Add GRANT and REVOKE commands using H... Content-Type: text/plain Message-Id: <20171122065203.4AB03DFF72@git1-us-west.apache.org> Date: Wed, 22 Nov 2017 06:52:03 +0000 (UTC) archived-at: Wed, 22 Nov 2017 06:52:05 -0000 Github user ankitsinghal commented on a diff in the pull request: https://github.com/apache/phoenix/pull/283#discussion_r152480973 --- Diff: phoenix-core/src/test/java/org/apache/phoenix/parse/QueryParserTest.java --- @@ -66,6 +68,46 @@ private void parseQueryThatShouldFail(String sql) throws Exception { } } + @Test + public void testParseGrantQuery() throws Exception { + + String sql0 = "GRANT 'RX' ON SYSTEM.\"SEQUENCE\" TO 'user'"; + parseQuery(sql0); + String sql1 = "GRANT 'RWXCA' ON TABLE some_table0 TO 'user0'"; + parseQuery(sql1); + String sql2 = "GRANT 'RWX' ON some_table1 TO 'user1'"; + parseQuery(sql2); + String sql3 = "GRANT 'CA' ON SCHEMA some_schema2 TO 'user2'"; + parseQuery(sql3); + String sql4 = "GRANT 'RXW' ON some_table3 TO GROUP 'group3'"; + parseQuery(sql4); + String sql5 = "GRANT 'RXW' ON \"some_schema5\".\"some_table5\" TO GROUP 'group5'"; + parseQuery(sql5); + String sql6 = "GRANT 'RWA' TO 'user6'"; + parseQuery(sql6); + String sql7 = "GRANT 'A' TO GROUP 'group7'"; + parseQuery(sql7); --- End diff -- Do we have validation on permission type like fail when permission is other than 'RWXCA' at parsing side? ---