Skip to content

Commit

Permalink
fix GeneratedColumnPlaceHolderTransformAction header (#8951) (#9049)
Browse files Browse the repository at this point in the history
close #8787
  • Loading branch information
ti-chi-bot authored May 16, 2024
1 parent 5b5aa96 commit a8caf67
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void GeneratedColumnPlaceHolderTransformAction::insertColumns(Block & block, boo
if (insert_data)
column = data_type->createColumnConstWithDefaultValue(block.rows());
else
column = data_type->createColumn();
column = data_type->createColumnConstWithDefaultValue(0);
block.insert(col_index, ColumnWithTypeAndName{column, data_type, col_name});
}
}
Expand Down
29 changes: 29 additions & 0 deletions tests/fullstack-test/mpp/generated_column.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2024 PingCAP, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Preparation.
mysql> drop table if exists test.t
mysql> create table test.t (col int null, __col int as (col) virtual);
mysql> alter table test.t set tiflash replica 1
mysql> insert into test.t (col) values (1);

func> wait_table test t

mysql> use test; set @@tidb_allow_mpp=0; set @@tidb_allow_tiflash_cop=true; set @@tidb_allow_batch_cop=2; set @@tidb_isolation_read_engines='tiflash'; select * from t order by col limit 10;
col __col
1 1

mysql> use test; set @@tidb_allow_mpp=1; set @@tidb_enforce_mpp=1; set @@tidb_isolation_read_engines='tiflash'; select * from t order by col limit 10;
col __col
1 1

0 comments on commit a8caf67

Please sign in to comment.