Repository: hive Updated Branches: refs/heads/master e7480d79a -> d2d50e694
HIVE-18886: ACID: NPE on unexplained mysql exceptions (Gopal V, reviewed by Eugene Koifman) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/d2d50e69 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/d2d50e69 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/d2d50e69 Branch: refs/heads/master Commit: d2d50e6940438f9cb1309aea9d6f278ed93b0536 Parents: e7480d7 Author: Gopal V <gop...@apache.org> Authored: Fri Mar 16 16:54:49 2018 -0700 Committer: Gopal V <gop...@apache.org> Committed: Fri Mar 16 16:54:49 2018 -0700 ---------------------------------------------------------------------- .../org/apache/hadoop/hive/metastore/DatabaseProduct.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/d2d50e69/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/DatabaseProduct.java ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/DatabaseProduct.java b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/DatabaseProduct.java index 03a5e4a..0b3504d 100644 --- a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/DatabaseProduct.java +++ b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/DatabaseProduct.java @@ -53,10 +53,10 @@ public enum DatabaseProduct { public static boolean isDeadlock(DatabaseProduct dbProduct, SQLException e) { return e instanceof SQLTransactionRollbackException || ((dbProduct == MYSQL || dbProduct == POSTGRES || dbProduct == SQLSERVER) - && e.getSQLState().equals("40001")) - || (dbProduct == POSTGRES && e.getSQLState().equals("40P01")) - || (dbProduct == ORACLE && (e.getMessage().contains("deadlock detected") - || e.getMessage().contains("can't serialize access for this transaction"))); + && "40001".equals(e.getSQLState())) + || (dbProduct == POSTGRES && "40P01".equals(e.getSQLState())) + || (dbProduct == ORACLE && (e.getMessage() != null && (e.getMessage().contains("deadlock detected") + || e.getMessage().contains("can't serialize access for this transaction")))); } /**