File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -2529,6 +2529,15 @@ func TestIssue46298(t *testing.T) {
2529
2529
tk .MustQuery ("select *, first_value(v) over (partition by p order by o range between 3.1 preceding and 2.9 following) as a from test.first_range;" )
2530
2530
}
2531
2531
2532
+ func TestIssue45044 (t * testing.T ) {
2533
+ store := testkit .CreateMockStore (t )
2534
+ tk := testkit .NewTestKit (t , store )
2535
+ tk .MustExec (`use test` )
2536
+ tk .MustExec (`set tidb_enable_ordered_result_mode = on` )
2537
+ tk .MustExec (`create table t1(c1 int)` )
2538
+ tk .MustQuery (`select * from t1 group by t1.c1 having count(1) > 1 order by count(1) limit 10` ).Check (testkit .Rows ()) // no error
2539
+ }
2540
+
2532
2541
// https://github.com/pingcap/tidb/issues/41458
2533
2542
func TestIssue41458 (t * testing.T ) {
2534
2543
store := testkit .CreateMockStore (t )
Original file line number Diff line number Diff line change @@ -107,6 +107,9 @@ func (rs *resultReorder) extractHandleCol(lp LogicalPlan) *expression.Column {
107
107
switch x := lp .(type ) {
108
108
case * LogicalSelection , * LogicalLimit :
109
109
handleCol := rs .extractHandleCol (lp .Children ()[0 ])
110
+ if handleCol == nil {
111
+ return nil // fail to extract handle column from the child, just return nil.
112
+ }
110
113
if x .Schema ().Contains (handleCol ) {
111
114
// some Projection Operator might be inlined, so check the column again here
112
115
return handleCol
You can’t perform that action at this time.
0 commit comments