Corrupt database file

Open
#157 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Quiet
Tech stack
cpp, mysql
Domain
databases

Research direction

Start by reproducing the shown SELECT queries against the imported database and inspect the reported DuckDB corrupt database file error at block location 359883091968. Trace the MySQL-to-AliSQL import path to determine how the checksum mismatch can occur; done means documenting a confirmed cause and a practical resolution or prevention procedure.

Written by the indexing model from the issue text.

Description

Import MySQL data into AliSQL. During queries, some data files were found to be corrupted. The query statement is as follows:
root[database]> select count() from h_record where time > '2025-04-01' and time < '2025-04-10';
+----------+
| count(
) |
+----------+
| 3061512 |
+----------+
1 row in set (0.02 sec)

root[database]> select count() from h_record where time > '2025-04-11' and time < '2025-04-12';
ERROR 7501 (HY000): [DuckDB] IO Error: Corrupt database file: computed checksum 7085340976184504599 does not match stored checksum 6666362943038018993 in block at location 359883091968.
root[database]> select count(
) from h_record where time > '2025-04-12' and time < '2025-04-13';
ERROR 7501 (HY000): [DuckDB] IO Error: Corrupt database file: computed checksum 7085340976184504599 does not match stored checksum 6666362943038018993 in block at location 359883091968.

How does this kind of problem occur, and how to resolve or prevent it?

Dominant language
C++
Stars
6k
Forks
902
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from alibaba/AliSQL

All issues in alibaba/AliSQL

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.