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

--no commit message

--no commit message
上级 481146ad
......@@ -20,9 +20,9 @@ public class Function {
Class.forName("org.h2.Driver");
Connection conn = DriverManager.getConnection("jdbc:h2:mem:", "sa", "");
Statement stat = conn.createStatement();
stat.execute("CREATE ALIAS ISPRIME FOR \"org.h2.samples.Function.isPrime\" ");
stat.execute("CREATE ALIAS IS_PRIME FOR \"org.h2.samples.Function.isPrime\" ");
ResultSet rs;
rs = stat.executeQuery("SELECT ISPRIME(X), X FROM SYSTEM_RANGE(1, 20) ORDER BY X");
rs = stat.executeQuery("SELECT IS_PRIME(X), X FROM SYSTEM_RANGE(1, 20) ORDER BY X");
while(rs.next()) {
boolean isPrime = rs.getBoolean(1);
if(isPrime) {
......
......@@ -32,7 +32,7 @@
Security:
- TCP Server: Can now specifiy a password (tcpPassword).
- TCP Server: Can now specify a password (tcpPassword).
- New option -ifExists for the TCP and ODBC server
to disallow creating new databases.
......
......@@ -86,20 +86,36 @@ java -Xmx512m -Xrunhprof:cpu=samples,depth=8 org.h2.tools.RunScript -url jdbc:h2
TestAll test = new TestAll();
test.printSystem();
// Hi i found one small nasty bug with h2 database. When i use prepared statement on tables that have primary key UUID DEFAULT random_UUID(), and when i call getGeneratedKeys() method I only get (long) 0 as result, instead of random_uuid.
// And if I use IDENTITY type for primary ket i get corect value from methord PreparedStatement.getGeneratedKeys(). Problem is with UUID and random_uuid() combination.
// It would be nice if the donation link opened a new window. I could not see where I was at in the address bar while filling out the form.
// NULL || 'X' should probably return null by default
// change default to read committed transaction isolation
// support % operator (modulo)
// java -cp .;%H2DRIVERS% org.h2.tools.RunScript -continueOnError -driver org.h2.Driver -url jdbc:h2:test -user sa -password sa -script c:/temp/test.sql
// java -cp .;%H2DRIVERS% org.h2.tools.RunScript -continueOnError -driver com.mysql.jdbc.Driver -url jdbc:mysql://localhost/test -user sa -password sa -script c:/temp/test.sql
// java -cp .;%H2DRIVERS% org.h2.tools.RunScript -continueOnError -driver org.apache.derby.jdbc.EmbeddedDriver -url jdbc:derby:test3;create=true -user sa -password sa -script c:/temp/test.sql
// java -cp .;%H2DRIVERS% org.h2.tools.RunScript -continueOnError -driver org.postgresql.Driver -url jdbc:postgresql:jpox2 -user sa -password sa -script c:/temp/test.sql
// http://monetdb.cwi.nl/Assets/DBtapestry100K.sql
// (delete all objects doesn't work for linux)
// Hi,
// Thanks for your feedback! Yes, this is a bug, it will be fixed in the next release.
// Thomas
// test backup
// backup: lobs, index
// improve TestHalt
// BACKUP: compare sql syntax with other databases
// Hot backup (incremental backup, online backup): backup data, log, index? files
// ESC/Java (http://secure.ucd.ie/products/opensource/ESCJava2/)
// GroovyServlet
// Cluster: hot deploy (adding a node on runtime)
// system property for base directory (h2.baseDir)
// SELECT ... FROM TA, TB, TC WHERE TC.COL3 = TA.COL1 AND TC.COL3=TB.COL2 AND TC.COL4 = 1
// The query implies TA.COL1 = TB.COL2 but does not explicitly set this condition.
// "trace.db" is created in the current directory
// dataSource.setLogWriter() seems to have no effect?
// CHAR data type
// DROP TABLE TEST;
// CREATE TABLE TEST(C CHAR(10));
// INSERT INTO TEST VALUES('1');
......
......@@ -120,7 +120,7 @@ public class BenchC implements Bench {
+ " TERMINAL INT,\n" + " OPERATION INT,\n"
+ " RESPONSE_TIME INT,\n" + " PROCESSING_TIME INT,\n"
+ " KEYING_TIME INT,\n" + " THINK_TIME INT,\n"
+ " SUCCESSFULL INT,\n" + " NOW TIMESTAMP)" };
+ " SUCCESSFUL INT,\n" + " NOW TIMESTAMP)" };
public void init(Database db, int size) throws Exception {
this.db = db;
......
......@@ -20,6 +20,21 @@ public class TestCsv extends TestBase {
testAsTable();
testWriteRead();
testRead();
testPipe();
}
private void testPipe() throws Exception {
deleteDb("csv");
Connection conn = getConnection("csv");
Statement stat = conn.createStatement();
stat.execute("call csvwrite('"+BASE_DIR+"/test.csv', 'select 1 id, ''Hello'' name', 'utf-8', '|')");
ResultSet rs = stat.executeQuery("select * from csvread('"+BASE_DIR+"/test.csv', null, 'utf-8', '|')");
check(rs.next());
check(rs.getInt(1), 1);
check(rs.getString(2), "Hello");
checkFalse(rs.next());
new File(BASE_DIR+"/test.csv").delete();
conn.close();
}
private void testAsTable() throws Exception {
......@@ -38,7 +53,6 @@ public class TestCsv extends TestBase {
checkFalse(rs.next());
new File(BASE_DIR+"/test.csv").delete();
conn.close();
}
public void testRead() throws Exception {
......
......@@ -68,7 +68,7 @@ public class TestListener extends TestBase implements DatabaseEventListener {
stateName = "Recover";
break;
default:
TestBase.logError("unknownn state: " + state, null);
TestBase.logError("unknown state: " + state, null);
stateName = "? " + name;
}
try {
......
......@@ -95,7 +95,7 @@ public class TestPowerOff extends TestBase {
}
deleteDb(dir, dbName);
Random random = new Random(1);
Constants.RUN_FINALIZERS = false;
Constants.RUN_FINALIZE = false;
int repeat = getSize(1, 20);
for(int i=0; i<repeat; i++) {
Connection conn = getConnection(url);
......
--- special grammar and test cases ---------------------------------------------------------------------------------------------
create table Foo (A varchar(20), B integer);
> ok
insert into Foo (A, B) values ('abcd', 1), ('abcd', 2);
> update count: 2
select * from Foo where A like 'abc%' escape '\' AND B=1;
> A B
> ---- -
> abcd 1
> rows: 1
drop table Foo;
> ok
create memory table orders ( orderid varchar(10), name varchar(20), custid varchar(10), completed numeric(1) not null, verified numeric(1) );
> ok
......
create table A ( ID integer, a1 varchar(20) );
create table B ( ID integer, AID integer, b1 varchar(20));
create table C ( ID integer, BId integer, c1 varchar(20));
insert into A (ID, a1) values (1, 'a1');
insert into A (ID, a1) values (2, 'a2');
select count(*) from A left outer join (B inner join C on C.BID=B.ID ) on B.AID=A.ID where A.id=1;
> 1;
select count(*) from A left outer join (B left join C on C.BID=B.ID ) on B.AID=A.ID where A.id=1;
> 1;
select count(*) from A left outer join B on B.AID=A.ID inner join C on C.BID=B.ID where A.id=1;
> 0;
select count(*) from (A left outer join B on B.AID=A.ID) inner join C on C.BID=B.ID where A.id=1;
> 0;
drop table a, b, c;
create schema a;
create table a.test(id int);
insert into a.test values(1);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论