phpmyadmin / phpmyadmin/phpmyadmin

Error while exporting a database with tables that cannot be read

Open
#18,028 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

affects/5.2 affects/6.0 Bug confirmed/5.2 confirmed/6.0
Dominant language
PHP
Stars
7.9k
Forks
3.6k
Avg merge
4d 18h
Merged PRs (30d)
36

Description

Describe the bug

If a table is created with a different version of MySQL, and if it says that it's in use, the database isn't exported successfully. Both 5.2.1-dev and 5.3.0-dev are affected.

To Reproduce

Steps to reproduce the behavior:

  1. Have a table that cannot be read (in use).
  2. Export database
  3. See error
Expected behavior

The database should be exported successfully, except the table that cannot be read.

Screenshots

bug1

Server configuration
  • Operating system: Windows 10
  • Web server: nginx/1.23.3
  • Database version: 5.7.40 - MySQL Community Server (GPL)
  • PHP version: 8.2.1
  • phpMyAdmin version: 5.2.1-dev, 5.3.0-dev
Additional context

5.2.1-dev

CREATE TABLE `tbl_test` (
  `id` int(10) UNSIGNED NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
<div class="alert alert-danger" role="alert"><strong>Internal error</strong> in .\libraries\classes\Plugins\Export\ExportSql.php#1532<br>
<img src="themes/dot.gif" title="" alt="" class="icon ic_s_error"> ErrorException: Error reading structure for table db_test.tbl_test1: #1033 - Table &amp;#039;.\db_test\tbl_test1.frm&amp;#039; was created with a different version of MySQL and cannot be read<br>
<br>
<strong>Backtrace</strong><br>
<br>
</div></body></html>

5.3.0-dev

CREATE TABLE `tbl_test` (
  `id` int(10) UNSIGNED NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
<div class="alert alert-danger" role="alert"><p><strong>Internal error</strong> in .\libraries\classes\Plugins\Export\ExportSql.php#1417</p><img src="themes/dot.gif" title="" alt="" class="icon ic_s_error"> ErrorException: Error reading structure for table db_test.tbl_test1: #1033 - Table &amp;#039;.\db_test\tbl_test1.frm&amp;#039; was created with a different version of MySQL and cannot be read<p class="mt-3"><strong>Backtrace</strong></p><ol class="list-group"></ol></div>
</body></html>

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.

Research direction

Start in libraries/classes/Plugins/Export/ExportSql.php, especially the export paths around the reported lines, and reproduce the failure with a table that cannot be read. Trace how the unreadable table error is handled during database export; done means the export completes while excluding that table, without producing the internal error shown in the report.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, php
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.