Skip to content

Commit

Permalink
fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
fzhedu committed Oct 12, 2021
1 parent 59469d9 commit 3a33860
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 86 deletions.
3 changes: 0 additions & 3 deletions expression/builtin_cast.go
Original file line number Diff line number Diff line change
Expand Up @@ -1878,12 +1878,9 @@ func WrapWithCastAsDecimal(ctx sessionctx.Context, expr Expression) Expression {
if expr.GetType().EvalType() == types.ETInt {
tp.Flen = mysql.MaxIntWidth
}
<<<<<<< HEAD
=======
if tp.Flen == types.UnspecifiedLength || tp.Flen > mysql.MaxDecimalWidth {
tp.Flen = mysql.MaxDecimalWidth
}
>>>>>>> a18e05d2f... expression: limit valid decimal length (#28466)
types.SetBinChsClnFlag(tp)
tp.Flag |= expr.GetType().Flag & mysql.UnsignedFlag
return BuildCastFunction(ctx, expr, tp)
Expand Down
105 changes: 22 additions & 83 deletions planner/core/testdata/integration_serial_suite_out.json
Original file line number Diff line number Diff line change
Expand Up @@ -1273,13 +1273,8 @@
"Plan": [
"HashAgg 1.00 root funcs:count(Column#8)->Column#6",
"└─TableReader 1.00 root data:HashAgg",
<<<<<<< HEAD
" └─HashAgg 1.00 batchCop[tiflash] funcs:count(Column#4)->Column#7",
" └─Projection 10000.00 batchCop[tiflash] plus(test.t.id, 1)->Column#4",
=======
" └─HashAgg 1.00 batchCop[tiflash] funcs:count(Column#10)->Column#8",
" └─Projection 10000.00 batchCop[tiflash] plus(test.t.id, 1)->Column#10",
>>>>>>> a18e05d2f... expression: limit valid decimal length (#28466)
" └─HashAgg 1.00 batchCop[tiflash] funcs:count(Column#5)->Column#8",
" └─Projection 10000.00 batchCop[tiflash] plus(test.t.id, 1)->Column#5",
" └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo"
]
},
Expand All @@ -1297,33 +1292,19 @@
"Plan": [
"HashAgg 1.00 root funcs:sum(Column#8)->Column#6",
"└─TableReader 1.00 root data:HashAgg",
<<<<<<< HEAD
" └─HashAgg 1.00 batchCop[tiflash] funcs:sum(Column#8)->Column#7",
" └─Projection 10000.00 batchCop[tiflash] cast(Column#4, decimal(41,0) BINARY)->Column#8",
" └─Projection 10000.00 batchCop[tiflash] plus(test.t.id, 1)->Column#4",
" └─HashAgg 1.00 batchCop[tiflash] funcs:sum(Column#9)->Column#8",
" └─Projection 10000.00 batchCop[tiflash] cast(Column#5, decimal(41,0) BINARY)->Column#9",
" └─Projection 10000.00 batchCop[tiflash] plus(test.t.id, 1)->Column#5",
" └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo"
=======
" └─HashAgg 1.00 batchCop[tiflash] funcs:sum(Column#10)->Column#8",
" └─Projection 10000.00 batchCop[tiflash] cast(plus(test.t.id, 1), decimal(41,0) BINARY)->Column#10",
" └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo"
>>>>>>> a18e05d2f... expression: limit valid decimal length (#28466)
]
},
{
"SQL": "desc format = 'brief' select /*+ stream_agg()*/ count(b) from (select id + 1 as b from t)A",
"Plan": [
<<<<<<< HEAD
"StreamAgg 1.00 root funcs:count(Column#4)->Column#5",
"└─Projection 10000.00 root plus(test.t.id, 1)->Column#4",
"StreamAgg 1.00 root funcs:count(Column#5)->Column#6",
"└─Projection 10000.00 root plus(test.t.id, 1)->Column#5",
" └─TableReader 10000.00 root data:TableFullScan",
" └─TableFullScan 10000.00 cop[tiflash] table:t keep order:false, stats:pseudo"
=======
"StreamAgg 1.00 root funcs:count(Column#8)->Column#6",
"└─TableReader 1.00 root data:StreamAgg",
" └─StreamAgg 1.00 batchCop[tiflash] funcs:count(Column#10)->Column#8",
" └─Projection 10000.00 batchCop[tiflash] plus(test.t.id, 1)->Column#10",
" └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo"
>>>>>>> a18e05d2f... expression: limit valid decimal length (#28466)
]
},
{
Expand All @@ -1338,19 +1319,11 @@
{
"SQL": "desc format = 'brief' select /*+ stream_agg()*/ sum(b) from (select id + 1 as b from t)A",
"Plan": [
<<<<<<< HEAD
"StreamAgg 1.00 root funcs:sum(Column#7)->Column#5",
"└─Projection 10000.00 root cast(Column#4, decimal(41,0) BINARY)->Column#7",
" └─Projection 10000.00 root plus(test.t.id, 1)->Column#4",
"StreamAgg 1.00 root funcs:sum(Column#8)->Column#6",
"└─Projection 10000.00 root cast(Column#5, decimal(41,0) BINARY)->Column#8",
" └─Projection 10000.00 root plus(test.t.id, 1)->Column#5",
" └─TableReader 10000.00 root data:TableFullScan",
" └─TableFullScan 10000.00 cop[tiflash] table:t keep order:false, stats:pseudo"
=======
"StreamAgg 1.00 root funcs:sum(Column#8)->Column#6",
"└─TableReader 1.00 root data:StreamAgg",
" └─StreamAgg 1.00 batchCop[tiflash] funcs:sum(Column#10)->Column#8",
" └─Projection 10000.00 batchCop[tiflash] cast(plus(test.t.id, 1), decimal(41,0) BINARY)->Column#10",
" └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo"
>>>>>>> a18e05d2f... expression: limit valid decimal length (#28466)
]
},
{
Expand Down Expand Up @@ -1453,13 +1426,8 @@
"HashAgg 1.00 root funcs:count(Column#9)->Column#6",
"└─TableReader 1.00 root data:ExchangeSender",
" └─ExchangeSender 1.00 batchCop[tiflash] ExchangeType: PassThrough",
<<<<<<< HEAD
" └─HashAgg 1.00 batchCop[tiflash] funcs:count(Column#4)->Column#8",
" └─Projection 10000.00 batchCop[tiflash] plus(test.t.id, 1)->Column#4",
=======
" └─HashAgg 1.00 batchCop[tiflash] funcs:count(Column#11)->Column#9",
" └─Projection 10000.00 batchCop[tiflash] plus(test.t.id, 1)->Column#11",
>>>>>>> a18e05d2f... expression: limit valid decimal length (#28466)
" └─HashAgg 1.00 batchCop[tiflash] funcs:count(Column#5)->Column#9",
" └─Projection 10000.00 batchCop[tiflash] plus(test.t.id, 1)->Column#5",
" └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo"
]
},
Expand All @@ -1479,34 +1447,20 @@
"HashAgg 1.00 root funcs:sum(Column#9)->Column#6",
"└─TableReader 1.00 root data:ExchangeSender",
" └─ExchangeSender 1.00 batchCop[tiflash] ExchangeType: PassThrough",
<<<<<<< HEAD
" └─HashAgg 1.00 batchCop[tiflash] funcs:sum(Column#10)->Column#8",
" └─Projection 10000.00 batchCop[tiflash] cast(Column#4, decimal(41,0) BINARY)->Column#10",
" └─Projection 10000.00 batchCop[tiflash] plus(test.t.id, 1)->Column#4",
" └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo"
=======
" └─HashAgg 1.00 batchCop[tiflash] funcs:sum(Column#11)->Column#9",
" └─Projection 10000.00 batchCop[tiflash] cast(plus(test.t.id, 1), decimal(41,0) BINARY)->Column#11",
" └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo"
>>>>>>> a18e05d2f... expression: limit valid decimal length (#28466)
" └─Projection 10000.00 batchCop[tiflash] cast(Column#5, decimal(41,0) BINARY)->Column#11",
" └─Projection 10000.00 batchCop[tiflash] plus(test.t.id, 1)->Column#5",
" └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo"
]
},
{
"SQL": "desc format = 'brief' select /*+ stream_agg()*/ count(b) from (select id + 1 as b from t)A",
"Plan": [
<<<<<<< HEAD
"HashAgg 1.00 root funcs:count(Column#7)->Column#5",
"└─TableReader 1.00 root data:ExchangeSender",
" └─ExchangeSender 1.00 batchCop[tiflash] ExchangeType: PassThrough",
" └─HashAgg 1.00 batchCop[tiflash] funcs:count(Column#4)->Column#7",
" └─Projection 10000.00 batchCop[tiflash] plus(test.t.id, 1)->Column#4",
=======
"HashAgg 1.00 root funcs:count(Column#10)->Column#6",
"HashAgg 1.00 root funcs:count(Column#8)->Column#6",
"└─TableReader 1.00 root data:ExchangeSender",
" └─ExchangeSender 1.00 batchCop[tiflash] ExchangeType: PassThrough",
" └─HashAgg 1.00 batchCop[tiflash] funcs:count(Column#11)->Column#10",
" └─Projection 10000.00 batchCop[tiflash] plus(test.t.id, 1)->Column#11",
>>>>>>> a18e05d2f... expression: limit valid decimal length (#28466)
" └─HashAgg 1.00 batchCop[tiflash] funcs:count(Column#5)->Column#8",
" └─Projection 10000.00 batchCop[tiflash] plus(test.t.id, 1)->Column#5",
" └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo"
]
},
Expand All @@ -1523,22 +1477,13 @@
{
"SQL": "desc format = 'brief' select /*+ stream_agg()*/ sum(b) from (select id + 1 as b from t)A",
"Plan": [
<<<<<<< HEAD
"HashAgg 1.00 root funcs:sum(Column#7)->Column#5",
"HashAgg 1.00 root funcs:sum(Column#8)->Column#6",
"└─TableReader 1.00 root data:ExchangeSender",
" └─ExchangeSender 1.00 batchCop[tiflash] ExchangeType: PassThrough",
" └─HashAgg 1.00 batchCop[tiflash] funcs:sum(Column#8)->Column#7",
" └─Projection 10000.00 batchCop[tiflash] cast(Column#4, decimal(41,0) BINARY)->Column#8",
" └─Projection 10000.00 batchCop[tiflash] plus(test.t.id, 1)->Column#4",
" └─HashAgg 1.00 batchCop[tiflash] funcs:sum(Column#9)->Column#8",
" └─Projection 10000.00 batchCop[tiflash] cast(Column#5, decimal(41,0) BINARY)->Column#9",
" └─Projection 10000.00 batchCop[tiflash] plus(test.t.id, 1)->Column#5",
" └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo"
=======
"HashAgg 1.00 root funcs:sum(Column#10)->Column#6",
"└─TableReader 1.00 root data:ExchangeSender",
" └─ExchangeSender 1.00 batchCop[tiflash] ExchangeType: PassThrough",
" └─HashAgg 1.00 batchCop[tiflash] funcs:sum(Column#11)->Column#10",
" └─Projection 10000.00 batchCop[tiflash] cast(plus(test.t.id, 1), decimal(41,0) BINARY)->Column#11",
" └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo"
>>>>>>> a18e05d2f... expression: limit valid decimal length (#28466)
]
},
{
Expand Down Expand Up @@ -1654,15 +1599,9 @@
" └─Projection 8000.00 batchCop[tiflash] div(Column#5, cast(case(eq(Column#20, 0), 1, Column#20), decimal(20,0) BINARY))->Column#5, test.t.id",
" └─HashAgg 8000.00 batchCop[tiflash] group by:test.t.id, funcs:sum(Column#21)->Column#20, funcs:sum(Column#22)->Column#5, funcs:firstrow(test.t.id)->test.t.id",
" └─ExchangeReceiver 8000.00 batchCop[tiflash] ",
<<<<<<< HEAD
" └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: test.t.id",
" └─HashAgg 8000.00 batchCop[tiflash] group by:Column#25, funcs:count(Column#23)->Column#20, funcs:sum(Column#24)->Column#21",
" └─Projection 10000.00 batchCop[tiflash] plus(test.t.value, 2)->Column#23, plus(test.t.value, 2)->Column#24, test.t.id",
=======
" └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: N/A]",
" └─HashAgg 8000.00 batchCop[tiflash] group by:Column#26, funcs:count(Column#24)->Column#21, funcs:sum(Column#25)->Column#22",
" └─Projection 10000.00 batchCop[tiflash] plus(test.t.value, 2)->Column#24, plus(test.t.value, 2)->Column#25, test.t.id",
>>>>>>> a18e05d2f... expression: limit valid decimal length (#28466)
" └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo"
]
},
Expand Down

0 comments on commit 3a33860

Please sign in to comment.