Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expression: open CAST push down switcher default #12652

Merged
merged 31 commits into from
Nov 7, 2019
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
8e27d6b
expression: open CAST push down switcher default
lonng Oct 12, 2019
c275ef1
fix plan explain diff after cop cast push down
H-ZeX Oct 14, 2019
c6ebe83
Merge branch 'master' of https://github.com/pingcap/tidb into cast-pu…
H-ZeX Oct 16, 2019
3d31c27
fix ci failed
H-ZeX Oct 16, 2019
c33b5fa
fix ci failed
H-ZeX Oct 16, 2019
5f09713
fix ci failed
H-ZeX Oct 16, 2019
62639e8
go mod tidy
lonng Oct 16, 2019
3285154
Merge remote-tracking branch 'origin/master' into cast-push-down
lonng Oct 16, 2019
d98dfc4
Merge remote-tracking branch 'origin/master' into cast-push-down
lonng Oct 16, 2019
fec2b71
tiny tweak logic
lonng Oct 16, 2019
4432ba2
Merge branch 'master' into cast-push-down
lonng Oct 16, 2019
5ab6317
Merge branch 'master' into cast-push-down
H-ZeX Oct 16, 2019
3746056
fix decimal evaluation precesion issue
lonng Oct 17, 2019
8755851
Merge branch 'master' into cast-push-down
lonng Oct 17, 2019
799bd92
fix the CI failure
lonng Oct 17, 2019
7c2d019
Merge remote-tracking branch 'origin/master' into cast-push-down
lonng Oct 17, 2019
df9f35f
revert some changes
lonng Oct 17, 2019
7afdfba
Merge remote-tracking branch 'origin/master' into cast-push-down
lonng Oct 17, 2019
677f3c5
Merge branch 'master' into cast-push-down
lonng Oct 18, 2019
9b37da7
Merge branch 'master' into cast-push-down
lonng Oct 18, 2019
7607ac5
Merge branch 'master' into cast-push-down
lonng Oct 18, 2019
57b24be
Merge branch 'master' into cast-push-down
lonng Nov 5, 2019
9c620a7
Merge branch 'master' into cast-push-down
lonng Nov 5, 2019
6d0d3b2
Merge remote-tracking branch 'origin/master' into cast-push-down
lonng Nov 6, 2019
9acf7ad
address comment
lonng Nov 6, 2019
e606ac3
fix imports
lonng Nov 6, 2019
e46be5c
Merge branch 'master' into cast-push-down
lonng Nov 7, 2019
daf7a02
Merge branch 'master' into cast-push-down
lonng Nov 7, 2019
9fc8390
Merge branch 'master' into cast-push-down
lonng Nov 7, 2019
48d4832
Merge branch 'master' into cast-push-down
lonng Nov 7, 2019
a04215c
Merge branch 'master' into cast-push-down
lonng Nov 7, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
address comment
Signed-off-by: Lonng <heng@lonng.org>
  • Loading branch information
lonng committed Nov 6, 2019
commit 9acf7addc21b0bda1b9313cd3a398afd092972b5
4 changes: 3 additions & 1 deletion expression/aggregation/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,11 @@ func calculateSum(sc *stmtctx.StatementContext, sum, v types.Datum, retType *typ
if int(dec.GetDigitsFrac()) > frac {
to := new(types.MyDecimal)
err := dec.Round(to, frac, types.ModeHalfEven)
terror.Log(err)
data = types.Datum{}
data.SetMysqlDecimal(to)
if err != nil {
return data, err
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why put return after creating data? If err != nil, to is not even integral.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we should return the data even though overflow occurred (the caller should handle it in a proper way if the err is overflow or truncated).

}
} else {
data = types.CloneDatum(v)
}
Expand Down