Skip to content

Commit

Permalink
[fix](replay) sql mode helper throw npe when ctx == null (#40906)
Browse files Browse the repository at this point in the history
  • Loading branch information
morrySnow authored Sep 19, 2024
1 parent e327e70 commit 3a7a80b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions fe/fe-core/src/main/java/org/apache/doris/qe/SqlModeHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,18 @@ public static Map<String, Long> getCombineMode() {
}

public static boolean hasNoBackSlashEscapes() {
return ((ConnectContext.get().getSessionVariable().getSqlMode() & MODE_ALLOWED_MASK)
SessionVariable sessionVariable = ConnectContext.get() == null
? VariableMgr.newSessionVariable()
: ConnectContext.get().getSessionVariable();
return ((sessionVariable.getSqlMode() & MODE_ALLOWED_MASK)
& MODE_NO_BACKSLASH_ESCAPES) != 0;
}

public static boolean hasPipeAsConcat() {
return ((ConnectContext.get().getSessionVariable().getSqlMode() & MODE_ALLOWED_MASK)
SessionVariable sessionVariable = ConnectContext.get() == null
? VariableMgr.newSessionVariable()
: ConnectContext.get().getSessionVariable();
return ((sessionVariable.getSqlMode() & MODE_ALLOWED_MASK)
& MODE_PIPES_AS_CONCAT) != 0;
}

Expand Down

0 comments on commit 3a7a80b

Please sign in to comment.