Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Shardingsphere
提交
8cf4d7ef
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,发现更多精彩内容 >>
提交
8cf4d7ef
编写于
6月 03, 2017
作者:
T
terrymanu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove token for limit
上级
02e94996
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
2 addition
and
10 deletion
+2
-10
sharding-jdbc-core/src/main/java/com/dangdang/ddframe/rdb/sharding/parsing/parser/token/OffsetLimitToken.java
...e/rdb/sharding/parsing/parser/token/OffsetLimitToken.java
+0
-2
sharding-jdbc-core/src/main/java/com/dangdang/ddframe/rdb/sharding/parsing/parser/token/RowCountLimitToken.java
...rdb/sharding/parsing/parser/token/RowCountLimitToken.java
+0
-2
sharding-jdbc-core/src/main/java/com/dangdang/ddframe/rdb/sharding/rewrite/SQLBuilderToken.java
...angdang/ddframe/rdb/sharding/rewrite/SQLBuilderToken.java
+0
-2
sharding-jdbc-core/src/main/java/com/dangdang/ddframe/rdb/sharding/rewrite/SQLRewriteEngine.java
...ngdang/ddframe/rdb/sharding/rewrite/SQLRewriteEngine.java
+2
-4
未找到文件。
sharding-jdbc-core/src/main/java/com/dangdang/ddframe/rdb/sharding/parsing/parser/token/OffsetLimitToken.java
浏览文件 @
8cf4d7ef
...
...
@@ -29,8 +29,6 @@ import lombok.RequiredArgsConstructor;
@Getter
public
final
class
OffsetLimitToken
implements
SQLToken
{
public
static
final
String
OFFSET_NAME
=
"limit_offset"
;
private
final
int
beginPosition
;
private
final
int
offset
;
...
...
sharding-jdbc-core/src/main/java/com/dangdang/ddframe/rdb/sharding/parsing/parser/token/RowCountLimitToken.java
浏览文件 @
8cf4d7ef
...
...
@@ -29,8 +29,6 @@ import lombok.RequiredArgsConstructor;
@Getter
public
final
class
RowCountLimitToken
implements
SQLToken
{
public
static
final
String
COUNT_NAME
=
"limit_count"
;
private
final
int
beginPosition
;
private
final
int
rowCount
;
...
...
sharding-jdbc-core/src/main/java/com/dangdang/ddframe/rdb/sharding/rewrite/SQLBuilderToken.java
浏览文件 @
8cf4d7ef
...
...
@@ -3,7 +3,6 @@ package com.dangdang.ddframe.rdb.sharding.rewrite;
import
com.google.common.base.Joiner
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
import
lombok.RequiredArgsConstructor
;
import
lombok.Setter
;
/**
...
...
@@ -12,7 +11,6 @@ import lombok.Setter;
* @author zhangliang
*/
@AllArgsConstructor
@RequiredArgsConstructor
@Getter
@Setter
public
final
class
SQLBuilderToken
{
...
...
sharding-jdbc-core/src/main/java/com/dangdang/ddframe/rdb/sharding/rewrite/SQLRewriteEngine.java
浏览文件 @
8cf4d7ef
...
...
@@ -120,16 +120,14 @@ public final class SQLRewriteEngine {
}
private
void
appendLimitRowCount
(
final
SQLBuilder
sqlBuilder
,
final
RowCountLimitToken
rowCountLimitToken
,
final
int
count
,
final
List
<
SQLToken
>
sqlTokens
,
final
boolean
isRewrite
)
{
String
rowCount
=
isRewrite
?
String
.
valueOf
(
rowCountLimitToken
.
getRowCount
()
+
limit
.
getOffset
())
:
String
.
valueOf
(
rowCountLimitToken
.
getRowCount
());
sqlBuilder
.
append
(
new
SQLBuilderToken
(
RowCountLimitToken
.
COUNT_NAME
,
rowCount
));
sqlBuilder
.
append
(
isRewrite
?
String
.
valueOf
(
rowCountLimitToken
.
getRowCount
()
+
limit
.
getOffset
())
:
String
.
valueOf
(
rowCountLimitToken
.
getRowCount
()));
int
beginPosition
=
rowCountLimitToken
.
getBeginPosition
()
+
String
.
valueOf
(
rowCountLimitToken
.
getRowCount
()).
length
();
int
endPosition
=
sqlTokens
.
size
()
-
1
==
count
?
originalSQL
.
length
()
:
sqlTokens
.
get
(
count
+
1
).
getBeginPosition
();
sqlBuilder
.
append
(
originalSQL
.
substring
(
beginPosition
,
endPosition
));
}
private
void
appendLimitOffsetToken
(
final
SQLBuilder
sqlBuilder
,
final
OffsetLimitToken
offsetLimitToken
,
final
int
count
,
final
List
<
SQLToken
>
sqlTokens
,
final
boolean
isRewrite
)
{
String
offset
=
isRewrite
?
"0"
:
String
.
valueOf
(
offsetLimitToken
.
getOffset
());
sqlBuilder
.
append
(
new
SQLBuilderToken
(
OffsetLimitToken
.
OFFSET_NAME
,
offset
));
sqlBuilder
.
append
(
isRewrite
?
"0"
:
String
.
valueOf
(
offsetLimitToken
.
getOffset
()));
int
beginPosition
=
offsetLimitToken
.
getBeginPosition
()
+
String
.
valueOf
(
offsetLimitToken
.
getOffset
()).
length
();
int
endPosition
=
sqlTokens
.
size
()
-
1
==
count
?
originalSQL
.
length
()
:
sqlTokens
.
get
(
count
+
1
).
getBeginPosition
();
sqlBuilder
.
append
(
originalSQL
.
substring
(
beginPosition
,
endPosition
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录