Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
6f2686c4
提交
6f2686c4
authored
2月 04, 2019
作者:
Evgenij Ryazanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix single-column row value expressions in UPDATE command
上级
764384ed
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
48 行增加
和
6 行删除
+48
-6
help.csv
h2/src/docsrc/help/help.csv
+2
-0
Parser.java
h2/src/main/org/h2/command/Parser.java
+1
-1
TestScript.java
h2/src/test/org/h2/test/scripts/TestScript.java
+1
-1
update.sql
h2/src/test/org/h2/test/scripts/dml/update.sql
+40
-0
table.sql
h2/src/test/org/h2/test/scripts/functions/system/table.sql
+4
-4
没有找到文件。
h2/src/docsrc/help/help.csv
浏览文件 @
6f2686c4
...
@@ -2597,11 +2597,13 @@ COMPRESSION LZF
...
@@ -2597,11 +2597,13 @@ COMPRESSION LZF
"Other Grammar","Row value expression","
"Other Grammar","Row value expression","
ROW (expression, [,...])
ROW (expression, [,...])
| ( [ expression, expression [,...] ] )
| ( [ expression, expression [,...] ] )
| expression
","
","
A row value expression.
A row value expression.
","
","
ROW (1)
ROW (1)
(1, 2)
(1, 2)
1
"
"
"Other Grammar","Select Expression","
"Other Grammar","Select Expression","
...
...
h2/src/main/org/h2/command/Parser.java
浏览文件 @
6f2686c4
...
@@ -1175,7 +1175,7 @@ public class Parser {
...
@@ -1175,7 +1175,7 @@ public class Parser {
}
while
(
readIfMore
(
true
));
}
while
(
readIfMore
(
true
));
read
(
EQUAL
);
read
(
EQUAL
);
Expression
expression
=
readExpression
();
Expression
expression
=
readExpression
();
if
(
columns
.
size
()
==
1
)
{
if
(
columns
.
size
()
==
1
&&
expression
.
getType
().
getValueType
()
!=
Value
.
ROW
)
{
// the expression is parsed as a simple value
// the expression is parsed as a simple value
command
.
setAssignment
(
columns
.
get
(
0
),
expression
);
command
.
setAssignment
(
columns
.
get
(
0
),
expression
);
}
else
{
}
else
{
...
...
h2/src/test/org/h2/test/scripts/TestScript.java
浏览文件 @
6f2686c4
...
@@ -158,7 +158,7 @@ public class TestScript extends TestDb {
...
@@ -158,7 +158,7 @@ public class TestScript extends TestDb {
testScript
(
"ddl/"
+
s
+
".sql"
);
testScript
(
"ddl/"
+
s
+
".sql"
);
}
}
for
(
String
s
:
new
String
[]
{
"delete"
,
"error_reporting"
,
"insert"
,
"insertIgnore"
,
"merge"
,
"mergeUsing"
,
for
(
String
s
:
new
String
[]
{
"delete"
,
"error_reporting"
,
"insert"
,
"insertIgnore"
,
"merge"
,
"mergeUsing"
,
"replace"
,
"script"
,
"select"
,
"show"
,
"table"
,
"values"
,
"with"
})
{
"replace"
,
"script"
,
"select"
,
"show"
,
"table"
,
"
update"
,
"
values"
,
"with"
})
{
testScript
(
"dml/"
+
s
+
".sql"
);
testScript
(
"dml/"
+
s
+
".sql"
);
}
}
for
(
String
s
:
new
String
[]
{
"help"
})
{
for
(
String
s
:
new
String
[]
{
"help"
})
{
...
...
h2/src/test/org/h2/test/scripts/dml/update.sql
0 → 100644
浏览文件 @
6f2686c4
-- Copyright 2004-2019 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
CREATE
TABLE
TEST
(
A
INT
,
B
INT
);
>
ok
INSERT
INTO
TEST
VALUES
(
1
,
2
);
>
update
count
:
1
UPDATE
TEST
SET
(
A
,
B
)
=
(
3
,
4
);
>
update
count
:
1
SELECT
*
FROM
TEST
;
>
A
B
>
-
-
>
3
4
>
rows
:
1
UPDATE
TEST
SET
(
B
)
=
5
;
>
update
count
:
1
SELECT
B
FROM
TEST
;
>>
5
UPDATE
TEST
SET
(
B
)
=
ROW
(
6
);
>
update
count
:
1
SELECT
B
FROM
TEST
;
>>
6
UPDATE
TEST
SET
(
B
)
=
(
7
);
>
update
count
:
1
SELECT
B
FROM
TEST
;
>>
7
DROP
TABLE
TEST
;
>
ok
h2/src/test/org/h2/test/scripts/functions/system/table.sql
浏览文件 @
6f2686c4
...
@@ -3,10 +3,10 @@
...
@@ -3,10 +3,10 @@
-- Initial Developer: H2 Group
-- Initial Developer: H2 Group
--
--
select
*
from
table
(
a
int
=
(
1
)),
table
(
b
int
=
(
2
));
select
*
from
table
(
a
int
=
(
1
)),
table
(
b
int
=
2
),
table
(
c
int
=
row
(
3
));
>
A
B
>
A
B
C
>
-
-
>
-
-
-
>
1
2
>
1
2
3
>
rows
:
1
>
rows
:
1
create
table
test
as
select
*
from
table
(
id
int
=
(
1
,
2
,
3
));
create
table
test
as
select
*
from
table
(
id
int
=
(
1
,
2
,
3
));
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论