Merge pull request #1775 from devenbansod/bug4975

Bug#4975-Some Tbl/Db operations don't work on Drizzle
This commit is contained in:
Madhura Jayaratne 2015-07-10 12:25:36 +05:30
commit 06db60da7d
2 changed files with 9 additions and 5 deletions

View File

@ -1065,9 +1065,11 @@ class PMA_Table
if (($what == 'data' || $what == 'dataonly')
&& ! PMA_Table::isView($target_db, $target_table)
) {
$sql_set_mode = "SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO'";
$GLOBALS['dbi']->query($sql_set_mode);
$GLOBALS['sql_query'] .= "\n\n" . $sql_set_mode . ';';
if (! PMA_DRIZZLE) {
$sql_set_mode = "SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO'";
$GLOBALS['dbi']->query($sql_set_mode);
$GLOBALS['sql_query'] .= "\n\n" . $sql_set_mode . ';';
}
$sql_insert_data = 'INSERT INTO ' . $target
. ' SELECT * FROM ' . $source;

View File

@ -336,8 +336,10 @@ function PMA_createDbBeforeCopy()
// Set the SQL mode to NO_AUTO_VALUE_ON_ZERO to prevent MySQL from creating
// export statements it cannot import
$sql_set_mode = "SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO'";
$GLOBALS['dbi']->query($sql_set_mode);
if (! PMA_DRIZZLE) {
$sql_set_mode = "SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO'";
$GLOBALS['dbi']->query($sql_set_mode);
}
// rebuild the database list because PMA_Table::moveCopy
// checks in this list if the target db exists