Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
amorynan committed Dec 12, 2024
1 parent 370c175 commit 0c83421
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,13 @@ private static long parseIPv4toLong(String ipv4) {

private static String parseLongToIPv4(long ipv4) {
StringBuilder sb = new StringBuilder();
sb.append("\"");
for (int i = 3; i >= 0; i--) {
short octet = (short) ((ipv4 >> (i * 8)) & 0xFF);
sb.append(octet);
if (i > 0) {
sb.append(".");
}
}
sb.append("\"");
return sb.toString();
}

Expand All @@ -117,7 +115,7 @@ public Expr clone() {

@Override
protected String toSqlImpl() {
return getStringValue();
return "\"" + getStringValue() + "\"";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private void checkValueValid(String ipv6) throws AnalysisException {

@Override
protected String toSqlImpl() {
return getStringValue();
return "\"" + getStringValue() + "\"";
}

@Override
Expand All @@ -101,7 +101,7 @@ public int compareLiteral(LiteralExpr expr) {

@Override
public String getStringValue() {
return "\"" + this.value + "\"";
return this.value;
}

@Override
Expand Down

0 comments on commit 0c83421

Please sign in to comment.