Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
f0bf7fad
提交
f0bf7fad
authored
1月 16, 2008
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
3ab5f276
全部展开
显示空白字符变更
内嵌
并排
正在显示
37 个修改的文件
包含
1882 行增加
和
1272 行删除
+1882
-1272
ant-build.properties
h2/ant-build.properties
+1
-1
build.xml
h2/build.xml
+41
-47
features.html
h2/src/docsrc/html/features.html
+1
-0
_docs_en.utf8.txt
h2/src/docsrc/text/_docs_en.utf8.txt
+353
-350
_docs_ja.utf8.txt
h2/src/docsrc/text/_docs_ja.utf8.txt
+728
-350
_docs_en.properties
h2/src/docsrc/textbase/_docs_en.properties
+351
-350
_messages_en.properties
h2/src/docsrc/textbase/_messages_en.properties
+1
-0
Parser.java
h2/src/main/org/h2/command/Parser.java
+16
-2
Set.java
h2/src/main/org/h2/command/dml/Set.java
+5
-0
SetTypes.java
h2/src/main/org/h2/command/dml/SetTypes.java
+2
-0
ErrorCode.java
h2/src/main/org/h2/constant/ErrorCode.java
+8
-0
Session.java
h2/src/main/org/h2/engine/Session.java
+23
-0
Function.java
h2/src/main/org/h2/expression/Function.java
+19
-1
Variable.java
h2/src/main/org/h2/expression/Variable.java
+98
-0
JdbcBlob.java
h2/src/main/org/h2/jdbc/JdbcBlob.java
+3
-1
JdbcConnection.java
h2/src/main/org/h2/jdbc/JdbcConnection.java
+4
-0
JdbcResultSet.java
h2/src/main/org/h2/jdbc/JdbcResultSet.java
+10
-0
JdbcDataSource.java
h2/src/main/org/h2/jdbcx/JdbcDataSource.java
+10
-0
JdbcXAConnection.java
h2/src/main/org/h2/jdbcx/JdbcXAConnection.java
+52
-42
UndoLog.java
h2/src/main/org/h2/log/UndoLog.java
+7
-3
_messages_de.properties
h2/src/main/org/h2/res/_messages_de.properties
+1
-0
_messages_en.properties
h2/src/main/org/h2/res/_messages_en.properties
+1
-0
_messages_ja.properties
h2/src/main/org/h2/res/_messages_ja.properties
+1
-0
_messages_pl.properties
h2/src/main/org/h2/res/_messages_pl.properties
+1
-0
_messages_pt_br.properties
h2/src/main/org/h2/res/_messages_pt_br.properties
+1
-0
TcpServer.java
h2/src/main/org/h2/server/TcpServer.java
+2
-2
FtpServer.java
h2/src/main/org/h2/server/ftp/FtpServer.java
+1
-1
PgServer.java
h2/src/main/org/h2/server/pg/PgServer.java
+1
-1
WebServer.java
h2/src/main/org/h2/server/web/WebServer.java
+1
-1
_text_uk.properties
h2/src/main/org/h2/server/web/res/_text_uk.properties
+105
-105
DiskFile.java
h2/src/main/org/h2/store/DiskFile.java
+1
-0
SimpleResultSet.java
h2/src/main/org/h2/tools/SimpleResultSet.java
+5
-3
NetUtils.java
h2/src/main/org/h2/util/NetUtils.java
+16
-2
TestAll.java
h2/src/test/org/h2/test/TestAll.java
+5
-9
test.in.txt
h2/src/test/org/h2/test/test.in.txt
+3
-0
testSimple.in.txt
h2/src/test/org/h2/test/testSimple.in.txt
+3
-0
dictionary.txt
h2/src/tools/org/h2/tools/doc/dictionary.txt
+1
-1
没有找到文件。
h2/ant-build.properties
浏览文件 @
f0bf7fad
#
Thu Jan 10 23:24:36
CET 2008
#
Wed Jan 16 10:26:35
CET 2008
javac
=
javac
javac
=
javac
benchmark.drivers.dir
=
C
\:
/data/java
benchmark.drivers.dir
=
C
\:
/data/java
path.servlet.jar
=
C
\:
/data/classpath/servlet-api.jar
path.servlet.jar
=
C
\:
/data/classpath/servlet-api.jar
...
...
h2/build.xml
浏览文件 @
f0bf7fad
...
@@ -59,46 +59,47 @@
...
@@ -59,46 +59,47 @@
</target>
</target>
<target
name=
"codeswitchJdk13"
depends=
"codeswitchPrepare"
>
<target
name=
"codeswitchJdk13"
depends=
"codeswitchPrepare"
>
<propertyfile
file=
"ant-build.properties"
>
<entry
key=
"jdk"
value=
"1.3"
/>
</propertyfile>
<java
classname=
"org.h2.tools.code.CodeSwitch"
classpath=
"bin"
>
<java
classname=
"org.h2.tools.code.CodeSwitch"
classpath=
"bin"
>
<arg
line=
"+JDK13 -JDK14 -JDK16 +AWT src/main/org/h2"
/>
<arg
line=
"+JDK13 -JDK14 -JDK16 +AWT src/main/org/h2"
/>
</java>
</java>
</target>
<target
name=
"codeswitchJdk14"
depends=
"codeswitchPrepare"
>
<propertyfile
file=
"ant-build.properties"
>
<propertyfile
file=
"ant-build.properties"
>
<entry
key=
"jdk"
value=
"1.
4
"
/>
<entry
key=
"jdk"
value=
"1.
3
"
/>
</propertyfile>
</propertyfile>
<property
name=
"jdk"
value=
"1.3"
/>
</target>
<target
name=
"codeswitchJdk14"
depends=
"codeswitchPrepare"
if=
"codeswitch.14"
>
<java
classname=
"org.h2.tools.code.CodeSwitch"
classpath=
"bin"
>
<java
classname=
"org.h2.tools.code.CodeSwitch"
classpath=
"bin"
>
<arg
line=
"-JDK13 +JDK14 -JDK16 +AWT src/main/org/h2"
/>
<arg
line=
"-JDK13 +JDK14 -JDK16 +AWT src/main/org/h2"
/>
</java>
</java>
</target>
<target
name=
"codeswitchJdk16"
depends=
"codeswitchPrepare"
>
<propertyfile
file=
"ant-build.properties"
>
<propertyfile
file=
"ant-build.properties"
>
<entry
key=
"jdk"
value=
"1.
6
"
/>
<entry
key=
"jdk"
value=
"1.
4
"
/>
</propertyfile>
</propertyfile>
</target>
<target
name=
"codeswitchJdk16"
depends=
"codeswitchPrepare"
if=
"codeswitch.16"
>
<java
classname=
"org.h2.tools.code.CodeSwitch"
classpath=
"bin"
>
<java
classname=
"org.h2.tools.code.CodeSwitch"
classpath=
"bin"
>
<arg
line=
"-JDK13 +JDK14 +JDK16 +AWT src/main/org/h2"
/>
<arg
line=
"-JDK13 +JDK14 +JDK16 +AWT src/main/org/h2"
/>
</java>
</java>
<propertyfile
file=
"ant-build.properties"
>
<entry
key=
"jdk"
value=
"1.6"
/>
</propertyfile>
</target>
</target>
<target
name=
"compileResources"
depends=
"clean, co
mpileTest
"
>
<target
name=
"compileResources"
depends=
"clean, co
deswitchJdk14, codeswitchJdk16
"
>
<javac
target=
"${jdk}"
source=
"${jdk}"
executable=
"${javac}"
srcdir=
"src/main"
destdir=
"bin"
debug=
"true"
includes=
"org/h2/util/Resources.java"
/>
<javac
executable=
"${javac}"
srcdir=
"src/main"
destdir=
"bin"
debug=
"true"
includes=
"org/h2/util/Resources.java"
/>
<java
classname=
"org.h2.util.Resources"
classpath=
"bin"
/>
<java
classname=
"org.h2.util.Resources"
classpath=
"bin"
/>
<delete>
<delete>
<fileset
dir=
"bin"
includes=
"org/h2/util/ResourceData.class"
/>
<fileset
dir=
"bin"
includes=
"org/h2/util/ResourceData.class"
/>
</delete>
</delete>
<javac
target=
"${jdk}"
source=
"${jdk}"
executable=
"${javac}"
srcdir=
"bin"
destdir=
"bin"
debug=
"true"
includes=
"org/h2/util/ResourceData.java"
/>
<javac
executable=
"${javac}"
srcdir=
"bin"
destdir=
"bin"
debug=
"true"
includes=
"org/h2/util/ResourceData.java"
/>
<delete>
<delete>
<fileset
dir=
"bin"
includes=
"org/h2/util/ResourceData.java"
/>
<fileset
dir=
"bin"
includes=
"org/h2/util/ResourceData.java"
/>
</delete>
</delete>
</target>
</target>
<target
name=
"compileFullTextLucene"
depends=
"compileFullTextLuceneTest, compile"
if=
"lucene.jar.present"
>
<target
name=
"compileFullTextLucene"
depends=
"compileFullTextLuceneTest, compile"
if=
"lucene.jar.present"
>
<javac
target=
"${jdk}"
source=
"${jdk}"
executable=
"${javac}"
srcdir=
"src/main"
destdir=
"bin"
debug=
"true"
>
<javac
executable=
"${javac}"
srcdir=
"src/main"
destdir=
"bin"
debug=
"true"
>
<classpath
location=
"${path.lucene.jar}"
/>
<classpath
location=
"${path.lucene.jar}"
/>
<include
name=
"org/h2/fulltext/FullTextLucene.java"
/>
<include
name=
"org/h2/fulltext/FullTextLucene.java"
/>
</javac>
</javac>
...
@@ -110,7 +111,7 @@
...
@@ -110,7 +111,7 @@
</target>
</target>
<target
name=
"compileServlet"
depends=
"compileServletTest, compile"
if=
"servlet.jar.present"
>
<target
name=
"compileServlet"
depends=
"compileServletTest, compile"
if=
"servlet.jar.present"
>
<javac
target=
"${jdk}"
source=
"${jdk}"
executable=
"${javac}"
srcdir=
"src/main"
destdir=
"bin"
debug=
"true"
>
<javac
executable=
"${javac}"
srcdir=
"src/main"
destdir=
"bin"
debug=
"true"
>
<classpath
location=
"${path.servlet.jar}"
/>
<classpath
location=
"${path.servlet.jar}"
/>
<include
name=
"org/h2/server/web/WebServlet.java"
/>
<include
name=
"org/h2/server/web/WebServlet.java"
/>
<include
name=
"org/h2/server/web/DbStarter.java"
/>
<include
name=
"org/h2/server/web/DbStarter.java"
/>
...
@@ -122,8 +123,9 @@
...
@@ -122,8 +123,9 @@
<echo
message=
"Please set ant-build.properties / path.servlet.jar"
/>
<echo
message=
"Please set ant-build.properties / path.servlet.jar"
/>
</target>
</target>
<target
name=
"compile"
depends=
"compileResources, compileTest"
>
<target
name=
"compile"
depends=
"compileResources"
>
<javac
target=
"${jdk}"
source=
"${jdk}"
executable=
"${javac}"
destdir=
"bin"
debug=
"true"
>
<echo
message=
"build-jdk:${java.specification.version} ant-build.properties/jdk:${jdk}"
></echo>
<javac
executable=
"${javac}"
destdir=
"bin"
debug=
"true"
>
<src
path=
"src/main"
/>
<src
path=
"src/main"
/>
<src
path=
"src/test"
/>
<src
path=
"src/test"
/>
<src
path=
"src/tools"
/>
<src
path=
"src/tools"
/>
...
@@ -148,12 +150,7 @@
...
@@ -148,12 +150,7 @@
<java
classname=
"org.h2.test.coverage.Coverage"
classpath=
"."
dir=
"bin"
fork=
"true"
>
<java
classname=
"org.h2.test.coverage.Coverage"
classpath=
"."
dir=
"bin"
fork=
"true"
>
<arg
line=
"-r org/h2"
/>
<arg
line=
"-r org/h2"
/>
</java>
</java>
<javac
target=
"${jdk}"
source=
"${jdk}"
executable=
"${javac}"
srcdir=
"bin"
destdir=
"bin"
debug=
"true"
includes=
"org/h2/**"
/>
<javac
executable=
"${javac}"
srcdir=
"bin"
destdir=
"bin"
debug=
"true"
includes=
"org/h2/**"
/>
</target>
<target
name=
"compileTest"
unless=
"java.version.ok"
>
<echo
message=
"WARNING: Java version is ${java.specification.version}, but source code is switched to ${jdk}."
/>
<echo
message=
"WARNING: Run ant codeswitchJdk... first."
/>
</target>
</target>
<target
name=
"docs"
depends=
"clean,javadoc,compile"
>
<target
name=
"docs"
depends=
"clean,javadoc,compile"
>
...
@@ -181,23 +178,20 @@
...
@@ -181,23 +178,20 @@
<target
name=
"init"
>
<target
name=
"init"
>
<available
file=
"${path.servlet.jar}"
property=
"servlet.jar.present"
/>
<available
file=
"${path.servlet.jar}"
property=
"servlet.jar.present"
/>
<available
file=
"${path.lucene.jar}"
property=
"lucene.jar.present"
/>
<available
file=
"${path.lucene.jar}"
property=
"lucene.jar.present"
/>
<condition
property=
"java.version.ok"
>
<condition
property=
"codeswitch.14"
>
<or>
<and>
<and>
<equals
arg1=
"${java.specification.version}"
arg2=
"1.6
"
/>
<equals
arg1=
"${java.specification.version}"
arg2=
"1.4
"
/>
<equals
arg1=
"${jdk}"
arg2=
"1.6"
/>
<equals
arg1=
"${jdk}"
arg2=
"1.6"
/>
</and>
</and>
</condition>
<condition
property=
"codeswitch.16"
>
<and>
<and>
<equals
arg1=
"${java.specification.version}"
arg2=
"1.5"
/>
<equals
arg1=
"${java.specification.version}"
arg2=
"1.6"
/>
<equals
arg1=
"${jdk}"
arg2=
"1.4"
/>
<not>
</and>
<equals
arg1=
"${jdk}"
arg2=
"1.6"
/>
<and>
</not>
<equals
arg1=
"${java.specification.version}"
arg2=
"1.4"
/>
<equals
arg1=
"${jdk}"
arg2=
"1.4"
/>
</and>
</and>
</or>
</condition>
</condition>
<echo
message=
"build-jdk:${java.specification.version} ant-build.properties/jdk:${jdk}"
></echo>
</target>
</target>
<target
name=
"jar"
depends=
"compile, compileServlet, compileFullTextLucene, manifest"
>
<target
name=
"jar"
depends=
"compile, compileServlet, compileFullTextLucene, manifest"
>
...
@@ -218,7 +212,7 @@
...
@@ -218,7 +212,7 @@
</target>
</target>
<target
name=
"jarClient"
depends=
"compileResources, manifest"
>
<target
name=
"jarClient"
depends=
"compileResources, manifest"
>
<javac
target=
"${jdk}"
source=
"${jdk}"
executable=
"${javac}"
srcdir=
"src/main"
destdir=
"bin"
debug=
"true"
>
<javac
executable=
"${javac}"
srcdir=
"src/main"
destdir=
"bin"
debug=
"true"
>
<include
name=
"org/h2/*"
/>
<include
name=
"org/h2/*"
/>
<include
name=
"org/h2/jdbc/**"
/>
<include
name=
"org/h2/jdbc/**"
/>
<include
name=
"org/h2/jdbcx/**"
/>
<include
name=
"org/h2/jdbcx/**"
/>
...
@@ -230,7 +224,7 @@
...
@@ -230,7 +224,7 @@
</target>
</target>
<target
name=
"jarDb"
depends=
"compileResources, manifest"
>
<target
name=
"jarDb"
depends=
"compileResources, manifest"
>
<javac
target=
"${jdk}"
source=
"${jdk}"
executable=
"${javac}"
srcdir=
"src/main"
destdir=
"bin"
debug=
"true"
>
<javac
executable=
"${javac}"
srcdir=
"src/main"
destdir=
"bin"
debug=
"true"
>
<include
name=
"org/h2/*"
/>
<include
name=
"org/h2/*"
/>
<include
name=
"org/h2/engine/**"
/>
<include
name=
"org/h2/engine/**"
/>
<include
name=
"org/h2/jdbc/**"
/>
<include
name=
"org/h2/jdbc/**"
/>
...
@@ -243,9 +237,9 @@
...
@@ -243,9 +237,9 @@
</target>
</target>
<target
name=
"javadoc"
>
<target
name=
"javadoc"
>
<javac
target=
"${jdk}"
source=
"${jdk}"
executable=
"${javac}"
srcdir=
"src/main"
destdir=
"bin"
debug=
"true"
includes=
"org/h2/util/StringUtils.java"
/>
<javac
executable=
"${javac}"
srcdir=
"src/main"
destdir=
"bin"
debug=
"true"
includes=
"org/h2/util/StringUtils.java"
/>
<javac
target=
"${jdk}"
source=
"${jdk}"
executable=
"${javac}"
srcdir=
"src/test"
destdir=
"bin"
debug=
"true"
includes=
"org/h2/test/bnf/*.java"
/>
<javac
executable=
"${javac}"
srcdir=
"src/test"
destdir=
"bin"
debug=
"true"
includes=
"org/h2/test/bnf/*.java"
/>
<javac
target=
"${jdk}"
source=
"${jdk}"
executable=
"${javac}"
srcdir=
"src/tools"
destdir=
"bin"
debug=
"true"
includes=
"org/h2/tools/doclet/*.java"
/>
<javac
executable=
"${javac}"
srcdir=
"src/tools"
destdir=
"bin"
debug=
"true"
includes=
"org/h2/tools/doclet/*.java"
/>
<mkdir
dir=
"docs/javadoc"
/>
<mkdir
dir=
"docs/javadoc"
/>
<javadoc
<javadoc
sourcepath=
"src/main"
sourcepath=
"src/main"
...
@@ -285,7 +279,7 @@
...
@@ -285,7 +279,7 @@
<attribute
name=
"Implementation-Title"
value=
"H2 Database Engine"
/>
<attribute
name=
"Implementation-Title"
value=
"H2 Database Engine"
/>
<attribute
name=
"Implementation-URL"
value=
"http://www.h2database.com"
/>
<attribute
name=
"Implementation-URL"
value=
"http://www.h2database.com"
/>
<attribute
name=
"Implementation-Version"
value=
"${version.name.maven}"
/>
<attribute
name=
"Implementation-Version"
value=
"${version.name.maven}"
/>
<attribute
name=
"Build-Jdk"
value=
"${j
dk
}"
/>
<attribute
name=
"Build-Jdk"
value=
"${j
ava.specification.version
}"
/>
</manifest>
</manifest>
</target>
</target>
...
...
h2/src/docsrc/html/features.html
浏览文件 @
f0bf7fad
...
@@ -132,6 +132,7 @@ Features
...
@@ -132,6 +132,7 @@ Features
</li><li>
Web-based Console application (English, German, partially French and Spanish) with autocomplete
</li><li>
Web-based Console application (English, German, partially French and Spanish) with autocomplete
</li><li>
The database can generate SQL script files
</li><li>
The database can generate SQL script files
</li><li>
Contains a recovery tool that can dump the contents of the data file
</li><li>
Contains a recovery tool that can dump the contents of the data file
</li><li>
Support for variables (for example to calculate running totals)
</li><li>
Automatic re-compilation of prepared statements
</li><li>
Automatic re-compilation of prepared statements
</li><li>
Uses a small number of database files, binary and text storage formats, graceful handling of low disk space situations
</li><li>
Uses a small number of database files, binary and text storage formats, graceful handling of low disk space situations
</li><li>
Uses a checksum for each record and log entry for data integrity
</li><li>
Uses a checksum for each record and log entry for data integrity
...
...
h2/src/docsrc/text/_docs_en.utf8.txt
浏览文件 @
f0bf7fad
差异被折叠。
点击展开。
h2/src/docsrc/text/_docs_ja.utf8.txt
浏览文件 @
f0bf7fad
This source diff could not be displayed because it is too large. You can
view the blob
instead.
h2/src/docsrc/textbase/_docs_en.properties
浏览文件 @
f0bf7fad
差异被折叠。
点击展开。
h2/src/docsrc/textbase/_messages_en.properties
浏览文件 @
f0bf7fad
...
@@ -157,6 +157,7 @@
...
@@ -157,6 +157,7 @@
90134
=
Access to the class {0} is denied
90134
=
Access to the class {0} is denied
90135
=
The database is open in exclusive mode; can not open additional connections
90135
=
The database is open in exclusive mode; can not open additional connections
90136
=
Unsupported outer join condition
\:
{0}
90136
=
Unsupported outer join condition
\:
{0}
90137
=
Can only assign to a variable, not to
\:
{0}
HY000
=
General error
\:
{0}
HY000
=
General error
\:
{0}
HY004
=
Unknown data type
\:
{0}
HY004
=
Unknown data type
\:
{0}
HYC00
=
Feature not supported
HYC00
=
Feature not supported
...
...
h2/src/main/org/h2/command/Parser.java
浏览文件 @
f0bf7fad
...
@@ -107,6 +107,7 @@ import org.h2.expression.Rownum;
...
@@ -107,6 +107,7 @@ import org.h2.expression.Rownum;
import
org.h2.expression.SequenceValue
;
import
org.h2.expression.SequenceValue
;
import
org.h2.expression.Subquery
;
import
org.h2.expression.Subquery
;
import
org.h2.expression.ValueExpression
;
import
org.h2.expression.ValueExpression
;
import
org.h2.expression.Variable
;
import
org.h2.expression.Wildcard
;
import
org.h2.expression.Wildcard
;
import
org.h2.index.Index
;
import
org.h2.index.Index
;
import
org.h2.message.Message
;
import
org.h2.message.Message
;
...
@@ -151,7 +152,7 @@ public class Parser {
...
@@ -151,7 +152,7 @@ public class Parser {
// this are token types
// this are token types
private
static
final
int
KEYWORD
=
1
,
IDENTIFIER
=
2
,
PARAMETER
=
3
,
END
=
4
,
VALUE
=
5
;
private
static
final
int
KEYWORD
=
1
,
IDENTIFIER
=
2
,
PARAMETER
=
3
,
END
=
4
,
VALUE
=
5
;
private
static
final
int
EQUAL
=
6
,
BIGGER_EQUAL
=
7
,
BIGGER
=
8
;
private
static
final
int
EQUAL
=
6
,
BIGGER_EQUAL
=
7
,
BIGGER
=
8
;
private
static
final
int
SMALLER
=
9
,
SMALLER_EQUAL
=
10
,
NOT_EQUAL
=
11
;
private
static
final
int
SMALLER
=
9
,
SMALLER_EQUAL
=
10
,
NOT_EQUAL
=
11
,
AT
=
12
;
private
static
final
int
MINUS
=
17
,
PLUS
=
18
;
private
static
final
int
MINUS
=
17
,
PLUS
=
18
;
private
static
final
int
STRING_CONCAT
=
22
;
private
static
final
int
STRING_CONCAT
=
22
;
private
static
final
int
OPEN
=
31
,
CLOSE
=
32
,
NULL
=
34
,
TRUE
=
40
,
FALSE
=
41
;
private
static
final
int
OPEN
=
31
,
CLOSE
=
32
,
NULL
=
34
,
TRUE
=
40
,
FALSE
=
41
;
...
@@ -1986,6 +1987,10 @@ public class Parser {
...
@@ -1986,6 +1987,10 @@ public class Parser {
private
Expression
readTerm
()
throws
SQLException
{
private
Expression
readTerm
()
throws
SQLException
{
Expression
r
;
Expression
r
;
switch
(
currentTokenType
)
{
switch
(
currentTokenType
)
{
case
AT:
read
();
r
=
new
Variable
(
session
,
readAliasIdentifier
());
break
;
case
PARAMETER:
case
PARAMETER:
// there must be no space between ? and the number
// there must be no space between ? and the number
boolean
indexed
=
Character
.
isDigit
(
sqlCommandChars
[
parseIndex
]);
boolean
indexed
=
Character
.
isDigit
(
sqlCommandChars
[
parseIndex
]);
...
@@ -2674,6 +2679,7 @@ public class Parser {
...
@@ -2674,6 +2679,7 @@ public class Parser {
case
'+'
:
case
'+'
:
case
'%'
:
case
'%'
:
case
'?'
:
case
'?'
:
case
'@'
:
case
'$'
:
case
'$'
:
case
']'
:
case
']'
:
type
=
CHAR_SPECIAL_1
;
type
=
CHAR_SPECIAL_1
;
...
@@ -2782,6 +2788,8 @@ public class Parser {
...
@@ -2782,6 +2788,8 @@ public class Parser {
case
'?'
:
case
'?'
:
case
'$'
:
case
'$'
:
return
PARAMETER
;
return
PARAMETER
;
case
'@'
:
return
AT
;
case
'+'
:
case
'+'
:
return
PLUS
;
return
PLUS
;
case
'-'
:
case
'-'
:
...
@@ -3677,7 +3685,13 @@ public class Parser {
...
@@ -3677,7 +3685,13 @@ public class Parser {
}
}
private
Prepared
parseSet
()
throws
SQLException
{
private
Prepared
parseSet
()
throws
SQLException
{
if
(
readIf
(
"AUTOCOMMIT"
))
{
if
(
readIf
(
"@"
))
{
Set
command
=
new
Set
(
session
,
SetTypes
.
VARIABLE
);
command
.
setString
(
readAliasIdentifier
());
readIfEqualOrTo
();
command
.
setExpression
(
readExpression
());
return
command
;
}
else
if
(
readIf
(
"AUTOCOMMIT"
))
{
readIfEqualOrTo
();
readIfEqualOrTo
();
boolean
value
=
readBooleanSetting
();
boolean
value
=
readBooleanSetting
();
int
setting
=
value
?
TransactionCommand
.
AUTOCOMMIT_TRUE
:
TransactionCommand
.
AUTOCOMMIT_FALSE
;
int
setting
=
value
?
TransactionCommand
.
AUTOCOMMIT_TRUE
:
TransactionCommand
.
AUTOCOMMIT_FALSE
;
...
...
h2/src/main/org/h2/command/dml/Set.java
浏览文件 @
f0bf7fad
...
@@ -290,6 +290,11 @@ public class Set extends Prepared {
...
@@ -290,6 +290,11 @@ public class Set extends Prepared {
}
}
break
;
break
;
}
}
case
SetTypes
.
VARIABLE
:
{
Expression
expr
=
expression
.
optimize
(
session
);
session
.
setVariable
(
stringValue
,
expr
.
getValue
(
session
));
break
;
}
default
:
default
:
throw
Message
.
getInternalError
(
"type="
+
type
);
throw
Message
.
getInternalError
(
"type="
+
type
);
}
}
...
...
h2/src/main/org/h2/command/dml/SetTypes.java
浏览文件 @
f0bf7fad
...
@@ -22,6 +22,7 @@ public class SetTypes {
...
@@ -22,6 +22,7 @@ public class SetTypes {
public
static
final
int
OPTIMIZE_REUSE_RESULTS
=
27
,
SCHEMA_SEARCH_PATH
=
28
,
UNDO_LOG
=
29
;
public
static
final
int
OPTIMIZE_REUSE_RESULTS
=
27
,
SCHEMA_SEARCH_PATH
=
28
,
UNDO_LOG
=
29
;
public
static
final
int
REFERENTIAL_INTEGRITY
=
30
,
MVCC
=
31
,
MAX_OPERATION_MEMORY
=
32
,
EXCLUSIVE
=
33
;
public
static
final
int
REFERENTIAL_INTEGRITY
=
30
,
MVCC
=
31
,
MAX_OPERATION_MEMORY
=
32
,
EXCLUSIVE
=
33
;
public
static
final
int
CREATE_BUILD
=
34
;
public
static
final
int
CREATE_BUILD
=
34
;
public
static
final
int
VARIABLE
=
35
;
private
static
ObjectArray
types
=
new
ObjectArray
();
private
static
ObjectArray
types
=
new
ObjectArray
();
...
@@ -60,6 +61,7 @@ public class SetTypes {
...
@@ -60,6 +61,7 @@ public class SetTypes {
setType
(
MAX_OPERATION_MEMORY
,
"MAX_OPERATION_MEMORY"
);
setType
(
MAX_OPERATION_MEMORY
,
"MAX_OPERATION_MEMORY"
);
setType
(
EXCLUSIVE
,
"EXCLUSIVE"
);
setType
(
EXCLUSIVE
,
"EXCLUSIVE"
);
setType
(
CREATE_BUILD
,
"CREATE_BUILD"
);
setType
(
CREATE_BUILD
,
"CREATE_BUILD"
);
setType
(
VARIABLE
,
"@"
);
}
}
private
static
void
setType
(
int
type
,
String
name
)
{
private
static
void
setType
(
int
type
,
String
name
)
{
...
...
h2/src/main/org/h2/constant/ErrorCode.java
浏览文件 @
f0bf7fad
...
@@ -318,6 +318,14 @@ public class ErrorCode {
...
@@ -318,6 +318,14 @@ public class ErrorCode {
public
static
final
int
DATABASE_IS_IN_EXCLUSIVE_MODE
=
90135
;
public
static
final
int
DATABASE_IS_IN_EXCLUSIVE_MODE
=
90135
;
public
static
final
int
UNSUPPORTED_OUTER_JOIN_CONDITION_1
=
90136
;
public
static
final
int
UNSUPPORTED_OUTER_JOIN_CONDITION_1
=
90136
;
/**
* Can only assign to a variable.
* <pre>
* SELECT AMOUNT, SET(@V, IFNULL(@V, 0)+AMOUNT) FROM TEST;
* </pre>
*/
public
static
final
int
CAN_ONLY_ASSIGN_TO_VARIABLE_1
=
90137
;
/**
/**
* INTERNAL
* INTERNAL
*/
*/
...
...
h2/src/main/org/h2/engine/Session.java
浏览文件 @
f0bf7fad
...
@@ -34,6 +34,7 @@ import org.h2.util.ObjectArray;
...
@@ -34,6 +34,7 @@ import org.h2.util.ObjectArray;
import
org.h2.util.ObjectUtils
;
import
org.h2.util.ObjectUtils
;
import
org.h2.value.Value
;
import
org.h2.value.Value
;
import
org.h2.value.ValueLong
;
import
org.h2.value.ValueLong
;
import
org.h2.value.ValueNull
;
/**
/**
* A session represents a database connection. When using the server mode,
* A session represents a database connection. When using the server mode,
...
@@ -75,10 +76,32 @@ public class Session implements SessionInterface {
...
@@ -75,10 +76,32 @@ public class Session implements SessionInterface {
private
boolean
rollbackMode
;
private
boolean
rollbackMode
;
private
long
sessionStart
=
System
.
currentTimeMillis
();
private
long
sessionStart
=
System
.
currentTimeMillis
();
private
long
currentCommandStart
;
private
long
currentCommandStart
;
private
HashMap
variables
;
public
Session
()
{
public
Session
()
{
}
}
private
void
initVariables
()
{
if
(
variables
==
null
)
{
variables
=
new
HashMap
();
}
}
public
void
setVariable
(
String
name
,
Value
value
)
{
initVariables
();
if
(
value
==
ValueNull
.
INSTANCE
)
{
variables
.
remove
(
name
);
}
else
{
variables
.
put
(
name
,
value
);
}
}
public
Value
getVariable
(
String
name
)
{
initVariables
();
Value
v
=
(
Value
)
variables
.
get
(
name
);
return
v
==
null
?
ValueNull
.
INSTANCE
:
v
;
}
public
Table
findLocalTempTable
(
String
name
)
{
public
Table
findLocalTempTable
(
String
name
)
{
Table
t
=
null
;
Table
t
=
null
;
if
(
localTempTables
!=
null
)
{
if
(
localTempTables
!=
null
)
{
...
...
h2/src/main/org/h2/expression/Function.java
浏览文件 @
f0bf7fad
...
@@ -86,7 +86,7 @@ public class Function extends Expression implements FunctionCall {
...
@@ -86,7 +86,7 @@ public class Function extends Expression implements FunctionCall {
public
static
final
int
IFNULL
=
200
,
CASEWHEN
=
201
,
CONVERT
=
202
,
CAST
=
203
,
COALESCE
=
204
,
NULLIF
=
205
,
public
static
final
int
IFNULL
=
200
,
CASEWHEN
=
201
,
CONVERT
=
202
,
CAST
=
203
,
COALESCE
=
204
,
NULLIF
=
205
,
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
,
TABLE
=
219
,
LEAST
=
220
,
GREATEST
=
221
,
TABLE_DISTINCT
=
222
,
CANCEL_SESSION
=
223
;
LINK_SCHEMA
=
218
,
TABLE
=
219
,
LEAST
=
220
,
GREATEST
=
221
,
TABLE_DISTINCT
=
222
,
CANCEL_SESSION
=
223
,
SET
=
224
;
private
static
final
int
VAR_ARGS
=
-
1
;
private
static
final
int
VAR_ARGS
=
-
1
;
...
@@ -289,6 +289,7 @@ public class Function extends Expression implements FunctionCall {
...
@@ -289,6 +289,7 @@ public class Function extends Expression implements FunctionCall {
addFunctionWithNull
(
"LEAST"
,
LEAST
,
VAR_ARGS
,
Value
.
NULL
);
addFunctionWithNull
(
"LEAST"
,
LEAST
,
VAR_ARGS
,
Value
.
NULL
);
addFunctionWithNull
(
"GREATEST"
,
GREATEST
,
VAR_ARGS
,
Value
.
NULL
);
addFunctionWithNull
(
"GREATEST"
,
GREATEST
,
VAR_ARGS
,
Value
.
NULL
);
addFunction
(
"CANCEL_SESSION"
,
CANCEL_SESSION
,
1
,
Value
.
BOOLEAN
);
addFunction
(
"CANCEL_SESSION"
,
CANCEL_SESSION
,
1
,
Value
.
BOOLEAN
);
addFunction
(
"SET"
,
SET
,
2
,
Value
.
NULL
,
false
,
false
);
}
}
private
static
void
addFunction
(
String
name
,
int
type
,
int
parameterCount
,
int
dataType
,
private
static
void
addFunction
(
String
name
,
int
type
,
int
parameterCount
,
int
dataType
,
...
@@ -1007,6 +1008,12 @@ public class Function extends Expression implements FunctionCall {
...
@@ -1007,6 +1008,12 @@ public class Function extends Expression implements FunctionCall {
result
=
ValueInt
.
get
(
rows
);
result
=
ValueInt
.
get
(
rows
);
break
;
break
;
}
}
case
SET:
{
Variable
var
=
(
Variable
)
args
[
0
];
session
.
setVariable
(
var
.
getName
(),
v1
);
result
=
v1
;
break
;
}
default
:
default
:
throw
Message
.
getInternalError
(
"type="
+
info
.
type
);
throw
Message
.
getInternalError
(
"type="
+
info
.
type
);
}
}
...
@@ -1576,6 +1583,17 @@ public class Function extends Expression implements FunctionCall {
...
@@ -1576,6 +1583,17 @@ public class Function extends Expression implements FunctionCall {
scale
=
0
;
scale
=
0
;
}
}
break
;
break
;
case
SET:
{
Expression
p1
=
args
[
1
];
dataType
=
p1
.
getType
();
precision
=
p1
.
getPrecision
();
scale
=
p1
.
getScale
();
displaySize
=
p1
.
getDisplaySize
();
if
(!(
p0
instanceof
Variable
))
{
throw
Message
.
getSQLException
(
ErrorCode
.
CAN_ONLY_ASSIGN_TO_VARIABLE_1
,
p0
.
getSQL
());
}
break
;
}
default
:
default
:
dataType
=
info
.
dataType
;
dataType
=
info
.
dataType
;
precision
=
0
;
precision
=
0
;
...
...
h2/src/main/org/h2/expression/Variable.java
0 → 100644
浏览文件 @
f0bf7fad
/*
* Copyright 2004-2007 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package
org
.
h2
.
expression
;
import
java.sql.SQLException
;
import
org.h2.command.Parser
;
import
org.h2.engine.Session
;
import
org.h2.message.Message
;
import
org.h2.table.ColumnResolver
;
import
org.h2.table.TableFilter
;
import
org.h2.value.Value
;
/**
* A user defined variable, for example: @ID.
*/
public
class
Variable
extends
Expression
{
private
final
String
name
;
private
Value
lastValue
;
public
Variable
(
Session
session
,
String
name
)
{
this
.
name
=
name
;
lastValue
=
session
.
getVariable
(
name
);
}
public
int
getCost
()
{
return
0
;
}
public
int
getDisplaySize
()
{
return
lastValue
.
getDisplaySize
();
}
public
long
getPrecision
()
{
return
lastValue
.
getPrecision
();
}
public
String
getSQL
()
{
return
"@"
+
Parser
.
quoteIdentifier
(
name
);
}
public
int
getScale
()
{
return
lastValue
.
getScale
();
}
public
int
getType
()
{
return
lastValue
.
getType
();
}
public
Value
getValue
(
Session
session
)
throws
SQLException
{
lastValue
=
session
.
getVariable
(
name
);
return
lastValue
;
}
public
boolean
isEverything
(
ExpressionVisitor
visitor
)
{
switch
(
visitor
.
type
)
{
case
ExpressionVisitor
.
OPTIMIZABLE_MIN_MAX_COUNT_ALL
:
return
true
;
case
ExpressionVisitor
.
DETERMINISTIC
:
return
false
;
case
ExpressionVisitor
.
READONLY
:
return
true
;
case
ExpressionVisitor
.
INDEPENDENT
:
return
true
;
case
ExpressionVisitor
.
EVALUATABLE
:
// the value will be evaluated at execute time
return
true
;
case
ExpressionVisitor
.
SET_MAX_DATA_MODIFICATION_ID
:
// it is checked independently if the value is the same as the last time
return
true
;
case
ExpressionVisitor
.
NOT_FROM_RESOLVER
:
return
true
;
default
:
throw
Message
.
getInternalError
(
"type="
+
visitor
.
type
);
}
}
public
void
mapColumns
(
ColumnResolver
resolver
,
int
level
)
throws
SQLException
{
}
public
Expression
optimize
(
Session
session
)
throws
SQLException
{
return
this
;
}
public
void
setEvaluatable
(
TableFilter
tableFilter
,
boolean
value
)
{
}
public
void
updateAggregate
(
Session
session
)
throws
SQLException
{
}
public
String
getName
()
{
return
name
;
}
}
h2/src/main/org/h2/jdbc/JdbcBlob.java
浏览文件 @
f0bf7fad
...
@@ -72,6 +72,8 @@ public class JdbcBlob extends TraceObject implements Blob {
...
@@ -72,6 +72,8 @@ public class JdbcBlob extends TraceObject implements Blob {
/**
/**
* [Not supported] Truncates the object.
* [Not supported] Truncates the object.
*
* @param len the new length
*/
*/
public
void
truncate
(
long
len
)
throws
SQLException
{
public
void
truncate
(
long
len
)
throws
SQLException
{
debugCodeCall
(
"truncate"
,
len
);
debugCodeCall
(
"truncate"
,
len
);
...
...
h2/src/main/org/h2/jdbc/JdbcConnection.java
浏览文件 @
f0bf7fad
...
@@ -1373,6 +1373,8 @@ public class JdbcConnection extends TraceObject implements Connection {
...
@@ -1373,6 +1373,8 @@ public class JdbcConnection extends TraceObject implements Connection {
/**
/**
* [Not supported] Return an object of this class if possible.
* [Not supported] Return an object of this class if possible.
*
* @param iface the class
*/
*/
//#ifdef JDK16
//#ifdef JDK16
/*
/*
...
@@ -1384,6 +1386,8 @@ public class JdbcConnection extends TraceObject implements Connection {
...
@@ -1384,6 +1386,8 @@ public class JdbcConnection extends TraceObject implements Connection {
/**
/**
* [Not supported] Checks if unwrap can return an object of this class.
* [Not supported] Checks if unwrap can return an object of this class.
*
* @param iface the class
*/
*/
//#ifdef JDK16
//#ifdef JDK16
/*
/*
...
...
h2/src/main/org/h2/jdbc/JdbcResultSet.java
浏览文件 @
f0bf7fad
...
@@ -2953,6 +2953,8 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
...
@@ -2953,6 +2953,8 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
/**
/**
* [Not supported] Returns the value of the specified column as a row id.
* [Not supported] Returns the value of the specified column as a row id.
*
* @param columnIndex (1,2,...)
*/
*/
//#ifdef JDK16
//#ifdef JDK16
/*
/*
...
@@ -2964,6 +2966,8 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
...
@@ -2964,6 +2966,8 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
/**
/**
* [Not supported] Returns the value of the specified column as a row id.
* [Not supported] Returns the value of the specified column as a row id.
*
* @param columnName the name of the column label
*/
*/
//#ifdef JDK16
//#ifdef JDK16
/*
/*
...
@@ -2975,6 +2979,9 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
...
@@ -2975,6 +2979,9 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
/**
/**
* [Not supported] Updates a column in the current or insert row.
* [Not supported] Updates a column in the current or insert row.
*
* @param columnIndex (1,2,...)
* @param x the value
*/
*/
//#ifdef JDK16
//#ifdef JDK16
/*
/*
...
@@ -2986,6 +2993,9 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
...
@@ -2986,6 +2993,9 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
/**
/**
* [Not supported] Updates a column in the current or insert row.
* [Not supported] Updates a column in the current or insert row.
*
* @param columnName the name of the column label
* @param x the value
*/
*/
//#ifdef JDK16
//#ifdef JDK16
/*
/*
...
...
h2/src/main/org/h2/jdbcx/JdbcDataSource.java
浏览文件 @
f0bf7fad
...
@@ -278,6 +278,11 @@ implements XADataSource, DataSource, ConnectionPoolDataSource, Serializable, Ref
...
@@ -278,6 +278,11 @@ implements XADataSource, DataSource, ConnectionPoolDataSource, Serializable, Ref
}
}
//#endif
//#endif
/**
* [Not supported] Return an object of this class if possible.
*
* @param iface the class
*/
//#ifdef JDK16
//#ifdef JDK16
/*
/*
public <T> T unwrap(Class<T> iface) throws SQLException {
public <T> T unwrap(Class<T> iface) throws SQLException {
...
@@ -286,6 +291,11 @@ implements XADataSource, DataSource, ConnectionPoolDataSource, Serializable, Ref
...
@@ -286,6 +291,11 @@ implements XADataSource, DataSource, ConnectionPoolDataSource, Serializable, Ref
*/
*/
//#endif
//#endif
/**
* [Not supported] Checks if unwrap can return an object of this class.
*
* @param iface the class
*/
//#ifdef JDK16
//#ifdef JDK16
/*
/*
public boolean isWrapperFor(Class< ? > iface) throws SQLException {
public boolean isWrapperFor(Class< ? > iface) throws SQLException {
...
...
h2/src/main/org/h2/jdbcx/JdbcXAConnection.java
浏览文件 @
f0bf7fad
...
@@ -376,6 +376,11 @@ implements XAConnection, XAResource, JdbcConnectionListener
...
@@ -376,6 +376,11 @@ implements XAConnection, XAResource, JdbcConnectionListener
}
}
//#endif
//#endif
/**
* [Not supported] Add a statement event listener.
*
* @param listener the new statement event listener
*/
//#ifdef JDK16
//#ifdef JDK16
/*
/*
public void addStatementEventListener(StatementEventListener listener) {
public void addStatementEventListener(StatementEventListener listener) {
...
@@ -384,6 +389,11 @@ implements XAConnection, XAResource, JdbcConnectionListener
...
@@ -384,6 +389,11 @@ implements XAConnection, XAResource, JdbcConnectionListener
*/
*/
//#endif
//#endif
/**
* [Not supported] Remove a statement event listener.
*
* @param listener the statement event listener
*/
//#ifdef JDK16
//#ifdef JDK16
/*
/*
public void removeStatementEventListener(StatementEventListener listener) {
public void removeStatementEventListener(StatementEventListener listener) {
...
...
h2/src/main/org/h2/log/UndoLog.java
浏览文件 @
f0bf7fad
...
@@ -67,14 +67,18 @@ public class UndoLog {
...
@@ -67,14 +67,18 @@ public class UndoLog {
}
}
first
.
seek
(
file
);
first
.
seek
(
file
);
}
}
records
.
remove
(
i
);
UndoLogRecord
r
=
(
UndoLogRecord
)
records
.
remove
(
i
);
if
(!
r
.
isStored
())
{
memoryUndo
--;
memoryUndo
--;
}
return
entry
;
return
entry
;
}
}
public
void
add
(
UndoLogRecord
entry
)
throws
SQLException
{
public
void
add
(
UndoLogRecord
entry
)
throws
SQLException
{
records
.
add
(
entry
);
records
.
add
(
entry
);
if
(!
entry
.
isStored
())
{
memoryUndo
++;
memoryUndo
++;
}
if
(
memoryUndo
>
database
.
getMaxMemoryUndo
()
&&
database
.
isPersistent
())
{
if
(
memoryUndo
>
database
.
getMaxMemoryUndo
()
&&
database
.
isPersistent
())
{
if
(
file
==
null
)
{
if
(
file
==
null
)
{
String
fileName
=
database
.
createTempFile
();
String
fileName
=
database
.
createTempFile
();
...
...
h2/src/main/org/h2/res/_messages_de.properties
浏览文件 @
f0bf7fad
...
@@ -157,6 +157,7 @@
...
@@ -157,6 +157,7 @@
90134
=
Der Zugriff auf die Klasse {0} ist nicht erlaubt
90134
=
Der Zugriff auf die Klasse {0} ist nicht erlaubt
90135
=
Die Datenbank befindet sich im Exclusiv Modus; es k
\u
00F6nnen keine zus
\u
00E4tzlichen Verbindungen ge
\u
00F6ffnet werden
90135
=
Die Datenbank befindet sich im Exclusiv Modus; es k
\u
00F6nnen keine zus
\u
00E4tzlichen Verbindungen ge
\u
00F6ffnet werden
90136
=
Diese Outer Join Bedingung wird nicht unterst
\u
00FCtzt
\:
{0}
90136
=
Diese Outer Join Bedingung wird nicht unterst
\u
00FCtzt
\:
{0}
90137
=
\#
Can only assign to a variable, not to
\:
{0}
HY000
=
Allgemeiner Fehler
\:
{0}
HY000
=
Allgemeiner Fehler
\:
{0}
HY004
=
Unbekannter Datentyp
\:
{0}
HY004
=
Unbekannter Datentyp
\:
{0}
HYC00
=
Dieses Feature wird unterst
\u
00FCtzt
HYC00
=
Dieses Feature wird unterst
\u
00FCtzt
...
...
h2/src/main/org/h2/res/_messages_en.properties
浏览文件 @
f0bf7fad
...
@@ -157,6 +157,7 @@
...
@@ -157,6 +157,7 @@
90134
=
Access to the class {0} is denied
90134
=
Access to the class {0} is denied
90135
=
The database is open in exclusive mode; can not open additional connections
90135
=
The database is open in exclusive mode; can not open additional connections
90136
=
Unsupported outer join condition
\:
{0}
90136
=
Unsupported outer join condition
\:
{0}
90137
=
Can only assign to a variable, not to
\:
{0}
HY000
=
General error
\:
{0}
HY000
=
General error
\:
{0}
HY004
=
Unknown data type
\:
{0}
HY004
=
Unknown data type
\:
{0}
HYC00
=
Feature not supported
HYC00
=
Feature not supported
...
...
h2/src/main/org/h2/res/_messages_ja.properties
浏览文件 @
f0bf7fad
...
@@ -157,6 +157,7 @@
...
@@ -157,6 +157,7 @@
90134
=
\#
Access to the class {0} is denied
90134
=
\#
Access to the class {0} is denied
90135
=
\#
The database is open in exclusive mode; can not open additional connections
90135
=
\#
The database is open in exclusive mode; can not open additional connections
90136
=
\#
Unsupported outer join condition
\:
{0}
90136
=
\#
Unsupported outer join condition
\:
{0}
90137
=
\#
Can only assign to a variable, not to
\:
{0}
HY000
=
\u
4E00
\u
822C
\u
30A8
\u
30E9
\u
30FC
\:
{0}
HY000
=
\u
4E00
\u
822C
\u
30A8
\u
30E9
\u
30FC
\:
{0}
HY004
=
\u
4E0D
\u
660E
\u
306A
\u
30C7
\u
30FC
\u
30BF
\u
578B
\:
{0}
HY004
=
\u
4E0D
\u
660E
\u
306A
\u
30C7
\u
30FC
\u
30BF
\u
578B
\:
{0}
HYC00
=
\u
6A5F
\u
80FD
\u
306F
\u
30B5
\u
30DD
\u
30FC
\u
30C8
\u3055\u
308C
\u3066\u3044\u
307E
\u
305B
\u3093
HYC00
=
\u
6A5F
\u
80FD
\u
306F
\u
30B5
\u
30DD
\u
30FC
\u
30C8
\u3055\u
308C
\u3066\u3044\u
307E
\u
305B
\u3093
...
...
h2/src/main/org/h2/res/_messages_pl.properties
浏览文件 @
f0bf7fad
...
@@ -157,6 +157,7 @@
...
@@ -157,6 +157,7 @@
90134
=
\#
Access to the class {0} is denied
90134
=
\#
Access to the class {0} is denied
90135
=
\#
The database is open in exclusive mode; can not open additional connections
90135
=
\#
The database is open in exclusive mode; can not open additional connections
90136
=
\#
Unsupported outer join condition
\:
{0}
90136
=
\#
Unsupported outer join condition
\:
{0}
90137
=
\#
Can only assign to a variable, not to
\:
{0}
HY000
=
Blad ogolny
\:
{0}
HY000
=
Blad ogolny
\:
{0}
HY004
=
Nieznany typ danyche
\:
{0}
HY004
=
Nieznany typ danyche
\:
{0}
HYC00
=
Cecha nie jest wspierana
HYC00
=
Cecha nie jest wspierana
...
...
h2/src/main/org/h2/res/_messages_pt_br.properties
浏览文件 @
f0bf7fad
...
@@ -157,6 +157,7 @@
...
@@ -157,6 +157,7 @@
90134
=
\#
Access to the class {0} is denied
90134
=
\#
Access to the class {0} is denied
90135
=
\#
The database is open in exclusive mode; can not open additional connections
90135
=
\#
The database is open in exclusive mode; can not open additional connections
90136
=
\#
Unsupported outer join condition
\:
{0}
90136
=
\#
Unsupported outer join condition
\:
{0}
90137
=
\#
Can only assign to a variable, not to
\:
{0}
HY000
=
Erro geral
\:
{0}
HY000
=
Erro geral
\:
{0}
HY004
=
Tipo de dados desconhecido
\:
{0}
HY004
=
Tipo de dados desconhecido
\:
{0}
HYC00
=
Recurso n
\u
00E3o suportado
HYC00
=
Recurso n
\u
00E3o suportado
...
...
h2/src/main/org/h2/server/TcpServer.java
浏览文件 @
f0bf7fad
...
@@ -163,7 +163,7 @@ public class TcpServer implements Service {
...
@@ -163,7 +163,7 @@ public class TcpServer implements Service {
}
}
}
}
org
.
h2
.
Driver
.
load
();
org
.
h2
.
Driver
.
load
();
url
=
(
ssl
?
"ssl"
:
"tcp"
)
+
"://
localhost
:"
+
port
;
url
=
(
ssl
?
"ssl"
:
"tcp"
)
+
"://
"
+
NetUtils
.
getLocalAddress
()
+
"
:"
+
port
;
}
}
public
String
getURL
()
{
public
String
getURL
()
{
...
@@ -266,7 +266,7 @@ public class TcpServer implements Service {
...
@@ -266,7 +266,7 @@ public class TcpServer implements Service {
server
.
stopManagementDb
();
server
.
stopManagementDb
();
server
.
stop
=
true
;
server
.
stop
=
true
;
try
{
try
{
Socket
s
=
new
Socket
(
"localhost"
,
port
);
Socket
s
=
NetUtils
.
createLoopbackSocket
(
port
,
false
);
s
.
close
();
s
.
close
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// try to connect - so that accept returns
// try to connect - so that accept returns
...
...
h2/src/main/org/h2/server/ftp/FtpServer.java
浏览文件 @
f0bf7fad
...
@@ -182,7 +182,7 @@ public class FtpServer implements Service {
...
@@ -182,7 +182,7 @@ public class FtpServer implements Service {
}
}
public
String
getURL
()
{
public
String
getURL
()
{
return
"ftp://
localhost
:"
+
port
;
return
"ftp://
"
+
NetUtils
.
getLocalAddress
()
+
"
:"
+
port
;
}
}
public
void
start
()
throws
SQLException
{
public
void
start
()
throws
SQLException
{
...
...
h2/src/main/org/h2/server/pg/PgServer.java
浏览文件 @
f0bf7fad
...
@@ -59,7 +59,7 @@ public class PgServer implements Service {
...
@@ -59,7 +59,7 @@ public class PgServer implements Service {
}
}
}
}
org
.
h2
.
Driver
.
load
();
org
.
h2
.
Driver
.
load
();
url
=
"pg://
localhost
:"
+
port
;
url
=
"pg://
"
+
NetUtils
.
getLocalAddress
()
+
"
:"
+
port
;
// int testing;
// int testing;
// log = true;
// log = true;
...
...
h2/src/main/org/h2/server/web/WebServer.java
浏览文件 @
f0bf7fad
...
@@ -227,7 +227,7 @@ public class WebServer implements Service {
...
@@ -227,7 +227,7 @@ public class WebServer implements Service {
for
(
int
i
=
0
;
i
<
LANGUAGES
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
LANGUAGES
.
length
;
i
++)
{
languages
.
add
(
LANGUAGES
[
i
][
0
]);
languages
.
add
(
LANGUAGES
[
i
][
0
]);
}
}
url
=
(
ssl
?
"https"
:
"http"
)
+
"://
localhost
:"
+
port
;
url
=
(
ssl
?
"https"
:
"http"
)
+
"://
"
+
NetUtils
.
getLocalAddress
()
+
"
:"
+
port
;
}
}
public
String
getURL
()
{
public
String
getURL
()
{
...
...
h2/src/main/org/h2/server/web/res/_text_uk.properties
浏览文件 @
f0bf7fad
h2/src/main/org/h2/store/DiskFile.java
浏览文件 @
f0bf7fad
...
@@ -317,6 +317,7 @@ public class DiskFile implements CacheWriter {
...
@@ -317,6 +317,7 @@ public class DiskFile implements CacheWriter {
throw
Message
.
getInternalError
();
throw
Message
.
getInternalError
();
}
}
Storage
storage
=
database
.
getStorage
(
id
,
this
);
Storage
storage
=
database
.
getStorage
(
id
,
this
);
setUnused
(
i
,
blockCount
);
setBlockOwner
(
storage
,
i
,
blockCount
,
true
);
setBlockOwner
(
storage
,
i
,
blockCount
,
true
);
storage
.
incrementRecordCount
();
storage
.
incrementRecordCount
();
i
+=
blockCount
;
i
+=
blockCount
;
...
...
h2/src/main/org/h2/tools/SimpleResultSet.java
浏览文件 @
f0bf7fad
...
@@ -1259,6 +1259,7 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
...
@@ -1259,6 +1259,7 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
return
(
Column
)
columns
.
get
(
i
);
return
(
Column
)
columns
.
get
(
i
);
}
}
/** INTERNAL */
//#ifdef JDK16
//#ifdef JDK16
/*
/*
public RowId getRowId(int columnIndex) throws SQLException {
public RowId getRowId(int columnIndex) throws SQLException {
...
@@ -1267,6 +1268,7 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
...
@@ -1267,6 +1268,7 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData {
*/
*/
//#endif
//#endif
/** INTERNAL */
//#ifdef JDK16
//#ifdef JDK16
/*
/*
public RowId getRowId(String columnName) throws SQLException {
public RowId getRowId(String columnName) throws SQLException {
...
...
h2/src/main/org/h2/util/NetUtils.java
浏览文件 @
f0bf7fad
...
@@ -25,7 +25,11 @@ public class NetUtils {
...
@@ -25,7 +25,11 @@ public class NetUtils {
private
static
InetAddress
bindAddress
;
private
static
InetAddress
bindAddress
;
public
static
Socket
createLoopbackSocket
(
int
port
,
boolean
ssl
)
throws
IOException
{
public
static
Socket
createLoopbackSocket
(
int
port
,
boolean
ssl
)
throws
IOException
{
return
createSocket
(
"127.0.0.1"
,
port
,
ssl
);
InetAddress
address
=
getBindAddress
();
if
(
address
==
null
)
{
address
=
InetAddress
.
getLocalHost
();
}
return
createSocket
(
address
.
getHostAddress
(),
port
,
ssl
);
}
}
public
static
Socket
createSocket
(
String
server
,
int
defaultPort
,
boolean
ssl
)
throws
IOException
{
public
static
Socket
createSocket
(
String
server
,
int
defaultPort
,
boolean
ssl
)
throws
IOException
{
...
@@ -75,7 +79,7 @@ public class NetUtils {
...
@@ -75,7 +79,7 @@ public class NetUtils {
}
}
synchronized
(
NetUtils
.
class
)
{
synchronized
(
NetUtils
.
class
)
{
if
(
bindAddress
==
null
)
{
if
(
bindAddress
==
null
)
{
bindAddress
=
InetAddress
.
getBy
Address
(
InetAddress
.
getByName
(
host
).
getAddress
()
);
bindAddress
=
InetAddress
.
getBy
Name
(
host
);
}
}
}
}
return
bindAddress
;
return
bindAddress
;
...
@@ -121,4 +125,14 @@ public class NetUtils {
...
@@ -121,4 +125,14 @@ public class NetUtils {
return
null
;
return
null
;
}
}
public
static
String
getLocalAddress
()
{
InetAddress
bind
=
null
;
try
{
bind
=
getBindAddress
();
}
catch
(
UnknownHostException
e
)
{
// ignore
}
return
bind
==
null
?
"localhost"
:
bind
.
getHostAddress
();
}
}
}
h2/src/test/org/h2/test/TestAll.java
浏览文件 @
f0bf7fad
...
@@ -150,18 +150,14 @@ java org.h2.test.TestAll timer
...
@@ -150,18 +150,14 @@ java org.h2.test.TestAll timer
/*
/*
Roadmap:
document SET method, variables
History:
send mail
Roadmap:
There is a problem with the h2.bindAddress build. When it is binding to 127.0.0.1,
History:
the bind function works perfectly and I could confirm it no longer
User defined variables are now supported. Examples: SET @VAR=10;CALL @VAR
listen to the ports of other IP addresses. However, when it is binding to normal IP
addresses, it always got the following exception.
Caused by: org.h2.jdbc.JdbcSQLException: Connection is broken [90067-64]
at org.h2.message.Message.getSQLException(Message.java:89)
Remarks: I build with JDK 1.6
Test Recovery with MAX_LOG_FILE_SIZE=1; test with various log file sizes
Test Recovery with MAX_LOG_FILE_SIZE=1; test with various log file sizes
...
...
h2/src/test/org/h2/test/test.in.txt
浏览文件 @
f0bf7fad
--- special grammar and test cases ---------------------------------------------------------------------------------------------
--- special grammar and test cases ---------------------------------------------------------------------------------------------
select x, set(@t, ifnull(@t, 0) + x) from system_range(1, 3);
> rows: 3
select * from system_range(1, 2) a,
select * from system_range(1, 2) a,
(select * from system_range(1, 2) union select * from system_range(1, 2)
(select * from system_range(1, 2) union select * from system_range(1, 2)
union select * from system_range(1, 1)) v where a.x = v.x;
union select * from system_range(1, 1)) v where a.x = v.x;
...
...
h2/src/test/org/h2/test/testSimple.in.txt
浏览文件 @
f0bf7fad
call set(1, 2);
> exception;
CREATE TABLE TEST(A int NOT NULL, B int NOT NULL, C int) ;
CREATE TABLE TEST(A int NOT NULL, B int NOT NULL, C int) ;
ALTER TABLE TEST ADD CONSTRAINT CON UNIQUE(A,B);
ALTER TABLE TEST ADD CONSTRAINT CON UNIQUE(A,B);
ALTER TABLE TEST DROP C;
ALTER TABLE TEST DROP C;
...
...
h2/src/tools/org/h2/tools/doc/dictionary.txt
浏览文件 @
f0bf7fad
...
@@ -522,4 +522,4 @@ camel council merges spelled adaptive pull controller abstractions workarounds d
...
@@ -522,4 +522,4 @@ camel council merges spelled adaptive pull controller abstractions workarounds d
thousands ridvan incremented slots debugging inherit agar fulvio invisible biondi hundreds occupied remap retrieved involved
thousands ridvan incremented slots debugging inherit agar fulvio invisible biondi hundreds occupied remap retrieved involved
turkish fulfils iapi filesync
turkish fulfils iapi filesync
compares packets destroying echo homed hosts clock countries validated catches turning staging kills distance morning performs internationalization simulator constructed nicer
compares packets destroying echo homed hosts clock countries validated catches turning staging kills distance morning performs internationalization simulator constructed nicer
echo callablestatement procid homed getstart staging
echo callablestatement procid homed getstart staging prices
\ No newline at end of file
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论