Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

copy table data missing SET SQL_MODE #4558

Copy link
Copy link
@pma-import

Description

@pma-import
Issue body actions

For the same reason SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO' is included in export / import operations it needs to precede the INSERT INTO statement that copies table data. Here's a diff of my modification that solves the problem.

diff -bu Table.class-orig.php Table.class.php

--- Table.class-orig.php 2011-12-01 11:21:14.000000000 -0600
+++ Table.class.php 2011-12-13 03:41:06.536499576 -0600
@@ -775,6 +775,10 @@

// Copy the data unless this is a VIEW
if (($what == 'data' || $what == 'dataonly') && ! PMA_Table::_isView($target_db,$target_table)) {

  •        $sql_set_mode =
    
  •            "SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO'";
    
  •        PMA_DBI_query($sql_set_mode);
    
  •        $GLOBALS['sql_query']      .= "\n\n" . $sql_set_mode . ';';
    

$sql_insert_data =
'INSERT INTO ' . $target . ' SELECT * FROM ' . $source;
PMA_DBI_query($sql_insert_data);

Not that it matters much in this case, here are relevant apps and versions:

Linux lindev2 3.1.0-1-686-pae #1 SMP Mon Nov 14 08:24:20 UTC 2011 i686 GNU/Linux
PHP extension: mysqli
PHP 5.3.8
MySQL sever 5.1.52
MySQL client 5.1.58
Apache/2.2.21 (Debian)


Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.