Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
85e74dd1
提交
85e74dd1
authored
8月 13, 2013
作者:
noelgrandin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Bug: Changes to the database structure did not result in the Session query cache being invalidated.
上级
101d72e0
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
18 行增加
和
6 行删除
+18
-6
changelog.html
h2/src/docsrc/html/changelog.html
+4
-2
Session.java
h2/src/main/org/h2/engine/Session.java
+7
-0
TestQueryCache.java
h2/src/test/org/h2/test/db/TestQueryCache.java
+6
-3
TestSQLInjection.java
h2/src/test/org/h2/test/db/TestSQLInjection.java
+1
-1
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
85e74dd1
...
@@ -22,8 +22,10 @@ Change Log
...
@@ -22,8 +22,10 @@ Change Log
</li><li>
Issue 467: OSGi Class Loader (ability to create reference to class
</li><li>
Issue 467: OSGi Class Loader (ability to create reference to class
in other ClassLoader, for example in another OSGi bundle).
in other ClassLoader, for example in another OSGi bundle).
</li><li>
Fix bug in unique and non-unique hash indexes which manifested as incorrect results
</li><li>
Fix bug in unique and non-unique hash indexes which manifested as incorrect results
when the search key was a different cardinal type from the table index key.
when the search key was a different cardinal type from the table index key.
e.g. where the one was INT and the other was LONG
e.g. where the one was INT and the other was LONG
</li><li>
Bug: Changes to the database structure did not result
in the Session query cache being invalidated.
</li></ul>
</li></ul>
<h2>
Version 1.3.173 (2013-07-28)
</h2>
<h2>
Version 1.3.173 (2013-07-28)
</h2>
...
...
h2/src/main/org/h2/engine/Session.java
浏览文件 @
85e74dd1
...
@@ -110,6 +110,7 @@ public class Session extends SessionWithState {
...
@@ -110,6 +110,7 @@ public class Session extends SessionWithState {
private
int
objectId
;
private
int
objectId
;
private
final
int
queryCacheSize
;
private
final
int
queryCacheSize
;
private
SmallLRUCache
<
String
,
Command
>
queryCache
;
private
SmallLRUCache
<
String
,
Command
>
queryCache
;
private
long
modificationMetaID
=
-
1
;
private
Transaction
transaction
;
private
Transaction
transaction
;
private
long
startStatement
=
-
1
;
private
long
startStatement
=
-
1
;
...
@@ -416,7 +417,13 @@ public class Session extends SessionWithState {
...
@@ -416,7 +417,13 @@ public class Session extends SessionWithState {
if
(
queryCacheSize
>
0
)
{
if
(
queryCacheSize
>
0
)
{
if
(
queryCache
==
null
)
{
if
(
queryCache
==
null
)
{
queryCache
=
SmallLRUCache
.
newInstance
(
queryCacheSize
);
queryCache
=
SmallLRUCache
.
newInstance
(
queryCacheSize
);
modificationMetaID
=
database
.
getModificationMetaId
();
}
else
{
}
else
{
long
newModificationMetaID
=
database
.
getModificationMetaId
();
if
(
newModificationMetaID
!=
modificationMetaID
)
{
queryCache
.
clear
();
modificationMetaID
=
newModificationMetaID
;
}
command
=
queryCache
.
get
(
sql
);
command
=
queryCache
.
get
(
sql
);
if
(
command
!=
null
&&
command
.
canReuse
())
{
if
(
command
!=
null
&&
command
.
canReuse
())
{
command
.
reuse
();
command
.
reuse
();
...
...
h2/src/test/org/h2/test/db/TestQueryCache.java
浏览文件 @
85e74dd1
...
@@ -68,9 +68,12 @@ public class TestQueryCache extends TestBase {
...
@@ -68,9 +68,12 @@ public class TestQueryCache extends TestBase {
private
void
testClearingCacheWithTableStructureChanges
()
throws
Exception
{
private
void
testClearingCacheWithTableStructureChanges
()
throws
Exception
{
Connection
conn
=
getConnection
(
"queryCache;QUERY_CACHE_SIZE=10"
);
Connection
conn
=
getConnection
(
"queryCache;QUERY_CACHE_SIZE=10"
);
conn
.
createStatement
().
executeUpdate
(
"CREATE TABLE TEST(col1 bigint, col2 varchar(255))"
);
assertThrows
(
ErrorCode
.
TABLE_OR_VIEW_NOT_FOUND_1
,
conn
).
prepareStatement
(
"SELECT * FROM TEST"
);
conn
.
prepareStatement
(
"SELECT * FROM TEST"
);
Statement
stat
=
conn
.
createStatement
();
conn
.
createStatement
().
executeUpdate
(
"DROP TABLE TEST"
);
stat
.
executeUpdate
(
"CREATE TABLE TEST(col1 bigint, col2 varchar(255))"
);
PreparedStatement
prep
=
conn
.
prepareStatement
(
"SELECT * FROM TEST"
);
prep
.
close
();
stat
.
executeUpdate
(
"DROP TABLE TEST"
);
assertThrows
(
ErrorCode
.
TABLE_OR_VIEW_NOT_FOUND_1
,
conn
).
prepareStatement
(
"SELECT * FROM TEST"
);
assertThrows
(
ErrorCode
.
TABLE_OR_VIEW_NOT_FOUND_1
,
conn
).
prepareStatement
(
"SELECT * FROM TEST"
);
conn
.
close
();
conn
.
close
();
}
}
...
...
h2/src/test/org/h2/test/db/TestSQLInjection.java
浏览文件 @
85e74dd1
...
@@ -57,7 +57,7 @@ public class TestSQLInjection extends TestBase {
...
@@ -57,7 +57,7 @@ public class TestSQLInjection extends TestBase {
stat
.
execute
(
"CALL 123"
);
stat
.
execute
(
"CALL 123"
);
assertThrows
(
ErrorCode
.
LITERALS_ARE_NOT_ALLOWED
,
stat
).
assertThrows
(
ErrorCode
.
LITERALS_ARE_NOT_ALLOWED
,
stat
).
execute
(
"CALL 'Hello'"
);
execute
(
"CALL 'Hello'"
);
assertThrows
(
ErrorCode
.
SYNTAX_ERROR_1
,
stat
).
assertThrows
(
ErrorCode
.
LITERALS_ARE_NOT_ALLOWED
,
stat
).
execute
(
"CALL $$Hello World$$"
);
execute
(
"CALL $$Hello World$$"
);
stat
.
execute
(
"SET ALLOW_LITERALS NONE"
);
stat
.
execute
(
"SET ALLOW_LITERALS NONE"
);
try
{
try
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论