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 6B4E2200D55 for ; Sat, 4 Nov 2017 00:21:04 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 69C31160BFB; Fri, 3 Nov 2017 23:21:04 +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 AE09C160BFC for ; Sat, 4 Nov 2017 00:21:03 +0100 (CET) Received: (qmail 71931 invoked by uid 500); 3 Nov 2017 23:21:02 -0000 Mailing-List: contact issues-help@sentry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@sentry.apache.org Received: (qmail 71922 invoked by uid 99); 3 Nov 2017 23:21:02 -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; Fri, 03 Nov 2017 23:21:02 +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 24498DFD9D for ; Fri, 3 Nov 2017 23:21:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] 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 c8X_k3Cf-loo for ; Fri, 3 Nov 2017 23:21:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id EB58A5FC38 for ; Fri, 3 Nov 2017 23:21:00 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 611F7E0D58 for ; Fri, 3 Nov 2017 23:21:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 1AB32241A0 for ; Fri, 3 Nov 2017 23:21:00 +0000 (UTC) Date: Fri, 3 Nov 2017 23:21:00 +0000 (UTC) From: "Hadoop QA (JIRA)" To: issues@sentry.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (SENTRY-2024) Specify Char Set for AUTHZ_OBJ_NAME MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 03 Nov 2017 23:21:04 -0000 [ https://issues.apache.org/jira/browse/SENTRY-2024?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16238565#comment-16238565 ] Hadoop QA commented on SENTRY-2024: ----------------------------------- Here are the results of testing the latest attachment https://issues.apache.org/jira/secure/attachment/12895974/SENTRY-2024.002.patch against master. {color:green}Overall:{color} +1 all checks pass {color:green}SUCCESS:{color} all tests passed Console output: https://builds.apache.org/job/PreCommit-SENTRY-Build/3406/console This message is automatically generated. > Specify Char Set for AUTHZ_OBJ_NAME > ----------------------------------- > > Key: SENTRY-2024 > URL: https://issues.apache.org/jira/browse/SENTRY-2024 > Project: Sentry > Issue Type: Bug > Components: Sentry > Affects Versions: 2.0.0 > Reporter: Na Li > Assignee: Na Li > Priority: Critical > Attachments: SENTRY-2024.001.patch, SENTRY-2024.001.patch, SENTRY-2024.001.patch, SENTRY-2024.002.patch, SENTRY-2024.002.patch > > > AUTHZ_OBJ_NAME has (384) chars. It is constructed by sentry from notification event as {color:red}DB_NAME + "." + TBL_NAME{color}. To be consistent with hive, sentry should use the same char set as what's used by DB_NAME and TBL_NAME > Besides, if its table char set is utf8, the constrain AUTHZOBJNAME will have error "Specified key was too long; max key length is 767 bytes" for mysql. > The solution is to specify the char set for this field, so it works for mysql regardless the char set of its table or DB. > Reference: > 1) CREATE TABLE AUTHZ_PATHS_MAPPING > ( > AUTHZ_OBJ_ID BIGINT NOT NULL generated always as identity (start with 1), > AUTHZ_OBJ_NAME VARCHAR({color:red}384{color}), > CREATE_TIME_MS BIGINT NOT NULL > ); > CREATE UNIQUE INDEX AUTHZOBJNAME ON AUTHZ_PATHS_MAPPING ({color:red}AUTHZ_OBJ_NAME{color}); > 2) AUTHZ_OBJ_NAME is constructed by sentry from notification event as DB_NAME + "." + TBL_NAME. To be consistent with hive, sentry should use the same char set as what's used by DB_NAME and TBL_NAME in NotificationProcessor.processAlterTable(). > 3) hive uses latin1 as default charset for notification event. > CREATE TABLE IF NOT EXISTS `NOTIFICATION_LOG` > ( > `NL_ID` BIGINT(20) NOT NULL, > `EVENT_ID` BIGINT(20) NOT NULL, > `EVENT_TIME` INT(11) NOT NULL, > `EVENT_TYPE` varchar(32) NOT NULL, > `DB_NAME` varchar(128), > `TBL_NAME` varchar(128), > `MESSAGE` mediumtext, > PRIMARY KEY (`NL_ID`) > ) ENGINE=InnoDB DEFAULT CHARSET=latin1; > 4) actual installation shows both fields are in latin1 char set. > SHOW FULL COLUMNS FROM NOTIFICATION_LOG; > +------------+--------------+-------------------+------+-----+---------+-------+---------------------------------+---------+ > | Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment | > +------------+--------------+-------------------+------+-----+---------+-------+---------------------------------+---------+ > | NL_ID | bigint(20) | NULL | NO | PRI | NULL | | select,insert,update,references | | > | EVENT_ID | bigint(20) | NULL | NO | | NULL | | select,insert,update,references | | > | EVENT_TIME | int(11) | NULL | NO | | NULL | | select,insert,update,references | | > | EVENT_TYPE | varchar(32) | latin1_swedish_ci | NO | | NULL | | select,insert,update,references | | > | DB_NAME | varchar(128) | latin1_swedish_ci | YES | | NULL | | select,insert,update,references | | > | TBL_NAME | varchar(128) | latin1_swedish_ci | YES | | NULL | | select,insert,update,references | | > | MESSAGE | mediumtext | latin1_swedish_ci | YES | | NULL | | select,insert,update,references | | > +------------+--------------+-------------------+------+-----+---------+-------+---------------------------------+---------+ -- This message was sent by Atlassian JIRA (v6.4.14#64029)