Skip to content

Conversation

Ariznawlll
Copy link
Contributor

@Ariznawlll Ariznawlll commented Oct 13, 2025

User description

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

rm tag 22350

issue ##22350

What this PR does / why we need it:

rm tag 22350


PR Type

Tests


Description

  • Removed issue tag [Bug]: clone operation across snapshot levels error #22350 from test file

  • Added three new test cases for snapshot cloning error scenarios

  • Tests cover table-level, database-level, and account-level snapshot mismatches

  • Includes expected error messages for invalid clone operations


Diagram Walkthrough

flowchart LR
  A["Test file"] --> B["Remove issue tag"]
  A --> C["Add table snapshot test"]
  A --> D["Add database snapshot test"]
  A --> E["Add account snapshot test"]
Loading

File Walkthrough

Relevant files
Tests
clone_sys_db_table_to_new_db_table.result
Add expected test results for snapshot clone error cases 

test/distributed/cases/snapshot/clone/clone_sys_db_table_to_new_db_table.result

  • Added expected output for three new test scenarios
  • Includes error messages for snapshot mismatches
  • Shows results for table, database, and account level clone operations
+72/-8   
clone_sys_db_table_to_new_db_table.sql
Remove issue tag and add snapshot clone error tests           

test/distributed/cases/snapshot/clone/clone_sys_db_table_to_new_db_table.sql

  • Removed @bvt:issue#22350 tag from existing test
  • Added test for cloning table without corresponding snapshot
  • Added test for cloning database with mismatched snapshot
  • Added test for account-level snapshot with database clone
+71/-1   

@Ariznawlll Ariznawlll requested a review from heni02 as a code owner October 13, 2025 09:50
@CLAassistant
Copy link

CLAassistant commented Oct 13, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ Ariznawlll
Ariznawl@163.com


Ariznawl@163.com seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link

qodo-merge-pro bot commented Oct 13, 2025

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🟡
🎫 #22350
🟢 Prevent cloning a database from a table-level snapshot (granularity mismatch should fail).
Ensure error is raised when cloning a table using a snapshot that does not belong to that
table or does not exist.
Ensure database-level snapshot cannot be used to clone another database if contents
mismatch (e.g., missing tables), and produce a clear error.
Ensure account-level snapshot cannot be used to clone a database from another account, and
produce a clear error.
Add regression tests that capture the above invalid clone scenarios with expected errors.
Verify errors occur consistently across environments and not due to test harness artifacts
(e.g., session/account context).
Confirm error messages exactly match productized/expected wording and error codes beyond
the textual strings in .result files.
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
No custom compliance provided

Follow the guide to enable custom compliance check.

  • Update
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

Copy link

qodo-merge-pro bot commented Oct 13, 2025

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Fix incorrect object reference in test

Correct the test case "clone table a where table a does not have snapshot" to
test its intended scenario. The current implementation attempts to create a
snapshot from a non-existent table; it should instead create a snapshot for one
table and attempt to clone another.

test/distributed/cases/snapshot/clone/clone_sys_db_table_to_new_db_table.sql [166-183]

 -- clone table a where table a does not have snapshot
 drop database if exists test101;
 create database test101;
 use test101;
 create table table01(col1 int primary key , col2 decimal, col3 char, col4 varchar(20), col5 text, col6 double);
 insert into table01 values (1, 2, 'a', '23eiojf', 'r23v324r23rer', 3923.324);
 insert into table01 values (2, 3, 'b', '32r32r', 'database', 1111111);
 drop table if exists table02;
 create table table02 (col1 int unique key, col2 varchar(20));
 insert into table02 (col1, col2) values (133, 'database');
 drop snapshot if exists sp08;
-create snapshot sp08 for table test100 table01;
+create snapshot sp08 for table test101.table01;
 drop database if exists db08;
 create database db08;
-create table db08.table01 clone test100.table01 {snapshot = 'sp08'};
+create table db08.table02 clone test101.table02 {snapshot = 'sp08'};
 drop database test101;
 drop database db08;
 drop snapshot sp08;
  • Apply / Chat
Suggestion importance[1-10]: 7

__

Why: The suggestion correctly identifies that the test case does not match its description, as it attempts to create a snapshot for a non-existent table. The proposed change corrects the test to a more logical scenario, improving the test suite's quality and clarity.

Medium
  • Update

@XuPeng-SH
Copy link
Contributor

@mergify refresh

Copy link
Contributor

mergify bot commented Oct 15, 2025

refresh

✅ Pull request refreshed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working Review effort 2/5 size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants