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 96D5B200B4C for ; Fri, 22 Jul 2016 19:14:50 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 95546160A8E; Fri, 22 Jul 2016 17:14:50 +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 DE2F8160A5A for ; Fri, 22 Jul 2016 19:14:49 +0200 (CEST) Received: (qmail 62770 invoked by uid 500); 22 Jul 2016 17:14:49 -0000 Mailing-List: contact commits-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hive-dev@hive.apache.org Delivered-To: mailing list commits@hive.apache.org Received: (qmail 62759 invoked by uid 99); 22 Jul 2016 17:14:49 -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; Fri, 22 Jul 2016 17:14:49 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id DF8A0E058E; Fri, 22 Jul 2016 17:14:48 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ekoifman@apache.org To: commits@hive.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: hive git commit: HIVE-14292 ACID table creation fails on mysql with MySQLIntegrityConstraintViolationException(Eugene Koifman, reviewed by Wei Zheng) Date: Fri, 22 Jul 2016 17:14:48 +0000 (UTC) archived-at: Fri, 22 Jul 2016 17:14:50 -0000 Repository: hive Updated Branches: refs/heads/branch-1 a29d9b29f -> f21a40e8b HIVE-14292 ACID table creation fails on mysql with MySQLIntegrityConstraintViolationException(Eugene Koifman, reviewed by Wei Zheng) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/f21a40e8 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/f21a40e8 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/f21a40e8 Branch: refs/heads/branch-1 Commit: f21a40e8bfa0f219bdf48fd0347831cc32fd1aaf Parents: a29d9b2 Author: Eugene Koifman Authored: Fri Jul 22 10:14:37 2016 -0700 Committer: Eugene Koifman Committed: Fri Jul 22 10:14:37 2016 -0700 ---------------------------------------------------------------------- .../java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/f21a40e8/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java ---------------------------------------------------------------------- diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java b/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java index 16d45ed..2d6b177 100644 --- a/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java +++ b/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java @@ -3141,7 +3141,9 @@ abstract class TxnHandler implements TxnStore, TxnStore.MutexAPI { } break; case MYSQL: - if(ex.getErrorCode() == 1022 && "23000".equals(ex.getSQLState())) { + //https://dev.mysql.com/doc/refman/5.5/en/error-messages-server.html + if((ex.getErrorCode() == 1022 || ex.getErrorCode() == 1062 || ex.getErrorCode() == 1586) + && "23000".equals(ex.getSQLState())) { return true; } break;