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

StringUtils.convertBytesToHex

上级 da1d6bf7
...@@ -286,7 +286,7 @@ public class ConnectionInfo implements Cloneable { ...@@ -286,7 +286,7 @@ public class ConnectionInfo implements Cloneable {
private static byte[] hashPassword(boolean passwordHash, String userName, char[] password) { private static byte[] hashPassword(boolean passwordHash, String userName, char[] password) {
if (passwordHash) { if (passwordHash) {
return StringUtils.convertStringToBytes(new String(password)); return StringUtils.convertHexToBytes(new String(password));
} }
if (userName.length() == 0 && password.length == 0 && SysProperties.EMPTY_PASSWORD) { if (userName.length() == 0 && password.length == 0 && SysProperties.EMPTY_PASSWORD) {
return new byte[0]; return new byte[0];
......
...@@ -370,10 +370,8 @@ public class Session extends SessionWithState { ...@@ -370,10 +370,8 @@ public class Session extends SessionWithState {
this.lockTimeout = lockTimeout; this.lockTimeout = lockTimeout;
} }
public CommandInterface prepareCommand(String sql, int fetchSize) { public synchronized CommandInterface prepareCommand(String sql, int fetchSize) {
synchronized (database) { return prepareLocal(sql);
return prepareLocal(sql);
}
} }
/** /**
......
...@@ -158,9 +158,9 @@ public class User extends RightOwner { ...@@ -158,9 +158,9 @@ public class User extends RightOwner {
} }
if (password) { if (password) {
buff.append(" SALT '"). buff.append(" SALT '").
append(StringUtils.convertBytesToString(salt)). append(StringUtils.convertBytesToHex(salt)).
append("' HASH '"). append("' HASH '").
append(StringUtils.convertBytesToString(passwordHash)). append(StringUtils.convertBytesToHex(passwordHash)).
append('\''); append('\'');
} else { } else {
buff.append(" PASSWORD ''"); buff.append(" PASSWORD ''");
......
...@@ -491,7 +491,7 @@ public class FullText { ...@@ -491,7 +491,7 @@ public class FullText {
case Types.VARBINARY: case Types.VARBINARY:
case Types.LONGVARBINARY: case Types.LONGVARBINARY:
case Types.BINARY: case Types.BINARY:
return "'" + StringUtils.convertBytesToString((byte[]) data) + "'"; return "'" + StringUtils.convertBytesToHex((byte[]) data) + "'";
case Types.CLOB: case Types.CLOB:
case Types.JAVA_OBJECT: case Types.JAVA_OBJECT:
case Types.OTHER: case Types.OTHER:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论