Skip to content

Commit

Permalink
fix GeneratedColumnPlaceHolderTransformAction header (#8951) (#8954)
Browse files Browse the repository at this point in the history
close #8787
  • Loading branch information
ti-chi-bot authored Apr 18, 2024
1 parent d83fbe3 commit eb6272c
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 @@ -84,7 +84,7 @@ class GeneratedColumnPlaceholderBlockInputStream : public IProfilingBlockInputSt
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_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 eb6272c

Please sign in to comment.