diff --git a/db_search.php b/db_search.php index c0f2c082af..6242a53d9b 100644 --- a/db_search.php +++ b/db_search.php @@ -128,8 +128,7 @@ if (isset($_REQUEST['submit_search'])) { $sqlstr_delete = 'DELETE'; // Fields to select - $tblfields = PMA_DBI_fetch_result('SHOW FIELDS FROM ' . PMA_backquote($table) . ' FROM ' . PMA_backquote($GLOBALS['db']), - null, 'Field'); + $tblfields = PMA_DBI_get_columns($GLOBALS['db'], $table); // Table to use $sqlstr_from = ' FROM ' . PMA_backquote($GLOBALS['db']) . '.' . PMA_backquote($table); @@ -148,8 +147,8 @@ if (isset($_REQUEST['submit_search'])) { $thefieldlikevalue = array(); foreach ($tblfields as $tblfield) { - if (! isset($field) || strlen($field) == 0 || $tblfield == $field) { - $thefieldlikevalue[] = 'CONVERT(' . PMA_backquote($tblfield) . ' USING utf8)' + if (! isset($field) || strlen($field) == 0 || $tblfield['Field'] == $field) { + $thefieldlikevalue[] = 'CONVERT(' . PMA_backquote($tblfield['Field']) . ' USING utf8)' . ' ' . $like_or_regex . ' ' . "'" . $automatic_wildcard . $search_word diff --git a/libraries/replication.inc.php b/libraries/replication.inc.php index 58ed7c5acc..857f4dc8da 100644 --- a/libraries/replication.inc.php +++ b/libraries/replication.inc.php @@ -298,21 +298,14 @@ function PMA_replication_synchronize_db($db, $src_link, $trg_link, $data = true) { $src_db = $trg_db = $db; - $src_connection = PMA_DBI_select_db($src_db, $src_link); - $trg_connection = PMA_DBI_select_db($trg_db, $trg_link); - $src_tables = PMA_DBI_get_tables($src_db, $src_link); - $source_tables_num = sizeof($src_tables); $trg_tables = PMA_DBI_get_tables($trg_db, $trg_link); - $target_tables_num = sizeof($trg_tables); /** * initializing arrays to save table names */ - $unmatched_num_src = 0; $source_tables_uncommon = array(); - $unmatched_num_trg = 0; $target_tables_uncommon = array(); $matching_tables = array(); $matching_tables_num = 0; @@ -367,6 +360,7 @@ function PMA_replication_synchronize_db($db, $src_link, $trg_link, $data = true) $source_indexes = array(); $target_indexes = array(); $add_indexes_array = array(); + $alter_indexes_array = array(); $remove_indexes_array = array(); $criteria = array('Field', 'Type', 'Null', 'Collation', 'Key', 'Default', 'Comment'); @@ -378,17 +372,11 @@ function PMA_replication_synchronize_db($db, $src_link, $trg_link, $data = true) $add_indexes_array, $alter_indexes_array,$remove_indexes_array, $counter); } - $matching_table_data_diff = array(); - $matching_table_structure_diff = array(); - $uncommon_table_structure_diff = array(); - $uncommon_table_data_diff = array(); - $uncommon_tables = $source_tables_uncommon; - /** * Generating Create Table query for all the non-matching tables present in Source but not in Target and populating tables. */ for ($q = 0; $q < sizeof($source_tables_uncommon); $q++) { - if (isset($uncommon_tables[$q])) { + if (isset($source_tables_uncommon[$q])) { PMA_createTargetTables($src_db, $trg_db, $src_link, $trg_link, $source_tables_uncommon, $q, $uncommon_tables_fields, false); } if (isset($row_count[$q]) && $data) { diff --git a/libraries/schema/Pdf_Relation_Schema.class.php b/libraries/schema/Pdf_Relation_Schema.class.php index e74c14d126..ed96efd053 100644 --- a/libraries/schema/Pdf_Relation_Schema.class.php +++ b/libraries/schema/Pdf_Relation_Schema.class.php @@ -923,8 +923,8 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema $pdf->SetX(10); $pdf->Cell(0, 6, $i . ' ' . $table, 0, 1, 'L', 0, $pdf->PMA_links['doc'][$table]['-']); // $pdf->Ln(1); - $result = PMA_DBI_query('SHOW FIELDS FROM ' . PMA_backquote($table) . ';'); - while ($row = PMA_DBI_fetch_assoc($result)) { + $fields = PMA_DBI_get_columns($GLOBALS['db'], $table); + foreach($fields as $row) { $pdf->SetX(20); $field_name = $row['Field']; $pdf->PMA_links['doc'][$table][$field_name] = $pdf->AddLink(); diff --git a/libraries/schema/User_Schema.class.php b/libraries/schema/User_Schema.class.php index 95d60e127b..41a2b9e6fe 100644 --- a/libraries/schema/User_Schema.class.php +++ b/libraries/schema/User_Schema.class.php @@ -38,7 +38,7 @@ class PMA_User_Schema public function processUserChoice() { - global $action_choose,$db,$cfgRelation,$cfg; + global $action_choose, $db, $cfgRelation; if (isset($this->action)) { switch ($this->action) { @@ -207,7 +207,7 @@ class PMA_User_Schema */ public function showTableDashBoard() { - global $db,$cfgRelation,$table,$cfg,$with_field_names; + global $db, $cfgRelation, $table, $with_field_names; /* * We will need an array of all tables in this db */ @@ -479,7 +479,7 @@ class PMA_User_Schema */ private function _displayScratchboardTables($array_sh_page) { - global $with_field_names,$cfg,$db; + global $with_field_names, $db; ?>