From e63e24991079fff1e5afe03e859f743cbb6cf4a7 Mon Sep 17 00:00:00 2001 From: Ti Chi Robot Date: Wed, 24 May 2023 13:31:39 +0800 Subject: [PATCH] fix keep order in table scan is lost when remote read of PartitionTableScan (#7529) (#7536) close pingcap/tiflash#7519 --- dbms/src/Flash/Coprocessor/TiDBTableScan.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dbms/src/Flash/Coprocessor/TiDBTableScan.cpp b/dbms/src/Flash/Coprocessor/TiDBTableScan.cpp index 20a12770c73..7ece272d04f 100644 --- a/dbms/src/Flash/Coprocessor/TiDBTableScan.cpp +++ b/dbms/src/Flash/Coprocessor/TiDBTableScan.cpp @@ -27,7 +27,7 @@ TiDBTableScan::TiDBTableScan( // Only No-partition table need keep order when tablescan executor required keep order. // If keep_order is not set, keep order for safety. , keep_order(!is_partition_table_scan && (table_scan->tbl_scan().keep_order() || !table_scan->tbl_scan().has_keep_order())) - , is_fast_scan(table_scan->tbl_scan().is_fast_scan()) + , is_fast_scan(is_partition_table_scan ? table_scan->partition_table_scan().is_fast_scan() : table_scan->tbl_scan().is_fast_scan()) { if (is_partition_table_scan) { @@ -75,6 +75,7 @@ void TiDBTableScan::constructTableScanForRemoteRead(tipb::TableScan * tipb_table for (auto id : partition_table_scan.primary_prefix_column_ids()) tipb_table_scan->add_primary_prefix_column_ids(id); tipb_table_scan->set_is_fast_scan(partition_table_scan.is_fast_scan()); + tipb_table_scan->set_keep_order(false); } else {