- assigned_to: nobody --> lem9
When exporting a table or database from a server with MySQL version 4.0.27 I get a file starting with the following content:
##### START #####
-- phpMyAdmin SQL Dump
-- version 2.11.0
-- http://www.phpmyadmin.net
--
-- Host: *****
-- Generation Time: Aug 29, 2007 at 12:05 AM
-- Server version: 4.0.27
-- PHP Version: 5.2.0
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
##### STOP #####
If I try to import this file on the same server I get the error:
"#1193 - Unknown system variable 'SQL_MODE'"
This is because the value "NO_AUTO_VALUE_ON_ZERO" was added in MySQL 4.1.1 (http://dev.mysql.com/doc/refman/4.1/en/server-sql-mode.html)
The code in libraries/export/sql.php doesn't check the MySQL server version:
##### START #####
/* We want exported AUTO_INCREMENT fields to have still same value, do this only for recent MySQL exports */
if (!isset($GLOBALS['sql_compatibility']) || $GLOBALS['sql_compatibility'] == 'NONE') {
$head .= $crlf . 'SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";' . $crlf;
}
##### STOP #####