Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Shardingsphere
提交
3eed43bf
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,发现更多精彩内容 >>
提交
3eed43bf
编写于
12月 15, 2016
作者:
G
gaohongtao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixed #209 Limit concurrent error
上级
14f31838
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
5 addition
and
10 deletion
+5
-10
sharding-jdbc-core/src/main/java/com/dangdang/ddframe/rdb/sharding/router/PreparedSQLRouter.java
...ngdang/ddframe/rdb/sharding/router/PreparedSQLRouter.java
+1
-2
sharding-jdbc-core/src/main/java/com/dangdang/ddframe/rdb/sharding/router/SQLRouteEngine.java
.../dangdang/ddframe/rdb/sharding/router/SQLRouteEngine.java
+2
-7
sharding-jdbc-doc/content/post/release_notes.md
sharding-jdbc-doc/content/post/release_notes.md
+2
-1
未找到文件。
sharding-jdbc-core/src/main/java/com/dangdang/ddframe/rdb/sharding/router/PreparedSQLRouter.java
浏览文件 @
3eed43bf
...
@@ -58,12 +58,11 @@ public class PreparedSQLRouter {
...
@@ -58,12 +58,11 @@ public class PreparedSQLRouter {
tableRuleOptional
=
shardingRule
.
tryFindTableRule
(
sqlParsedResult
.
getRouteContext
().
getTables
().
iterator
().
next
().
getName
());
tableRuleOptional
=
shardingRule
.
tryFindTableRule
(
sqlParsedResult
.
getRouteContext
().
getTables
().
iterator
().
next
().
getName
());
}
else
{
}
else
{
generateId
(
parameters
);
generateId
(
parameters
);
engine
.
setParameters
(
parameters
);
for
(
ConditionContext
each
:
sqlParsedResult
.
getConditionContexts
())
{
for
(
ConditionContext
each
:
sqlParsedResult
.
getConditionContexts
())
{
each
.
setNewConditionValue
(
parameters
);
each
.
setNewConditionValue
(
parameters
);
}
}
}
}
return
engine
.
routeSQL
(
sqlParsedResult
);
return
engine
.
routeSQL
(
sqlParsedResult
,
parameters
);
}
}
private
void
generateId
(
final
List
<
Object
>
parameters
)
{
private
void
generateId
(
final
List
<
Object
>
parameters
)
{
...
...
sharding-jdbc-core/src/main/java/com/dangdang/ddframe/rdb/sharding/router/SQLRouteEngine.java
浏览文件 @
3eed43bf
...
@@ -34,7 +34,6 @@ import com.google.common.base.Function;
...
@@ -34,7 +34,6 @@ import com.google.common.base.Function;
import
com.google.common.collect.Collections2
;
import
com.google.common.collect.Collections2
;
import
com.google.common.collect.Sets
;
import
com.google.common.collect.Sets
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.Setter
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
java.util.Collections
;
import
java.util.Collections
;
...
@@ -55,9 +54,6 @@ public final class SQLRouteEngine {
...
@@ -55,9 +54,6 @@ public final class SQLRouteEngine {
private
final
DatabaseType
databaseType
;
private
final
DatabaseType
databaseType
;
@Setter
private
List
<
Object
>
parameters
;
/**
/**
* SQL路由.
* SQL路由.
*
*
...
@@ -70,7 +66,7 @@ public final class SQLRouteEngine {
...
@@ -70,7 +66,7 @@ public final class SQLRouteEngine {
}
}
SQLRouteResult
route
(
final
String
logicSql
,
final
List
<
Object
>
parameters
)
throws
SQLParserException
{
SQLRouteResult
route
(
final
String
logicSql
,
final
List
<
Object
>
parameters
)
throws
SQLParserException
{
return
routeSQL
(
parseSQL
(
logicSql
,
parameters
));
return
routeSQL
(
parseSQL
(
logicSql
,
parameters
)
,
parameters
);
}
}
/**
/**
...
@@ -84,14 +80,13 @@ public final class SQLRouteEngine {
...
@@ -84,14 +80,13 @@ public final class SQLRouteEngine {
}
}
SQLParsedResult
parseSQL
(
final
String
logicSql
,
final
List
<
Object
>
parameters
)
{
SQLParsedResult
parseSQL
(
final
String
logicSql
,
final
List
<
Object
>
parameters
)
{
this
.
parameters
=
parameters
;
Context
context
=
MetricsContext
.
start
(
"Parse SQL"
);
Context
context
=
MetricsContext
.
start
(
"Parse SQL"
);
SQLParsedResult
result
=
SQLParserFactory
.
create
(
databaseType
,
logicSql
,
parameters
,
shardingRule
).
parse
();
SQLParsedResult
result
=
SQLParserFactory
.
create
(
databaseType
,
logicSql
,
parameters
,
shardingRule
).
parse
();
MetricsContext
.
stop
(
context
);
MetricsContext
.
stop
(
context
);
return
result
;
return
result
;
}
}
SQLRouteResult
routeSQL
(
final
SQLParsedResult
parsedResult
)
{
SQLRouteResult
routeSQL
(
final
SQLParsedResult
parsedResult
,
final
List
<
Object
>
parameters
)
{
Context
context
=
MetricsContext
.
start
(
"Route SQL"
);
Context
context
=
MetricsContext
.
start
(
"Route SQL"
);
SQLRouteResult
result
=
new
SQLRouteResult
(
parsedResult
.
getRouteContext
().
getSqlStatementType
(),
parsedResult
.
getMergeContext
(),
parsedResult
.
getGeneratedKeyContext
());
SQLRouteResult
result
=
new
SQLRouteResult
(
parsedResult
.
getRouteContext
().
getSqlStatementType
(),
parsedResult
.
getMergeContext
(),
parsedResult
.
getGeneratedKeyContext
());
for
(
ConditionContext
each
:
parsedResult
.
getConditionContexts
())
{
for
(
ConditionContext
each
:
parsedResult
.
getConditionContexts
())
{
...
...
sharding-jdbc-doc/content/post/release_notes.md
浏览文件 @
3eed43bf
...
@@ -13,7 +13,8 @@ weight = 1
...
@@ -13,7 +13,8 @@ weight = 1
1.
[
ISSUE #194
](
https://github.com/dangdangdotcom/sharding-jdbc/issues/194
)
jdbc接口中资源释放错误
1.
[
ISSUE #194
](
https://github.com/dangdangdotcom/sharding-jdbc/issues/194
)
jdbc接口中资源释放错误
1.
[
ISSUE #199
](
https://github.com/dangdangdotcom/sharding-jdbc/issues/199
)
分表且复用PreparedStatement对象造成数据路由错误
1.
[
ISSUE #199
](
https://github.com/dangdangdotcom/sharding-jdbc/issues/199
)
分表且复用PreparedStatement对象造成数据路由错误
1.
[
ISSUE #201
](
https://github.com/dangdangdotcom/sharding-jdbc/issues/201
)
批量操作执行前事件发送缺失
1.
[
ISSUE #201
](
https://github.com/dangdangdotcom/sharding-jdbc/issues/201
)
批量操作执行前事件发送缺失
1.
[
ISSUE #203
](
https://github.com/dangdangdotcom/sharding-jdbc/issues/201
)
合并batch操作发送的事件
1.
[
ISSUE #203
](
https://github.com/dangdangdotcom/sharding-jdbc/issues/203
)
合并batch操作发送的事件
1.
[
ISSUE #209
](
https://github.com/dangdangdotcom/sharding-jdbc/issues/209
)
limit并行异常
## 1.4.0
## 1.4.0
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录