diff --git a/core/trino-main/src/main/java/io/trino/operator/scalar/JoniRegexpFunctions.java b/core/trino-main/src/main/java/io/trino/operator/scalar/JoniRegexpFunctions.java index 56aa7784bb50..3a943da09600 100644 --- a/core/trino-main/src/main/java/io/trino/operator/scalar/JoniRegexpFunctions.java +++ b/core/trino-main/src/main/java/io/trino/operator/scalar/JoniRegexpFunctions.java @@ -416,9 +416,6 @@ public static int getSearchingOffset(Matcher matcher, int at, int range) return matcher.searchInterruptible(at, range, Option.DEFAULT); } catch (InterruptedException interruptedException) { - // The JONI library is compliant with the InterruptedException contract. They reset the interrupted flag before throwing an exception. - // Since the InterruptedException is being caught the interrupt flag must either be recovered or the thread must be terminated. - // Since we are simply throwing a different exception, the interrupt flag must be recovered to propagate the interrupted status to the upper level code. Thread.currentThread().interrupt(); throw new TrinoException(GENERIC_USER_ERROR, "" + "Regular expression matching was interrupted, likely because it took too long. " + diff --git a/core/trino-main/src/main/java/io/trino/type/LikeFunctions.java b/core/trino-main/src/main/java/io/trino/type/LikeFunctions.java index b50eb00867c4..8020104bf0db 100644 --- a/core/trino-main/src/main/java/io/trino/type/LikeFunctions.java +++ b/core/trino-main/src/main/java/io/trino/type/LikeFunctions.java @@ -253,9 +253,6 @@ private static int getMatchingOffset(Matcher matcher, int at, int range) return matcher.matchInterruptible(at, range, Option.NONE); } catch (InterruptedException interruptedException) { - // The JONI library is compliant with the InterruptedException contract. They reset the interrupted flag before throwing an exception. - // Since the InterruptedException is being caught the interrupt flag must either be recovered or the thread must be terminated. - // Since we are simply throwing a different exception, the interrupt flag must be recovered to propagate the interrupted status to the upper level code. Thread.currentThread().interrupt(); throw new TrinoException(GENERIC_USER_ERROR, "" + "Regular expression matching was interrupted, likely because it took too long. " +