提交 da1d6bf7 authored 作者: Thomas Mueller's avatar Thomas Mueller

StringUtils.convertBytesToHex

上级 3b457ffc
...@@ -2472,7 +2472,7 @@ public class Parser { ...@@ -2472,7 +2472,7 @@ public class Parser {
r = ValueExpression.get(ValueTimestamp.getNoCopy(ValueTimestamp.parseTimestamp(timestamp))); r = ValueExpression.get(ValueTimestamp.getNoCopy(ValueTimestamp.parseTimestamp(timestamp)));
} else if (equalsToken("X", name)) { } else if (equalsToken("X", name)) {
read(); read();
byte[] buffer = StringUtils.convertStringToBytes(currentValue.getString()); byte[] buffer = StringUtils.convertHexToBytes(currentValue.getString());
r = ValueExpression.get(ValueBytes.getNoCopy(buffer)); r = ValueExpression.get(ValueBytes.getNoCopy(buffer));
} else if (equalsToken("E", name)) { } else if (equalsToken("E", name)) {
String text = currentValue.getString(); String text = currentValue.getString();
......
...@@ -69,7 +69,7 @@ public class AlterUser extends DefineCommand { ...@@ -69,7 +69,7 @@ public class AlterUser extends DefineCommand {
} }
private byte[] getByteArray(Expression e) { private byte[] getByteArray(Expression e) {
return StringUtils.convertStringToBytes(e.optimize(session).getValue(session).getString()); return StringUtils.convertHexToBytes(e.optimize(session).getValue(session).getString());
} }
public int update() { public int update() {
......
...@@ -52,7 +52,7 @@ public class CreateUser extends DefineCommand { ...@@ -52,7 +52,7 @@ public class CreateUser extends DefineCommand {
} }
private byte[] getByteArray(Expression e) { private byte[] getByteArray(Expression e) {
return StringUtils.convertStringToBytes(e.optimize(session).getValue(session).getString()); return StringUtils.convertHexToBytes(e.optimize(session).getValue(session).getString());
} }
public int update() { public int update() {
......
...@@ -364,7 +364,7 @@ public class ScriptCommand extends ScriptBase { ...@@ -364,7 +364,7 @@ public class ScriptCommand extends ScriptBase {
if (len <= 0) { if (len <= 0) {
break; break;
} }
buff.append(StringUtils.convertBytesToString(bytes, len)).append("')"); buff.append(StringUtils.convertBytesToHex(bytes, len)).append("')");
String sql = buff.toString(); String sql = buff.toString();
add(sql, true); add(sql, true);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论