提交 0678a27b authored 作者: noelgrandin's avatar noelgrandin

fix previous commit

上级 90dc0db2
...@@ -385,7 +385,9 @@ public class LobStorageBackend implements LobStorageInterface { ...@@ -385,7 +385,9 @@ public class LobStorageBackend implements LobStorageInterface {
ValueLobDb v = ValueLobDb.createSmallLob(type, small, precision); ValueLobDb v = ValueLobDb.createSmallLob(type, small, precision);
return v; return v;
} }
return registerLob(type, lobId, LobStorageFrontend.TABLE_TEMP, length); // For a BLOB, precision is length in bytes. For a CLOB, precision is length in chars
long precision = countingReaderForClob == null ? length : countingReaderForClob.getLength();
return registerLob(type, lobId, LobStorageFrontend.TABLE_TEMP, length, precision);
} catch (IOException e) { } catch (IOException e) {
if (lobId != -1) { if (lobId != -1) {
removeLob(lobId); removeLob(lobId);
...@@ -397,7 +399,7 @@ public class LobStorageBackend implements LobStorageInterface { ...@@ -397,7 +399,7 @@ public class LobStorageBackend implements LobStorageInterface {
} }
} }
private ValueLobDb registerLob(int type, long lobId, int tableId, long byteCount) { private ValueLobDb registerLob(int type, long lobId, int tableId, long byteCount, long precision) {
synchronized (conn.getSession()) { synchronized (conn.getSession()) {
synchronized (database) { synchronized (database) {
try { try {
...@@ -408,7 +410,7 @@ public class LobStorageBackend implements LobStorageInterface { ...@@ -408,7 +410,7 @@ public class LobStorageBackend implements LobStorageInterface {
prep.setInt(3, tableId); prep.setInt(3, tableId);
prep.execute(); prep.execute();
reuse(sql, prep); reuse(sql, prep);
ValueLobDb v = ValueLobDb.create(type, database, tableId, lobId, null, byteCount); ValueLobDb v = ValueLobDb.create(type, database, tableId, lobId, null, precision);
return v; return v;
} catch (SQLException e) { } catch (SQLException e) {
throw DbException.convert(e); throw DbException.convert(e);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论