Skip to content

Skip tables that cannot be read#20224

Open
liviuconcioiu wants to merge 1 commit intophpmyadmin:QA_5_2from
liviuconcioiu:export_tables
Open

Skip tables that cannot be read#20224
liviuconcioiu wants to merge 1 commit intophpmyadmin:QA_5_2from
liviuconcioiu:export_tables

Conversation

@liviuconcioiu
Copy link
Copy Markdown
Contributor

Description

This should fix the export for all other formats, except SQL, when tables cannot be read. Previously HTML content was added to the exported file. Now, it will skip the tables and only export what can be read.

Something similar was done here:

$nonGeneratedCols = $oldTable->getNonGeneratedColumns(true);
if (count($nonGeneratedCols) > 0) {

$nonGeneratedCols = $oldTable->getNonGeneratedColumns();
if ($nonGeneratedCols === []) {
return;
}

Before:

07.03.2026_15.55.46_REC.mp4

After:

07.03.2026_15.53.17_REC.mp4

Related #18028, #18183, #20160

Before submitting pull request, please review the following checklist:

  • Make sure you have read our CONTRIBUTING.md document.
  • Make sure you are making a pull request against the correct branch. For example, for bug fixes in a released version use the corresponding QA branch and for new features use the master branch. If you have a doubt, you can ask as a comment in the bug report or on the mailing list.
  • Every commit has proper Signed-off-by line as described in our DCO. This ensures that the work you're submitting is your own creation.
  • Every commit has a descriptive commit message.
  • Every commit is needed on its own, if you have just minor fixes to previous commits, you can squash them.
  • Any new functionality is covered by tests.

Signed-off-by: Liviu-Mihail Concioiu <liviu.concioiu@gmail.com>
Comment on lines 844 to +1122
@@ -1110,6 +1115,11 @@ public function exportTable(
$tableObj = new Table($table, $db);
$nonGeneratedCols = $tableObj->getNonGeneratedColumns(true);

// Skip tables that cannot be read
if ($nonGeneratedCols === []) {
return;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you add a warning to the front end ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Those lines aren't related to export, just copy. Should I remove them?

Also, not sure how to add one, I tried, but I still get an error:

Internal error in .\libraries\classes\Plugins\Export\ExportSql.php#1543
ErrorException: Error reading structure for table test21.1: #1707 - Table rebuild required. Please do &quot;ALTER TABLE `test21.1` FORCE&quot; or dump/reload to fix it!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants