Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
10757c6a
提交
10757c6a
authored
12月 14, 2012
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove support for function "version()" - issue 406 (due to compatibility problems with PostgreSQL)
上级
806e3797
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
2 行增加
和
34 行删除
+2
-34
help.csv
h2/src/docsrc/help/help.csv
+0
-8
changelog.html
h2/src/docsrc/html/changelog.html
+0
-1
Function.java
h2/src/main/org/h2/expression/Function.java
+2
-9
TestFunctions.java
h2/src/test/org/h2/test/db/TestFunctions.java
+0
-16
没有找到文件。
h2/src/docsrc/help/help.csv
浏览文件 @
10757c6a
...
@@ -3821,14 +3821,6 @@ Returns the name of the current user of this session.
...
@@ -3821,14 +3821,6 @@ Returns the name of the current user of this session.
CURRENT_USER()
CURRENT_USER()
"
"
"Functions (System)","VERSION","
VERSION()
","
Returns the H2 version as a String.
","
VERSION()
"
"System Tables","Information Schema","
"System Tables","Information Schema","
INFORMATION_SCHEMA
INFORMATION_SCHEMA
","
","
...
...
h2/src/docsrc/html/changelog.html
浏览文件 @
10757c6a
...
@@ -34,7 +34,6 @@ Change Log
...
@@ -34,7 +34,6 @@ Change Log
</li><li>
MVStore: old data is now retained for 45 seconds by default.
</li><li>
MVStore: old data is now retained for 45 seconds by default.
</ul><li>
MVStore: compress is now disabled by default, and can be enabled on request.
</ul><li>
MVStore: compress is now disabled by default, and can be enabled on request.
</ul><li>
Support ALTER TABLE ADD ... AFTER. Patch from Andrew Gaul (argaul at gmail.com). Fixes issue 401.
</ul><li>
Support ALTER TABLE ADD ... AFTER. Patch from Andrew Gaul (argaul at gmail.com). Fixes issue 401.
</ul><li>
support "SELECT version()". Patch from Andrew Gaul. Fixes issue 406.
</ul><li>
Improved OSGi support. H2 now registers itself as a DataSourceFactory service. Fixes issue 365.
</ul><li>
Improved OSGi support. H2 now registers itself as a DataSourceFactory service. Fixes issue 365.
</ul><li>
Add a DISK_SPACE_USED system function. Fixes issue 270.
</ul><li>
Add a DISK_SPACE_USED system function. Fixes issue 270.
</li></ul>
</li></ul>
...
...
h2/src/main/org/h2/expression/Function.java
浏览文件 @
10757c6a
...
@@ -26,7 +26,6 @@ import java.util.regex.PatternSyntaxException;
...
@@ -26,7 +26,6 @@ import java.util.regex.PatternSyntaxException;
import
org.h2.command.Command
;
import
org.h2.command.Command
;
import
org.h2.command.Parser
;
import
org.h2.command.Parser
;
import
org.h2.constant.ErrorCode
;
import
org.h2.constant.ErrorCode
;
import
org.h2.engine.Constants
;
import
org.h2.engine.Database
;
import
org.h2.engine.Database
;
import
org.h2.engine.Mode
;
import
org.h2.engine.Mode
;
import
org.h2.engine.Session
;
import
org.h2.engine.Session
;
...
@@ -99,8 +98,7 @@ public class Function extends Expression implements FunctionCall {
...
@@ -99,8 +98,7 @@ public class Function extends Expression implements FunctionCall {
CASE
=
206
,
NEXTVAL
=
207
,
CURRVAL
=
208
,
ARRAY_GET
=
209
,
CSVREAD
=
210
,
CSVWRITE
=
211
,
CASE
=
206
,
NEXTVAL
=
207
,
CURRVAL
=
208
,
ARRAY_GET
=
209
,
CSVREAD
=
210
,
CSVWRITE
=
211
,
MEMORY_FREE
=
212
,
MEMORY_USED
=
213
,
LOCK_MODE
=
214
,
SCHEMA
=
215
,
SESSION_ID
=
216
,
ARRAY_LENGTH
=
217
,
MEMORY_FREE
=
212
,
MEMORY_USED
=
213
,
LOCK_MODE
=
214
,
SCHEMA
=
215
,
SESSION_ID
=
216
,
ARRAY_LENGTH
=
217
,
LINK_SCHEMA
=
218
,
GREATEST
=
219
,
LEAST
=
220
,
CANCEL_SESSION
=
221
,
SET
=
222
,
TABLE
=
223
,
TABLE_DISTINCT
=
224
,
LINK_SCHEMA
=
218
,
GREATEST
=
219
,
LEAST
=
220
,
CANCEL_SESSION
=
221
,
SET
=
222
,
TABLE
=
223
,
TABLE_DISTINCT
=
224
,
FILE_READ
=
225
,
TRANSACTION_ID
=
226
,
TRUNCATE_VALUE
=
227
,
NVL2
=
228
,
DECODE
=
229
,
ARRAY_CONTAINS
=
230
,
FILE_READ
=
225
,
TRANSACTION_ID
=
226
,
TRUNCATE_VALUE
=
227
,
NVL2
=
228
,
DECODE
=
229
,
ARRAY_CONTAINS
=
230
;
VERSION
=
231
;
public
static
final
int
ROW_NUMBER
=
300
;
public
static
final
int
ROW_NUMBER
=
300
;
...
@@ -346,7 +344,6 @@ public class Function extends Expression implements FunctionCall {
...
@@ -346,7 +344,6 @@ public class Function extends Expression implements FunctionCall {
addFunction
(
"FILE_READ"
,
FILE_READ
,
VAR_ARGS
,
Value
.
NULL
,
false
,
false
,
false
);
addFunction
(
"FILE_READ"
,
FILE_READ
,
VAR_ARGS
,
Value
.
NULL
,
false
,
false
,
false
);
addFunctionNotDeterministic
(
"TRANSACTION_ID"
,
TRANSACTION_ID
,
0
,
Value
.
STRING
);
addFunctionNotDeterministic
(
"TRANSACTION_ID"
,
TRANSACTION_ID
,
0
,
Value
.
STRING
);
addFunctionWithNull
(
"DECODE"
,
DECODE
,
VAR_ARGS
,
Value
.
NULL
);
addFunctionWithNull
(
"DECODE"
,
DECODE
,
VAR_ARGS
,
Value
.
NULL
);
addFunction
(
"VERSION"
,
VERSION
,
0
,
Value
.
STRING
);
addFunctionNotDeterministic
(
"DISK_SPACE_USED"
,
DISK_SPACE_USED
,
1
,
Value
.
LONG
);
addFunctionNotDeterministic
(
"DISK_SPACE_USED"
,
DISK_SPACE_USED
,
1
,
Value
.
LONG
);
// TableFunction
// TableFunction
...
@@ -953,7 +950,7 @@ public class Function extends Expression implements FunctionCall {
...
@@ -953,7 +950,7 @@ public class Function extends Expression implements FunctionCall {
Table
table
=
p
.
parseTableName
(
sql
);
Table
table
=
p
.
parseTableName
(
sql
);
return
table
.
getDiskSpaceUsed
();
return
table
.
getDiskSpaceUsed
();
}
}
private
static
Value
getNullOrValue
(
Session
session
,
Expression
[]
args
,
Value
[]
values
,
int
i
)
{
private
static
Value
getNullOrValue
(
Session
session
,
Expression
[]
args
,
Value
[]
values
,
int
i
)
{
if
(
i
>=
args
.
length
)
{
if
(
i
>=
args
.
length
)
{
return
null
;
return
null
;
...
@@ -1129,10 +1126,6 @@ public class Function extends Expression implements FunctionCall {
...
@@ -1129,10 +1126,6 @@ public class Function extends Expression implements FunctionCall {
case
LPAD:
case
LPAD:
result
=
ValueString
.
get
(
StringUtils
.
pad
(
v0
.
getString
(),
v1
.
getInt
(),
v2
==
null
?
null
:
v2
.
getString
(),
false
));
result
=
ValueString
.
get
(
StringUtils
.
pad
(
v0
.
getString
(),
v1
.
getInt
(),
v2
==
null
?
null
:
v2
.
getString
(),
false
));
break
;
break
;
case
VERSION:
result
=
ValueString
.
get
(
Constants
.
getVersion
());
break
;
// date
case
DATE_ADD:
case
DATE_ADD:
result
=
ValueTimestamp
.
get
(
dateadd
(
v0
.
getString
(),
v1
.
getInt
(),
v2
.
getTimestamp
()));
result
=
ValueTimestamp
.
get
(
dateadd
(
v0
.
getString
(),
v1
.
getInt
(),
v2
.
getTimestamp
()));
break
;
break
;
...
...
h2/src/test/org/h2/test/db/TestFunctions.java
浏览文件 @
10757c6a
...
@@ -29,7 +29,6 @@ import java.util.Properties;
...
@@ -29,7 +29,6 @@ import java.util.Properties;
import
java.util.UUID
;
import
java.util.UUID
;
import
org.h2.api.AggregateFunction
;
import
org.h2.api.AggregateFunction
;
import
org.h2.constant.ErrorCode
;
import
org.h2.constant.ErrorCode
;
import
org.h2.engine.Constants
;
import
org.h2.store.fs.FileUtils
;
import
org.h2.store.fs.FileUtils
;
import
org.h2.test.TestBase
;
import
org.h2.test.TestBase
;
import
org.h2.tools.SimpleResultSet
;
import
org.h2.tools.SimpleResultSet
;
...
@@ -55,7 +54,6 @@ public class TestFunctions extends TestBase implements AggregateFunction {
...
@@ -55,7 +54,6 @@ public class TestFunctions extends TestBase implements AggregateFunction {
public
void
test
()
throws
Exception
{
public
void
test
()
throws
Exception
{
deleteDb
(
"functions"
);
deleteDb
(
"functions"
);
testVersion
();
testFunctionTable
();
testFunctionTable
();
testArrayParameters
();
testArrayParameters
();
testDefaultConnection
();
testDefaultConnection
();
...
@@ -81,20 +79,6 @@ public class TestFunctions extends TestBase implements AggregateFunction {
...
@@ -81,20 +79,6 @@ public class TestFunctions extends TestBase implements AggregateFunction {
FileUtils
.
deleteRecursive
(
TEMP_DIR
,
true
);
FileUtils
.
deleteRecursive
(
TEMP_DIR
,
true
);
}
}
private
void
testVersion
()
throws
SQLException
{
Connection
conn
=
getConnection
(
"functions"
);
Statement
stat
=
conn
.
createStatement
();
String
query
=
"select version()"
;
ResultSet
rs
=
stat
.
executeQuery
(
query
);
assertTrue
(
rs
.
next
());
String
version
=
rs
.
getString
(
1
);
assertEquals
(
Constants
.
getVersion
(),
version
);
assertFalse
(
rs
.
next
());
rs
.
close
();
stat
.
close
();
conn
.
close
();
}
private
void
testFunctionTable
()
throws
SQLException
{
private
void
testFunctionTable
()
throws
SQLException
{
Connection
conn
=
getConnection
(
"functions"
);
Connection
conn
=
getConnection
(
"functions"
);
Statement
stat
=
conn
.
createStatement
();
Statement
stat
=
conn
.
createStatement
();
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论