[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_2-15831-g88ef580
Michal Čihař
nijel at users.sourceforge.net
Fri Aug 19 09:09:34 CEST 2011
The branch, master has been updated
via 88ef580bd5c575b8cdaa8dea2a3968cfd2504efe (commit)
via ab166dd8490cba11d172e8573f8b407fe4d776d1 (commit)
via ecb999e010986143bb1c715c932f3c94d676f72f (commit)
from 65aed176dd3e2dcb379af23a574b7bce3f412585 (commit)
- Log -----------------------------------------------------------------
commit 88ef580bd5c575b8cdaa8dea2a3968cfd2504efe
Author: Michal Čihař <michal at cihar.com>
Date: Fri Aug 19 09:09:12 2011 +0200
Use PMA_DBI_get_columns instead of custom query
commit ab166dd8490cba11d172e8573f8b407fe4d776d1
Author: Michal Čihař <michal at cihar.com>
Date: Fri Aug 19 09:06:46 2011 +0200
Remove some unused vars
commit ecb999e010986143bb1c715c932f3c94d676f72f
Author: Michal Čihař <michal at cihar.com>
Date: Fri Aug 19 09:02:11 2011 +0200
Remove some unused variables
-----------------------------------------------------------------------
Summary of changes:
libraries/replication.inc.php | 16 ++--------------
libraries/schema/User_Schema.class.php | 18 +++++-------------
2 files changed, 7 insertions(+), 27 deletions(-)
diff --git a/libraries/replication.inc.php b/libraries/replication.inc.php
index 58ed7c5..857f4dc 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/User_Schema.class.php b/libraries/schema/User_Schema.class.php
index 95d60e1..4ed00f2 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;
?>
<script type="text/javascript" src="./js/dom-drag.js"></script>
<form method="post" action="schema_edit.php" name="dragdrop">
@@ -505,22 +505,14 @@ class PMA_User_Schema
$reset_draginit .= ' document.edcoord.elements["c_table_' . $i . '[x]"].value = "2"' . "\n";
$reset_draginit .= ' document.edcoord.elements["c_table_' . $i . '[y]"].value = "' . (15 * $i) . '"' . "\n";
- $local_query = 'SHOW FIELDS FROM '
- . PMA_backquote($temp_sh_page['table_name'])
- . ' FROM ' . PMA_backquote($db);
- $fields_rs = PMA_DBI_query($local_query);
- unset($local_query);
- $fields_cnt = PMA_DBI_num_rows($fields_rs);
-
echo '<div id="table_' . $i . '" class="pdflayout_table"><u>' . $temp_sh_page['table_name'] . '</u>';
if (isset($with_field_names)) {
- while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
+ $fields = PMA_DBI_get_columns($db, $temp_sh_page['table_name'])
+ foreach ($fields as $row) {
echo '<br />' . htmlspecialchars($row['Field']) . "\n";
}
}
echo '</div>' . "\n";
- PMA_DBI_free_result($fields_rs);
- unset($fields_rs);
$i++;
}
?>
hooks/post-receive
--
phpMyAdmin
More information about the Git
mailing list