提交 98574ac2 authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 c5ae92cb
......@@ -88,6 +88,63 @@ java -Xmx512m -Xrunhprof:cpu=samples,depth=8 org.h2.tools.RunScript -url jdbc:h2
TestAll test = new TestAll();
test.printSystem();
// pilar sms
/*
CREATE TABLE T(DATA VARCHAR(10), MYINT INTEGER);
INSERT INTO T (DATA,MYINT) VALUES (null,1);
@META select ifnull(t.data, 0), myint from t;
-- 1 should be VARCHAR
select ifnull(t.data, 0), myint from t;
drop table t;
*/
/*
drop all objects;
create table parent(id int primary key, parent int);
insert into parent values(1, null), (2, 1), (3, 1);
create view recursive test_view(id, parent) as
select id, parent from parent
union all
select parent.id, parent.parent from test_view, parent
where parent.id = test_view.parent;
drop view test_view;
drop table parent;
*/
// Under certain conditions in client/server mode, obtaining text values
// of CLOBs becomes very slow (e.g., it could take a minimum of 200 ms
// instead of 2 ms). If I change the column type to VARCHAR, the
// performance is very fast again.
//
// Between 2006-12-03 and 2006-12-17, you remarked: "Very large BLOB and
// CLOB data can now be used with the server and the cluster mode. The
// objects will temporarily be buffered on the client side if they are
// larger than some size (currently 64 KB)."
//
// I think the issue is now in Transfer.java, as below:
// 272: writer.flush();
// 273: writeInt(LOB_MAGIC);
//
// I believe the flush() can cause a TCP performance problem in certain
// circumstances. The reason is that when flush() occurs, the blob
// packets are flushed over the network, then a TCP ACK must be exchanged
// from client to server before the separate LOB_MAGIC packet can be sent
// from the server to client. This can cause enough latency to degrade
// application performance noticeably.
//
// I do not know of a good way to solve this, since you cannot avoid
// calling writer.flush(). One "workaround" for some applications is to
// convert CLOB to VARCHAR. However, I am currently trying something
// different. It works so far for me. My "patch" is:
//
// Transfer.java, at line 267:
// java.io.OutputStream out2 = new java.io.FilterOutputStream(out) {
// public void flush() {} };
// Writer writer = new OutputStreamWriter(out2, Constants.UTF8);
//
// James.
// TODO: fix Hibernate dialect bug / Bordea Felix (lost email)
// run TestHalt
......
--- special grammar and test cases ---------------------------------------------------------------------------------------------
create table t1(c1 int, c2 int);
> ok
create table t2(c1 int, c2 int);
> ok
insert into t1 values(1, null), (2, 2), (3, 3);
> update count: 3
insert into t2 values(1, 1), (1, 2), (2, null), (3, 3);
> update count: 4
select * from t2 where c1 not in(select c2 from t1);
> C1 C2
> -- --
> rows: 0
select * from t2 where c1 not in(null, 2, 3);
> C1 C2
> -- --
> rows: 0
select * from t1 where c2 not in(select c1 from t2);
> C1 C2
> -- --
> rows: 0
select * from t1 where not exists(select * from t2 where t1.c2=t2.c1);
> C1 C2
> -- ----
> 1 null
> rows: 1
drop table t1;
> ok
drop table t2;
> ok
create constant abc value 1;
> ok
call abc;
> 1
> -
> 1
> rows: 1
drop all objects;
> ok
call abc;
> exception
create table FOO(id integer primary key);
> ok
......
select case (1) when 1 then 1 else 2 end;
> 1;
create table test(id int);
insert into test values(1);
select distinct id from test a order by a.id;
> 1;
drop table test;
create table FOO (ID int, A number(18, 2));
insert into FOO (ID, A) values (1, 10.0), (2, 20.0);
select SUM (CASE when ID=1 then 0 ELSE A END) col0 from Foo;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论