patch #2983492 When asking to synchronize Structure and Data, only Structure is done
This commit is contained in:

committed by
Marc Delisle

parent
a99858b16a
commit
b3c041bb99
@@ -8,6 +8,8 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
|
||||
3.3.3.0 (not yet released)
|
||||
- patch #2982480 [navi] Do not group if there would be one table in group,
|
||||
thanks to Lorikeet Lee.
|
||||
- patch #2983492 [sync] When asking to synchronize Structure and Data,
|
||||
only Structure is done, thanks to Ankit Gupta - ankitgupta3
|
||||
|
||||
3.3.2.0 (not yet released)
|
||||
- patch #2969449 [core] Name for MERGE engine varies depending on the
|
||||
|
@@ -671,11 +671,11 @@ function PMA_createTargetTables($src_db, $trg_db, $src_link, $trg_link, &$uncomm
|
||||
function PMA_populateTargetTables($src_db, $trg_db, $src_link, $trg_link, $uncommon_tables, $table_index, $uncommon_tables_fields, $display)
|
||||
{
|
||||
$display = false; // todo: maybe display some of the queries if they are not too numerous
|
||||
|
||||
$unbuffered_result = PMA_DBI_try_query('SELECT * FROM ' . PMA_backquote($src_db) . '.' . PMA_backquote($uncommon_tables[$table_index]), $src_link, PMA_DBI_QUERY_UNBUFFERED);
|
||||
if (false !== $unbuffered_result) {
|
||||
$insert_query = 'INSERT INTO ' . PMA_backquote($trg_db) . '.' .PMA_backquote($uncommon_tables[$table_index]) . ' VALUES';
|
||||
while ($one_row = PMA_DBI_fetch_row($unbuffered_result)) {
|
||||
$insert_query = 'INSERT INTO ' . PMA_backquote($trg_db) . '.' .PMA_backquote($uncommon_tables[$table_index]) . ' VALUES(';
|
||||
$insert_query .= '(';
|
||||
$key_of_last_value = count($one_row) - 1;
|
||||
foreach($one_row as $key => $value) {
|
||||
$insert_query .= "'" . PMA_sqlAddslashes($value) . "'";
|
||||
@@ -683,12 +683,14 @@ function PMA_populateTargetTables($src_db, $trg_db, $src_link, $trg_link, $uncom
|
||||
$insert_query .= ",";
|
||||
}
|
||||
}
|
||||
$insert_query .= ');';
|
||||
if ($display == true) {
|
||||
PMA_displayQuery($insert_query);
|
||||
}
|
||||
PMA_DBI_try_query($insert_query, $trg_link, 0);
|
||||
$insert_query .= '),';
|
||||
}
|
||||
$insert_query = substr($insert_query, 0, -1);
|
||||
$insert_query .= ';';
|
||||
if ($display == true) {
|
||||
PMA_displayQuery($insert_query);
|
||||
}
|
||||
PMA_DBI_try_query($insert_query, $trg_link, 0);
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
Reference in New Issue
Block a user