Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
98574ac2
提交
98574ac2
authored
3月 31, 2007
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
c5ae92cb
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
121 行增加
和
1 行删除
+121
-1
TestAll.java
h2/src/test/org/h2/test/TestAll.java
+58
-1
test.in.txt
h2/src/test/org/h2/test/test.in.txt
+54
-0
testSimple.in.txt
h2/src/test/org/h2/test/testSimple.in.txt
+9
-0
没有找到文件。
h2/src/test/org/h2/test/TestAll.java
浏览文件 @
98574ac2
...
...
@@ -87,7 +87,64 @@ java -Xmx512m -Xrunhprof:cpu=samples,depth=8 org.h2.tools.RunScript -url jdbc:h2
long
time
=
System
.
currentTimeMillis
();
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
...
...
h2/src/test/org/h2/test/test.in.txt
浏览文件 @
98574ac2
--- 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
...
...
h2/src/test/org/h2/test/testSimple.in.txt
浏览文件 @
98574ac2
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
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论