Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions br/tests/br_partial_index/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/bin/sh
#
# Copyright 2025 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.

set -eu
DB="$TEST_NAME"

run_sql "CREATE DATABASE $DB;"

run_sql "
USE $DB;

CREATE TABLE t0 (
id int primary key,
col1 int,
col2 int,
key idx_col1 (col1) where col2 > 10
);
INSERT INTO t0 VALUES (1, 1, 1);
INSERT INTO t0 VALUES (2, 2, 15);
INSERT INTO t0 VALUES (3, 3, 1);
INSERT INTO t0 VALUES (4, 4, 20);
INSERT INTO t0 VALUES (5, 5, 1);
"

# backup table
echo "backup start..."
run_br --pd $PD_ADDR backup db -s "local://$TEST_DIR/$DB" --db $DB

run_sql "DROP DATABASE $DB;"
run_sql "CREATE DATABASE $DB;"

# restore table
echo "restore start..."
run_br restore db --db $DB -s "local://$TEST_DIR/$DB" --pd $PD_ADDR

if run_sql "admin check table ${DB}.t0;" | grep -q 'inconsistency'; then
echo "TEST: [$TEST_NAME] failed after restoring $DB.t0"
exit 1
fi

run_sql "show create table $DB.t0;"
check_contains "WHERE \`col2\` > 10"

run_sql "DROP DATABASE $DB;"
5 changes: 5 additions & 0 deletions br/tests/run_group_br_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,13 @@ groups=(
["G04"]='br_range br_replica_read br_restore_TDE_enable br_restore_log_task_enable br_s3 br_shuffle_leader br_shuffle_region br_single_table br_region_rule br_merge_option_attributes'
["G05"]='br_skip_checksum br_split_region_fail br_systables br_table_filter br_txn br_stats br_clustered_index br_crypter br_partition_add_index br_pitr_log_restore_backup_compatibility'
["G06"]='br_tikv_outage br_tikv_outage3 br_restore_checkpoint br_encryption br_pitr_online_table_filter'
<<<<<<< HEAD
["G07"]='br_pitr br_restore_physical br_blocklist'
["G08"]='br_tikv_outage2 br_ttl br_views_and_sequences br_z_gc_safepoint br_autorandom br_file_corruption br_tiflash_conflict br_pitr_table_filter'
=======
["G07"]='br_pitr br_restore_physical'
["G08"]='br_tikv_outage2 br_ttl br_views_and_sequences br_z_gc_safepoint br_autorandom br_file_corruption br_tiflash_conflict br_pitr_table_filter br_partial_index'
>>>>>>> 8c2781681a4 (ddl,tables: only write the index when it meets partial index condition (#62762))
Comment on lines +30 to +36
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Unresolved merge conflict markers must be removed.

The merge conflict markers (<<<<<<< HEAD, =======, >>>>>>>) are still present in the shell script. This will cause syntax errors when the script is executed.

🔧 Proposed fix
-<<<<<<< HEAD
-	["G07"]='br_pitr br_restore_physical br_blocklist'
-	["G08"]='br_tikv_outage2 br_ttl br_views_and_sequences br_z_gc_safepoint br_autorandom br_file_corruption br_tiflash_conflict br_pitr_table_filter'
-=======
 	["G07"]='br_pitr br_restore_physical'
 	["G08"]='br_tikv_outage2 br_ttl br_views_and_sequences br_z_gc_safepoint br_autorandom br_file_corruption br_tiflash_conflict br_pitr_table_filter br_partial_index'
->>>>>>> 8c2781681a4 (ddl,tables: only write the index when it meets partial index condition (`#62762`))
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<<<<<<< HEAD
["G07"]='br_pitr br_restore_physical br_blocklist'
["G08"]='br_tikv_outage2 br_ttl br_views_and_sequences br_z_gc_safepoint br_autorandom br_file_corruption br_tiflash_conflict br_pitr_table_filter'
=======
["G07"]='br_pitr br_restore_physical'
["G08"]='br_tikv_outage2 br_ttl br_views_and_sequences br_z_gc_safepoint br_autorandom br_file_corruption br_tiflash_conflict br_pitr_table_filter br_partial_index'
>>>>>>> 8c2781681a4 (ddl,tables: only write the index when it meets partial index condition (#62762))
["G07"]='br_pitr br_restore_physical'
["G08"]='br_tikv_outage2 br_ttl br_views_and_sequences br_z_gc_safepoint br_autorandom br_file_corruption br_tiflash_conflict br_pitr_table_filter br_partial_index'
🧰 Tools
🪛 Shellcheck (0.11.0)

[error] 30-30: Fix any mentioned problems and try again.

(SC1072)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@br/tests/run_group_br_tests.sh` around lines 30 - 36, Remove the unresolved
Git conflict markers and produce a single coherent assignment for the
associative array keys ["G07"] and ["G08"]: delete the lines containing <<<<<<<
HEAD, ======= and >>>>>>> and merge the two conflicting values so the final
assignments include the unioned test names (ensure ["G07"] contains the intended
entries and ["G08"] contains the intended entries including br_partial_index or
br_pitr_table_filter as required by the branch change); update the array entries
for ["G07"] and ["G08"] so they are valid shell string assignments with no
conflict markers remaining.

)

# Get other cases not in groups, to avoid missing any case
Expand Down
5 changes: 5 additions & 0 deletions errors.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1601,6 +1601,11 @@ error = '''
Invalid AFFINITY %s
'''

["ddl:8272"]
error = '''
Cannot drop, change or modify column '%s': it is referenced in partial index '%s'
'''

["ddl:9014"]
error = '''
TiFlash backfill index failed: %s
Expand Down
Loading