Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
7b482dff
提交
7b482dff
authored
10月 21, 2017
作者:
Owner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Undo help.csv change, minor edits in other file
上级
5cad03b9
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
17 行增加
和
33 行删除
+17
-33
Parser.java
h2/src/main/org/h2/command/Parser.java
+10
-9
CreateView.java
h2/src/main/org/h2/command/ddl/CreateView.java
+7
-7
help.csv
h2/src/main/org/h2/res/help.csv
+0
-17
没有找到文件。
h2/src/main/org/h2/command/Parser.java
浏览文件 @
7b482dff
...
...
@@ -1137,7 +1137,7 @@ public class Parser {
String
[]
querySQLOutput
=
new
String
[]{
null
};
List
<
Column
>
columnTemplateList
=
createQueryColumnTemplateList
(
null
,
command
.
getQuery
(),
querySQLOutput
);
Table
temporarySourceTableView
=
createTemporarySessionView
(
Table
View
temporarySourceTableView
=
createTemporarySessionView
(
command
.
getQueryAlias
(),
querySQLOutput
[
0
],
columnTemplateList
,
false
/* no recursion */
,
false
/* do not add to session */
,
...
...
@@ -5129,18 +5129,18 @@ public class Parser {
List
<
TableView
>
viewsCreated
=
new
ArrayList
<>();
readIf
(
"RECURSIVE"
);
// this WITH statement might not be temporary - allow keyword to tell us that
// this WITH statement might not be temporary - allow optional keyword to tell us that
// this keyword is a work in progress feature and will not be documented
boolean
isPersistent
=
readIf
(
"PERSISTENT"
);
// this WITH statement might not be temporary - it my part of a persistent view
// as in CREATE VIEW abc AS WITH
// this WITH statement might not be temporary - it m
a
y part of a persistent view
// as in CREATE VIEW abc AS WITH
- this auto detects that condition
if
(
session
.
isParsingView
()){
isPersistent
=
true
;
}
do
{
TableView
newView
=
parseSingleCommonTableExpression
(
isPersistent
);
viewsCreated
.
add
(
newView
);
viewsCreated
.
add
(
parseSingleCommonTableExpression
(
isPersistent
));
}
while
(
readIf
(
","
));
Prepared
p
=
null
;
...
...
@@ -5227,6 +5227,7 @@ public class Parser {
// table expressions need to reference something that look like
// themselves
// to work (its removed after creation in this method)
// only create table data and table if we don't have a working CTE already
if
(
oldViewFound
==
null
){
CreateTableData
recursiveTableData
=
new
CreateTableData
();
recursiveTableData
.
id
=
database
.
allocateObjectId
();
...
...
@@ -5246,7 +5247,6 @@ public class Parser {
read
(
"AS"
);
read
(
"("
);
Query
withQuery
=
parseSelect
();
//withQuery.setSession(targetSession);
read
(
")"
);
columnTemplateList
=
createQueryColumnTemplateList
(
cols
,
withQuery
,
querySQLOutput
);
...
...
@@ -5255,13 +5255,14 @@ public class Parser {
targetSession
.
removeLocalTempTable
(
recursiveTable
);
}
}
// If it's persistent, a CTE and a TableView - return existing one
// If it's persistent, a CTE and a TableView - return existing one
, otherwise create new...
if
(
oldViewFound
!=
null
&&
isPersistent
&&
oldViewFound
instanceof
TableView
&&
oldViewFound
.
isTableExpression
()){
return
(
TableView
)
oldViewFound
;
}
TableView
view
=
createTemporarySessionView
(
tempViewName
,
querySQLOutput
[
0
],
columnTemplateList
,
true
/* allowRecursiveQueryDetection */
,
true
,
isPersistent
);
true
/* allowRecursiveQueryDetection */
,
true
/* add to session */
,
isPersistent
);
return
view
;
}
...
...
h2/src/main/org/h2/command/ddl/CreateView.java
浏览文件 @
7b482dff
...
...
@@ -101,9 +101,9 @@ public class CreateView extends SchemaCommand {
}
// The view creates a Prepared command object, which belongs to a
// session, so we pass the system session (not the current session) down.
//
Session viewSession = select.isTableExpression()!=null ? select.getSession() : db.getSystemSession();
Session
view
Session
=
db
.
getSystemSession
();
synchronized
(
view
Session
)
{
//
Why is the SYS session used here ? I think it might cause a problem...
Session
sys
Session
=
db
.
getSystemSession
();
synchronized
(
sys
Session
)
{
try
{
Column
[]
columnTemplates
=
null
;
if
(
columnNames
!=
null
)
{
...
...
@@ -115,15 +115,15 @@ public class CreateView extends SchemaCommand {
if
(
view
==
null
)
{
Schema
schema
=
session
.
getDatabase
().
getSchema
(
session
.
getCurrentSchemaName
());
view
Session
.
setCurrentSchema
(
schema
);
sys
Session
.
setCurrentSchema
(
schema
);
view
=
new
TableView
(
getSchema
(),
id
,
viewName
,
querySQL
,
null
,
columnTemplates
,
view
Session
,
false
,
false
);
columnTemplates
,
sys
Session
,
false
,
false
);
}
else
{
view
.
replace
(
querySQL
,
columnTemplates
,
view
Session
,
false
,
force
,
false
);
view
.
replace
(
querySQL
,
columnTemplates
,
sys
Session
,
false
,
force
,
false
);
view
.
setModified
();
}
}
finally
{
view
Session
.
setCurrentSchema
(
db
.
getSchema
(
Constants
.
SCHEMA_MAIN
));
sys
Session
.
setCurrentSchema
(
db
.
getSchema
(
Constants
.
SCHEMA_MAIN
));
}
}
if
(
comment
!=
null
)
{
...
...
h2/src/main/org/h2/res/help.csv
浏览文件 @
7b482dff
...
...
@@ -47,14 +47,6 @@ MERGE INTO tableName [ ( columnName [,...] ) ]
{ VALUES { ( { DEFAULT | expression } [,...] ) } [,...] | select }
","
Updates existing rows, and insert rows that don't exist."
"Commands (DML)","MERGE USING","
MERGE INTO targetTableName [ [AS] targetAlias]
USING { ( select ) | sourceTableName }[ [AS] sourceAlias ]
ON ( expression )
[ WHEN MATCHED THEN [ update ] [ delete] ]
[ WHEN NOT MATCHED THEN insert ]
","
Updates or deletes existing rows, and insert rows that don't exist."
"Commands (DML)","RUNSCRIPT","
RUNSCRIPT FROM fileNameString scriptCompressionEncryption
[ CHARSET charsetString ]
...
...
@@ -378,11 +370,6 @@ Switches auto commit on or off."
SET CACHE_SIZE int
","
Sets the size of the cache in KB (each KB being 1024 bytes) for the current database."
"Commands (Other)","SET COLUMN_NAMING_RULES","
SET COLUMN_NAMING_RULES = { DEFAULT | EMULATE=... | MAX_IDENTIFIER_LENGTH=... | REGULAR_EXPRESSION_MATCH_ALLOWED=... | REGULAR_EXPRESSION_MATCH_DISALLOWED=... | DEFAULT_COLUMN_NAME_PATTERN=... | GENERATE_UNIQUE_COLUMN_NAMES=...}
","
This setting controls the rules dealing with how column names are generated
in select statements."
"Commands (Other)","SET CLUSTER","
SET CLUSTER serverListString
","
...
...
@@ -440,10 +427,6 @@ SET JAVA_OBJECT_SERIALIZER
{ null | className }
","
Sets the object used to serialize and deserialize java objects being stored in column of type OTHER."
"Commands (Other)","SET LAZY_QUERY_EXECUTION","
SET LAZY_QUERY_EXECUTION int
","
Sets the lazy query execution mode."
"Commands (Other)","SET LOG","
SET LOG int
","
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论