Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
18a85209
提交
18a85209
authored
10月 06, 2007
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
bfa69ccc
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
59 行增加
和
9 行删除
+59
-9
history.html
h2/src/docsrc/html/history.html
+3
-2
Constants.java
h2/src/main/org/h2/engine/Constants.java
+1
-1
CompareLike.java
h2/src/main/org/h2/expression/CompareLike.java
+5
-5
Expression.java
h2/src/main/org/h2/expression/Expression.java
+4
-0
Parameter.java
h2/src/main/org/h2/expression/Parameter.java
+4
-0
ValueExpression.java
h2/src/main/org/h2/expression/ValueExpression.java
+4
-0
TestPreparedStatement.java
h2/src/test/org/h2/test/jdbc/TestPreparedStatement.java
+36
-0
dictionary.txt
h2/src/tools/org/h2/tools/doc/dictionary.txt
+2
-1
没有找到文件。
h2/src/docsrc/html/history.html
浏览文件 @
18a85209
...
@@ -40,10 +40,11 @@ Hypersonic SQL or HSQLDB. H2 is built from scratch.
...
@@ -40,10 +40,11 @@ Hypersonic SQL or HSQLDB. H2 is built from scratch.
<h3>
Version 1.0 (Current)
</h3>
<h3>
Version 1.0 (Current)
</h3>
<h3>
Version 1.0.60 (2007-10-?)
</h3><ul>
<h3>
Version 1.0.60 (2007-10-?)
</h3><ul>
<li>
PreparedStatement.setMaxRows could not be changed to a higher value after the statement was executed.
<li>
Prepared statements could not be used after data definition statements (creating tables and so on). Fixed.
</li><li>
PreparedStatement.setMaxRows could not be changed to a higher value after the statement was executed.
</li><li>
The H2 Console could not connect twice to the same H2 embedded database at the same time. Fixed.
</li><li>
The H2 Console could not connect twice to the same H2 embedded database at the same time. Fixed.
</li><li>
CSVREAD, RUNSCRIPT and so on now support URLs as well, using
</li><li>
CSVREAD, RUNSCRIPT and so on now support URLs as well, using
URL.openStream(). Example: select * from csvread('jar:file:///c:/temp/test.jar!/test.csv');
URL.openStream(). Example: select * from csvread('jar:file:///c:/temp/test.jar!/test.csv');
</li></ul>
</li></ul>
<h3>
Version 1.0.59 (2007-10-03)
</h3><ul>
<h3>
Version 1.0.59 (2007-10-03)
</h3><ul>
...
...
h2/src/main/org/h2/engine/Constants.java
浏览文件 @
18a85209
...
@@ -93,7 +93,7 @@ public class Constants {
...
@@ -93,7 +93,7 @@ public class Constants {
public
static
final
int
DEFAULT_SERVER_PORT
=
9092
;
// this is also in the docs
public
static
final
int
DEFAULT_SERVER_PORT
=
9092
;
// this is also in the docs
public
static
final
String
START_URL
=
"jdbc:h2:"
;
public
static
final
String
START_URL
=
"jdbc:h2:"
;
public
static
final
String
URL_FORMAT
=
START_URL
+
"{ {.|mem:}[name] | [file:]fileName | {tcp|ssl}:[//]server[:port][,server2[:port]]/name }[;key=value...]"
;
public
static
final
String
URL_FORMAT
=
START_URL
+
"{ {.|mem:}[name] | [file:]fileName | {tcp|ssl}:[//]server[:port][,server2[:port]]/name }[;key=value...]"
;
public
static
final
String
PRODUCT_NAME
=
"H2"
;
public
static
final
String
PRODUCT_NAME
=
"H2"
;
// must stay like that (http://opensource.atlassian.com/projects/hibernate/browse/HHH-2682)
public
static
final
String
DRIVER_NAME
=
"H2 JDBC Driver"
;
public
static
final
String
DRIVER_NAME
=
"H2 JDBC Driver"
;
public
static
final
int
IO_BUFFER_SIZE
=
4
*
1024
;
public
static
final
int
IO_BUFFER_SIZE
=
4
*
1024
;
public
static
final
int
IO_BUFFER_SIZE_COMPRESS
=
128
*
1024
;
public
static
final
int
IO_BUFFER_SIZE_COMPRESS
=
128
*
1024
;
...
...
h2/src/main/org/h2/expression/CompareLike.java
浏览文件 @
18a85209
...
@@ -69,7 +69,7 @@ public class CompareLike extends Condition {
...
@@ -69,7 +69,7 @@ public class CompareLike extends Condition {
if
(
left
.
getType
()
==
Value
.
STRING_IGNORECASE
)
{
if
(
left
.
getType
()
==
Value
.
STRING_IGNORECASE
)
{
ignoreCase
=
true
;
ignoreCase
=
true
;
}
}
if
(
left
.
is
Constan
t
())
{
if
(
left
.
is
ValueSe
t
())
{
Value
l
=
left
.
getValue
(
session
);
Value
l
=
left
.
getValue
(
session
);
if
(
l
==
ValueNull
.
INSTANCE
)
{
if
(
l
==
ValueNull
.
INSTANCE
)
{
// NULL LIKE something > NULL
// NULL LIKE something > NULL
...
@@ -79,8 +79,8 @@ public class CompareLike extends Condition {
...
@@ -79,8 +79,8 @@ public class CompareLike extends Condition {
if
(
escape
!=
null
)
{
if
(
escape
!=
null
)
{
escape
=
escape
.
optimize
(
session
);
escape
=
escape
.
optimize
(
session
);
}
}
if
(
right
.
is
Constant
()
&&
(
escape
==
null
||
escape
.
isConstan
t
()))
{
if
(
right
.
is
ValueSet
()
&&
(
escape
==
null
||
escape
.
isValueSe
t
()))
{
if
(
left
.
is
Constan
t
())
{
if
(
left
.
is
ValueSe
t
())
{
return
ValueExpression
.
get
(
getValue
(
session
));
return
ValueExpression
.
get
(
getValue
(
session
));
}
}
Value
r
=
right
.
getValue
(
session
);
Value
r
=
right
.
getValue
(
session
);
...
@@ -130,10 +130,10 @@ public class CompareLike extends Condition {
...
@@ -130,10 +130,10 @@ public class CompareLike extends Condition {
// otherwise we would need to prepare at execute time,
// otherwise we would need to prepare at execute time,
// which is maybe slower (but maybe not in this case!)
// which is maybe slower (but maybe not in this case!)
// TODO optimizer: like: check what other databases do!
// TODO optimizer: like: check what other databases do!
if
(!
right
.
is
Constan
t
())
{
if
(!
right
.
is
ValueSe
t
())
{
return
;
return
;
}
}
if
(
escape
!=
null
&&
!
escape
.
is
Constan
t
())
{
if
(
escape
!=
null
&&
!
escape
.
is
ValueSe
t
())
{
return
;
return
;
}
}
String
p
=
right
.
getValue
(
session
).
getString
();
String
p
=
right
.
getValue
(
session
).
getString
();
...
...
h2/src/main/org/h2/expression/Expression.java
浏览文件 @
18a85209
...
@@ -47,6 +47,10 @@ public abstract class Expression {
...
@@ -47,6 +47,10 @@ public abstract class Expression {
return
false
;
return
false
;
}
}
public
boolean
isValueSet
()
{
return
false
;
}
public
boolean
isAutoIncrement
()
{
public
boolean
isAutoIncrement
()
{
return
false
;
return
false
;
}
}
...
...
h2/src/main/org/h2/expression/Parameter.java
浏览文件 @
18a85209
...
@@ -70,6 +70,10 @@ public class Parameter extends Expression implements ParameterInterface {
...
@@ -70,6 +70,10 @@ public class Parameter extends Expression implements ParameterInterface {
}
}
public
boolean
isConstant
()
{
public
boolean
isConstant
()
{
return
false
;
}
public
boolean
isValueSet
()
{
return
value
!=
null
;
return
value
!=
null
;
}
}
...
...
h2/src/main/org/h2/expression/ValueExpression.java
浏览文件 @
18a85209
...
@@ -62,6 +62,10 @@ public class ValueExpression extends Expression {
...
@@ -62,6 +62,10 @@ public class ValueExpression extends Expression {
public
boolean
isConstant
()
{
public
boolean
isConstant
()
{
return
true
;
return
true
;
}
}
public
boolean
isValueSet
()
{
return
true
;
}
public
void
setEvaluatable
(
TableFilter
tableFilter
,
boolean
b
)
{
public
void
setEvaluatable
(
TableFilter
tableFilter
,
boolean
b
)
{
}
}
...
...
h2/src/test/org/h2/test/jdbc/TestPreparedStatement.java
浏览文件 @
18a85209
...
@@ -28,6 +28,7 @@ public class TestPreparedStatement extends TestBase {
...
@@ -28,6 +28,7 @@ public class TestPreparedStatement extends TestBase {
deleteDb
(
"preparedStatement"
);
deleteDb
(
"preparedStatement"
);
Connection
conn
=
getConnection
(
"preparedStatement"
);
Connection
conn
=
getConnection
(
"preparedStatement"
);
testPrepareRecompile
(
conn
);
testMaxRowsChange
(
conn
);
testMaxRowsChange
(
conn
);
testUnknownDataType
(
conn
);
testUnknownDataType
(
conn
);
testCancelReuse
(
conn
);
testCancelReuse
(
conn
);
...
@@ -52,6 +53,41 @@ public class TestPreparedStatement extends TestBase {
...
@@ -52,6 +53,41 @@ public class TestPreparedStatement extends TestBase {
conn
.
close
();
conn
.
close
();
}
}
private
void
testPrepareRecompile
(
Connection
conn
)
throws
Exception
{
Statement
stat
=
conn
.
createStatement
();
PreparedStatement
prep
;
ResultSet
rs
;
prep
=
conn
.
prepareStatement
(
"SELECT COUNT(*) FROM DUAL WHERE ? IS NULL"
);
prep
.
setString
(
1
,
null
);
prep
.
executeQuery
();
stat
.
execute
(
"CREATE TABLE TEST(ID INT)"
);
stat
.
execute
(
"DROP TABLE TEST"
);
prep
.
setString
(
1
,
null
);
prep
.
executeQuery
();
prep
.
setString
(
1
,
"X"
);
rs
=
prep
.
executeQuery
();
rs
.
next
();
check
(
rs
.
getInt
(
1
),
0
);
stat
.
execute
(
"CREATE TABLE t1 (c1 INT, c2 VARCHAR(10))"
);
stat
.
execute
(
"INSERT INTO t1 SELECT X, CONCAT('Test', X) FROM SYSTEM_RANGE(1, 5);"
);
prep
=
conn
.
prepareStatement
(
"SELECT c1, c2 FROM t1 WHERE c1 = ?"
);
prep
.
setInt
(
1
,
1
);
prep
.
executeQuery
();
stat
.
execute
(
"CREATE TABLE t2 (x int PRIMARY KEY)"
);
prep
.
setInt
(
1
,
2
);
rs
=
prep
.
executeQuery
();
rs
.
next
();
check
(
rs
.
getInt
(
1
),
2
);
prep
.
setInt
(
1
,
3
);
rs
=
prep
.
executeQuery
();
rs
.
next
();
check
(
rs
.
getInt
(
1
),
3
);
stat
.
execute
(
"DROP TABLE t1, t2"
);
}
private
void
testMaxRowsChange
(
Connection
conn
)
throws
Exception
{
private
void
testMaxRowsChange
(
Connection
conn
)
throws
Exception
{
PreparedStatement
prep
=
conn
.
prepareStatement
(
"SELECT * FROM SYSTEM_RANGE(1, 100)"
);
PreparedStatement
prep
=
conn
.
prepareStatement
(
"SELECT * FROM SYSTEM_RANGE(1, 100)"
);
ResultSet
rs
;
ResultSet
rs
;
...
...
h2/src/tools/org/h2/tools/doc/dictionary.txt
浏览文件 @
18a85209
...
@@ -509,4 +509,5 @@ imports bnot severity colon braces suppress star bxor band bor unary bsr puppy l
...
@@ -509,4 +509,5 @@ imports bnot severity colon braces suppress star bxor band bor unary bsr puppy l
forge chr trunc gabealbert tunebackup manifest
forge chr trunc gabealbert tunebackup manifest
lumber thus taking repositories ago delegated mention leaks pgsql seeded felt efficiently mill mentioned forgot leaked restarted clearing occupies randomness warn implementing abstraction
lumber thus taking repositories ago delegated mention leaks pgsql seeded felt efficiently mill mentioned forgot leaked restarted clearing occupies randomness warn implementing abstraction
spfile svr pkey synced semicolon terminating
spfile svr pkey synced semicolon terminating
framework constructing architectural jmatter workgroup upgraded naked stopper skipping
framework constructing architectural jmatter workgroup upgraded naked stopper skipping assumed
\ No newline at end of file
opensource atlassian hhh
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论