Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Shardingsphere
提交
33aca175
Shardingsphere
项目概览
apache
/
Shardingsphere
通知
56
Star
3
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Shardingsphere
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
33aca175
编写于
3月 17, 2020
作者:
流
流浪诗人
提交者:
GitHub
3月 17, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix 4782. (#4803)
上级
124dfc7f
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
13 addition
and
13 deletion
+13
-13
shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/asserts/segment/expression/ExpressionAssert.java
...ntegrate/asserts/segment/expression/ExpressionAssert.java
+2
-2
shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/dml/insert.xml
...ere-sql-parser-test/src/test/resources/sql/dml/insert.xml
+8
-8
shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/dml/select-aggregate.xml
...rser-test/src/test/resources/sql/dml/select-aggregate.xml
+2
-2
shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/dml/update.xml
...ere-sql-parser-test/src/test/resources/sql/dml/update.xml
+1
-1
未找到文件。
shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/asserts/segment/expression/ExpressionAssert.java
浏览文件 @
33aca175
...
...
@@ -20,6 +20,7 @@ package org.apache.shardingsphere.sql.parser.integrate.asserts.segment.expressio
import
lombok.AccessLevel
;
import
lombok.NoArgsConstructor
;
import
org.apache.shardingsphere.sql.parser.integrate.asserts.SQLCaseAssertContext
;
import
org.apache.shardingsphere.sql.parser.integrate.asserts.segment.SQLSegmentAssert
;
import
org.apache.shardingsphere.sql.parser.integrate.asserts.statement.dml.impl.SelectStatementAssert
;
import
org.apache.shardingsphere.sql.parser.integrate.jaxb.domain.segment.impl.expr.complex.ExpectedCommonExpression
;
import
org.apache.shardingsphere.sql.parser.integrate.jaxb.domain.segment.impl.expr.simple.ExpectedLiteralExpression
;
...
...
@@ -83,8 +84,7 @@ public final class ExpressionAssert {
assertNotNull
(
assertContext
.
getText
(
"Expected common expression should exist."
));
String
expectedText
=
SQLCaseType
.
Literal
==
assertContext
.
getSqlCaseType
()
&&
null
!=
expected
.
getLiteralText
()
?
expected
.
getLiteralText
()
:
expected
.
getText
();
assertThat
(
assertContext
.
getText
(
"Common expression text assertion error: "
),
actual
.
getText
(),
is
(
expectedText
));
// TODO assert start index and stop index
// SQLSegmentAssert.assertIs(assertContext, actual, expected);
SQLSegmentAssert
.
assertIs
(
assertContext
,
actual
,
expected
);
}
/**
...
...
shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/dml/insert.xml
浏览文件 @
33aca175
...
...
@@ -69,7 +69,7 @@
<literal-expression
value=
"insert"
/>
</assignment-value>
<assignment-value>
<common-expression
text=
"now()"
/>
<common-expression
text=
"now()"
start-index=
"104"
stop-index=
"108"
literal-start-index=
"109"
literal-stop-index=
"113"
/>
</assignment-value>
</value>
</values>
...
...
@@ -468,7 +468,7 @@
<assignment
start-index=
"89"
stop-index=
"111"
literal-start-index=
"94"
literal-stop-index=
"116"
>
<column
name=
"status"
start-index=
"89"
stop-index=
"94"
literal-start-index=
"94"
literal-stop-index=
"99"
/>
<assignment-value>
<common-expression
text=
"VALUES(status)"
/>
<common-expression
text=
"VALUES(status)"
start-index=
"98"
stop-index=
"111"
literal-start-index=
"103"
literal-stop-index=
"116"
/>
</assignment-value>
</assignment>
</on-duplicate-key-columns>
...
...
@@ -542,7 +542,7 @@
<owner
name=
"t_order"
start-index=
"113"
stop-index=
"119"
literal-start-index=
"118"
literal-stop-index=
"124"
/>
</column>
<assignment-value>
<common-expression
text=
"VALUES(t_order.status)"
/>
<common-expression
text=
"VALUES(t_order.status)"
start-index=
"130"
stop-index=
"151"
literal-start-index=
"135"
literal-stop-index=
"156"
/>
</assignment-value>
</assignment>
</on-duplicate-key-columns>
...
...
@@ -744,7 +744,7 @@
<literal-expression
value=
"200"
/>
</assignment-value>
<assignment-value>
<common-expression
text=
"ST_GeographyFromText('SRID=4326;POINT(100 200)')"
/>
<common-expression
text=
"ST_GeographyFromText('SRID=4326;POINT(100 200)')"
start-index=
"71"
stop-index=
"118"
literal-start-index=
"73"
literal-stop-index=
"120"
/>
</assignment-value>
<assignment-value>
<parameter-marker-expression
value=
"2"
/>
...
...
@@ -873,7 +873,7 @@
<values>
<value>
<assignment-value>
<common-expression
text=
"curdate()"
/>
<common-expression
text=
"curdate()"
start-index=
"61"
stop-index=
"69"
literal-start-index=
"61"
literal-stop-index=
"69"
/>
</assignment-value>
<assignment-value>
<parameter-marker-expression
value=
"0"
/>
...
...
@@ -937,7 +937,7 @@
<values>
<value>
<assignment-value>
<common-expression
text=
"unix_timestamp(?)"
literal-text=
"unix_timestamp(2019-10-19)"
/>
<common-expression
text=
"unix_timestamp(?)"
literal-text=
"unix_timestamp(2019-10-19)"
start-index=
"55"
stop-index=
"71"
literal-start-index=
"55"
literal-stop-index=
"80"
/>
</assignment-value>
<assignment-value>
<parameter-marker-expression
value=
"1"
/>
...
...
@@ -987,7 +987,7 @@
<value>
<assignment-value>
<parameter-marker-expression
value=
"0"
/>
<common-expression
text=
"str_to_date(?,'%Y-%m-%d')"
literal-text=
"str_to_date(2019-12-10,'%Y-%m-%d')"
/>
<common-expression
text=
"str_to_date(?,'%Y-%m-%d')"
literal-text=
"str_to_date(2019-12-10,'%Y-%m-%d')"
start-index=
"61"
stop-index=
"86"
literal-start-index=
"61"
literal-stop-index=
"95"
/>
</assignment-value>
<assignment-value>
<parameter-marker-expression
value=
"1"
/>
...
...
@@ -1100,7 +1100,7 @@
<value>
<assignment-value>
<parameter-marker-expression
value=
"0"
/>
<common-expression
text=
"date_add(now(),interval?second)"
literal-text=
"date_add(now(),interval1second)"
/>
<common-expression
text=
"date_add(now(),interval?second)"
literal-text=
"date_add(now(),interval1second)"
start-index=
"61"
stop-index=
"93"
literal-start-index=
"61"
literal-stop-index=
"93"
/>
</assignment-value>
<assignment-value>
<parameter-marker-expression
value=
"1"
/>
...
...
shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/dml/select-aggregate.xml
浏览文件 @
33aca175
...
...
@@ -48,7 +48,7 @@
<column-left-value
name=
"order_id"
start-index=
"51"
stop-index=
"58"
/>
<operator
type=
">"
/>
<compare-right-value>
<common-expression
text=
"1-1"
/>
<common-expression
text=
"1-1"
start-index=
"62"
stop-index=
"64"
literal-start-index=
"62"
literal-stop-index=
"64"
/>
</compare-right-value>
</predicate>
</and-predicate>
...
...
@@ -68,7 +68,7 @@
<column-left-value
name=
"order_id"
start-index=
"51"
stop-index=
"58"
/>
<operator
type=
">"
/>
<compare-right-value>
<common-expression
text=
"1-1"
/>
<common-expression
text=
"1-1"
start-index=
"62"
stop-index=
"66"
literal-start-index=
"62"
literal-stop-index=
"66"
/>
</compare-right-value>
</predicate>
</and-predicate>
...
...
shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/dml/update.xml
浏览文件 @
33aca175
...
...
@@ -108,7 +108,7 @@
<assignment
start-index=
"47"
stop-index=
"116"
literal-start-index=
"58"
literal-stop-index=
"131"
>
<column
name=
"start_point"
start-index=
"47"
stop-index=
"57"
literal-start-index=
"58"
literal-stop-index=
"68"
/>
<assignment-value>
<common-expression
text=
"ST_GeographyFromText('SRID=4326;POINT('||?||' '||?||')')"
literal-text=
"ST_GeographyFromText('SRID=4326;POINT('||100||' '||200||')')"
/>
<common-expression
text=
"ST_GeographyFromText('SRID=4326;POINT('||?||' '||?||')')"
literal-text=
"ST_GeographyFromText('SRID=4326;POINT('||100||' '||200||')')"
start-index=
"61"
stop-index=
"116"
literal-start-index=
"72"
literal-stop-index=
"131"
/>
</assignment-value>
</assignment>
<assignment
start-index=
"119"
stop-index=
"133"
literal-start-index=
"134"
literal-stop-index=
"166"
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录