mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
eavl SQLBinaryExpr
This commit is contained in:
@@ -18,7 +18,7 @@ package com.alibaba.druid.sql.ast.expr;
|
||||
import com.alibaba.druid.sql.ast.SQLExprImpl;
|
||||
import com.alibaba.druid.sql.visitor.SQLASTVisitor;
|
||||
|
||||
public class SQLBinaryExpr extends SQLExprImpl implements SQLLiteralExpr, SQLValuableExpr {
|
||||
public class SQLBinaryExpr extends SQLExprImpl implements SQLLiteralExpr {
|
||||
|
||||
private String value;
|
||||
|
||||
|
||||
@@ -584,11 +584,11 @@ public class SQLEvalVisitorUtils {
|
||||
String text = x.getValue();
|
||||
|
||||
long[] words = new long[text.length() / 64 + 1];
|
||||
for (int i = 0; i < text.length(); ++i) {
|
||||
for (int i = text.length()-1; i >= 0 ; --i) {
|
||||
char ch = text.charAt(i);
|
||||
if (ch == '1') {
|
||||
int wordIndex = i >> 6;
|
||||
words[wordIndex] |= (1L << i);
|
||||
words[wordIndex] |= (1L << (text.length() - 1 - i));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -600,7 +600,7 @@ public class SQLEvalVisitorUtils {
|
||||
byte[] bytes = new byte[words.length * 8];
|
||||
|
||||
for (int i = 0; i < words.length; ++i) {
|
||||
Utils.putLong(bytes, i * 8, words[i]);
|
||||
Utils.putLong(bytes, (words.length-1-i) * 8, words[i]);
|
||||
}
|
||||
|
||||
val = new BigInteger(bytes);
|
||||
|
||||
Reference in New Issue
Block a user