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

--no commit message

--no commit message
上级 4b0fe6a5
...@@ -547,14 +547,6 @@ public class Select extends Query { ...@@ -547,14 +547,6 @@ public class Select extends Query {
} }
} }
cost = preparePlan(); cost = preparePlan();
if (sort != null && !isQuickQuery && !isGroupQuery && !distinct) {
Index index = getSortIndex();
Index current = topTableFilter.getIndex();
if (index != null && (current.getIndexType().isScan() || current == index)) {
topTableFilter.setIndex(index);
sortUsingIndex = true;
}
}
if (SysProperties.OPTIMIZE_DISTINCT && distinct && !isGroupQuery && filters.size() == 1 && expressions.size() == 1 && condition == null) { if (SysProperties.OPTIMIZE_DISTINCT && distinct && !isGroupQuery && filters.size() == 1 && expressions.size() == 1 && condition == null) {
Expression expr = (Expression) expressions.get(0); Expression expr = (Expression) expressions.get(0);
expr = expr.getNonAliasExpression(); expr = expr.getNonAliasExpression();
...@@ -578,6 +570,14 @@ public class Select extends Query { ...@@ -578,6 +570,14 @@ public class Select extends Query {
} }
} }
} }
if (sort != null && !isQuickQuery && !isGroupQuery && (!distinct || isDistinctQuery)) {
Index index = getSortIndex();
Index current = topTableFilter.getIndex();
if (index != null && (current.getIndexType().isScan() || current == index)) {
topTableFilter.setIndex(index);
sortUsingIndex = true;
}
}
} }
public double getCost() { public double getCost() {
......
...@@ -149,8 +149,7 @@ java org.h2.test.TestAll timer ...@@ -149,8 +149,7 @@ java org.h2.test.TestAll timer
/* /*
(code coverage: limit, sample-size) check no more @author
add tests with select distinct type
staging.trace.db.gz staging.trace.db.gz
......
...@@ -70,6 +70,18 @@ public class TestOptimizations extends TestBase { ...@@ -70,6 +70,18 @@ public class TestOptimizations extends TestBase {
check(i, rs.getInt(1)); check(i, rs.getInt(1));
} }
checkFalse(rs.next()); checkFalse(rs.next());
rs = stat.executeQuery("SELECT DISTINCT TYPE FROM TEST ORDER BY TYPE LIMIT 5 OFFSET 2");
for (int i = 2; i < 7; i++) {
rs.next();
check(i, rs.getInt(1));
}
checkFalse(rs.next());
rs = stat.executeQuery("SELECT DISTINCT TYPE FROM TEST ORDER BY TYPE LIMIT 0 OFFSET 0 SAMPLE_SIZE 3");
for (int i = 0; i < 3; i++) {
rs.next();
check(i, rs.getInt(1));
}
checkFalse(rs.next());
conn.close(); conn.close();
} }
......
/* /*
* Copyright 2004-2007 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html). * Copyright 2004-2007 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group * Initial Developer: H2 Group
*/ */
package org.h2.test.unit; package org.h2.test.unit;
...@@ -21,6 +21,9 @@ import org.h2.util.IOUtils; ...@@ -21,6 +21,9 @@ import org.h2.util.IOUtils;
import org.h2.util.NetUtils; import org.h2.util.NetUtils;
import org.h2.util.StringUtils; import org.h2.util.StringUtils;
/**
* A simple standalone FTP client.
*/
public class FtpClient { public class FtpClient {
private Socket socket; private Socket socket;
private BufferedReader reader; private BufferedReader reader;
...@@ -30,13 +33,13 @@ public class FtpClient { ...@@ -30,13 +33,13 @@ public class FtpClient {
private Socket socketData; private Socket socketData;
private InputStream inData; private InputStream inData;
private OutputStream outData; private OutputStream outData;
public static FtpClient open(String url) throws SQLException, IOException { public static FtpClient open(String url) throws SQLException, IOException {
FtpClient client = new FtpClient(); FtpClient client = new FtpClient();
client.connect(url); client.connect(url);
return client; return client;
} }
private FtpClient() { private FtpClient() {
} }
...@@ -48,7 +51,7 @@ public class FtpClient { ...@@ -48,7 +51,7 @@ public class FtpClient {
writer = new PrintWriter(new OutputStreamWriter(out, Constants.UTF8)); writer = new PrintWriter(new OutputStreamWriter(out, Constants.UTF8));
readCode(220); readCode(220);
} }
private void readLine() throws IOException { private void readLine() throws IOException {
message = reader.readLine(); message = reader.readLine();
int idx = message.indexOf(' '); int idx = message.indexOf(' ');
...@@ -59,26 +62,26 @@ public class FtpClient { ...@@ -59,26 +62,26 @@ public class FtpClient {
message = message.substring(idx + 1); message = message.substring(idx + 1);
} }
} }
private void readCode(int expected) throws IOException { private void readCode(int expected) throws IOException {
readLine(); readLine();
if (code != expected) { if (code != expected) {
throw new IOException("Expected: " + expected + " got: " + message); throw new IOException("Expected: " + expected + " got: " + message);
} }
} }
private void send(String command) throws IOException { private void send(String command) throws IOException {
writer.println(command); writer.println(command);
writer.flush(); writer.flush();
} }
public void login(String userName, String password) throws IOException { public void login(String userName, String password) throws IOException {
send("USER " + userName); send("USER " + userName);
readCode(331); readCode(331);
send("PASS " + password); send("PASS " + password);
readCode(230); readCode(230);
send("SYST"); send("SYST");
readCode(215); readCode(215);
send("SITE"); send("SITE");
readCode(500); readCode(500);
send("STRU F"); send("STRU F");
...@@ -86,7 +89,7 @@ public class FtpClient { ...@@ -86,7 +89,7 @@ public class FtpClient {
send("TYPE I"); send("TYPE I");
readCode(200); readCode(200);
} }
public void close() throws IOException { public void close() throws IOException {
if (socket != null) { if (socket != null) {
send("QUIT"); send("QUIT");
...@@ -94,7 +97,7 @@ public class FtpClient { ...@@ -94,7 +97,7 @@ public class FtpClient {
socket.close(); socket.close();
} }
} }
public void changeWorkingDirectory(String dir) throws IOException { public void changeWorkingDirectory(String dir) throws IOException {
send("CWD " + dir); send("CWD " + dir);
readCode(250); readCode(250);
...@@ -122,7 +125,7 @@ public class FtpClient { ...@@ -122,7 +125,7 @@ public class FtpClient {
public void modificationTime(String fileName) throws IOException { public void modificationTime(String fileName) throws IOException {
send("MDTM " + fileName); send("MDTM " + fileName);
readCode(213); readCode(213);
} }
...@@ -136,7 +139,7 @@ public class FtpClient { ...@@ -136,7 +139,7 @@ public class FtpClient {
readCode(257); readCode(257);
return removeQuotes(); return removeQuotes();
} }
private String removeQuotes() { private String removeQuotes() {
int first = message.indexOf('"') + 1; int first = message.indexOf('"') + 1;
int last = message.lastIndexOf('"'); int last = message.lastIndexOf('"');
...@@ -150,7 +153,7 @@ public class FtpClient { ...@@ -150,7 +153,7 @@ public class FtpClient {
} }
return buff.toString(); return buff.toString();
} }
private void passive() throws IOException, SQLException { private void passive() throws IOException, SQLException {
send("PASV"); send("PASV");
readCode(227); readCode(227);
...@@ -171,14 +174,14 @@ public class FtpClient { ...@@ -171,14 +174,14 @@ public class FtpClient {
inData = socketData.getInputStream(); inData = socketData.getInputStream();
outData = socketData.getOutputStream(); outData = socketData.getOutputStream();
} }
public void rename(String fromFileName, String toFileName) throws IOException { public void rename(String fromFileName, String toFileName) throws IOException {
send("RNFR " + fromFileName); send("RNFR " + fromFileName);
readCode(350); readCode(350);
send("RNTO " + toFileName); send("RNTO " + toFileName);
readCode(250); readCode(250);
} }
public void retrieve(String fileName, OutputStream out, long restartAt) throws IOException, SQLException { public void retrieve(String fileName, OutputStream out, long restartAt) throws IOException, SQLException {
passive(); passive();
if (restartAt > 0) { if (restartAt > 0) {
...@@ -194,14 +197,14 @@ public class FtpClient { ...@@ -194,14 +197,14 @@ public class FtpClient {
send("RMD " + dir); send("RMD " + dir);
readCode(250); readCode(250);
} }
public long size(String fileName) throws IOException { public long size(String fileName) throws IOException {
send("SIZE " + fileName); send("SIZE " + fileName);
readCode(250); readCode(250);
long size = Long.parseLong(message); long size = Long.parseLong(message);
return size; return size;
} }
public void store(String fileName, InputStream in) throws IOException, SQLException { public void store(String fileName, InputStream in) throws IOException, SQLException {
passive(); passive();
send("STOR " + fileName); send("STOR " + fileName);
...@@ -209,7 +212,7 @@ public class FtpClient { ...@@ -209,7 +212,7 @@ public class FtpClient {
IOUtils.copyAndClose(in, outData); IOUtils.copyAndClose(in, outData);
readCode(226); readCode(226);
} }
public String nameList(String dir) throws IOException, SQLException { public String nameList(String dir) throws IOException, SQLException {
passive(); passive();
send("NLST " + dir); send("NLST " + dir);
......
/* /*
* Copyright 2004-2007 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html). * Copyright 2004-2007 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group * Initial Developer: H2 Group
*/ */
package org.h2.test.unit; package org.h2.test.unit;
...@@ -11,9 +11,8 @@ import org.h2.test.TestBase; ...@@ -11,9 +11,8 @@ import org.h2.test.TestBase;
import org.h2.util.BitField; import org.h2.util.BitField;
/** /**
* @author Thomas * A unit test for bit fields.
*/ */
public class TestBitField extends TestBase { public class TestBitField extends TestBase {
public void test() throws Exception { public void test() throws Exception {
......
...@@ -11,6 +11,9 @@ import java.util.Random; ...@@ -11,6 +11,9 @@ import java.util.Random;
import org.h2.test.TestBase; import org.h2.test.TestBase;
/**
* Tests the cache.
*/
public class TestCache extends TestBase { public class TestCache extends TestBase {
public void test() throws Exception { public void test() throws Exception {
......
...@@ -9,66 +9,10 @@ import java.util.Random; ...@@ -9,66 +9,10 @@ import java.util.Random;
import org.h2.test.TestBase; import org.h2.test.TestBase;
import org.h2.tools.CompressTool; import org.h2.tools.CompressTool;
/**
* Data compression tests.
*/
public class TestCompress extends TestBase { public class TestCompress extends TestBase {
public static void main(String[] a) throws Exception {
byte[] data = new byte[1000];
long total = 0;
for (int i = 100; i < 104; i++) {
long time = System.currentTimeMillis();
for (int j = 0; j < 10000000; j++) {
// System.arraycopy(data, 0, data, 100, 11);
// for (int k = 0, n = 100; k < 11; k++) {
// data[k] = data[n++];
// }
int outPos = 0, ctrl = 100, len = i;
// do {
// switch((len - outPos) & 7) {
// case 0:
// data[outPos] = data[outPos++ + ctrl];
// case 7:
// data[outPos] = data[outPos++ + ctrl];
// case 6:
// data[outPos] = data[outPos++ + ctrl];
// case 5:
// data[outPos] = data[outPos++ + ctrl];
// case 4:
// data[outPos] = data[outPos++ + ctrl];
// case 3:
// data[outPos] = data[outPos++ + ctrl];
// case 2:
// data[outPos] = data[outPos++ + ctrl];
// case 1:
// data[outPos] = data[outPos++ + ctrl];
// }
// } while(outPos < len);
//
data[outPos] = data[outPos++ + ctrl];
data[outPos] = data[outPos++ + ctrl];
while (outPos < len - 8) {
data[outPos] = data[outPos++ + ctrl];
data[outPos] = data[outPos++ + ctrl];
data[outPos] = data[outPos++ + ctrl];
data[outPos] = data[outPos++ + ctrl];
data[outPos] = data[outPos++ + ctrl];
data[outPos] = data[outPos++ + ctrl];
data[outPos] = data[outPos++ + ctrl];
data[outPos] = data[outPos++ + ctrl];
}
while (outPos < len) {
data[outPos] = data[outPos++ + ctrl];
}
}
// now: 8907/11859, switch: 9078/14782
long t = (System.currentTimeMillis() - time);
total += t;
System.out.println("i: " + i + " time: " + t);
}
System.out.println("total: " + total);
}
public void test() throws Exception { public void test() throws Exception {
if (config.big) { if (config.big) {
......
/* /*
* Copyright 2004-2007 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html). * Copyright 2004-2007 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group * Initial Developer: H2 Group
*/ */
package org.h2.test.unit; package org.h2.test.unit;
...@@ -18,9 +18,8 @@ import org.h2.value.ValueNull; ...@@ -18,9 +18,8 @@ import org.h2.value.ValueNull;
import org.h2.value.ValueString; import org.h2.value.ValueString;
/** /**
* @author Thomas * Data page tests.
*/ */
public class TestDataPage extends TestBase implements DataHandler { public class TestDataPage extends TestBase implements DataHandler {
boolean text; boolean text;
......
...@@ -11,6 +11,12 @@ import org.h2.test.TestBase; ...@@ -11,6 +11,12 @@ import org.h2.test.TestBase;
import org.h2.util.DateTimeUtils; import org.h2.util.DateTimeUtils;
import org.h2.value.Value; import org.h2.value.Value;
/**
* Tests the data parsing.
* The problem is that some dates are not allowed because of the summer time change.
* Most countries change at 2 o'clock in the morning to 3 o'clock, but some
* (for example Chile) change at midnight. Non-lenient parsing wouldn't work in this case.
*/
public class TestDate extends TestBase { public class TestDate extends TestBase {
public void test() throws Exception { public void test() throws Exception {
......
...@@ -13,6 +13,10 @@ import java.sql.SQLException; ...@@ -13,6 +13,10 @@ import java.sql.SQLException;
import org.h2.api.DatabaseEventListener; import org.h2.api.DatabaseEventListener;
import org.h2.test.TestBase; import org.h2.test.TestBase;
/**
* Tests the flag db_close_on_exit.
* A new process is started.
*/
public class TestExit extends TestBase implements DatabaseEventListener { public class TestExit extends TestBase implements DatabaseEventListener {
public void test() throws Exception { public void test() throws Exception {
......
...@@ -12,13 +12,16 @@ import org.h2.test.TestBase; ...@@ -12,13 +12,16 @@ import org.h2.test.TestBase;
import org.h2.util.FileUtils; import org.h2.util.FileUtils;
import org.h2.value.Value; import org.h2.value.Value;
/**
* Tests the in-memory file system.
*/
public class TestFile extends TestBase implements DataHandler { public class TestFile extends TestBase implements DataHandler {
public void test() throws Exception { public void test() throws Exception {
doTest(false); doTest(false);
doTest(true); doTest(true);
} }
private void doTest(boolean compress) throws Exception { private void doTest(boolean compress) throws Exception {
byte[] magic = new byte[0]; byte[] magic = new byte[0];
int len = getSize(1000, 10000); int len = getSize(1000, 10000);
......
...@@ -11,7 +11,8 @@ import org.h2.store.FileLock; ...@@ -11,7 +11,8 @@ import org.h2.store.FileLock;
import org.h2.test.TestBase; import org.h2.test.TestBase;
/** /**
* @author Thomas * Tests the database file locking facility.
* Both lock files and sockets locking is tested.
*/ */
public class TestFileLock extends TestBase implements Runnable { public class TestFileLock extends TestBase implements Runnable {
......
...@@ -19,6 +19,9 @@ import org.h2.store.fs.FileObject; ...@@ -19,6 +19,9 @@ import org.h2.store.fs.FileObject;
import org.h2.store.fs.FileSystem; import org.h2.store.fs.FileSystem;
import org.h2.test.TestBase; import org.h2.test.TestBase;
/**
* Tests various file system.
*/
public class TestFileSystem extends TestBase { public class TestFileSystem extends TestBase {
public void test() throws Exception { public void test() throws Exception {
......
...@@ -10,6 +10,9 @@ import org.h2.server.ftp.FtpServer; ...@@ -10,6 +10,9 @@ import org.h2.server.ftp.FtpServer;
import org.h2.test.TestBase; import org.h2.test.TestBase;
import org.h2.tools.Server; import org.h2.tools.Server;
/**
* Tests the FTP server tool.
*/
public class TestFtp extends TestBase implements FtpEventListener { public class TestFtp extends TestBase implements FtpEventListener {
private FtpEvent lastEvent; private FtpEvent lastEvent;
......
...@@ -9,6 +9,9 @@ import java.util.Random; ...@@ -9,6 +9,9 @@ import java.util.Random;
import org.h2.test.TestBase; import org.h2.test.TestBase;
import org.h2.util.IntArray; import org.h2.util.IntArray;
/**
* Tests the IntArray class.
*/
public class TestIntArray extends TestBase { public class TestIntArray extends TestBase {
public void test() throws Exception { public void test() throws Exception {
......
...@@ -9,6 +9,9 @@ import java.util.Random; ...@@ -9,6 +9,9 @@ import java.util.Random;
import org.h2.test.TestBase; import org.h2.test.TestBase;
import org.h2.util.IntIntHashMap; import org.h2.util.IntIntHashMap;
/**
* Tests the IntHashMap class.
*/
public class TestIntIntHashMap extends TestBase { public class TestIntIntHashMap extends TestBase {
Random rand = new Random(); Random rand = new Random();
......
...@@ -11,13 +11,16 @@ import java.sql.SQLException; ...@@ -11,13 +11,16 @@ import java.sql.SQLException;
import org.h2.test.TestBase; import org.h2.test.TestBase;
/**
* Tests the multi-threaded kernel feature.
*/
public class TestMultiThreadedKernel extends TestBase implements Runnable { public class TestMultiThreadedKernel extends TestBase implements Runnable {
private String url, user, password; private String url, user, password;
private int id; private int id;
private TestMultiThreadedKernel master; private TestMultiThreadedKernel master;
private volatile boolean stop; private volatile boolean stop;
public void test() throws Exception { public void test() throws Exception {
if (config.networked) { if (config.networked) {
return; return;
...@@ -43,7 +46,7 @@ public class TestMultiThreadedKernel extends TestBase implements Runnable { ...@@ -43,7 +46,7 @@ public class TestMultiThreadedKernel extends TestBase implements Runnable {
list[i].join(); list[i].join();
} }
} }
public void run() { public void run() {
try { try {
org.h2.Driver.load(); org.h2.Driver.load();
......
...@@ -14,6 +14,10 @@ import org.h2.test.TestBase; ...@@ -14,6 +14,10 @@ import org.h2.test.TestBase;
import org.h2.value.Value; import org.h2.value.Value;
import org.h2.value.ValueString; import org.h2.value.ValueString;
/**
* Tests numeric overflow on various data types.
* Other than in Java, overflow is detected and an exception is thrown.
*/
public class TestOverflow extends TestBase { public class TestOverflow extends TestBase {
public void test() throws Exception { public void test() throws Exception {
......
/* /*
* Copyright 2004-2007 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html). * Copyright 2004-2007 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group * Initial Developer: H2 Group
*/ */
package org.h2.test.unit; package org.h2.test.unit;
...@@ -9,7 +9,7 @@ import org.h2.test.TestBase; ...@@ -9,7 +9,7 @@ import org.h2.test.TestBase;
import org.h2.value.CompareMode; import org.h2.value.CompareMode;
/** /**
* @author Thomas * Tests LIKE pattern matching.
*/ */
public class TestPattern extends TestBase { public class TestPattern extends TestBase {
......
...@@ -12,6 +12,9 @@ import java.io.StringReader; ...@@ -12,6 +12,9 @@ import java.io.StringReader;
import org.h2.test.TestBase; import org.h2.test.TestBase;
import org.h2.util.IOUtils; import org.h2.util.IOUtils;
/**
* Tests the stream to UTF-8 reader conversion.
*/
public class TestReader extends TestBase { public class TestReader extends TestBase {
public void test() throws Exception { public void test() throws Exception {
......
...@@ -12,6 +12,9 @@ import org.h2.test.TestBase; ...@@ -12,6 +12,9 @@ import org.h2.test.TestBase;
import org.h2.tools.DeleteDbFiles; import org.h2.tools.DeleteDbFiles;
import org.h2.util.StringUtils; import org.h2.util.StringUtils;
/**
* Tests the sample apps.
*/
public class TestSampleApps extends TestBase { public class TestSampleApps extends TestBase {
public void test() throws Exception { public void test() throws Exception {
......
...@@ -10,6 +10,9 @@ import java.util.Random; ...@@ -10,6 +10,9 @@ import java.util.Random;
import org.h2.test.TestBase; import org.h2.test.TestBase;
import org.h2.util.ScriptReader; import org.h2.util.ScriptReader;
/**
* Tests the script reader tool that breaks up SQL scripts in statements.
*/
public class TestScriptReader extends TestBase { public class TestScriptReader extends TestBase {
public void test() throws Exception { public void test() throws Exception {
......
/* /*
* Copyright 2004-2007 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html). * Copyright 2004-2007 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group * Initial Developer: H2 Group
*/ */
package org.h2.test.unit; package org.h2.test.unit;
...@@ -11,9 +11,8 @@ import org.h2.test.TestBase; ...@@ -11,9 +11,8 @@ import org.h2.test.TestBase;
import org.h2.util.ByteUtils; import org.h2.util.ByteUtils;
/** /**
* @author Thomas * Tests various security primitives.
*/ */
public class TestSecurity extends TestBase { public class TestSecurity extends TestBase {
public void test() throws Exception { public void test() throws Exception {
......
...@@ -12,6 +12,9 @@ import org.h2.compress.LZFInputStream; ...@@ -12,6 +12,9 @@ import org.h2.compress.LZFInputStream;
import org.h2.compress.LZFOutputStream; import org.h2.compress.LZFOutputStream;
import org.h2.test.TestBase; import org.h2.test.TestBase;
/**
* Tests the LZF stream.
*/
public class TestStreams extends TestBase { public class TestStreams extends TestBase {
public void test() throws Exception { public void test() throws Exception {
......
...@@ -9,6 +9,9 @@ import java.util.Random; ...@@ -9,6 +9,9 @@ import java.util.Random;
import org.h2.test.TestBase; import org.h2.test.TestBase;
import org.h2.util.StringCache; import org.h2.util.StringCache;
/**
* Tests the string cache facility.
*/
public class TestStringCache extends TestBase { public class TestStringCache extends TestBase {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
......
...@@ -12,6 +12,9 @@ import java.util.Random; ...@@ -12,6 +12,9 @@ import java.util.Random;
import org.h2.test.TestBase; import org.h2.test.TestBase;
import org.h2.util.StringUtils; import org.h2.util.StringUtils;
/**
* Tests string utility methods.
*/
public class TestStringUtils extends TestBase { public class TestStringUtils extends TestBase {
public void test() throws Exception { public void test() throws Exception {
......
...@@ -30,6 +30,9 @@ import org.h2.tools.Script; ...@@ -30,6 +30,9 @@ import org.h2.tools.Script;
import org.h2.tools.Server; import org.h2.tools.Server;
import org.h2.util.Resources; import org.h2.util.Resources;
/**
* Tests the database tools.
*/
public class TestTools extends TestBase { public class TestTools extends TestBase {
private Server server; private Server server;
......
...@@ -7,12 +7,15 @@ package org.h2.test.unit; ...@@ -7,12 +7,15 @@ package org.h2.test.unit;
import org.h2.test.TestBase; import org.h2.test.TestBase;
import org.h2.value.ValueUuid; import org.h2.value.ValueUuid;
/**
* Tests features of values.
*/
public class TestValue extends TestBase { public class TestValue extends TestBase {
public void test() throws Exception { public void test() throws Exception {
testUUID(); testUUID();
} }
private void testUUID() throws Exception { private void testUUID() throws Exception {
long maxHigh = 0, maxLow = 0, minHigh = -1L, minLow = -1L; long maxHigh = 0, maxLow = 0, minHigh = -1L, minLow = -1L;
for (int i = 0; i < 100; i++) { for (int i = 0; i < 100; i++) {
......
...@@ -18,6 +18,9 @@ import org.h2.value.CompareMode; ...@@ -18,6 +18,9 @@ import org.h2.value.CompareMode;
import org.h2.value.Value; import org.h2.value.Value;
import org.h2.value.ValueInt; import org.h2.value.ValueInt;
/**
* Tests the value hash map.
*/
public class TestValueHashMap extends TestBase implements DataHandler { public class TestValueHashMap extends TestBase implements DataHandler {
CompareMode compareMode = new CompareMode(null, null); CompareMode compareMode = new CompareMode(null, null);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论