Skip to content

Importing Adminer's own SQL export ends with "Error in query: Unknown error." because of the trailing timestamp comment #1331

Description

@acboudion

Adminer version: 6.0.1
Compiled: single file (official Docker image adminer:6.0.1, PHP 8.4.24)
Driver: PDO_PgSQL
Database version: PostgreSQL 13.23
Plugins used: none

Summary

Importing a SQL file produced by Adminer's own Export page always ends with Error in query: Unknown error. The "query" that fails is the timestamp comment that dumpFooter() appends to every export.

Steps to reproduce

  1. Export any table → Format SQL (any table/data style). The file ends with:
INSERT INTO "t" ("id", "b") VALUES
(1,	'1'),
(2,	0);

-- 2026-08-28 15:55:44 UTC
  1. Import the file on the Import page ("File upload" or "From server"), with Stop on error unchecked so the whole file runs.

The output ends with:

-- 2026-08-28 14:28:29 UTC

Error in query: Unknown error.

17 queries executed OK. (0.151 s)

The trailing comment has no terminating semicolon, so the remaining comment-only text is sent to the server as a statement; PDO returns neither a result set nor an error message, hence "Unknown error". With Stop on error checked the import is reported as failed even though every real statement succeeded (psql imports the same file without complaint — it skips the trailing comment).

Expected

Comment-only / whitespace-only text at the end of the file is skipped instead of being executed, or the footer is emitted in a form the importer ignores.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions