diff --git a/db_operations.php b/db_operations.php index 5a04bde59c76..7253f28d4fc9 100644 --- a/db_operations.php +++ b/db_operations.php @@ -132,11 +132,19 @@ $views = array(); // remove all foreign key constraints, otherwise we can get errors - include_once 'libraries/export/sql.php'; + $export_sql_plugin = PMA_getPlugin( + "export", + "sql", + 'libraries/plugins/export/', + array( + 'export_type' => $export_type, + 'single_table' => isset($single_table) + ) + ); foreach ($tables_full as $each_table => $tmp) { $sql_constraints = ''; $sql_drop_foreign_keys = ''; - $sql_structure = PMA_getTableDef($db, $each_table, "\n", '', false, false); + $sql_structure = $export_sql_plugin->getTableDef($db, $each_table, "\n", '', false, false); if ($move && ! empty($sql_drop_foreign_keys)) { PMA_DBI_query($sql_drop_foreign_keys); } @@ -154,7 +162,7 @@ if (PMA_Table::isView($db, $each_table)) { $views[] = $each_table; // Create stand-in definition to resolve view dependencies - $sql_view_standin = PMA_getTableDefStandIn($db, $each_table, "\n"); + $sql_view_standin = $export_sql_plugin->getTableDefStandIn($db, $each_table, "\n"); PMA_DBI_select_db($newname); PMA_DBI_query($sql_view_standin); $GLOBALS['sql_query'] .= "\n" . $sql_view_standin; diff --git a/libraries/Table.class.php b/libraries/Table.class.php index d89314ce130a..53f1c3c93afd 100644 --- a/libraries/Table.class.php +++ b/libraries/Table.class.php @@ -794,12 +794,21 @@ static public function moveCopy($source_db, $source_table, $target_db, // do not create the table if dataonly if ($what != 'dataonly') { - include_once './libraries/export/sql.php'; + // get Export SQL instance + $export_sql_plugin = PMA_getPlugin( + "export", + "sql", + 'libraries/plugins/export/', + array( + 'export_type' => $export_type, + 'single_table' => isset($single_table) + ) + ); $no_constraints_comments = true; $GLOBALS['sql_constraints_query'] = ''; - $sql_structure = PMA_getTableDef( + $sql_structure = $export_sql_plugin->getTableDef( $source_db, $source_table, "\n", $err_url, false, false ); unset($no_constraints_comments); @@ -990,11 +999,11 @@ static public function moveCopy($source_db, $source_table, $target_db, if ($GLOBALS['cfgRelation']['commwork']) { // Get all comments and MIME-Types for current table $comments_copy_query = 'SELECT - column_name, comment' . ($GLOBALS['cfgRelation']['mimework'] ? ', mimetype, transformation, transformation_options' : '') . ' - FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($GLOBALS['cfgRelation']['column_info']) . ' - WHERE - db_name = \'' . PMA_sqlAddSlashes($source_db) . '\' AND - table_name = \'' . PMA_sqlAddSlashes($source_table) . '\''; + column_name, comment' . ($GLOBALS['cfgRelation']['mimework'] ? ', mimetype, transformation, transformation_options' : '') . ' + FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($GLOBALS['cfgRelation']['column_info']) . ' + WHERE + db_name = \'' . PMA_sqlAddSlashes($source_db) . '\' AND + table_name = \'' . PMA_sqlAddSlashes($source_table) . '\''; $comments_copy_rs = PMA_query_as_controluser($comments_copy_query); // Write every comment as new copied entry. [MIME] diff --git a/libraries/Tracker.class.php b/libraries/Tracker.class.php index 6fe1cea52432..02c784c5d197 100644 --- a/libraries/Tracker.class.php +++ b/libraries/Tracker.class.php @@ -257,7 +257,16 @@ static public function createVersion($dbname, $tablename, $version, $tracking_set = self::$default_tracking_set; } - include_once './libraries/export/sql.php'; + // get Export SQL instance + $export_sql_plugin = PMA_getPlugin( + "export", + "sql", + 'libraries/plugins/export/', + array( + 'export_type' => $export_type, + 'single_table' => isset($single_table) + ) + ); $sql_backquotes = true; @@ -295,7 +304,7 @@ static public function createVersion($dbname, $tablename, $version, } $create_sql .= self::getLogComment() . - PMA_getTableDef($dbname, $tablename, "\n", ""); + $export_sql_plugin->getTableDef($dbname, $tablename, "\n", ""); // Save version