提交 86f06728 authored 作者: S.Vladykin's avatar S.Vladykin

Added getCompareMode method to DataHandler.

上级 05821d35
......@@ -10,7 +10,6 @@ import java.io.BufferedOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import org.h2.api.ErrorCode;
import org.h2.api.JavaObjectSerializer;
import org.h2.command.Prepared;
......@@ -31,6 +30,7 @@ import org.h2.tools.CompressTool;
import org.h2.util.IOUtils;
import org.h2.util.SmallLRUCache;
import org.h2.util.TempFileDeleter;
import org.h2.value.CompareMode;
/**
* This class is the base for RunScriptCommand and ScriptCommand.
......@@ -259,4 +259,9 @@ abstract class ScriptBase extends Prepared implements DataHandler {
public JavaObjectSerializer getJavaObjectSerializer() {
return session.getDataHandler().getJavaObjectSerializer();
}
@Override
public CompareMode getCompareMode() {
return session.getDataHandler().getCompareMode();
}
}
......@@ -1530,6 +1530,7 @@ public class Database implements DataHandler {
return cluster;
}
@Override
public CompareMode getCompareMode() {
return compareMode;
}
......
......@@ -8,7 +8,6 @@ package org.h2.engine;
import java.io.IOException;
import java.net.Socket;
import java.util.ArrayList;
import org.h2.api.DatabaseEventListener;
import org.h2.api.ErrorCode;
import org.h2.api.JavaObjectSerializer;
......@@ -32,6 +31,7 @@ import org.h2.util.New;
import org.h2.util.SmallLRUCache;
import org.h2.util.StringUtils;
import org.h2.util.TempFileDeleter;
import org.h2.value.CompareMode;
import org.h2.value.Transfer;
import org.h2.value.Value;
......@@ -90,6 +90,8 @@ public class SessionRemote extends SessionWithState implements DataHandler {
private JavaObjectSerializer javaObjectSerializer;
private volatile boolean javaObjectSerializerInitialized;
private CompareMode compareMode = CompareMode.getInstance(null, 0);
public SessionRemote(ConnectionInfo ci) {
this.connectionInfo = ci;
......@@ -846,4 +848,9 @@ public class SessionRemote extends SessionWithState implements DataHandler {
public void addTemporaryLob(Value v) {
// do nothing
}
@Override
public CompareMode getCompareMode() {
return compareMode;
}
}
......@@ -81,7 +81,6 @@ public class JdbcConnection extends TraceObject implements Connection {
private int savepointId;
private String catalog;
private Statement executingStatement;
private final CompareMode compareMode = CompareMode.getInstance(null, 0);
private final CloseWatcher watcher;
private int queryTimeoutCache = -1;
......@@ -1938,7 +1937,7 @@ public class JdbcConnection extends TraceObject implements Connection {
}
CompareMode getCompareMode() {
return compareMode;
return session.getDataHandler().getCompareMode();
}
/**
......
......@@ -9,6 +9,7 @@ import org.h2.api.JavaObjectSerializer;
import org.h2.message.DbException;
import org.h2.util.SmallLRUCache;
import org.h2.util.TempFileDeleter;
import org.h2.value.CompareMode;
/**
* A data handler contains a number of callback methods, mostly related to CLOB
......@@ -113,4 +114,11 @@ public interface DataHandler {
* column of type OTHER
*/
JavaObjectSerializer getJavaObjectSerializer();
/**
* Return compare mode.
*
* @return Compare mode.
*/
CompareMode getCompareMode();
}
......@@ -28,7 +28,6 @@ import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.zip.CRC32;
import org.h2.api.ErrorCode;
import org.h2.api.JavaObjectSerializer;
import org.h2.compress.CompressLZF;
......@@ -72,6 +71,7 @@ import org.h2.util.StringUtils;
import org.h2.util.TempFileDeleter;
import org.h2.util.Tool;
import org.h2.util.Utils;
import org.h2.value.CompareMode;
import org.h2.value.Value;
import org.h2.value.ValueArray;
import org.h2.value.ValueLob;
......@@ -1730,4 +1730,9 @@ public class Recover extends Tool implements DataHandler {
public JavaObjectSerializer getJavaObjectSerializer() {
return null;
}
@Override
public CompareMode getCompareMode() {
return CompareMode.getInstance(null, 0);
}
}
......@@ -339,4 +339,8 @@ public class TestDataPage extends TestBase implements DataHandler {
return null;
}
@Override
public CompareMode getCompareMode() {
return compareMode;
}
}
......@@ -6,7 +6,6 @@
package org.h2.test.unit;
import java.util.Random;
import org.h2.api.JavaObjectSerializer;
import org.h2.store.DataHandler;
import org.h2.store.FileStore;
......@@ -15,6 +14,7 @@ import org.h2.store.fs.FileUtils;
import org.h2.test.TestBase;
import org.h2.util.SmallLRUCache;
import org.h2.util.TempFileDeleter;
import org.h2.value.CompareMode;
/**
* Tests the in-memory file store.
......@@ -197,4 +197,8 @@ public class TestFile extends TestBase implements DataHandler {
return null;
}
@Override
public CompareMode getCompareMode() {
return CompareMode.getInstance(null, 0);
}
}
......@@ -171,4 +171,9 @@ public class TestValueHashMap extends TestBase implements DataHandler {
public JavaObjectSerializer getJavaObjectSerializer() {
return null;
}
@Override
public CompareMode getCompareMode() {
return compareMode;
}
}
......@@ -12,7 +12,6 @@ import java.sql.SQLException;
import java.util.ArrayList;
import java.util.IdentityHashMap;
import java.util.Random;
import org.h2.api.JavaObjectSerializer;
import org.h2.engine.Constants;
import org.h2.store.DataHandler;
......@@ -24,6 +23,7 @@ import org.h2.tools.SimpleResultSet;
import org.h2.util.SmallLRUCache;
import org.h2.util.TempFileDeleter;
import org.h2.util.Utils;
import org.h2.value.CompareMode;
import org.h2.value.DataType;
import org.h2.value.Value;
import org.h2.value.ValueArray;
......@@ -288,4 +288,9 @@ public class TestValueMemory extends TestBase implements DataHandler {
public JavaObjectSerializer getJavaObjectSerializer() {
return null;
}
@Override
public CompareMode getCompareMode() {
return CompareMode.getInstance(null, 0);
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论