when clicking Synchronize Databases, do not load all source data in memory; todo: handle correctly BLOBs
This commit is contained in:
@@ -1292,8 +1292,8 @@ CREATE DATABASE,ALTER DATABASE,DROP DATABASE</pre>
|
|||||||
<dt id="cfg_ExecTimeLimit">$cfg['ExecTimeLimit'] integer [number of seconds]</dt>
|
<dt id="cfg_ExecTimeLimit">$cfg['ExecTimeLimit'] integer [number of seconds]</dt>
|
||||||
<dd>Set the number of seconds a script is allowed to run. If seconds is set
|
<dd>Set the number of seconds a script is allowed to run. If seconds is set
|
||||||
to zero, no time limit is imposed.<br />
|
to zero, no time limit is imposed.<br />
|
||||||
This setting is used while importing/exporting dump files but has no
|
This setting is used while importing/exporting dump files and in the
|
||||||
effect when PHP is running in safe mode.</dd>
|
Synchronize feature but has no effect when PHP is running in safe mode.</dd>
|
||||||
|
|
||||||
<dt id="cfg_MemoryLimit">$cfg['MemoryLimit'] integer [number of bytes]</dt>
|
<dt id="cfg_MemoryLimit">$cfg['MemoryLimit'] integer [number of bytes]</dt>
|
||||||
<dd>Set the number of bytes a script is allowed to allocate. If number set
|
<dd>Set the number of bytes a script is allowed to allocate. If number set
|
||||||
|
@@ -695,18 +695,17 @@ 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)
|
function PMA_populateTargetTables($src_db, $trg_db, $src_link, $trg_link, $uncommon_tables, $table_index, $uncommon_tables_fields, $display)
|
||||||
{
|
{
|
||||||
$table_data = PMA_DBI_fetch_result('SELECT * FROM ' . PMA_backquote($src_db) . '.' . PMA_backquote($uncommon_tables[$table_index]), null, null, $src_link);
|
$display = false; // todo: maybe display some of the queries if they are not too numerous
|
||||||
|
|
||||||
if (sizeof($table_data) != 0 )
|
$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) {
|
||||||
for ($row = 0; $row < sizeof($table_data); $row++)
|
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 = 'INSERT INTO '. PMA_backquote($trg_db) . '.' .PMA_backquote($uncommon_tables[$table_index]) . ' VALUES(';
|
||||||
for ($y = 0; $y < sizeof($uncommon_tables_fields[$table_index]); $y++)
|
$key_of_last_value = count($one_row) - 1;
|
||||||
{
|
foreach($one_row as $key => $value) {
|
||||||
$insert_query .= "'" . $table_data[$row][$uncommon_tables_fields[$table_index][$y]] . "'";
|
$insert_query .= "'" . PMA_sqlAddslashes($value) . "'";
|
||||||
if ($y < (sizeof($uncommon_tables_fields[$table_index]) - 1)) {
|
if ($key < $key_of_last_value) {
|
||||||
$insert_query .= ',';
|
$insert_query .= ",";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$insert_query .= ');';
|
$insert_query .= ');';
|
||||||
|
@@ -24,6 +24,11 @@ require_once './libraries/server_common.inc.php';
|
|||||||
*/
|
*/
|
||||||
require './libraries/server_synchronize.lib.php';
|
require './libraries/server_synchronize.lib.php';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Increases the time limit up to the configured maximum
|
||||||
|
*/
|
||||||
|
@set_time_limit($cfg['ExecTimeLimit']);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays the links
|
* Displays the links
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user