Environment:
Adminer 4.7.6
Apache 2.4.39
MariaDB 10.3.21
PHP 7.3.11
When the MariaDB variable SQL_MODE contains the ANSI_MODE flag, importing a database that was exported on the same environment halts on a error #1064. The export procedure followed the quoting style of the database, but the import procedure is not performed with the same quotation style, so the syntax error is given on the double quotes used for fieldnames.
The backup .sql created by Adminer starts by setting some variables and contains the following line:
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
The SQL_MODE is a comma separated list and could contain multiple values, the previous statement bluntly resets it to a single value: "NO_AUTO_VALUE_ON_ZERO". Thus eliminating the ANSI_QUOTE setting that is required for a successful import.
Possible fix: SET sql_mode = CONCAT(@@SQL_MODE, ',NO_AUTO_VALUE_ON_ZERO');
More info: https://mariadb.com/kb/en/sql-mode/
I've decided to reset
sql_mode
before export to be importable elsewhere.