[-]
[+]
|
Changed |
_service:set_version:vhcs2.spec
|
|
[-]
[+]
|
Deleted |
_service:recompress:tar_scm:vhcs2-2.4.8.rev892.tar.bz2/gui/tools/pma3/RELEASE-DATE-3.4.7.1
^
|
@@ -1 +0,0 @@
-Thu Nov 10 14:13:42 UTC 2011
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/CHANGELOG
^
|
@@ -1,5 +1,9 @@
VHCS 2.4.8 Changelog
~~~~~~~~~~~~~~~~~~~~~~~~~~
+2011-12-04 Carsten Schoene:
+ - GUI:
+ * updated pma3 to version 3.4.8
+
2011-11-14 Carsten Schoene:
- GUI:
* updated pma3 to version 3.4.7.1
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/ChangeLog
^
|
@@ -1,8 +1,35 @@
phpMyAdmin - ChangeLog
======================
+3.4.8.0 (2011-12-01)
+- bug #3425230 [interface] enum data split at space char (more space to edit)
+- bug #3426840 [interface] ENUM/SET editor can't handle commas in values
+- bug #3427256 [interface] no links to browse/empty views and tables
+- bug #3430377 [interface] Deleted search results remain visible
+- bug #3428627 [import] ODS import ignores memory limits
+- bug #3426836 [interface] Visual column separation
+- bug #3428065 [parser] TRUE not recognized by parser
++ patch #3433770 [config] Make location of php-gettext configurable
+- patch #3430291 [import] Handle conflicts in some open_basedir situations
+- bug #3431427 [display] Dropdown results - setting NULL does not work
+- patch #3428764 [edit] Inline edit on multi-server configuration
+- patch #3437354 [core] Notice: Array to string conversion in PHP 5.4
+- [interface] When ShowTooltipAliasTB is true, VIEW is wrongly shown as the
+ view name in main panel db Structure page
+- bug #3439292 [core] Fail to synchronize column with name of keyword
+- bug #3425156 [interface] Add column after drop
+- [interface] Avoid showing the password in phpinfo()'s output
+- bug #3441572 [GUI] 'newer version of phpMyAdmin' message not shown in IE8
+- bug #3407235 [interface] Entering the key through a lookup window does not reset NULL
+- [security] Self-XSS on database names (Synchronize), see PMASA-2011-18
+- [security] Self-XSS on database names (Operations/rename), see PMASA-2011-18
+- [security] Self-XSS on column type (Create index), see PMASA-2011-18
+- [security] Self-XSS on column type (table Search), see PMASA-2011-18
+- [security] Self-XSS on invalid query (table overview), see PMASA-2011-18
+
3.4.7.1 (2011-11-10)
-- [security] Fixed possible local file inclusion in XML import (CVE-2011-4107).
+- [security] Fixed possible local file inclusion in XML import
+(CVE-2011-4107).
3.4.7.0 (2011-10-23)
- bug #3418610 [interface] Links in navigation when $cfg['MainPageIconic'] = false
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/Documentation.html
^
|
@@ -9,7 +9,7 @@
<link rel="icon" href="./favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>phpMyAdmin 3.4.7.1 - Documentation</title>
+ <title>phpMyAdmin 3.4.8 - Documentation</title>
<link rel="stylesheet" type="text/css" href="docs.css" />
</head>
@@ -17,7 +17,7 @@
<div id="header">
<h1>
<a href="http://www.phpmyadmin.net/">php<span class="myadmin">MyAdmin</span></a>
- 3.4.7.1
+ 3.4.8
Documentation
</h1>
</div>
@@ -1446,7 +1446,7 @@
</dd>
<dt id="cfg_LeftFrameDBTree">$cfg['LeftFrameDBTree'] boolean</dt>
- <dd>In light mode, defines whether to display the names of databases (in the
+ <dd>Defines whether to display the names of databases (in the
selector) using a tree, see also
<a href="#cfg_LeftFrameDBSeparator" class="configrule">$cfg['LeftFrameDBSeparator']</a>.
</dd>
@@ -3510,8 +3510,7 @@
group under which Apache runs.
</li>
<li>
- You should use PHP safe mode, to protect from other users that try
- to include your <i>config.inc.php</i> in their scripts.
+ Follow security recommendations for PHP and your webserver.
</li>
</ul>
@@ -4585,7 +4584,7 @@
<li>Marc Delisle <marc_at_infomarc.info>
<ul>
- <li>multi-language version</li>
+ <li>multi-language version in December 1998</li>
<li>various fixes and improvements</li>
<li><abbr title="structured query language">SQL</abbr> analyser (most of it)</li>
<li>current project maintainer</li>
@@ -4596,7 +4595,6 @@
<li>started SourceForge phpMyAdmin project in March 2001</li>
<li>sync'ed different existing CVS trees with new features and bugfixes</li>
<li>multi-language improvements, dynamic language selection</li>
- <li>current project maintainer</li>
<li>many bugfixes and improvements</li>
</ul></li>
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/Documentation.txt
^
|
@@ -1,4 +1,4 @@
-phpMyAdmin 3.4.7.1 Documentation
+phpMyAdmin 3.4.8 Documentation
* Top
* Requirements
@@ -1014,8 +1014,8 @@
tables in the left frame (smaller page). Only in Non-Lightmode you can use
the feature to display nested folders using $cfg['LeftFrameTableSeparator']
$cfg['LeftFrameDBTree'] boolean
- In light mode, defines whether to display the names of databases (in the
- selector) using a tree, see also $cfg['LeftFrameDBSeparator'].
+ Defines whether to display the names of databases (in the selector) using a
+ tree, see also $cfg['LeftFrameDBSeparator'].
$cfg['LeftFrameDBSeparator'] string or array
The string used to separate the parts of the database name when showing
them in a tree. Alternatively you can specify more strings in an array and
@@ -2565,8 +2565,7 @@
* All your phpMyAdmin files should be chown -R phpmy.apache, where phpmy is a
user whose password is only known to you, and apache is the group under
which Apache runs.
- * You should use PHP safe mode, to protect from other users that try to
- include your config.inc.php in their scripts.
+ * Follow security recommendations for PHP and your webserver.
4.3 I get errors about not being able to include a file in /lang or in /
libraries.
@@ -3382,7 +3381,7 @@
+ creator of the phpmyadmin project
+ maintainer from 1998 to summer 2000
* Marc Delisle <marc_at_infomarc.info>
- + multi-language version
+ + multi-language version in December 1998
+ various fixes and improvements
+ SQL analyser (most of it)
+ current project maintainer
@@ -3390,7 +3389,6 @@
+ started SourceForge phpMyAdmin project in March 2001
+ sync'ed different existing CVS trees with new features and bugfixes
+ multi-language improvements, dynamic language selection
- + current project maintainer
+ many bugfixes and improvements
* Lo?c Chapeaux <lolo_at_phpheaven.net>
+ rewrote and optimized javascript, DHTML and DOM stuff
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/README
^
|
@@ -1,7 +1,7 @@
phpMyAdmin - Readme
===================
-Version 3.4.7.1
+Version 3.4.8
A set of PHP-scripts to manage MySQL over the web.
|
[-]
[+]
|
Added |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/RELEASE-DATE-3.4.8
^
|
@@ -0,0 +1 @@
+Thu Dec 1 17:19:47 UTC 2011
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/browse_foreigners.php
^
|
@@ -104,9 +104,11 @@
if (opener && opener.document && opener.document.insertForm) {
var field = 'fields';
+ var field_null = 'fields_null';
<?php if (isset($rownumber)) { ?>
var element_name = field + '[multi_edit][<?php echo htmlspecialchars($rownumber); ?>][' + fieldmd5 + ']';
+ var null_name = field_null + '[multi_edit][<?php echo htmlspecialchars($rownumber); ?>][' + fieldmd5 + ']';
<?php } else { ?>
var element_name = field + '[]';
<?php } ?>
@@ -120,6 +122,9 @@
if (opener.document.insertForm.elements[element_name]) {
// Edit/Insert form
opener.document.insertForm.elements[element_name].value = key;
+ if (opener.document.insertForm.elements[null_name]) {
+ opener.document.insertForm.elements[null_name].checked = false;
+ }
self.close();
return false;
} else if (opener.document.insertForm.elements[element_name_alt]) {
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/db_structure.php
^
|
@@ -254,31 +254,57 @@
$hidden_fields[] = '<input type="hidden" name="views[]" value="' . htmlspecialchars($each_table['TABLE_NAME']) . '" />';
}
- if ($each_table['TABLE_ROWS'] > 0) {
- $browse_table = '<a href="sql.php?' . $tbl_url_query . '&pos=0">' . $titles['Browse'] . '</a>';
- $search_table = '<a href="tbl_select.php?' . $tbl_url_query . '">' . $titles['Search'] . '</a>';
- $browse_table_label = '<a href="sql.php?' . $tbl_url_query . '&pos=0">' . $truename . '</a>';
+ /*
+ * Always activate links for Browse, Search and Empty, even if
+ * the icons are greyed, because
+ * 1. for views, we don't know the number of rows at this point
+ * 2. for tables, another source could have populated them since the
+ * page was generated
+ *
+ * I could have used the PHP ternary conditional operator but I find
+ * the code easier to read without this operator.
+ */
+ if ($each_table['TABLE_ROWS'] > 0 || $table_is_view) {
+ $may_have_rows = true;
} else {
- $browse_table = $titles['NoBrowse'];
- $search_table = $titles['NoSearch'];
- $browse_table_label = '<a href="tbl_structure.php?' . $tbl_url_query . '">' . $truename . '</a>';
+ $may_have_rows = false;
}
+ $browse_table = '<a href="sql.php?' . $tbl_url_query . '&pos=0">';
+ if ($may_have_rows) {
+ $browse_table .= $titles['Browse'];
+ } else {
+ $browse_table .= $titles['NoBrowse'];
+ }
+ $browse_table .= '</a>';
+
+ $search_table = '<a href="tbl_select.php?' . $tbl_url_query . '">';
+ if ($may_have_rows) {
+ $search_table .= $titles['Search'];
+ } else {
+ $search_table .= $titles['NoSearch'];
+ }
+ $search_table .= '</a>';
+
+ $browse_table_label = '<a href="sql.php?' . $tbl_url_query . '&pos=0">' . $truename . '</a>';
if (! $db_is_information_schema) {
- if (! empty($each_table['TABLE_ROWS'])) {
- $empty_table = '<a ';
- if ($GLOBALS['cfg']['AjaxEnable']) {
- $empty_table .= 'class="truncate_table_anchor"';
- }
- $empty_table .= ' href="sql.php?' . $tbl_url_query
- . '&sql_query=';
- $empty_table .= urlencode('TRUNCATE ' . PMA_backquote($each_table['TABLE_NAME']))
- . '&message_to_show='
- . urlencode(sprintf(__('Table %s has been emptied'), htmlspecialchars($each_table['TABLE_NAME'])))
- .'">' . $titles['Empty'] . '</a>';
+ $empty_table = '<a ';
+ if ($GLOBALS['cfg']['AjaxEnable']) {
+ $empty_table .= 'class="truncate_table_anchor"';
+ }
+ $empty_table .= ' href="sql.php?' . $tbl_url_query
+ . '&sql_query=';
+ $empty_table .= urlencode('TRUNCATE ' . PMA_backquote($each_table['TABLE_NAME']))
+ . '&message_to_show='
+ . urlencode(sprintf(__('Table %s has been emptied'), htmlspecialchars($each_table['TABLE_NAME'])))
+ .'">';
+ if ($may_have_rows) {
+ $empty_table .= $titles['Empty'];
} else {
- $empty_table = $titles['NoEmpty'];
+ $empty_table .= $titles['NoEmpty'];
}
+ $empty_table .= '</a>';
+
$drop_query = 'DROP '
. ($table_is_view ? 'VIEW' : 'TABLE')
. ' ' . PMA_backquote($each_table['TABLE_NAME']);
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/import.php
^
|
@@ -259,7 +259,7 @@
if (is_writable($tmp_subdir)) {
- $import_file_new = $tmp_subdir . basename($import_file);
+ $import_file_new = $tmp_subdir . basename($import_file) . uniqid();
if (move_uploaded_file($import_file, $import_file_new)) {
$import_file = $import_file_new;
$file_to_unlink = $import_file_new;
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/js/db_operations.js
^
|
@@ -1,4 +1,4 @@
-$(document).ready(function(){$("#rename_db_form.ajax").live("submit",function(a){a.preventDefault();a=$(this);var d="CREATE DATABASE "+$("#new_db_name").val()+" / DROP DATABASE "+window.parent.db;PMA_prepareForAjaxRequest(a);var b={};b[PMA_messages.strYes]=function(){$(this).dialog("close").remove();window.parent.refreshMain();window.parent.refreshNavigation()};b[PMA_messages.strNo]=function(){$(this).dialog("close").remove()};a.PMA_confirm(d,a.attr("action"),function(e){PMA_ajaxShowMessage(PMA_messages.strRenamingDatabases);
+$(document).ready(function(){$("#rename_db_form.ajax").live("submit",function(a){a.preventDefault();a=$(this);var d=escapeHtml("CREATE DATABASE "+$("#new_db_name").val()+" / DROP DATABASE "+window.parent.db);PMA_prepareForAjaxRequest(a);var b={};b[PMA_messages.strYes]=function(){$(this).dialog("close").remove();window.parent.refreshMain();window.parent.refreshNavigation()};b[PMA_messages.strNo]=function(){$(this).dialog("close").remove()};a.PMA_confirm(d,a.attr("action"),function(e){PMA_ajaxShowMessage(PMA_messages.strRenamingDatabases);
$.get(e,$("#rename_db_form").serialize()+"&is_js_confirmed=1",function(c){if(c.success==true){PMA_ajaxShowMessage(c.message);window.parent.db=c.newname;$("#topmenucontainer").next("div").remove().end().after(c.sql_query);c=$("#topmenucontainer").next("div").find(".notice");c.text()==""&&c.remove();$("<span>"+PMA_messages.strReloadDatabase+"?</span>").dialog({buttons:b})}else PMA_ajaxShowMessage(c.error)})})});$("#copy_db_form.ajax").live("submit",function(a){a.preventDefault();var d=PMA_ajaxShowMessage(PMA_messages.strCopyingDatabase);
a=$(this);PMA_prepareForAjaxRequest(a);$.get(a.attr("action"),a.serialize(),function(b){$(".success").fadeOut();$(".error").fadeOut();if(b.success==true){$("#topmenucontainer").after(b.message);if($("#checkbox_switch").is(":checked")){window.parent.db=b.newname;window.parent.refreshMain();window.parent.refreshNavigation()}else window.parent.refreshNavigation(true)}else $("#topmenucontainer").after(b.error);PMA_ajaxRemoveMessage(d)})});$("#change_db_charset_form.ajax").live("submit",function(a){a.preventDefault();
a=$(this);PMA_prepareForAjaxRequest(a);PMA_ajaxShowMessage(PMA_messages.strChangingCharset);$.get(a.attr("action"),a.serialize()+"&submitcollation="+a.find("input[name=submitcollation]").attr("value"),function(d){d.success==true?PMA_ajaxShowMessage(d.message):PMA_ajaxShowMessage(d.error)})})},"top.frame_content");
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/js/db_search.js
^
|
@@ -1,5 +1,6 @@
function loadResult(a,c,b,d){$(document).ready(function(){if(d){$("#sqlqueryform").hide();$("#togglequerybox").hide();$("#table-info").show();$("#table-link").attr({href:"sql.php?"+b}).text(c);$("#browse-results").load(a+" '#sqlqueryresults'").show()}else event.preventDefault()})}
-function deleteResult(a,c,b){$(document).ready(function(){$("#table-info").hide();$("#browse-results").hide();$("#sqlqueryform").hide();$("#togglequerybox").hide();if(confirm(c))if(b){$("#browse-results").load(a+" '#result_query'");$("#sqlqueryform").load(a+" '#sqlqueryform'");$("#togglequerybox").html(PMA_messages.strHideQueryBox);document.getElementById("buttonGo").click();$("#browse-results").show();$("#sqlqueryform").show();$("#togglequerybox").show()}else event.preventDefault()})}
+function deleteResult(a,c,b){$(document).ready(function(){$("#table-info").hide();$("#browse-results").hide();$("#sqlqueryform").hide();$("#togglequerybox").hide();if(confirm(c))if(b){var d=PMA_ajaxShowMessage(PMA_messages.strDeleting);$("#browse-results").load(a+" '#result_query'",function(){$("#sqlqueryform").load(a+" '#sqlqueryform'",function(){document.getElementById("buttonGo").click();$("#togglequerybox").html(PMA_messages.strHideQueryBox);PMA_ajaxRemoveMessage(d);$("#browse-results").show();
+$("#sqlqueryform").show();$("#togglequerybox").show()})})}else event.preventDefault()})}
$(document).ready(function(){$.ajaxSetup({cache:"false"});$("#table-info").prepend('<img id="table-image" src="./themes/original/img/s_tbl.png" />').hide();$("#buttonGo").click(function(){$("#table-info").hide();$("#browse-results").hide();$("#sqlqueryform").hide();$("#togglequerybox").hide()});$('<div id="togglesearchformdiv"><a id="togglesearchformlink"></a></div>').insertAfter("#db_search_form").hide();$("#togglequerybox").hide();$("#togglequerybox").bind("click",function(){var a=$(this);$("#sqlqueryform").slideToggle("medium");
a.text()==PMA_messages.strHideQueryBox?a.text(PMA_messages.strShowQueryBox):a.text(PMA_messages.strHideQueryBox);return false});$("#togglesearchformlink").html(PMA_messages.strShowSearchCriteria).bind("click",function(){var a=$(this);$("#db_search_form").slideToggle();a.text()==PMA_messages.strHideSearchCriteria?a.text(PMA_messages.strShowSearchCriteria):a.text(PMA_messages.strHideSearchCriteria);return false});$("#db_search_form.ajax").live("submit",function(a){a.preventDefault();var c=PMA_ajaxShowMessage(PMA_messages.strSearching);
$form=$(this);PMA_prepareForAjaxRequest($form);$.post($form.attr("action"),$form.serialize()+"&submit_search="+$("#buttonGo").val(),function(b){if(typeof b=="string"){$("#searchresults").html(b);$("#sqlqueryresults").trigger("appendAnchor");$("#db_search_form").slideToggle().hide();$("#togglesearchformlink").text(PMA_messages.strShowSearchCriteria);$("#togglesearchformdiv").show()}else $("#sqlqueryresults").html(b.message);PMA_ajaxRemoveMessage(c)})})},"top.frame_content");
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/js/functions.js
^
|
@@ -12,15 +12,15 @@
"")!="")return true;if(typeof a.elements.sql_localfile!="undefined"&&a.elements.sql_localfile.value.replace(d,"")!="")return true;if(c&&typeof a.elements.id_bookmark!="undefined"&&(a.elements.id_bookmark.value!=null||a.elements.id_bookmark.value!="")&&a.elements.id_bookmark.selectedIndex!=0)return true;if(b.value.replace(d,"")!="")return confirmQuery(a,b)?true:false;a.reset();c=1}if(c){b.select();alert(PMA_messages.strFormEmpty);b.focus();return false}return true}
function emptyCheckTheField(a,b){var c=1;c=a.elements[b];return c=typeof c.value.replace!="undefined"?c.value.replace(/\s+/,"")==""?1:0:c.value==""?1:0}function emptyFormElements(a,b){return emptyCheckTheField(a,b)}
function checkFormElementInRange(a,b,c,d,e){a=a.elements[b];b=parseInt(a.value);if(typeof d=="undefined")d=0;if(typeof e=="undefined")e=Number.MAX_VALUE;if(isNaN(b)){a.select();alert(PMA_messages.strNotNumber);a.focus();return false}else if(b<d||b>e){a.select();alert(c.replace("%d",b));a.focus();return false}else a.value=b;return true}
-function checkTableEditForm(a,b){var c=0,d,e,g,h;for(d=0;d<b;d++){e="#field_"+d+"_2";e=$(e);h=e.val();if(h=="VARCHAR"||h=="CHAR"||h=="BIT"||h=="VARBINARY"||h=="BINARY"){e=$("#field_"+d+"_3");h=parseInt(e.val());g=$("#field_"+d+"_1");if(isNaN(h)&&g.val()!=""){e.select();alert(PMA_messages.strNotNumber);e.focus();return false}}if(c==0){e="field_"+d+"_1";emptyCheckTheField(a,e)||(c=1)}}if(c==0){c=a.elements.field_0_1;alert(PMA_messages.strFormEmpty);c.focus();return false}if($("input.textfield[name='table']").val()==
+function checkTableEditForm(a,b){var c=0,d,e,f,j;for(d=0;d<b;d++){e="#field_"+d+"_2";e=$(e);j=e.val();if(j=="VARCHAR"||j=="CHAR"||j=="BIT"||j=="VARBINARY"||j=="BINARY"){e=$("#field_"+d+"_3");j=parseInt(e.val());f=$("#field_"+d+"_1");if(isNaN(j)&&f.val()!=""){e.select();alert(PMA_messages.strNotNumber);e.focus();return false}}if(c==0){e="field_"+d+"_1";emptyCheckTheField(a,e)||(c=1)}}if(c==0){c=a.elements.field_0_1;alert(PMA_messages.strFormEmpty);c.focus();return false}if($("input.textfield[name='table']").val()==
""){alert(PMA_messages.strFormEmpty);$("input.textfield[name='table']").focus();return false}return true}
function checkTransmitDump(a,b){var c=a.elements;if(b=="zip"&&c.zip.checked){if(!c.asfile.checked)a.elements.asfile.checked=true;if(typeof c.gzip!="undefined"&&c.gzip.checked)a.elements.gzip.checked=false;if(typeof c.bzip!="undefined"&&c.bzip.checked)a.elements.bzip.checked=false}else if(b=="gzip"&&c.gzip.checked){if(!c.asfile.checked)a.elements.asfile.checked=true;if(typeof c.zip!="undefined"&&c.zip.checked)a.elements.zip.checked=false;if(typeof c.bzip!="undefined"&&c.bzip.checked)a.elements.bzip.checked=
false}else if(b=="bzip"&&c.bzip.checked){if(!c.asfile.checked)a.elements.asfile.checked=true;if(typeof c.zip!="undefined"&&c.zip.checked)a.elements.zip.checked=false;if(typeof c.gzip!="undefined"&&c.gzip.checked)a.elements.gzip.checked=false}else if(b=="transmit"&&!c.asfile.checked){if(typeof c.zip!="undefined"&&c.zip.checked)a.elements.zip.checked=false;if(typeof c.gzip!="undefined"&&c.gzip.checked)a.elements.gzip.checked=false;if(typeof c.bzip!="undefined"&&c.bzip.checked)a.elements.bzip.checked=
false}return true}$(document).ready(function(){$("tr.odd:not(.noclick), tr.even:not(.noclick)").live("click",function(a){if(!$(a.target).is("a, img, a *")){var b=$(this),c=b.find(":checkbox");if(c.length){var d=c.attr("checked");if(!$(a.target).is(":checkbox, label")){d=!d;c.attr("checked",d)}d?b.addClass("marked"):b.removeClass("marked")}else b.toggleClass("marked")}});$(".datefield, .datetimefield").each(function(){PMA_addDatepicker($(this))})});
$(document).ready(function(){$("tr.odd, tr.even").live("hover",function(){var a=$(this);a.toggleClass("hover");a.children().toggleClass("hover")})});var marked_row=[];function markAllRows(a){$("#"+a).find("input:checkbox:enabled").attr("checked","checked").parents("tr").addClass("marked");return true}function unMarkAllRows(a){$("#"+a).find("input:checkbox:enabled").removeAttr("checked").parents("tr").removeClass("marked");return true}
function setCheckboxes(a,b){b?$("#"+a).find("input:checkbox").attr("checked","checked"):$("#"+a).find("input:checkbox").removeAttr("checked");return true}function setSelectOptions(a,b,c){$("form[name='"+a+"'] select[name='"+b+"']").find("option").attr("selected",c);return true}
-function insertQuery(a){var b=document.sqlform.dummy,c="",d=document.sqlform.table.value;if(b.options.length>0){sql_box_locked=true;for(var e="",g="",h="",f=0,j=0;j<b.options.length;j++){f++;if(f>1){e+=", ";g+=",";h+=","}e+=b.options[j].value;g+="[value-"+f+"]";h+=b.options[j].value+"=[value-"+f+"]"}if(a=="selectall")c="SELECT * FROM `"+d+"` WHERE 1";else if(a=="select")c="SELECT "+e+" FROM `"+d+"` WHERE 1";else if(a=="insert")c="INSERT INTO `"+d+"`("+e+") VALUES ("+g+")";else if(a=="update")c="UPDATE `"+
-d+"` SET "+h+" WHERE 1";else if(a=="delete")c="DELETE FROM `"+d+"` WHERE 1";document.sqlform.sql_query.value=c;sql_box_locked=false}}
+function insertQuery(a){var b=document.sqlform.dummy,c="",d=document.sqlform.table.value;if(b.options.length>0){sql_box_locked=true;for(var e="",f="",j="",g=0,h=0;h<b.options.length;h++){g++;if(g>1){e+=", ";f+=",";j+=","}e+=b.options[h].value;f+="[value-"+g+"]";j+=b.options[h].value+"=[value-"+g+"]"}if(a=="selectall")c="SELECT * FROM `"+d+"` WHERE 1";else if(a=="select")c="SELECT "+e+" FROM `"+d+"` WHERE 1";else if(a=="insert")c="INSERT INTO `"+d+"`("+e+") VALUES ("+f+")";else if(a=="update")c="UPDATE `"+
+d+"` SET "+j+" WHERE 1";else if(a=="delete")c="DELETE FROM `"+d+"` WHERE 1";document.sqlform.sql_query.value=c;sql_box_locked=false}}
function insertValueQuery(){var a=document.sqlform.sql_query,b=document.sqlform.dummy;if(b.options.length>0){sql_box_locked=true;for(var c="",d=0,e=0;e<b.options.length;e++)if(b.options[e].selected){d++;if(d>1)c+=", ";c+=b.options[e].value}if(document.selection){a.focus();sel=document.selection.createRange();sel.text=c;document.sqlform.insert.focus()}else if(document.sqlform.sql_query.selectionStart||document.sqlform.sql_query.selectionStart=="0"){b=document.sqlform.sql_query.selectionEnd;d=document.sqlform.sql_query.value;
a.value=d.substring(0,document.sqlform.sql_query.selectionStart)+c+d.substring(b,d.length)}else a.value+=c;sql_box_locked=false}}function goToUrl(a,b){eval("document.location.href = '"+b+"pos="+a.options[a.selectedIndex].value+"'")}function getElement(a,b){if(document.layers){b=b?b:self;if(b.document.layers[a])return b.document.layers[a];for(W=0;W<b.document.layers.length;)return getElement(a,b.document.layers[W])}if(document.all)return document.all[a];return document.getElementById(a)}
function refreshDragOption(a){if($("#"+a).css("visibility")=="visible"){refreshLayout();TableDragInit()}}function refreshLayout(){var a=$("#pdflayout"),b=$("#orientation_opt").val(),c=$("#paper_opt").length==1?$("#paper_opt").val():"A4";if(b=="P"){posa="x";posb="y"}else{posa="y";posb="x"}a.css("width",pdfPaperSize(c,posa)+"px");a.css("height",pdfPaperSize(c,posb)+"px")}
@@ -29,11 +29,11 @@
"x"?104.88:147.4;case "A10":return b=="x"?73.7:104.88;case "B0":return b=="x"?2834.65:4008.19;case "B1":return b=="x"?2004.09:2834.65;case "B2":return b=="x"?1417.32:2004.09;case "B3":return b=="x"?1000.63:1417.32;case "B4":return b=="x"?708.66:1000.63;case "B5":return b=="x"?498.9:708.66;case "B6":return b=="x"?354.33:498.9;case "B7":return b=="x"?249.45:354.33;case "B8":return b=="x"?175.75:249.45;case "B9":return b=="x"?124.72:175.75;case "B10":return b=="x"?87.87:124.72;case "C0":return b=="x"?
2599.37:3676.54;case "C1":return b=="x"?1836.85:2599.37;case "C2":return b=="x"?1298.27:1836.85;case "C3":return b=="x"?918.43:1298.27;case "C4":return b=="x"?649.13:918.43;case "C5":return b=="x"?459.21:649.13;case "C6":return b=="x"?323.15:459.21;case "C7":return b=="x"?229.61:323.15;case "C8":return b=="x"?161.57:229.61;case "C9":return b=="x"?113.39:161.57;case "C10":return b=="x"?79.37:113.39;case "RA0":return b=="x"?2437.8:3458.27;case "RA1":return b=="x"?1729.13:2437.8;case "RA2":return b==
"x"?1218.9:1729.13;case "RA3":return b=="x"?864.57:1218.9;case "RA4":return b=="x"?609.45:864.57;case "SRA0":return b=="x"?2551.18:3628.35;case "SRA1":return b=="x"?1814.17:2551.18;case "SRA2":return b=="x"?1275.59:1814.17;case "SRA3":return b=="x"?907.09:1275.59;case "SRA4":return b=="x"?637.8:907.09;case "LETTER":return b=="x"?612:792;case "LEGAL":return b=="x"?612:1008;case "EXECUTIVE":return b=="x"?521.86:756;case "FOLIO":return b=="x"?612:936}return 0}
-function popupBSMedia(a,b,c,d,e,g){if(e==undefined)e=640;if(g==undefined)g=480;window.open("bs_play_media.php?"+a+"&bs_reference="+b+"&media_type="+c+"&custom_type="+d,"viewBSMedia","width="+e+", height="+g+", resizable=1, scrollbars=1, status=0")}function requestMIMETypeChange(a,b,c,d){if(undefined==d)d="";var e=prompt("Enter custom MIME type",d);e&&e!=d&&changeMIMEType(a,b,c,e)}
+function popupBSMedia(a,b,c,d,e,f){if(e==undefined)e=640;if(f==undefined)f=480;window.open("bs_play_media.php?"+a+"&bs_reference="+b+"&media_type="+c+"&custom_type="+d,"viewBSMedia","width="+e+", height="+f+", resizable=1, scrollbars=1, status=0")}function requestMIMETypeChange(a,b,c,d){if(undefined==d)d="";var e=prompt("Enter custom MIME type",d);e&&e!=d&&changeMIMEType(a,b,c,e)}
function changeMIMEType(a,b,c,d){jQuery.post("bs_change_mime_type.php",{bs_db:a,bs_table:b,bs_reference:c,bs_new_mime_type:d})}
-$(document).ready(function(){$(".inline_edit_sql").live("click",function(){var a=$(this).prev().find("input[name='server']").val(),b=$(this).prev().find("input[name='db']").val(),c=$(this).prev().find("input[name='table']").val(),d=$(this).prev().find("input[name='token']").val(),e=$(this).prev().find("input[name='sql_query']").val(),g=$(this).parent().prev().find(".inner_sql"),h=g.html(),f='<textarea name="sql_query_edit" id="sql_query_edit">'+e+"</textarea>\n";f+='<input type="button" class="btnSave" value="'+
-PMA_messages.strGo+'">\n';f+='<input type="button" class="btnDiscard" value="'+PMA_messages.strCancel+'">\n';g.replaceWith(f);$(".btnSave").each(function(){$(this).click(function(){e=$(this).prev().val();window.location.replace("import.php?server="+encodeURIComponent(a)+"&db="+encodeURIComponent(b)+"&table="+encodeURIComponent(c)+"&sql_query="+encodeURIComponent(e)+"&show_query=1&token="+d)})});$(".btnDiscard").each(function(){$(this).click(function(){$(this).closest(".sql").html('<span class="syntax"><span class="inner_sql">'+
-h+"</span></span>")})});return false});$(".sqlbutton").click(function(a){a.target.id=="clear"?$("#sqlquery").val(""):insertQuery(a.target.id);return false});$("#export_type").change(function(){if($("#export_type").val()=="svg"){$("#show_grid_opt").attr("disabled","disabled");$("#orientation_opt").attr("disabled","disabled");$("#with_doc").attr("disabled","disabled");$("#show_table_dim_opt").removeAttr("disabled");$("#all_table_same_wide").removeAttr("disabled");$("#paper_opt").removeAttr("disabled",
+$(document).ready(function(){$(".inline_edit_sql").live("click",function(){var a=$(this).prev().find("input[name='server']").val(),b=$(this).prev().find("input[name='db']").val(),c=$(this).prev().find("input[name='table']").val(),d=$(this).prev().find("input[name='token']").val(),e=$(this).prev().find("input[name='sql_query']").val(),f=$(this).parent().prev().find(".inner_sql"),j=f.html(),g='<textarea name="sql_query_edit" id="sql_query_edit">'+e+"</textarea>\n";g+='<input type="button" class="btnSave" value="'+
+PMA_messages.strGo+'">\n';g+='<input type="button" class="btnDiscard" value="'+PMA_messages.strCancel+'">\n';f.replaceWith(g);$(".btnSave").each(function(){$(this).click(function(){e=$(this).prev().val();window.location.replace("import.php?server="+encodeURIComponent(a)+"&db="+encodeURIComponent(b)+"&table="+encodeURIComponent(c)+"&sql_query="+encodeURIComponent(e)+"&show_query=1&token="+d)})});$(".btnDiscard").each(function(){$(this).click(function(){$(this).closest(".sql").html('<span class="syntax"><span class="inner_sql">'+
+j+"</span></span>")})});return false});$(".sqlbutton").click(function(a){a.target.id=="clear"?$("#sqlquery").val(""):insertQuery(a.target.id);return false});$("#export_type").change(function(){if($("#export_type").val()=="svg"){$("#show_grid_opt").attr("disabled","disabled");$("#orientation_opt").attr("disabled","disabled");$("#with_doc").attr("disabled","disabled");$("#show_table_dim_opt").removeAttr("disabled");$("#all_table_same_wide").removeAttr("disabled");$("#paper_opt").removeAttr("disabled",
"disabled");$("#show_color_opt").removeAttr("disabled","disabled")}else if($("#export_type").val()=="dia"){$("#show_grid_opt").attr("disabled","disabled");$("#with_doc").attr("disabled","disabled");$("#show_table_dim_opt").attr("disabled","disabled");$("#all_table_same_wide").attr("disabled","disabled");$("#paper_opt").removeAttr("disabled","disabled");$("#show_color_opt").removeAttr("disabled","disabled");$("#orientation_opt").removeAttr("disabled","disabled")}else if($("#export_type").val()=="eps"){$("#show_grid_opt").attr("disabled",
"disabled");$("#orientation_opt").removeAttr("disabled");$("#with_doc").attr("disabled","disabled");$("#show_table_dim_opt").attr("disabled","disabled");$("#all_table_same_wide").attr("disabled","disabled");$("#paper_opt").attr("disabled","disabled");$("#show_color_opt").attr("disabled","disabled")}else if($("#export_type").val()=="pdf"){$("#show_grid_opt").removeAttr("disabled");$("#orientation_opt").removeAttr("disabled");$("#with_doc").removeAttr("disabled","disabled");$("#show_table_dim_opt").removeAttr("disabled",
"disabled");$("#all_table_same_wide").removeAttr("disabled","disabled");$("#paper_opt").removeAttr("disabled","disabled");$("#show_color_opt").removeAttr("disabled","disabled")}});$("#sqlquery").focus();if($("#input_username"))$("#input_username").val()==""?$("#input_username").focus():$("#input_password").focus()});
@@ -54,21 +54,21 @@
close:function(){$(this).remove()},buttons:b,beforeClose:function(){$("#change_password_anchor.dialog_active").removeClass("dialog_active").addClass("ajax")}}).append(c);displayPasswordGenerateButton()})});$("#change_password_form.ajax").find("input[name=change_pw]").live("click",function(a){a.preventDefault();a=$("#change_password_form");var b=$(this).val(),c=PMA_ajaxShowMessage(PMA_messages.strProcessingRequest);$(a).append('<input type="hidden" name="ajax_request" value="true" />');$.post($(a).attr("action"),
$(a).serialize()+"&change_pw="+b,function(d){if(d.success==true){$("#topmenucontainer").after(d.sql_query);$("#change_password_dialog").hide().remove();$("#edit_user_dialog").dialog("close").remove();$("#change_password_anchor.dialog_active").removeClass("dialog_active").addClass("ajax");PMA_ajaxRemoveMessage(c)}else PMA_ajaxShowMessage(d.error)})})});$(document).ready(function(){PMA_verifyTypeOfAllColumns();$("select[class='column_type']").live("change",function(){PMA_showNoticeForEnum($(this))})});
function PMA_verifyTypeOfAllColumns(){$("select[class='column_type']").each(function(){PMA_showNoticeForEnum($(this))})}function disable_popup(){$("#popup_background").fadeOut("fast");$("#enum_editor").fadeOut("fast");$("#enum_editor #values input").remove();$("#enum_editor input[type='hidden']").remove()}
-$(document).ready(function(){$("a[class='open_enum_editor']").live("click",function(){var c=document.documentElement.clientWidth,d=document.documentElement.clientHeight,e=c/2,g=d*0.8;d=d/2-g/2;c=c/2-e/2;$("#enum_editor").css({position:"absolute",top:d,left:c,width:e,height:g});$("#popup_background").css({opacity:"0.7"});$("#popup_background").fadeIn("fast");$("#enum_editor").fadeIn("fast");e=$(this).parent().prev("input").attr("value").split(",");$.each(e,function(h,f){if(jQuery.trim(f)!=""){if(f.substr(0,
-1)!="'")f="'"+f;if(f.substr(f.length-1,f.length)!="'")f+="'";f=f.substr(1,f.length-2).replace(/''/g,"'").replace(/\\\\/g,"\\").replace(/\\'/g,"'").replace(/'/g,"'");f=f.replace(/>/g,">");$("#enum_editor #values").append("<input type='text' value="+f+" />")}});$("#enum_editor").append("<input type='hidden' value='"+$(this).parent().prev("input").attr("id")+"' />");return false});$("a[class='close_enum_editor']").live("click",function(){disable_popup()});$("a[class='cancel_enum_editor']").live("click",
-function(){disable_popup()});$("a[class='add_value']").live("click",function(){$("#enum_editor #values").append("<input type='text' />")});$("#enum_editor input[type='submit']").live("click",function(){var c=[];$.each($("#enum_editor #values input"),function(e,g){val=jQuery.trim(g.value);val!=""&&c.push("'"+val.replace(/\\/g,"\\\\").replace(/'/g,"''")+"'")});var d=$("#enum_editor input[type='hidden']").attr("value");$("input[id='"+d+"']").attr("value",c.join(","));disable_popup()});if($("input[type='hidden'][name='table_type']").val()==
-"table"){var a=$("table[id='tablestructure']");a.find("td[class='browse']").remove();a.find("td[class='primary']").remove();a.find("td[class='unique']").remove();a.find("td[class='index']").remove();a.find("td[class='fulltext']").remove();a.find("th[class='action']").attr("colspan",3);a.find("td[class='more_opts']").show();$(".structure_actions_dropdown").each(function(){var c=$(this),d=c.parent().offset().left+c.parent().innerWidth()-c.innerWidth(),e=c.parent().offset().top+c.parent().innerHeight();
-c.offset({top:e,left:d})});var b=$("select[name='after_field']");$("iframe[class='IE_hack']").width(b.width()).height(b.height()).offset({top:b.offset().top,left:b.offset().left});a.find("td[class='more_opts']").mouseenter(function(){$.browser.msie&&$.browser.version=="6.0"&&$("iframe[class='IE_hack']").show().width(b.width()+4).height(b.height()+4).offset({top:b.offset().top,left:b.offset().left});$(".structure_actions_dropdown").hide();$(this).children(".structure_actions_dropdown").show();if($.browser.msie){var c=
-$(this).offset().left+$(this).innerWidth()-$(this).children(".structure_actions_dropdown").innerWidth(),d=$(this).offset().top+$(this).innerHeight();$(this).children(".structure_actions_dropdown").offset({top:d,left:c})}}).mouseleave(function(){$(this).children(".structure_actions_dropdown").hide();$.browser.msie&&$.browser.version=="6.0"&&$("iframe[class='IE_hack']").hide()})}});
+$(document).ready(function(){$("a[class='open_enum_editor']").live("click",function(){var c=document.documentElement.clientWidth,d=document.documentElement.clientHeight,e=c/2,f=d*0.8;d=d/2-f/2;c=c/2-e/2;$("#enum_editor").css({position:"absolute",top:d,left:c,width:e,height:f});$("#popup_background").css({opacity:"0.7"});$("#popup_background").fadeIn("fast");$("#enum_editor").fadeIn("fast");e=$(this).parent().prev("input").val();e=$("<div/>").text(e).html();f=[];c=false;for(var j,g="",h=0;h<e.length;h++){d=
+e.charAt(h);j=h==e.length?"":e.charAt(h+1);if(!c&&d=="'")c=true;else if(c&&d=="\\"&&j=="\\"){g+="\";h++}else if(c&&j=="'"&&(d=="'"||d=="\\")){g+="'";h++}else if(c&&d=="'"){c=false;f.push(g);g=""}else if(c)g+=d}g.length>0&&f.push(g);for(h=0;h<f.length;h++)$("#enum_editor #values").append("<input type='text' value='"+f[h]+"' />");$("#enum_editor").append("<input type='hidden' value='"+$(this).parent().prev("input").attr("id")+"' />");return false});$("a[class='close_enum_editor']").live("click",
+function(){disable_popup()});$("a[class='cancel_enum_editor']").live("click",function(){disable_popup()});$("a[class='add_value']").live("click",function(){$("#enum_editor #values").append("<input type='text' />")});$("#enum_editor input[type='submit']").live("click",function(){var c=[];$.each($("#enum_editor #values input"),function(e,f){val=jQuery.trim(f.value);val!=""&&c.push("'"+val.replace(/\\/g,"\\\\").replace(/'/g,"''")+"'")});var d=$("#enum_editor input[type='hidden']").attr("value");$("input[id='"+
+d+"']").attr("value",c.join(","));disable_popup()});if($("input[type='hidden'][name='table_type']").val()=="table"){var a=$("table[id='tablestructure']");a.find("td[class='browse']").remove();a.find("td[class='primary']").remove();a.find("td[class='unique']").remove();a.find("td[class='index']").remove();a.find("td[class='fulltext']").remove();a.find("th[class='action']").attr("colspan",3);a.find("td[class='more_opts']").show();$(".structure_actions_dropdown").each(function(){var c=$(this),d=c.parent().offset().left+
+c.parent().innerWidth()-c.innerWidth(),e=c.parent().offset().top+c.parent().innerHeight();c.offset({top:e,left:d})});var b=$("select[name='after_field']");$("iframe[class='IE_hack']").width(b.width()).height(b.height()).offset({top:b.offset().top,left:b.offset().left});a.find("td[class='more_opts']").mouseenter(function(){$.browser.msie&&$.browser.version=="6.0"&&$("iframe[class='IE_hack']").show().width(b.width()+4).height(b.height()+4).offset({top:b.offset().top,left:b.offset().left});$(".structure_actions_dropdown").hide();
+$(this).children(".structure_actions_dropdown").show();if($.browser.msie){var c=$(this).offset().left+$(this).innerWidth()-$(this).children(".structure_actions_dropdown").innerWidth(),d=$(this).offset().top+$(this).innerHeight();$(this).children(".structure_actions_dropdown").offset({top:d,left:c})}}).mouseleave(function(){$(this).children(".structure_actions_dropdown").hide();$.browser.msie&&$.browser.version=="6.0"&&$("iframe[class='IE_hack']").hide()})}});
$(document).ready(function(){$(".footnotes").hide();$(".footnotes span").each(function(){$(this).children("sup").remove()});$(".footnotes").css("border","none");$(".footnotes").css("padding","0px");$("sup[class='footnotemarker']").hide();$("img[class='footnotemarker']").show();$("img[class='footnotemarker']").each(function(){var a=$(this).attr("id");a=a.split("_")[1];a=$(".footnotes span[id='footnote_"+a+"']").html();$(this).qtip({content:a,show:{delay:0},hide:{delay:1E3},style:{background:"#ffffcc"}})})});
-function menuResize(){var a=$("#topmenu"),b=a.innerWidth()-5,c=a.find(".submenu"),d=c.outerWidth(true),e=c.find("ul");a=a.find("> li");for(var g=e.find("li"),h=g.length>0,f=h?d:0,j=0,k=0;k<a.length-1;k++){var m=$(a[k]),l=m.outerWidth(true);m.data("width",l);f+=l;if(f>b){f-=l;if(f+d<b)j=k;else{j=k-1;f-=$(a[k-1]).data("width")}break}}if(j>0){for(k=j;k<a.length-1;k++)$(a[k])[h?"prependTo":"appendTo"](e);c.addClass("shown")}else if(h){f-=d;for(k=0;k<g.length;k++){f+=$(g[k]).data("width");if(f+d<b||k==
-g.length-1&&f<b){$(g[k]).insertBefore(c);k==g.length-1&&c.removeClass("shown")}else break}}c.find(".tabactive").length?c.addClass("active").find("> a").removeClass("tab").addClass("tabactive"):c.removeClass("active").find("> a").addClass("tab").removeClass("tabactive")}
+function menuResize(){var a=$("#topmenu"),b=a.innerWidth()-5,c=a.find(".submenu"),d=c.outerWidth(true),e=c.find("ul");a=a.find("> li");for(var f=e.find("li"),j=f.length>0,g=j?d:0,h=0,k=0;k<a.length-1;k++){var m=$(a[k]),l=m.outerWidth(true);m.data("width",l);g+=l;if(g>b){g-=l;if(g+d<b)h=k;else{h=k-1;g-=$(a[k-1]).data("width")}break}}if(h>0){for(k=h;k<a.length-1;k++)$(a[k])[j?"prependTo":"appendTo"](e);c.addClass("shown")}else if(j){g-=d;for(k=0;k<f.length;k++){g+=$(f[k]).data("width");if(g+d<b||k==
+f.length-1&&g<b){$(f[k]).insertBefore(c);k==f.length-1&&c.removeClass("shown")}else break}}c.find(".tabactive").length?c.addClass("active").find("> a").removeClass("tab").addClass("tabactive"):c.removeClass("active").find("> a").addClass("tab").removeClass("tabactive")}
$(function(){var a=$("#topmenu");if(a.length!=0){var b=$("<a />",{href:"#","class":"tab"}).text(PMA_messages.strMore).click(function(d){d.preventDefault()}),c=a.find("li:first-child img");c.length&&c.clone().attr("src",c.attr("src").replace(/\/[^\/]+$/,"/b_more.png")).prependTo(b);b=$("<li />",{"class":"submenu"}).append(b).append($("<ul />")).mouseenter(function(){$(this).find("ul .tabactive").length==0&&$(this).addClass("submenuhover").find("> a").addClass("tabactive")}).mouseleave(function(){$(this).find("ul .tabactive").length==
0&&$(this).removeClass("submenuhover").find("> a").removeClass("tabactive")});a.append(b);$(window).resize(menuResize);menuResize()}});
-$(document).ready(function(){$(".multi_checkbox").live("click",function(a){var b=this.id,c=b.replace("_right","_left"),d=b.replace("_left","_right"),e="";e=b==c?d:c;var g=$("#"+b);b=$("#"+e);if(a.shiftKey){var h=$(".multi_checkbox").index(g);a=$(".multi_checkbox").filter(".last_clicked");var f=$(".multi_checkbox").index(a);$(".multi_checkbox").filter(function(j){return h>f&&j>f&&j<h||f>h&&j<f&&j>h}).each(function(){var j=$(this);g.is(":checked")?j.attr("checked",true):j.attr("checked",false)})}$(".multi_checkbox").removeClass("last_clicked");
-g.addClass("last_clicked");g.is(":checked")?b.attr("checked",true):b.attr("checked",false)})});function PMA_getRowNumber(a){return parseInt(a.split(/row_/)[1])}function PMA_set_status_label(a){$("#"+a).css("display")=="none"?$("#anchor_status_"+a).text("+ "):$("#anchor_status_"+a).text("- ")}
+$(document).ready(function(){$(".multi_checkbox").live("click",function(a){var b=this.id,c=b.replace("_right","_left"),d=b.replace("_left","_right"),e="";e=b==c?d:c;var f=$("#"+b);b=$("#"+e);if(a.shiftKey){var j=$(".multi_checkbox").index(f);a=$(".multi_checkbox").filter(".last_clicked");var g=$(".multi_checkbox").index(a);$(".multi_checkbox").filter(function(h){return j>g&&h>g&&h<j||g>j&&h<g&&h>j}).each(function(){var h=$(this);f.is(":checked")?h.attr("checked",true):h.attr("checked",false)})}$(".multi_checkbox").removeClass("last_clicked");
+f.addClass("last_clicked");f.is(":checked")?b.attr("checked",true):b.attr("checked",false)})});function PMA_getRowNumber(a){return parseInt(a.split(/row_/)[1])}function PMA_set_status_label(a){$("#"+a).css("display")=="none"?$("#anchor_status_"+a).text("+ "):$("#anchor_status_"+a).text("- ")}
function PMA_init_slider(){$(".pma_auto_slider").each(function(a,b){if(!$(b).hasClass("slider_init_done")){$(b).addClass("slider_init_done");$('<span id="anchor_status_'+b.id+'"></span>').insertBefore(b);PMA_set_status_label(b.id);$('<a href="#'+b.id+'" id="anchor_'+b.id+'">'+b.title+"</a>").insertBefore(b).click(function(){$("#"+b.id).toggle("clip",function(){PMA_set_status_label(b.id)});return false})}})}
$(document).ready(function(){$(".vpointer").live("hover",function(){var a=$(this);a=PMA_getRowNumber(a.attr("class"));$(".vpointer").filter(".row_"+a).toggleClass("hover")})});
$(document).ready(function(){$(".vmarker").live("click",function(){var a=$(this);a=PMA_getRowNumber(a.attr("class"));$(".vmarker").filter(".row_"+a).toggleClass("marked")});$("#visual_builder_anchor").show();$("#tableslistcontainer").find("#pageselector").live("change",function(){$(this).parent("form").submit()});$("#navidbpageselector").find("#pageselector").live("change",function(){$(this).parent("form").submit()});$("#body_browse_foreigners").find("#pageselector").live("change",function(){$(this).closest("form").submit()});
-$(".jsversioncheck").length>0&&function(){var a=document.createElement("script");a.type="text/javascript";a.async=true;a.src="http://www.phpmyadmin.net/home_page/version.js";a.onload=PMA_current_version;var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)}();PMA_init_slider();$(".clickprevimage").css("color",function(){return $("a").css("color")}).css("cursor",function(){return $("a").css("cursor")}).live("click",function(){$this_span=$(this);$this_span.closest("td").is(".inline_edit_anchor")||
-$this_span.parent().find("input:image").click()})});function escapeHtml(a){return a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")};
+$(".jsversioncheck").length>0&&$.getScript("http://www.phpmyadmin.net/home_page/version.js",PMA_current_version);PMA_init_slider();$(".clickprevimage").css("color",function(){return $("a").css("color")}).css("cursor",function(){return $("a").css("cursor")}).live("click",function(){$this_span=$(this);$this_span.closest("td").is(".inline_edit_anchor")||$this_span.parent().find("input:image").click()})});
+function escapeHtml(a){return a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")};
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/js/sql.js
^
|
@@ -19,13 +19,14 @@
b=a.parent("tr").find(".inline_edit");q=a.parent("tr").find(".where_clause").val()}b.each(function(){var f=$(this).html(),c=$(this),i=getFieldName(c,d),h=c.find("a").text(),t=c.find("a").attr("title"),s=c.text();if(c.is(":not(.not_null)")){c.html('<div class="null_div">Null :<input type="checkbox" class="checkbox_null_'+i+"_"+l+'"></div>');c.is(".null")&&$(".checkbox_null_"+i+"_"+l).attr("checked",true);if(c.is(".enum, .set"))c.find("select").live("change",function(){$(".checkbox_null_"+i+"_"+l).attr("checked",
false)});else if(c.is(".relation")){c.find("select").live("change",function(){$(".checkbox_null_"+i+"_"+l).attr("checked",false)});c.find(".browse_foreign").live("click",function(){$(".checkbox_null_"+i+"_"+l).attr("checked",false)})}else c.find("textarea").live("keypress",function(n){n.which!=0&&$(".checkbox_null_"+i+"_"+l).attr("checked",false)});$(".checkbox_null_"+i+"_"+l).bind("click",function(){if(c.is(".enum"))c.find("select").attr("value","");else if(c.is(".set"))c.find("select").find("option").each(function(){$(this).attr("selected",
false)});else if(c.is(".relation"))c.find("select").length>0?c.find("select").attr("value",""):c.find("span.curr_value").empty();else c.find("textarea").val("")})}else c.html('<div class="null_div"></div>');if(c.is(":not(.truncated, .transformed, .relation, .enum, .set, .null)")){value=f.replace("<br>","\n");c.append("<textarea>"+value+"</textarea>");c.data("original_data",f)}else if(c.is(".truncated, .transformed")){h="SELECT `"+i+"` FROM `"+window.parent.table+"` WHERE "+PMA_urldecode(q);$.post("sql.php",
-{token:window.parent.token,db:window.parent.db,ajax_request:true,sql_query:h,inline_edit:true},function(n){n.success==true&&a.hasClass("inline_edit_active")?c.append("<textarea>"+n.value+"</textarea>"):PMA_ajaxShowMessage(n.error)});c.data("original_data",f)}else if(c.is(".relation")){h={ajax_request:true,get_relational_values:true,db:window.parent.db,table:window.parent.table,column:i,token:window.parent.token,curr_value:h,relation_key_or_display_column:t};$.post("sql.php",h,function(n){a.hasClass("inline_edit_active")&&
-c.append(n.dropdown)});c.data("original_data",f)}else if(c.is(".enum")){h={ajax_request:true,get_enum_values:true,db:window.parent.db,table:window.parent.table,column:i,token:window.parent.token,curr_value:s};$.post("sql.php",h,function(n){a.hasClass("inline_edit_active")&&c.append(n.dropdown)});c.data("original_data",f)}else if(c.is(".set")){h={ajax_request:true,get_set_values:true,db:window.parent.db,table:window.parent.table,column:i,token:window.parent.token,curr_value:s};$.post("sql.php",h,function(n){a.hasClass("inline_edit_active")&&
-c.append(n.select)});c.data("original_data",f)}else if(c.is(".null")){c.append("<textarea></textarea>");c.data("original_data","NULL")}})});$(".inline_edit_active span a").live("click",function(b){b.preventDefault();var a=$(this).parent().parent(),e="";if(d=="vertical")var g=a.index(),m=a.parents("tbody").find("tr").find(".inline_edit:nth("+g+")"),k=a.parents("tbody").find("tr").find(".where_clause:nth("+g+")").val();else{m=a.parent("tr").find(".inline_edit");k=a.parent("tr").find(".where_clause").val()}b=
-a.is(".nonunique")?0:1;var r={},l=$("#relational_display_K").attr("checked")?"K":"D",q={},f=false,c="UPDATE `"+window.parent.table+"` SET ",i=false,h="";m.each(function(){var j=$(this),o=getFieldName(j,d),p={};if(j.is(".transformed"))f=true;var u=true;if(j.find("input:checkbox").is(":checked")){c+=" `"+o+"`=NULL , ";i=true}else{if(j.is(":not(.relation, .enum, .set, .bit)")){p[o]=j.find("textarea").val();j.is(".transformed")&&$.extend(q,p)}else if(j.is(".bit")){p[o]="0b"+j.find("textarea").val();u=
-false}else if(j.is(".set")){e=j.find("select");p[o]=e.map(function(){return $(this).val()}).get().join(",")}else{e=j.find("select");if(e.length!=0)p[o]=e.val();e=j.find("span.curr_value");if(e.length!=0)p[o]=e.text();j.is(".relation")&&$.extend(r,p)}if(k.indexOf(o)>-1)h+="`"+window.parent.table+"`.`"+o+"` = '"+p[o].replace(/'/g,"''")+"' AND ";if(p[o]!=j.data("original_data")){c+=u==true?" `"+o+"`='"+p[o].replace(/'/g,"''")+"', ":" `"+o+"`="+p[o].replace(/'/g,"''")+", ";i=true}}});c=c.replace(/,\s$/,
-"");c=c.replace(/\\/g,"\\\\");h=h.substring(0,h.length-5);h=PMA_urlencode(h);c+=" WHERE "+PMA_urldecode(k);c+=" LIMIT 1";var t=$.param(r),s=$.param(q),n=$(this).parent(),v=$(this);i?$.post("tbl_replace.php",{ajax_request:true,sql_query:c,disp_direction:d,token:window.parent.token,db:window.parent.db,table:window.parent.table,clause_is_unique:b,where_clause:k,rel_fields_list:t,do_transformations:f,transform_fields_list:s,relational_display:l,"goto":"sql.php",submit_type:"save"},function(j){if(j.success==
-true){PMA_ajaxShowMessage(j.message);d=="vertical"?a.parents("tbody").find("tr").find(".where_clause:nth("+g+")").attr("value",h):a.parent("tr").find(".where_clause").attr("value",h);$("#result_query").remove();typeof j.sql_query!="undefined"&&$("#sqlqueryresults").prepend(j.sql_query);PMA_unInlineEditRow(n,v,a,m,j,d)}else PMA_ajaxShowMessage(j.error)}):PMA_unInlineEditRow(n,v,a,m,"",d)})},"top.frame_content");
+{token:window.parent.token,server:window.parent.server,db:window.parent.db,ajax_request:true,sql_query:h,inline_edit:true},function(n){n.success==true&&a.hasClass("inline_edit_active")?c.append("<textarea>"+n.value+"</textarea>"):PMA_ajaxShowMessage(n.error)});c.data("original_data",f)}else if(c.is(".relation")){h={ajax_request:true,get_relational_values:true,server:window.parent.server,db:window.parent.db,table:window.parent.table,column:i,token:window.parent.token,curr_value:h,relation_key_or_display_column:t};
+$.post("sql.php",h,function(n){a.hasClass("inline_edit_active")&&c.append(n.dropdown)});c.data("original_data",f)}else if(c.is(".enum")){h={ajax_request:true,get_enum_values:true,server:window.parent.server,db:window.parent.db,table:window.parent.table,column:i,token:window.parent.token,curr_value:s};$.post("sql.php",h,function(n){a.hasClass("inline_edit_active")&&c.append(n.dropdown)});c.data("original_data",f)}else if(c.is(".set")){h={ajax_request:true,get_set_values:true,server:window.parent.server,
+db:window.parent.db,table:window.parent.table,column:i,token:window.parent.token,curr_value:s};$.post("sql.php",h,function(n){a.hasClass("inline_edit_active")&&c.append(n.select)});c.data("original_data",f)}else if(c.is(".null")){c.append("<textarea></textarea>");c.data("original_data","NULL")}})});$(".inline_edit_active span a").live("click",function(b){b.preventDefault();var a=$(this).parent().parent(),e="";if(d=="vertical")var g=a.index(),m=a.parents("tbody").find("tr").find(".inline_edit:nth("+
+g+")"),k=a.parents("tbody").find("tr").find(".where_clause:nth("+g+")").val();else{m=a.parent("tr").find(".inline_edit");k=a.parent("tr").find(".where_clause").val()}b=a.is(".nonunique")?0:1;var r={},l=$("#relational_display_K").attr("checked")?"K":"D",q={},f=false,c="UPDATE `"+window.parent.table+"` SET ",i=false,h="";m.each(function(){var j=$(this),o=getFieldName(j,d),p={};if(j.is(".transformed"))f=true;var u=true;if(j.find("input:checkbox").is(":checked")){c+=" `"+o+"`=NULL , ";i=true}else{if(j.is(":not(.relation, .enum, .set, .bit)")){p[o]=
+j.find("textarea").val();j.is(".transformed")&&$.extend(q,p)}else if(j.is(".bit")){p[o]="0b"+j.find("textarea").val();u=false}else if(j.is(".set")){e=j.find("select");p[o]=e.map(function(){return $(this).val()}).get().join(",")}else{e=j.find("select");if(e.length!=0)p[o]=e.val();e=j.find("span.curr_value");if(e.length!=0)p[o]=e.text();j.is(".relation")&&$.extend(r,p)}if(k.indexOf(o)>-1)h+="`"+window.parent.table+"`.`"+o+"` = '"+p[o].replace(/'/g,"''")+"' AND ";if(p[o]!=j.data("original_data")){c+=
+u==true?" `"+o+"`='"+p[o].replace(/'/g,"''")+"', ":" `"+o+"`="+p[o].replace(/'/g,"''")+", ";i=true}}});c=c.replace(/,\s$/,"");c=c.replace(/\\/g,"\\\\");h=h.substring(0,h.length-5);h=PMA_urlencode(h);c+=" WHERE "+PMA_urldecode(k);c+=" LIMIT 1";var t=$.param(r),s=$.param(q),n=$(this).parent(),v=$(this);i?$.post("tbl_replace.php",{ajax_request:true,sql_query:c,disp_direction:d,token:window.parent.token,server:window.parent.server,db:window.parent.db,table:window.parent.table,clause_is_unique:b,where_clause:k,
+rel_fields_list:t,do_transformations:f,transform_fields_list:s,relational_display:l,"goto":"sql.php",submit_type:"save"},function(j){if(j.success==true){PMA_ajaxShowMessage(j.message);d=="vertical"?a.parents("tbody").find("tr").find(".where_clause:nth("+g+")").attr("value",h):a.parent("tr").find(".where_clause").attr("value",h);$("#result_query").remove();typeof j.sql_query!="undefined"&&$("#sqlqueryresults").prepend(j.sql_query);PMA_unInlineEditRow(n,v,a,m,j,d)}else PMA_ajaxShowMessage(j.error)}):
+PMA_unInlineEditRow(n,v,a,m,"",d)})},"top.frame_content");
function PMA_unInlineEditRow(d,b,a,e,g,m){d.find("a, br").remove();d.append($data_a.clone());a.removeClass("inline_edit_active").addClass("inline_edit_anchor");a.parent("tr").removeClass("noclick");m!="vertical"?a.parent("tr").removeClass("hover").find("td").removeClass("hover"):a.parents("tbody").find("tr").find("td:eq("+a.index()+")").removeClass("marked hover");e.each(function(){$this_sibling=$(this);if($this_sibling.find("input:checkbox").is(":checked")){$this_sibling.html("NULL");$this_sibling.addClass("null")}else{$this_sibling.removeClass("null");
if($this_sibling.is(":not(.relation, .enum, .set)")){var k=$this_sibling.find("textarea").val();if($this_sibling.is(".transformed")){var r=getFieldName($this_sibling,m);typeof g.transformations!="undefined"&&$.each(g.transformations,function(q,f){if(q==r){if($this_sibling.is(".text_plain, .application_octetstream"))k=f;else{var c=$this_sibling.find("textarea").val();k=$(f).append(c)}return false}})}}else{var l=k="";$test_element=$this_sibling.find("select");if($test_element.length!=0)l=$test_element.val();
$test_element=$this_sibling.find("span.curr_value");if($test_element.length!=0)l=$test_element.text();if($this_sibling.is(".relation")){r=getFieldName($this_sibling,m);typeof g.relations!="undefined"&&$.each(g.relations,function(q,f){if(q==r){k=$(f);return false}})}else if($this_sibling.is(".enum"))k=l;else if($this_sibling.is(".set"))if(l!=null){$.each(l,function(q,f){k=k+f+","});k=k.substring(0,k.length-1)}}$this_sibling.text(k)}})}
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/js/tbl_change.js
^
|
@@ -1,5 +1,5 @@
-function nullify(a,c,b,d){c=document.forms.insertForm;if(typeof c.elements["funcs"+d+"["+b+"]"]!="undefined")c.elements["funcs"+d+"["+b+"]"].selectedIndex=-1;if(a==1||a==3||a==4)c.elements["field_"+b+d+"[]"].selectedIndex=-1;else if(a==2){a=c.elements["field_"+b+d+"[]"];if(a.checked)a.checked=false;else{b=a.length;for(d=0;d<b;d++)a[d].checked=false}}else if(a==6)c.elements["field_"+b+d+"[]"].value="";else c.elements["fields"+d+"["+b+"]"].value="";return true}
-function daysInFebruary(a){return a%4==0&&(a%100!=0||a%400==0)?29:28}function fractionReplace(a){a=parseInt(a);var c="00";switch(a){case 1:c="01";break;case 2:c="02";break;case 3:c="03";break;case 4:c="04";break;case 5:c="05";break;case 6:c="06";break;case 7:c="07";break;case 8:c="08";break;case 9:c="09"}return c}
+function nullify(a,c,b,d){c=document.forms.insertForm;if(typeof c.elements["funcs"+d+"["+b+"]"]!="undefined")c.elements["funcs"+d+"["+b+"]"].selectedIndex=-1;if(a==1)c.elements["fields"+d+"["+b+"]"][1].selectedIndex=-1;else if(a==2){a=c.elements["fields"+d+"["+b+"]"];if(a.checked)a.checked=false;else{b=a.length;for(d=0;d<b;d++)a[d].checked=false}}else if(a==3)c.elements["fields"+d+"["+b+"][]"].selectedIndex=-1;else if(a==4)c.elements["fields"+d+"["+b+"]"].selectedIndex=-1;else c.elements["fields"+
+d+"["+b+"]"].value="";return true}function daysInFebruary(a){return a%4==0&&(a%100!=0||a%400==0)?29:28}function fractionReplace(a){a=parseInt(a);var c="00";switch(a){case 1:c="01";break;case 2:c="02";break;case 3:c="03";break;case 4:c="04";break;case 5:c="05";break;case 6:c="06";break;case 7:c="07";break;case 8:c="08";break;case 9:c="09"}return c}
function isDate(a,c){a=a.replace(/[.|*|^|+|//|@]/g,"-");for(var b=a.split("-"),d=0;d<b.length;d++)if(b[d].length==1)b[d]=fractionReplace(b[d]);a=b.join("-");b=2;dtexp=RegExp(/^([0-9]{4})-(((01|03|05|07|08|10|12)-((0[0-9])|([1-2][0-9])|(3[0-1])))|((02|04|06|09|11)-((0[0-9])|([1-2][0-9])|30)))$/);if(a.length==8){dtexp=RegExp(/^([0-9]{2})-(((01|03|05|07|08|10|12)-((0[0-9])|([1-2][0-9])|(3[0-1])))|((02|04|06|09|11)-((0[0-9])|([1-2][0-9])|30)))$/);b=0}if(dtexp.test(a)){d=parseInt(a.substring(b+3,b+5));
var e=parseInt(a.substring(b+6,b+8)),g=parseInt(a.substring(0,b+2));if(d==2&&e>daysInFebruary(g))return false;if(a.substring(0,b+2).length==2)g=a.substring(0,b+2).length==2?parseInt("20"+a.substring(0,b+2)):parseInt("19"+a.substring(0,b+2));if(c==true){if(g<1978)return false;if(g>2038||g>2037&&e>19&&d>=1||g>2037&&d>1)return false}}else return false;return true}
function isTime(a){a=a.split(":");for(var c=0;c<a.length;c++)if(a[c].length==1)a[c]=fractionReplace(a[c]);a=a.join(":");tmexp=RegExp(/^(([0-1][0-9])|(2[0-3])):((0[0-9])|([1-5][0-9])):((0[0-9])|([1-5][0-9]))$/);if(!tmexp.test(a))return false;return true}
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/js/tbl_structure.js
^
|
@@ -1,4 +1,4 @@
-$(document).ready(function(){$(".drop_column_anchor").live("click",function(a){a.preventDefault();a=window.parent.table;var e=$(this).parents("tr"),c=$(e).children("th").children("label").text();a=PMA_messages.strDoYouReally+" :\n ALTER TABLE `"+escapeHtml(a)+"` DROP `"+escapeHtml(c)+"`";$(this).PMA_confirm(a,$(this).attr("href"),function(b){PMA_ajaxShowMessage(PMA_messages.strDroppingColumn);$.get(b,{is_js_confirmed:1,ajax_request:true},function(d){if(d.success==true){PMA_ajaxShowMessage(d.message);
-$(e).hide("medium").remove()}else PMA_ajaxShowMessage(PMA_messages.strErrorProcessingRequest+" : "+d.error)})})});$(".action_primary a").live("click",function(a){a.preventDefault();a=window.parent.table;var e=$(this).parents("tr").children("th").children("label").text();a=PMA_messages.strDoYouReally+" :\n ALTER TABLE `"+escapeHtml(a)+"` ADD PRIMARY KEY(`"+escapeHtml(e)+"`)";$(this).PMA_confirm(a,$(this).attr("href"),function(c){PMA_ajaxShowMessage(PMA_messages.strAddingPrimaryKey);$.get(c,{is_js_confirmed:1,
-ajax_request:true},function(b){if(b.success==true){PMA_ajaxShowMessage(b.message);$(this).remove();typeof b.reload!="undefined"&&window.parent.frame_content.location.reload()}else PMA_ajaxShowMessage(PMA_messages.strErrorProcessingRequest+" : "+b.error)})})});$(".drop_primary_key_index_anchor").live("click",function(a){a.preventDefault();$anchor=$(this);a=$anchor.parents("tr");for(var e=$anchor.parents("td").attr("rowspan")||1,c=a,b=1,d=a.next();b<e;b++,d=d.next())c=c.add(d);a=a.children("td").children(".drop_primary_key_index_msg").val();
-$anchor.PMA_confirm(a,$anchor.attr("href"),function(g){PMA_ajaxShowMessage(PMA_messages.strDroppingPrimaryKeyIndex);$.get(g,{is_js_confirmed:1,ajax_request:true},function(f){if(f.success==true){PMA_ajaxShowMessage(f.message);c.hide("medium").remove()}else PMA_ajaxShowMessage(PMA_messages.strErrorProcessingRequest+" : "+f.error)})})})});
+$(document).ready(function(){$(".drop_column_anchor").live("click",function(a){a.preventDefault();a=window.parent.table;var d=$(this).parents("tr"),c=$(d).children("th").children("label").text(),b=$("select[name='after_field'] option[value='"+c+"']");a=PMA_messages.strDoYouReally+" :\n ALTER TABLE `"+escapeHtml(a)+"` DROP `"+escapeHtml(c)+"`";$(this).PMA_confirm(a,$(this).attr("href"),function(e){PMA_ajaxShowMessage(PMA_messages.strDroppingColumn);$.get(e,{is_js_confirmed:1,ajax_request:true},function(f){if(f.success==
+true){PMA_ajaxShowMessage(f.message);b.remove();$(d).hide("medium").remove()}else PMA_ajaxShowMessage(PMA_messages.strErrorProcessingRequest+" : "+f.error)})})});$(".action_primary a").live("click",function(a){a.preventDefault();a=window.parent.table;var d=$(this).parents("tr").children("th").children("label").text();a=PMA_messages.strDoYouReally+" :\n ALTER TABLE `"+escapeHtml(a)+"` ADD PRIMARY KEY(`"+escapeHtml(d)+"`)";$(this).PMA_confirm(a,$(this).attr("href"),function(c){PMA_ajaxShowMessage(PMA_messages.strAddingPrimaryKey);
+$.get(c,{is_js_confirmed:1,ajax_request:true},function(b){if(b.success==true){PMA_ajaxShowMessage(b.message);$(this).remove();typeof b.reload!="undefined"&&window.parent.frame_content.location.reload()}else PMA_ajaxShowMessage(PMA_messages.strErrorProcessingRequest+" : "+b.error)})})});$(".drop_primary_key_index_anchor").live("click",function(a){a.preventDefault();$anchor=$(this);a=$anchor.parents("tr");for(var d=$anchor.parents("td").attr("rowspan")||1,c=a,b=1,e=a.next();b<d;b++,e=e.next())c=c.add(e);
+a=a.children("td").children(".drop_primary_key_index_msg").val();$anchor.PMA_confirm(a,$anchor.attr("href"),function(f){PMA_ajaxShowMessage(PMA_messages.strDroppingPrimaryKeyIndex);$.get(f,{is_js_confirmed:1,ajax_request:true},function(g){if(g.success==true){PMA_ajaxShowMessage(g.message);c.hide("medium").remove()}else PMA_ajaxShowMessage(PMA_messages.strErrorProcessingRequest+" : "+g.error)})})})});
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/libraries/Config.class.php
^
|
@@ -96,7 +96,7 @@
*/
function checkSystem()
{
- $this->set('PMA_VERSION', '3.4.7.1');
+ $this->set('PMA_VERSION', '3.4.8');
/**
* @deprecated
*/
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/libraries/Error.class.php
^
|
@@ -175,7 +175,7 @@
$this->getMessage() .
$this->getFile() .
$this->getLine() .
- $this->getBacktrace()
+ serialize($this->getBacktrace())
);
}
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/libraries/auth/cookie.auth.lib.php
^
|
@@ -549,6 +549,10 @@
$cfg['Server']['user'] = $GLOBALS['PHP_AUTH_USER'];
$cfg['Server']['password'] = $GLOBALS['PHP_AUTH_PW'];
+ // Avoid showing the password in phpinfo()'s output
+ unset($GLOBALS['PHP_AUTH_PW']);
+ unset($_SERVER['PHP_AUTH_PW']);
+
$_SESSION['last_access_time'] = time();
// Name and password cookies need to be refreshed each time
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/libraries/auth/http.auth.lib.php
^
|
@@ -207,6 +207,10 @@
$cfg['Server']['user'] = $PHP_AUTH_USER;
$cfg['Server']['password'] = $PHP_AUTH_PW;
+ // Avoid showing the password in phpinfo()'s output
+ unset($GLOBALS['PHP_AUTH_PW']);
+ unset($_SERVER['PHP_AUTH_PW']);
+
return true;
} // end of the 'PMA_auth_set_user()' function
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/libraries/common.lib.php
^
|
@@ -1059,13 +1059,10 @@
} else {
// Parse SQL if needed
$parsed_sql = PMA_SQP_parse($query_base);
- if (PMA_SQP_isError()) {
- unset($parsed_sql);
- }
}
// Analyze it
- if (isset($parsed_sql)) {
+ if (isset($parsed_sql) && ! PMA_SQP_isError()) {
$analyzed_display_query = PMA_SQP_analyze($parsed_sql);
// Here we append the LIMIT added for navigation, to
// enable its display. Adding it higher in the code
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/libraries/db_info.inc.php
^
|
@@ -75,6 +75,10 @@
// remove InnoDB comment from end, just the minimal part (*? is non greedy)
$table['Comment'] = preg_replace('@; InnoDB free:.*?$@', '', $table['Comment']);
}
+ // views have VIEW as comment so it's not a real comment put by a user
+ if ('VIEW' == $table['Comment']) {
+ $table['Comment'] = '';
+ }
if (empty($table['Comment'])) {
$table['Comment'] = $table['Name'];
} else {
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/libraries/import/ods.php
^
|
@@ -42,9 +42,6 @@
return;
}
-ini_set('memory_limit', '128M');
-set_time_limit(120);
-
$i = 0;
$len = 0;
$buffer = "";
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/libraries/import/xml.php
^
|
@@ -35,9 +35,6 @@
return;
}
-ini_set('memory_limit', '128M');
-set_time_limit(120);
-
$i = 0;
$len = 0;
$buffer = "";
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/libraries/language_stats.inc.php
^
|
@@ -8,7 +8,7 @@
'az' => 26,
'be@latin' => 48,
'be' => 48,
- 'bg' => 65,
+ 'bg' => 66,
'bn' => 42,
'br' => 31,
'bs' => 26,
@@ -21,7 +21,7 @@
'en_GB' => 99,
'es' => 99,
'et' => 44,
- 'eu' => 27,
+ 'eu' => 28,
'fa' => 19,
'fi' => 79,
'fr' => 99,
@@ -29,7 +29,7 @@
'he' => 27,
'hi' => 77,
'hr' => 48,
- 'hu' => 81,
+ 'hu' => 83,
'id' => 48,
'it' => 99,
'ja' => 99,
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/libraries/select_lang.lib.php
^
|
@@ -373,7 +373,7 @@
/**
* Load gettext functions.
*/
-require './libraries/php-gettext/gettext.inc';
+require GETTEXT_INC;
/**
* @global string interface language
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/libraries/server_synchronize.lib.php
^
|
@@ -1,27 +1,27 @@
-<?php
+<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
-* PMA_getMatchingTables places matching tables in source
+* PMA_getMatchingTables places matching tables in source
* and target databases in $matching_tables array whereas
* $uncommon_source_tables array gets the tables present in
* source database but are absent from target database.
* Criterion for matching tables is just comparing their names.
-*
-* @param $trg_tables array of target database table names,
-* @param $src_tables array of source database table names,
-*
-* @param &$matching_tables empty array passed by reference to save names of matching tables,
-* @param &$uncommon_source_tables empty array passed by reference to save names of tables present in
+*
+* @param $trg_tables array of target database table names,
+* @param $src_tables array of source database table names,
+*
+* @param &$matching_tables empty array passed by reference to save names of matching tables,
+* @param &$uncommon_source_tables empty array passed by reference to save names of tables present in
* source database but absent from target database
*/
-
+
function PMA_getMatchingTables($trg_tables, $src_tables, &$matching_tables, &$uncommon_source_tables)
{
- for($k=0; $k< sizeof($src_tables); $k++) {
- $present_in_target = false;
- for($l=0; $l < sizeof($trg_tables); $l++) {
- if ($src_tables[$k] === $trg_tables[$l]) {
+ for($k=0; $k< sizeof($src_tables); $k++) {
+ $present_in_target = false;
+ for($l=0; $l < sizeof($trg_tables); $l++) {
+ if ($src_tables[$k] === $trg_tables[$l]) {
$present_in_target = true;
$matching_tables[] = $src_tables[$k];
}
@@ -35,30 +35,30 @@
/**
* PMA_getNonMatchingTargetTables() places tables present
* in target database but are absent from source database
-*
-* @param $trg_tables array of target database table names,
-*
-* @param $matching_tables $matching tables array containing names of matching tables,
-* @param &$uncommon_target_tables empty array passed by reference to save names of tables presnet in
+*
+* @param $trg_tables array of target database table names,
+*
+* @param $matching_tables $matching tables array containing names of matching tables,
+* @param &$uncommon_target_tables empty array passed by reference to save names of tables presnet in
* target database but absent from source database
*/
function PMA_getNonMatchingTargetTables($trg_tables, $matching_tables, &$uncommon_target_tables)
{
for($c=0; $c<sizeof($trg_tables) ;$c++) {
- $match = false;
+ $match = false;
for($d=0; $d < sizeof($matching_tables); $d++)
{
if ($trg_tables[$c] === $matching_tables[$d]) {
$match=true;
- }
+ }
}
if ($match === false) {
$uncommon_target_tables[] = $trg_tables[$c];
- }
+ }
}
}
-
+
/**
* PMA_dataDiffInTables() finds the difference in source and target matching tables by
* first comparing source table's primary key entries with target table enteries.
@@ -67,32 +67,32 @@
* field values also, in order to check whether update is required or not.
* If update is required, it is placed in $update_array
* Otherwise that entry is placed in the $insert_array.
- *
+ *
* @uses PMA_DBI_get_fields()
* @uses PMA_DBI_get_column_values()
* @uses PMA_DBI_fetch_result()
- *
+ *
* @param $src_db name of source database
* @param $trg_db name of target database
* @param $src_link connection established with source server
* @param $trg_link connection established with target server
- * @param $index Index of a table from $matching_table array
- *
- * @param $update_array A three dimensional array passed by reference to
+ * @param $index Index of a table from $matching_table array
+ *
+ * @param $update_array A three dimensional array passed by reference to
* contain updates required for each matching table
- * @param $insert_array A three dimensional array passed by reference to
+ * @param $insert_array A three dimensional array passed by reference to
* contain inserts required for each matching table
- * @param $fields_num A two dimensional array passed by reference to
+ * @param $fields_num A two dimensional array passed by reference to
* contain number of fields for each matching table
* @param $matching_table array containing matching table names
- *
+ *
* @param $matching_tables_fields A two dimensional array passed by reference to contain names of fields for each matching table
- *
+ *
* @param $matching_tables_keys A two dimensional array passed by reference to contain names of keys for each matching table
- */
+ */
function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link, &$matching_table, &$matching_tables_fields,
&$update_array, &$insert_array, &$delete_array, &$fields_num, $matching_table_index, &$matching_tables_keys)
-{
+{
if (isset($matching_table[$matching_table_index])) {
$fld = array();
$fld_results = PMA_DBI_get_fields($src_db, $matching_table[$matching_table_index], $src_link);
@@ -104,80 +104,80 @@
$is_key[] = $field_name;
}
$fld[] = $field_name;
- }
+ }
}
- $matching_tables_fields[$matching_table_index] = $fld;
+ $matching_tables_fields[$matching_table_index] = $fld;
$fields_num[$matching_table_index] = sizeof($fld);
$matching_tables_keys[$matching_table_index] = $is_key;
-
- $source_result_set = PMA_DBI_get_column_values($src_db, $matching_table[$matching_table_index], $is_key, $src_link);
+
+ $source_result_set = PMA_DBI_get_column_values($src_db, $matching_table[$matching_table_index], $is_key, $src_link);
$source_size = sizeof($source_result_set);
-
+
$trg_fld_results = PMA_DBI_get_fields($trg_db, $matching_table[$matching_table_index], $trg_link);
$all_keys_match = true;
$trg_keys = array();
-
+
if (isset($trg_fld_results)) {
foreach ($trg_fld_results as $each_field) {
if ($each_field['Key'] == 'PRI') {
- $trg_keys[] = $each_field['Field'];
+ $trg_keys[] = $each_field['Field'];
if (! (in_array($each_field['Field'], $is_key))) {
$all_keys_match = false;
- }
- }
- }
+ }
+ }
+ }
}
$update_row = 0;
$insert_row = 0;
$update_field = 0;
$insert_field = 0;
- $starting_index = 0;
-
- for ($j = 0; $j < $source_size; $j++) {
+ $starting_index = 0;
+
+ for ($j = 0; $j < $source_size; $j++) {
$starting_index = 0;
- $update_field = 0;
+ $update_field = 0;
if (isset($source_result_set[$j]) && ($all_keys_match)) {
// Query the target server to see which rows already exist
- $trg_select_query = "SELECT * FROM " . PMA_backquote($trg_db) . "."
+ $trg_select_query = "SELECT * FROM " . PMA_backquote($trg_db) . "."
. PMA_backquote($matching_table[$matching_table_index]) . " WHERE ";
-
+
if (sizeof($is_key) == 1) {
- $trg_select_query .= $is_key[0]. "='" . $source_result_set[$j] . "'";
+ $trg_select_query .= PMA_backquote($is_key[0]). "='" . $source_result_set[$j] . "'";
} elseif (sizeof($is_key) > 1){
for ($k=0; $k < sizeof($is_key); $k++) {
- $trg_select_query .= $is_key[$k] . "='" . $source_result_set[$j][$is_key[$k]] . "'";
+ $trg_select_query .= PMA_backquote($is_key[$k]) . "='" . $source_result_set[$j][$is_key[$k]] . "'";
if ($k < (sizeof($is_key)-1)){
- $trg_select_query .= " AND ";
+ $trg_select_query .= " AND ";
}
- }
+ }
}
-
+
$target_result_set = PMA_DBI_fetch_result($trg_select_query, null, null, $trg_link);
if ($target_result_set) {
// Fetch the row from the source server to do a comparison
- $src_select_query = "SELECT * FROM " . PMA_backquote($src_db) . "."
+ $src_select_query = "SELECT * FROM " . PMA_backquote($src_db) . "."
. PMA_backquote($matching_table[$matching_table_index]) . " WHERE ";
-
+
if (sizeof($is_key) == 1) {
- $src_select_query .= $is_key[0] . "='" . $source_result_set[$j] . "'";
+ $src_select_query .= PMA_backquote($is_key[0]) . "='" . $source_result_set[$j] . "'";
} else if(sizeof($is_key) > 1){
for ($k=0; $k< sizeof($is_key); $k++) {
- $src_select_query .= $is_key[$k] . "='" . $source_result_set[$j][$is_key[$k]] . "'";
+ $src_select_query .= PMA_backquote($is_key[$k]) . "='" . $source_result_set[$j][$is_key[$k]] . "'";
if ($k < (sizeof($is_key) - 1)){
- $src_select_query .= " AND ";
+ $src_select_query .= " AND ";
}
}
- }
-
+ }
+
$src_result_set = PMA_DBI_fetch_result($src_select_query, null, null, $src_link);
-
+
/**
* Comparing each corresponding field of the source and target matching rows.
- * Placing the primary key, value of primary key, field to be updated, and the
- * new value of field to be updated in each row of the update array.
+ * Placing the primary key, value of primary key, field to be updated, and the
+ * new value of field to be updated in each row of the update array.
*/
for ($m = 0; ($m < $fields_num[$matching_table_index]) && ($starting_index == 0) ; $m++) {
if (isset($src_result_set[0][$fld[$m]])) {
@@ -187,19 +187,19 @@
if ($source_result_set[$j]) {
$update_array[$matching_table_index][$update_row][$is_key[0]] = $source_result_set[$j];
}
- } elseif (sizeof($is_key) > 1) {
+ } elseif (sizeof($is_key) > 1) {
for ($n=0; $n < sizeof($is_key); $n++) {
if (isset($src_result_set[0][$is_key[$n]])) {
$update_array[$matching_table_index][$update_row][$is_key[$n]] = $src_result_set[0][$is_key[$n]];
}
}
}
-
+
$update_array[$matching_table_index][$update_row][$update_field] = $fld[$m];
-
+
$update_field++;
if (isset($src_result_set[0][$fld[$m]])) {
- $update_array[$matching_table_index][$update_row][$update_field] = $src_result_set[0][$fld[$m]];
+ $update_array[$matching_table_index][$update_row][$update_field] = $src_result_set[0][$fld[$m]];
$update_field++;
}
$starting_index = $m;
@@ -209,21 +209,21 @@
if (sizeof($is_key) == 1) {
if ($source_result_set[$j]) {
$update_array[$matching_table_index][$update_row][$is_key[0]] = $source_result_set[$j];
-
+
}
- } elseif (sizeof($is_key) > 1) {
+ } elseif (sizeof($is_key) > 1) {
for ($n = 0; $n < sizeof($is_key); $n++) {
if (isset($src_result_set[0][$is_key[$n]])) {
$update_array[$matching_table_index][$update_row][$is_key[$n]] = $src_result_set[0][$is_key[$n]];
}
}
}
-
+
$update_array[$matching_table_index][$update_row][$update_field] = $fld[$m];
-
+
$update_field++;
if (isset($src_result_set[0][$fld[$m]])) {
- $update_array[$matching_table_index][$update_row][$update_field] = $src_result_set[0][$fld[$m]];
+ $update_array[$matching_table_index][$update_row][$update_field] = $src_result_set[0][$fld[$m]];
$update_field++;
}
$starting_index = $m;
@@ -232,28 +232,28 @@
}
}
for ($m = $starting_index + 1; $m < $fields_num[$matching_table_index] ; $m++)
- {
+ {
if (isset($src_result_set[0][$fld[$m]])) {
- if (isset($target_result_set[0][$fld[$m]])) {
+ if (isset($target_result_set[0][$fld[$m]])) {
if (($src_result_set[0][$fld[$m]] != $target_result_set[0][$fld[$m]]) && (!(in_array($fld[$m], $is_key)))) {
- $update_row--;
+ $update_row--;
$update_array[$matching_table_index][$update_row][$update_field] = $fld[$m];
$update_field++;
if ($src_result_set[0][$fld[$m]]) {
$update_array[$matching_table_index][$update_row][$update_field] = $src_result_set[0][$fld[$m]];
$update_field++;
}
- $update_row++;
+ $update_row++;
}
} else {
- $update_row--;
+ $update_row--;
$update_array[$matching_table_index][$update_row][$update_field] = $fld[$m];
$update_field++;
if ($src_result_set[0][$fld[$m]]) {
$update_array[$matching_table_index][$update_row][$update_field] = $src_result_set[0][$fld[$m]];
$update_field++;
}
- $update_row++;
+ $update_row++;
}
}
}
@@ -265,7 +265,7 @@
if (isset($source_result_set[$j])) {
$insert_array[$matching_table_index][$insert_row][$is_key[0]] = $source_result_set[$j];
}
- } elseif (sizeof($is_key) > 1) {
+ } elseif (sizeof($is_key) > 1) {
for($l = 0; $l < sizeof($is_key); $l++) {
if (isset($source_result_set[$j][$matching_tables_fields[$matching_table_index][$l]])) {
$insert_array[$matching_table_index][$insert_row][$is_key[$l]] = $source_result_set[$j][$matching_tables_fields[$matching_table_index][$l]];
@@ -277,13 +277,13 @@
} else {
/**
* Placing the primary key, and the value of primary key of the row that is to be inserted in the target table
- * This condition is met when there is an additional column in the source table
+ * This condition is met when there is an additional column in the source table
*/
if (sizeof($is_key) == 1) {
if (isset($source_result_set[$j])) {
$insert_array[$matching_table_index][$insert_row][$is_key[0]] = $source_result_set[$j];
}
- } elseif (sizeof($is_key) > 1) {
+ } elseif (sizeof($is_key) > 1) {
for ($l = 0; $l < sizeof($is_key); $l++) {
if (isset($source_result_set[$j][$matching_tables_fields[$matching_table_index][$l]])) {
$insert_array[$matching_table_index][$insert_row][$is_key[$l]] = $source_result_set[$j][$matching_tables_fields[$matching_table_index][$l]];
@@ -293,34 +293,34 @@
$insert_row++;
}
} // for loop ends
- }
-}
+ }
+}
/**
* PMA_findDeleteRowsFromTargetTables finds the rows which are to be deleted from target table.
* @uses sizeof()
* @uses PMA_DBI_get_column_values()
* @uses in_array()
-*
-* @param $delete_array array containing rows that are to be deleted
+*
+* @param $delete_array array containing rows that are to be deleted
* @param $matching_table array containing matching table names
* @param $matching_table_index index of a table from $matching_table array
* @param $trg_keys array of target table keys
* @param $src_keys array of source table keys
* @param $trg_db name of target database
* @param $trg_link connection established with target server
-* @param $src_db name of source database
+* @param $src_db name of source database
* @param $src_link connection established with source server
-*
+*
*/
function PMA_findDeleteRowsFromTargetTables(&$delete_array, $matching_table, $matching_table_index, $trg_keys, $src_keys, $trg_db, $trg_link,$src_db, $src_link)
{
if (isset($trg_keys[$matching_table_index])) {
- $target_key_values = PMA_DBI_get_column_values($trg_db, $matching_table[$matching_table_index], $trg_keys[$matching_table_index], $trg_link);
- $target_row_size = sizeof($target_key_values);
+ $target_key_values = PMA_DBI_get_column_values($trg_db, $matching_table[$matching_table_index], $trg_keys[$matching_table_index], $trg_link);
+ $target_row_size = sizeof($target_key_values);
}
if (isset($src_keys[$matching_table_index])) {
- $source_key_values = PMA_DBI_get_column_values($src_db, $matching_table[$matching_table_index], $src_keys[$matching_table_index], $src_link);
- $source_size = sizeof($source_key_values);
+ $source_key_values = PMA_DBI_get_column_values($src_db, $matching_table[$matching_table_index], $src_keys[$matching_table_index], $src_link);
+ $source_size = sizeof($source_key_values);
}
$all_keys_match = 1;
for ($a = 0; $a < sizeof($trg_keys[$matching_table_index]); $a++) {
@@ -328,7 +328,7 @@
if (! (in_array($trg_keys[$matching_table_index][$a], $src_keys[$matching_table_index]))) {
$all_keys_match = 0;
}
- }
+ }
}
if (! ($all_keys_match)) {
if (isset($target_key_values)) {
@@ -337,17 +337,17 @@
}
if (isset($trg_keys[$matching_table_index])) {
if ((sizeof($trg_keys[$matching_table_index]) == 1) && $all_keys_match) {
- $row = 0;
+ $row = 0;
if (isset($target_key_values)) {
for ($i = 0; $i < sizeof($target_key_values); $i++) {
if (! (in_array($target_key_values[$i], $source_key_values))) {
$delete_array[$matching_table_index][$row] = $target_key_values[$i];
- $row++;
+ $row++;
}
- }
+ }
}
} elseif ((sizeof($trg_keys[$matching_table_index]) > 1) && $all_keys_match) {
- $row = 0;
+ $row = 0;
if (isset($target_key_values)) {
for ($i = 0; $i < sizeof($target_key_values); $i++) {
$is_present = false;
@@ -356,7 +356,7 @@
for ($k = 0; $k < sizeof($trg_keys[$matching_table_index]); $k++) {
if ($target_key_values[$i][$trg_keys[$matching_table_index][$k]] != $source_key_values[$j][$trg_keys[$matching_table_index][$k]]) {
$check = false;
- }
+ }
}
if ($check) {
$is_present = true;
@@ -368,16 +368,16 @@
}
$row++;
}
- }
- }
+ }
+ }
}
- }
+ }
}
/**
* PMA_dataDiffInUncommonTables() finds the data difference in $source_tables_uncommon
* @uses PMA_DBI_fetch_result()
-*
+*
* @param $source_tables_uncommon array of table names; containing table names that are in source db and not in target db
* @param $src_db name of source database
* @param $src_link connection established with source server
@@ -387,9 +387,9 @@
function PMA_dataDiffInUncommonTables($source_tables_uncommon, $src_db, $src_link, $index, &$row_count)
{
- $query = "SELECT COUNT(*) FROM " . PMA_backquote($src_db) . "." . PMA_backquote($source_tables_uncommon[$index]);
- $rows = PMA_DBI_fetch_result($query, null, null, $src_link);
- $row_count[$index] = $rows[0];
+ $query = "SELECT COUNT(*) FROM " . PMA_backquote($src_db) . "." . PMA_backquote($source_tables_uncommon[$index]);
+ $rows = PMA_DBI_fetch_result($query, null, null, $src_link);
+ $row_count[$index] = $rows[0];
}
/**
@@ -397,35 +397,35 @@
*
* @uses PMA_DBI_fetch_result()
* @uses PMA_backquote()
-*
-* @param $table Array containing matching tables' names
+*
+* @param $table Array containing matching tables' names
* @param $update_array A three dimensional array containing field
* value updates required for each matching table
-* @param $src_db Name of source database
+* @param $src_db Name of source database
* @param $trg_db Name of target database
* @param $trg_link Connection established with target server
-* @param $matching_table_index index of matching table in matching_table_array
+* @param $matching_table_index index of matching table in matching_table_array
* @param $display true/false value
-*/
+*/
function PMA_updateTargetTables($table, $update_array, $src_db, $trg_db, $trg_link, $matching_table_index, $matching_table_keys, $display)
-{
+{
if (isset($update_array[$matching_table_index])) {
if (sizeof($update_array[$matching_table_index])) {
-
+
for ($update_row = 0; $update_row < sizeof($update_array[$matching_table_index]); $update_row++) {
-
- if (isset($update_array[$matching_table_index][$update_row])) {
+
+ if (isset($update_array[$matching_table_index][$update_row])) {
$update_fields_num = sizeof($update_array[$matching_table_index][$update_row])-sizeof($matching_table_keys[$matching_table_index]);
if ($update_fields_num > 0) {
- $query = "UPDATE " . PMA_backquote($trg_db) . "." .PMA_backquote($table[$matching_table_index]) . " SET ";
-
+ $query = "UPDATE " . PMA_backquote($trg_db) . "." .PMA_backquote($table[$matching_table_index]) . " SET ";
+
for ($update_field = 0; $update_field < $update_fields_num; $update_field = $update_field+2) {
if (isset($update_array[$matching_table_index][$update_row][$update_field]) && isset($update_array[$matching_table_index][$update_row][$update_field+1])) {
- $query .= $update_array[$matching_table_index][$update_row][$update_field] . "='" . $update_array[$matching_table_index][$update_row][$update_field+1] . "'";
+ $query .= PMA_backquote($update_array[$matching_table_index][$update_row][$update_field]) . "='" . $update_array[$matching_table_index][$update_row][$update_field+1] . "'";
}
if ($update_field < ($update_fields_num - 2)) {
- $query .= ", ";
+ $query .= ", ";
}
}
$query .= " WHERE ";
@@ -433,8 +433,8 @@
for ($key = 0; $key < sizeof($matching_table_keys[$matching_table_index]); $key++)
{
if (isset($matching_table_keys[$matching_table_index][$key])) {
-
- $query .= $matching_table_keys[$matching_table_index][$key] . "='" . $update_array[$matching_table_index][$update_row][$matching_table_keys[$matching_table_index][$key]] . "'";
+
+ $query .= PMA_backquote($matching_table_keys[$matching_table_index][$key]) . "='" . $update_array[$matching_table_index][$update_row][$matching_table_keys[$matching_table_index][$key]] . "'";
}
if ($key < (sizeof($matching_table_keys[$matching_table_index]) - 1)) {
$query .= " AND ";
@@ -443,29 +443,29 @@
}
if ($display == true) {
echo "<p>" . $query . "</p>";
- }
+ }
PMA_DBI_try_query($query, $trg_link, 0);
}
- }
+ }
}
}
}
}
/**
* PMA_insertIntoTargetTable() inserts missing rows in the target table using $array_insert[$matching_table_index]
-*
+*
* @uses PMA_DBI_fetch_result()
* @uses PMA_backquote()
-*
-*
+*
+*
* @param $matching_table array containing matching table names
* @param $src_db name of source database
* @param $trg_db name of target database
* @param $src_link connection established with source server
* @param $trg_link connection established with target server
* @param $table_fields array containing field names of a table
-* @param $array_insert
-* @param $matching_table_index index of matching table in matching_table_array
+* @param $array_insert
+* @param $matching_table_index index of matching table in matching_table_array
* @param $matching_tables_keys array containing field names that are keys in the matching table
* @param $source_columns array containing source column information
* @param $add_column_array array containing column names that are to be added in target table
@@ -474,79 +474,79 @@
* @param $uncommon_tables array containing table names that are present in source db but not in targt db
* @param $uncommon_tables_fields array containing field names of the uncommon tables
* @param $uncommon_cols column names that are present in target table and not in source table
-* @param $alter_str_array array containing column names that are to be altered
-* @param $source_indexes column names on which indexes are made in source table
-* @param $target_indexes column names on which indexes are made in target table
+* @param $alter_str_array array containing column names that are to be altered
+* @param $source_indexes column names on which indexes are made in source table
+* @param $target_indexes column names on which indexes are made in target table
* @param $add_indexes_array array containing column names on which index is to be added in target table
-* @param $alter_indexes_array array containing column names whose indexes are to be altered. Only index name and uniqueness of an index can be changed
+* @param $alter_indexes_array array containing column names whose indexes are to be altered. Only index name and uniqueness of an index can be changed
* @param $delete_array array containing rows that are to be deleted
* @param $update_array array containing rows that are to be updated in target
* @param $display true/false value
*
*/
function PMA_insertIntoTargetTable($matching_table, $src_db, $trg_db, $src_link, $trg_link, $table_fields, &$array_insert, $matching_table_index,
- $matching_tables_keys, $source_columns, &$add_column_array, $criteria, $target_tables_keys, $uncommon_tables, &$uncommon_tables_fields,$uncommon_cols,
+ $matching_tables_keys, $source_columns, &$add_column_array, $criteria, $target_tables_keys, $uncommon_tables, &$uncommon_tables_fields,$uncommon_cols,
&$alter_str_array,&$source_indexes, &$target_indexes, &$add_indexes_array, &$alter_indexes_array, &$delete_array, &$update_array, $display)
-{
+{
if(isset($array_insert[$matching_table_index])) {
if (sizeof($array_insert[$matching_table_index])) {
for ($insert_row = 0; $insert_row< sizeof($array_insert[$matching_table_index]); $insert_row++) {
if (isset($array_insert[$matching_table_index][$insert_row][$matching_tables_keys[$matching_table_index][0]])) {
-
+
$select_query = "SELECT * FROM " . PMA_backquote($src_db) . "." . PMA_backquote($matching_table[$matching_table_index]) . " WHERE ";
for ($i = 0; $i < sizeof($matching_tables_keys[$matching_table_index]); $i++) {
$select_query .= $matching_tables_keys[$matching_table_index][$i] . "='";
$select_query .= $array_insert[$matching_table_index][$insert_row][$matching_tables_keys[$matching_table_index][$i]] . "'" ;
-
+
if ($i < (sizeof($matching_tables_keys[$matching_table_index]) - 1)) {
- $select_query.= " AND ";
+ $select_query.= " AND ";
}
}
$select_query .= "; ";
$result = PMA_DBI_fetch_result ($select_query, null, null, $src_link);
$insert_query = "INSERT INTO " . PMA_backquote($trg_db) . "." . PMA_backquote($matching_table[$matching_table_index]) ." (";
-
- for ($field_index = 0; $field_index < sizeof($table_fields[$matching_table_index]); $field_index++)
+
+ for ($field_index = 0; $field_index < sizeof($table_fields[$matching_table_index]); $field_index++)
{
- $insert_query .= $table_fields[$matching_table_index][$field_index];
-
- $is_fk_query = "SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE TABLE_SCHEMA = '" . $trg_db ."'
+ $insert_query .= PMA_backquote($table_fields[$matching_table_index][$field_index]);
+
+ $is_fk_query = "SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE TABLE_SCHEMA = '" . $trg_db ."'
AND TABLE_NAME = '" . $matching_table[$matching_table_index]. "'AND COLUMN_NAME = '" .
$table_fields[$matching_table_index][$field_index] . "' AND TABLE_NAME <> REFERENCED_TABLE_NAME;" ;
-
+
$is_fk_result = PMA_DBI_fetch_result($is_fk_query, null, null, $trg_link);
if (sizeof($is_fk_result) > 0) {
for ($j = 0; $j < sizeof($is_fk_result); $j++)
{
$table_index = array_keys($matching_table, $is_fk_result[$j]['REFERENCED_TABLE_NAME']);
-
+
if (isset($alter_str_array[$table_index[0]])) {
PMA_alterTargetTableStructure($trg_db, $trg_link, $matching_tables, $source_columns, $alter_str_array, $matching_tables_fields,
$criteria, $matching_tables_keys, $target_tables_keys, $table_index[0], $display);
- unset($alter_str_array[$table_index[0]]);
- }
+ unset($alter_str_array[$table_index[0]]);
+ }
if (isset($uncommon_columns[$table_index[0]])) {
PMA_removeColumnsFromTargetTable($trg_db, $trg_link, $matching_tables, $uncommon_columns, $table_index[0], $display);
- unset($uncommon_columns[$table_index[0]]);
- }
+ unset($uncommon_columns[$table_index[0]]);
+ }
if (isset($add_column_array[$table_index[0]])) {
PMA_findDeleteRowsFromTargetTables($delete_array, $matching_tables, $table_index[0], $target_tables_keys, $matching_tables_keys,
$trg_db, $trg_link, $src_db, $src_link);
-
+
if (isset($delete_array[$table_index[0]])) {
PMA_deleteFromTargetTable($trg_db, $trg_link, $matching_tables, $table_index[0], $target_tables_keys, $delete_array, $display);
- unset($delete_array[$table_index[0]]);
- }
- PMA_addColumnsInTargetTable($src_db, $trg_db, $src_link, $trg_link, $matching_tables, $source_columns, $add_column_array,
+ unset($delete_array[$table_index[0]]);
+ }
+ PMA_addColumnsInTargetTable($src_db, $trg_db, $src_link, $trg_link, $matching_tables, $source_columns, $add_column_array,
$matching_tables_fields, $criteria, $matching_tables_keys, $target_tables_keys, $uncommon_tables,$uncommon_tables_fields,
$table_index[0], $uncommon_cols, $display);
unset($add_column_array[$table_index[0]]);
}
- if (isset($add_indexes_array[$table_index[0]]) || isset($remove_indexes_array[$table_index[0]])
+ if (isset($add_indexes_array[$table_index[0]]) || isset($remove_indexes_array[$table_index[0]])
|| isset($alter_indexes_array[$table_index[0]])) {
- PMA_applyIndexesDiff ($trg_db, $trg_link, $matching_tables, $source_indexes, $target_indexes, $add_indexes_array, $alter_indexes_array,
- $remove_indexes_array, $table_index[0], $display);
-
+ PMA_applyIndexesDiff ($trg_db, $trg_link, $matching_tables, $source_indexes, $target_indexes, $add_indexes_array, $alter_indexes_array,
+ $remove_indexes_array, $table_index[0], $display);
+
unset($add_indexes_array[$table_index[0]]);
unset($alter_indexes_array[$table_index[0]]);
unset($remove_indexes_array[$table_index[0]]);
@@ -559,16 +559,16 @@
if (isset($array_insert[$table_index[0]])) {
PMA_insertIntoTargetTable($matching_table, $src_db, $trg_db, $src_link, $trg_link, $table_fields, $array_insert,
$table_index[0], $matching_tables_keys, $source_columns, $add_column_array, $criteria, $target_tables_keys, $uncommon_tables,
- $uncommon_tables_fields, $uncommon_cols, $alter_str_array, $source_indexes, $target_indexes, $add_indexes_array,
- $alter_indexes_array, $delete_array, $update_array, $display);
+ $uncommon_tables_fields, $uncommon_cols, $alter_str_array, $source_indexes, $target_indexes, $add_indexes_array,
+ $alter_indexes_array, $delete_array, $update_array, $display);
unset($array_insert[$table_index[0]]);
- }
+ }
}
}
if ($field_index < sizeof($table_fields[$matching_table_index])-1) {
$insert_query .= ", ";
}
- }
+ }
$insert_query .= ") VALUES(";
if (sizeof($table_fields[$matching_table_index]) == 1) {
$insert_query .= "'" . PMA_sqlAddslashes($result[0]) . "'";
@@ -581,35 +581,35 @@
}
if ($field_index < (sizeof($table_fields[$matching_table_index])) - 1) {
$insert_query .= " ," ;
- }
+ }
}
- }
+ }
$insert_query .= ");";
if ($display == true) {
PMA_displayQuery($insert_query);
}
PMA_DBI_try_query($insert_query, $trg_link, 0);
- }
+ }
}
}
}
-}
+}
/**
-* PMA_createTargetTables() Create the missing table $uncommon_table in target database
-*
+* PMA_createTargetTables() Create the missing table $uncommon_table in target database
+*
* @uses PMA_DBI_get_fields()
* @uses PMA_backquote()
* @uses PMA_DBI_fetch_result()
-*
-* @param $src_db name of source database
+*
+* @param $src_db name of source database
* @param $trg_db name of target database
* @param $trg_link connection established with target server
* @param $src_link connection established with source server
* @param $uncommon_table name of table present in source but not in target
-* @param $table_index index of table in matching_table_array
+* @param $table_index index of table in matching_table_array
* @param $uncommon_tables_fields field names of the uncommon table
* @param $display true/false value
-*/
+*/
function PMA_createTargetTables($src_db, $trg_db, $src_link, $trg_link, &$uncommon_tables, $table_index, &$uncommon_tables_fields, $display)
{
if (isset($uncommon_tables[$table_index])) {
@@ -619,20 +619,20 @@
$field_name = $each_field['Field'];
$fields[] = $field_name;
}
- $uncommon_tables_fields[$table_index] = $fields;
-
+ $uncommon_tables_fields[$table_index] = $fields;
+
$Create_Query = PMA_DBI_fetch_value("SHOW CREATE TABLE " . PMA_backquote($src_db) . '.' . PMA_backquote($uncommon_tables[$table_index]), 0, 1, $src_link);
// Replace the src table name with a `dbname`.`tablename`
- $Create_Table_Query = preg_replace('/' . preg_quote(PMA_backquote($uncommon_tables[$table_index]), '/') . '/',
+ $Create_Table_Query = preg_replace('/' . preg_quote(PMA_backquote($uncommon_tables[$table_index]), '/') . '/',
PMA_backquote($trg_db) . '.' .PMA_backquote($uncommon_tables[$table_index]),
$Create_Query,
$limit = 1
);
- $is_fk_query = "SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE TABLE_SCHEMA = '" . $src_db . "'
+ $is_fk_query = "SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE TABLE_SCHEMA = '" . $src_db . "'
AND TABLE_NAME = '" . $uncommon_tables[$table_index] . "' AND TABLE_NAME <> REFERENCED_TABLE_NAME;" ;
-
+
$is_fk_result = PMA_DBI_fetch_result($is_fk_query, null, null, $src_link);
if (sizeof($is_fk_result) > 0) {
for ($j = 0; $j < sizeof($is_fk_result); $j++)
@@ -641,14 +641,14 @@
$table_index = array_keys($uncommon_tables, $is_fk_result[$j]['REFERENCED_TABLE_NAME']);
PMA_createTargetTables($src_db, $trg_db, $trg_link, $src_link, $uncommon_tables, $table_index[0], $uncommon_tables_fields, $display);
unset($uncommon_tables[$table_index[0]]);
- }
+ }
}
}
if ($display == true) {
echo '<p>' . $Create_Table_Query . '</p>';
}
PMA_DBI_try_query($Create_Table_Query, $trg_link, 0);
- }
+ }
}
/**
* PMA_populateTargetTables() inserts data into uncommon tables after they have been created
@@ -656,24 +656,24 @@
* @uses PMA_backquote()
* @uses sizeof()
* @uses PMA_DBI_try_query()
-*
+*
* @param $src_db name of source database
* @param $trg_db name of target database
* @param $src_link connection established with source server
* @param $trg_link connection established with target server
-* @param $uncommon_tables array containing uncommon table names (table names that are present in source but not in target db)
-* @param $table_index index of table in matching_table_array
+* @param $uncommon_tables array containing uncommon table names (table names that are present in source but not in target db)
+* @param $table_index index of table in matching_table_array
* @param $uncommon_tables_fields field names of the uncommon table
* @param $display true/false value
*
* FIXME: This turns NULL values into '' (empty string)
*/
-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)
+{
$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';
+ $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 .= '(';
$key_of_last_value = count($one_row) - 1;
@@ -694,53 +694,54 @@
}
}
/**
-* PMA_deleteFromTargetTable() delete rows from target table
+* PMA_deleteFromTargetTable() delete rows from target table
* @uses sizeof()
* @uses PMA_backquote()
* @uses PMA_DBI_try_query()
-*
-*
+*
+*
* @param $trg_db name of target database
* @param $trg_link connection established with target server
* @param $matching_tables array containing matching table names
* @param $table_index index of table in matching_table_array
* @param $target_table_keys primary key names of the target tables
-* @param $delete array array containing the key values of rows that are to be deleted
+* @param $delete array array containing the key values of rows that are to be deleted
* @param $display true/false value
*/
-function PMA_deleteFromTargetTable($trg_db, $trg_link, $matching_tables, $table_index, $target_tables_keys, $delete_array, $display)
+function PMA_deleteFromTargetTable($trg_db, $trg_link, $matching_tables, $table_index, $target_tables_keys, $delete_array, $display)
{
for($i = 0; $i < sizeof($delete_array[$table_index]); $i++) {
if (isset($target_tables_keys[$table_index])) {
- $delete_query = 'DELETE FROM ' . PMA_backquote($trg_db) . '.' .PMA_backquote($matching_tables[$table_index]) . ' WHERE ';
+ $delete_query = 'DELETE FROM ' . PMA_backquote($trg_db) . '.' .PMA_backquote($matching_tables[$table_index]) . ' WHERE ';
for($y = 0; $y < sizeof($target_tables_keys[$table_index]); $y++) {
- $delete_query .= $target_tables_keys[$table_index][$y] . " = '";
-
+
+ $delete_query .= PMA_backquote($target_tables_keys[$table_index][$y]) . " = '";
+
if (sizeof($target_tables_keys[$table_index]) == 1) {
- $delete_query .= $delete_array[$table_index][$i] . "'";
+ $delete_query .= $delete_array[$table_index][$i] . "'";
} elseif (sizeof($target_tables_keys[$table_index]) > 1) {
$delete_query .= $delete_array[$table_index][$i][$target_tables_keys[$table_index][$y]] . "'";
}
if ($y < (sizeof($target_tables_keys[$table_index]) - 1)) {
$delete_query .= ' AND ';
}
- $pk_query = "SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE REFERENCED_TABLE_SCHEMA = '" . $trg_db . "'
+ $pk_query = "SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE REFERENCED_TABLE_SCHEMA = '" . $trg_db . "'
AND REFERENCED_TABLE_NAME = '" . $matching_tables[$table_index]."' AND REFERENCED_COLUMN_NAME = '"
. $target_tables_keys[$table_index][$y] . "' AND TABLE_NAME <> REFERENCED_TABLE_NAME;";
-
+
$pk_query_result = PMA_DBI_fetch_result($pk_query, null, null, $trg_link);
$result_size = sizeof($pk_query_result);
-
+
if ($result_size > 0) {
for ($b = 0; $b < $result_size; $b++) {
- $drop_pk_query = "DELETE FROM " . PMA_backquote($pk_query_result[$b]['TABLE_SCHEMA']) . "." . PMA_backquote($pk_query_result[$b]['TABLE_NAME']) . " WHERE " . $pk_query_result[$b]['COLUMN_NAME'] . " = " . $target_tables_keys[$table_index][$y] . ";";
+ $drop_pk_query = "DELETE FROM " . PMA_backquote($pk_query_result[$b]['TABLE_SCHEMA']) . "." . PMA_backquote($pk_query_result[$b]['TABLE_NAME']) . " WHERE " . PMA_backquote($pk_query_result[$b]['COLUMN_NAME']) . " = " . $target_tables_keys[$table_index][$y] . ";";
PMA_DBI_try_query($drop_pk_query, $trg_link, 0);
- }
- }
- }
+ }
+ }
+ }
}
if ($display == true) {
- echo '<p>' . $delete_query . '</p>';
+ echo '<p>' . $delete_query . '</p>';
}
PMA_DBI_try_query($delete_query, $trg_link, 0);
}
@@ -753,45 +754,45 @@
* If column exists in target table but criteria is different then it is palced in $alter_str_array.
* If column does not exist in source table but is present in target table then it is placed in $uncommon_columns.
* Keys for all the source tables that have a corresponding target table are placed in $matching_tables_keys.
-* Keys for all the target tables that have a corresponding source table are placed in $target_tables_keys.
-*
+* Keys for all the target tables that have a corresponding source table are placed in $target_tables_keys.
+*
* @uses PMA_DBI_get_columns_full()
-* @uses sizeof()
-*
-* @param $src_db name of source database
+* @uses sizeof()
+*
+* @param $src_db name of source database
* @param $trg_db name of target database
* @param $src_link connection established with source server
* @param $trg_link connection established with target server
* @param $matching_tables array containing names of matching tables
* @param $source_columns array containing columns information of the source tables
* @param $target_columns array containing columns information of the target tables
-* @param $alter_str_array three dimensional associative array first index being the matching table index, second index being column name for which target
+* @param $alter_str_array three dimensional associative array first index being the matching table index, second index being column name for which target
* column have some criteria different and third index containing the criteria which is different.
-* @param $add_column_array two dimensional associative array, first index of the array contain the matching table number and second index contain the
+* @param $add_column_array two dimensional associative array, first index of the array contain the matching table number and second index contain the
* column name which is to be added in the target table
* @param $uncommon_columns array containing the columns that are present in the target table but not in the source table
* @param $criteria array containing the criterias which are to be checked for field that is present in source table and target table
* @param $target_tables_keys array containing the field names which is key in the target table
-* @param $matching_table_index integer number of the matching table
-*
+* @param $matching_table_index integer number of the matching table
+*
*/
function PMA_structureDiffInTables($src_db, $trg_db, $src_link, $trg_link, $matching_tables, &$source_columns, &$target_columns, &$alter_str_array,
- &$add_column_array, &$uncommon_columns, $criteria, &$target_tables_keys, $matching_table_index)
+ &$add_column_array, &$uncommon_columns, $criteria, &$target_tables_keys, $matching_table_index)
{
//Gets column information for source and target table
$source_columns[$matching_table_index] = PMA_DBI_get_columns_full($src_db, $matching_tables[$matching_table_index], null, $src_link);
$target_columns[$matching_table_index] = PMA_DBI_get_columns_full($trg_db, $matching_tables[$matching_table_index], null, $trg_link);
foreach ($source_columns[$matching_table_index] as $column_name => $each_column) {
if (isset($target_columns[$matching_table_index][$column_name]['Field'])) {
- //If column exists in target table then matches criterias like type, null, collation, key, default, comment of the column
+ //If column exists in target table then matches criterias like type, null, collation, key, default, comment of the column
for ($i = 0; $i < sizeof($criteria); $i++) {
if ($source_columns[$matching_table_index][$column_name][$criteria[$i]] != $target_columns[$matching_table_index][$column_name][$criteria[$i]]) {
if (($criteria[$i] == 'Default') && ($source_columns[$matching_table_index][$column_name][$criteria[$i]] == '' )) {
- $alter_str_array[$matching_table_index][$column_name][$criteria[$i]] = 'None';
+ $alter_str_array[$matching_table_index][$column_name][$criteria[$i]] = 'None';
} else {
if (! (($criteria[$i] == 'Key') && (($source_columns[$matching_table_index][$column_name][$criteria[$i]] == 'MUL')
- || ($target_columns[$matching_table_index][$column_name][$criteria[$i]] == 'MUL')
- || ($source_columns[$matching_table_index][$column_name][$criteria[$i]] == 'UNI')
+ || ($target_columns[$matching_table_index][$column_name][$criteria[$i]] == 'MUL')
+ || ($source_columns[$matching_table_index][$column_name][$criteria[$i]] == 'UNI')
|| ($target_columns[$matching_table_index][$column_name][$criteria[$i]] == 'UNI')))) {
$alter_str_array[$matching_table_index][$column_name][$criteria[$i]] = $source_columns[$matching_table_index][$column_name][$criteria[$i]];
}
@@ -805,17 +806,17 @@
//Finds column names that are present in target table but not in source table
foreach ($target_columns[$matching_table_index] as $fld_name => $each_column) {
if (! (isset($source_columns[$matching_table_index][$fld_name]['Field']))) {
- $fields_uncommon[] = $fld_name;
+ $fields_uncommon[] = $fld_name;
}
if ($target_columns[$matching_table_index][$fld_name]['Key'] == 'PRI') {
$keys[] = $fld_name;
}
}
if (isset($fields_uncommon)) {
- $uncommon_columns[$matching_table_index] = $fields_uncommon;
+ $uncommon_columns[$matching_table_index] = $fields_uncommon;
}
if (isset($keys)) {
- $target_tables_keys[$matching_table_index] = $keys;
+ $target_tables_keys[$matching_table_index] = $keys;
}
}
/**
@@ -827,8 +828,8 @@
* @uses PMA_createTargetTables()
* @uses PMA_DBI_try_query()
* @uses PMA_DBI_fetch_result()
-*
-* @param $src_db name of source database
+*
+* @param $src_db name of source database
* @param $trg_db name of target database
* @param $src_link connection established with source server
* @param $trg_link connection established with target server
@@ -836,7 +837,7 @@
* @param $source_columns array containing columns information of the source tables
* @param $add_column_array array containing the names of the column(field) that are to be added in the target
* @param $matching_tables_fields
-* @param $criteria array containing the criterias
+* @param $criteria array containing the criterias
* @param $matching_tables_keys array containing the field names which is key in the source table
* @param $target_tables_keys array containing the field names which is key in the target table
* @param $uncommon_tables array containing the table names that are present in source db and not in target db
@@ -851,12 +852,12 @@
for ($i = 0; $i < sizeof($matching_tables_fields[$table_counter]); $i++) {
if (isset($add_column_array[$table_counter][$matching_tables_fields[$table_counter][$i]])) {
$query = "ALTER TABLE " . PMA_backquote($trg_db) . '.' . PMA_backquote($matching_tables[$table_counter]). " ADD COLUMN " .
- $add_column_array[$table_counter][$matching_tables_fields[$table_counter][$i]] . " " . $source_columns[$table_counter][$matching_tables_fields[$table_counter][$i]]['Type'];
-
+ PMA_backquote($add_column_array[$table_counter][$matching_tables_fields[$table_counter][$i]]) . " " . $source_columns[$table_counter][$matching_tables_fields[$table_counter][$i]]['Type'];
+
if($source_columns[$table_counter][$matching_tables_fields[$table_counter][$i]]['Null'] == 'NO') {
$query .= ' Not Null ';
} elseif ($source_columns[$table_counter][$matching_tables_fields[$table_counter][$i]]['Null'] == 'YES') {
- $query .= ' Null ';
+ $query .= ' Null ';
}
if ($source_columns[$table_counter][$matching_tables_fields[$table_counter][$i]]['Collation'] != '') {
$query .= ' COLLATE ' . $source_columns[$table_counter][$matching_tables_fields[$table_counter][$i]]['Collation'];
@@ -865,45 +866,45 @@
$query .= " DEFAULT " . $source_columns[$table_counter][$matching_tables_fields[$table_counter][$i]]['Default'];
}
if ($source_columns[$table_counter][$matching_tables_fields[$table_counter][$i]]['Comment'] != '') {
- $query .= " COMMENT " . $source_columns[$table_counter][$matching_tables_fields[$table_counter][$i]]['Comment'];
- }
- if ($source_columns[$table_counter][$matching_tables_fields[$table_counter][$i]]['Key'] == 'PRI' ) {
+ $query .= " COMMENT " . $source_columns[$table_counter][$matching_tables_fields[$table_counter][$i]]['Comment'];
+ }
+ if ($source_columns[$table_counter][$matching_tables_fields[$table_counter][$i]]['Key'] == 'PRI' ) {
$trg_key_size = sizeof($target_tables_keys[$table_counter]);
if ($trg_key_size) {
$check = true;
- for ($a = 0; ($a < $trg_key_size) && ($check); $a++) {
+ for ($a = 0; ($a < $trg_key_size) && ($check); $a++) {
if (! (in_array($target_tables_keys[$table_counter], $uncommon_cols))) {
$check = false;
- }
+ }
}
if (! $check) {
- $query .= " ,DROP PRIMARY KEY " ;
+ $query .= " ,DROP PRIMARY KEY " ;
}
- }
+ }
$query .= " , ADD PRIMARY KEY (";
for ($t = 0; $t < sizeof($matching_tables_keys[$table_counter]); $t++) {
- $query .= $matching_tables_keys[$table_counter][$t];
+ $query .= PMA_backquote($matching_tables_keys[$table_counter][$t]);
if ($t < (sizeof($matching_tables_keys[$table_counter]) - 1)) {
$query .= " , " ;
}
}
$query .= ")";
}
-
+
$query .= ";";
if ($display == true) {
echo '<p>' . $query . '</p>';
}
PMA_DBI_try_query($query, $trg_link, 0);
-
+
//Checks if column to be added is a foreign key or not
$is_fk_query = "SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE TABLE_SCHEMA = '" . $trg_db . "' AND TABLE_NAME = '"
. $matching_tables[$table_counter] . "' AND COLUMN_NAME ='" . $add_column_array[$table_counter][$matching_tables_fields[$table_counter][$i]] .
"' AND TABLE_NAME <> REFERENCED_TABLE_NAME;";
-
+
$is_fk_result = PMA_DBI_fetch_result($is_fk_query, null, null, $src_link);
-
- //If column is a foreign key then it is checked that referenced table exist in target db. If referenced table does not exist in target db then
+
+ //If column is a foreign key then it is checked that referenced table exist in target db. If referenced table does not exist in target db then
//it is created first.
if (isset($is_fk_result)) {
if (in_array($is_fk_result[0]['REFERENCED_TABLE_NAME'], $uncommon_tables)) {
@@ -912,12 +913,12 @@
PMA_createTargetTables($src_db, $trg_db, $trg_link, $src_link, $uncommon_tables, $table_index[0], $uncommon_tables_fields);
unset($uncommon_tables[$table_index[0]]);
}
- $fk_query = "ALTER TABLE " . PMA_backquote($trg_db) . '.' . PMA_backquote($matching_tables[$table_counter]) .
- "ADD CONSTRAINT FOREIGN KEY " . $add_column_array[$table_counter][$matching_tables_fields[$table_counter][$i]] . "
+ $fk_query = "ALTER TABLE " . PMA_backquote($trg_db) . '.' . PMA_backquote($matching_tables[$table_counter]) .
+ "ADD CONSTRAINT FOREIGN KEY " . PMA_backquote($add_column_array[$table_counter][$matching_tables_fields[$table_counter][$i]]) . "
(" . $add_column_array[$table_counter][$matching_tables_fields[$table_counter][$i]] . ") REFERENCES " . PMA_backquote($trg_db) .
'.' . PMA_backquote($is_fk_result[0]['REFERENCED_TABLE_NAME']) . " (" . $is_fk_result[0]['REFERENCED_COLUMN_NAME'] . ");";
-
- PMA_DBI_try_query($fk_query, $trg_link, null);
+
+ PMA_DBI_try_query($fk_query, $trg_link, null);
}
}
}
@@ -929,31 +930,31 @@
* @uses array_keys()
* @uses PMA_checkForeignKeys()
* uses PMA_createTargetTables()
-*
+*
* @param $src_db name of source database
* @param $src_link connection established with source server
* @param $trg_db name of target database
* @param $trg_link connection established with target server
* @param $referenced_table table whose column is a foreign key in another table
-* @param $uncommon_tables array containing names that are uncommon
+* @param $uncommon_tables array containing names that are uncommon
* @param $uncommon_tables_fields field names of the uncommon table
* @param $display true/false value
*/
function PMA_checkForeignKeys($src_db, $src_link, $trg_db, $trg_link ,$referenced_table, &$uncommon_tables, &$uncommon_tables_fields, $display)
{
- $is_fk_query = "SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE TABLE_SCHEMA = '" . $src_db . "'
+ $is_fk_query = "SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE TABLE_SCHEMA = '" . $src_db . "'
AND TABLE_NAME = '" . $referenced_table . "' AND TABLE_NAME <> REFERENCED_TABLE_NAME;";
-
+
$is_fk_result = PMA_DBI_fetch_result($is_fk_query, null, null, $src_link);
if (sizeof($is_fk_result) > 0) {
for ($j = 0; $j < sizeof($is_fk_result); $j++) {
if (in_array($is_fk_result[$j]['REFERENCED_TABLE_NAME'], $uncommon_tables)) {
$table_index = array_keys($uncommon_tables, $is_fk_result[$j]['REFERENCED_TABLE_NAME']);
- PMA_checkForeignKeys($src_db, $src_link, $trg_db, $trg_link, $is_fk_result[$j]['REFERENCED_TABLE_NAME'], $uncommon_tables,
- $uncommon_tables_fields, $display);
+ PMA_checkForeignKeys($src_db, $src_link, $trg_db, $trg_link, $is_fk_result[$j]['REFERENCED_TABLE_NAME'], $uncommon_tables,
+ $uncommon_tables_fields, $display);
PMA_createTargetTables($src_db, $trg_db, $trg_link, $src_link, $uncommon_tables, $table_index[0], $uncommon_tables_fields, $display);
unset($uncommon_tables[$table_index[0]]);
- }
+ }
}
}
}
@@ -964,14 +965,14 @@
* @uses is_string()
* @uses is_numeric()
* @uses PMA_DBI_try_query()
-*
-*
+*
+*
* @param $trg_db name of target database
* @param $trg_link connection established with target server
* @param $matching_tables array containing names of matching tables
* @param $source_columns array containing columns information of the source table
* @param $alter_str_array array containing the column name and criteria which is to be altered for the targert table
-* @param $matching_tables_fields array containing the name of the fields for the matching table
+* @param $matching_tables_fields array containing the name of the fields for the matching table
* @param $criteria array containing the criterias
* @param $matching_tables_keys array containing the field names which is key in the source table
* @param $target_tables_keys array containing the field names which is key in the target table
@@ -979,7 +980,7 @@
* @param $display true/false value
*/
function PMA_alterTargetTableStructure($trg_db, $trg_link, $matching_tables, &$source_columns, &$alter_str_array, $matching_tables_fields, $criteria,
- &$matching_tables_keys, &$target_tables_keys, $matching_table_index, $display)
+ &$matching_tables_keys, &$target_tables_keys, $matching_table_index, $display)
{
$check = true;
$sql_query = '';
@@ -1001,29 +1002,29 @@
}
$pri_query .= " ADD PRIMARY KEY (";
for ($z = 0; $z < sizeof($matching_tables_keys[$matching_table_index]); $z++) {
- $pri_query .= $matching_tables_keys[$matching_table_index][$z];
+ $pri_query .= PMA_backquote($matching_tables_keys[$matching_table_index][$z]);
if ($z < (sizeof($matching_tables_keys[$matching_table_index]) - 1)) {
$pri_query .= " , " ;
}
}
$pri_query .= ");";
}
-
+
if (isset($pri_query)) {
if ($display == true) {
echo '<p>' . $pri_query . '</p>';
}
- PMA_DBI_try_query($pri_query, $trg_link, 0);
+ PMA_DBI_try_query($pri_query, $trg_link, 0);
}
for ($t = 0; $t < sizeof($matching_tables_fields[$matching_table_index]); $t++) {
if ((isset($alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]])) && (sizeof($alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]]) > 0)) {
- $sql_query = 'ALTER TABLE ' . PMA_backquote($trg_db) . '.' . PMA_backquote($matching_tables[$matching_table_index]) . ' MODIFY ' .
- $matching_tables_fields[$matching_table_index][$t] . ' ' . $source_columns[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]]['Type'];
+ $sql_query = 'ALTER TABLE ' . PMA_backquote($trg_db) . '.' . PMA_backquote($matching_tables[$matching_table_index]) . ' MODIFY ' .
+ PMA_backquote($matching_tables_fields[$matching_table_index][$t]) . ' ' . $source_columns[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]]['Type'];
$found = false;
for ($i = 0; $i < sizeof($criteria); $i++)
{
if (isset($alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]][$criteria[$i]]) && $criteria[$i] != 'Key') {
- $found = true;
+ $found = true;
if (($criteria[$i] == 'Type') && (! isset($alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]][$criteria[$i+1]]))) {
if ($source_columns[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]][$criteria[$i + 1]] == 'NO') {
$sql_query .= " Not Null" ;
@@ -1049,12 +1050,12 @@
} elseif($criteria[$i] == 'Default') {
if(! (isset($alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]][$criteria[2]]))) {
$sql_query .= " Not Null " ;
- }
+ }
if (is_string($alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]][$criteria[$i]])) {
if ($source_columns[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]]['Type'] != 'timestamp') {
$sql_query .= " DEFAULT '" . $alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]][$criteria[$i]] . "'";
} elseif($source_columns[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]]['Type'] == 'timestamp') {
- $sql_query .= " DEFAULT " . $alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]][$criteria[$i]];
+ $sql_query .= " DEFAULT " . $alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]][$criteria[$i]];
}
} elseif (is_numeric($alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]][$criteria[$i]])) {
$sql_query .= " DEFAULT " . $alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]][$criteria[$i]];
@@ -1082,7 +1083,7 @@
for($p = 0; $p < sizeof($matching_tables_keys[$matching_table_index]); $p++) {
if ((isset($alter_str_array[$matching_table_index][$matching_tables_keys[$matching_table_index][$p]]['Key']))) {
$check = true;
- $query .= ' MODIFY ' . $matching_tables_keys[$matching_table_index][$p] . ' '
+ $query .= ' MODIFY ' . PMA_backquote($matching_tables_keys[$matching_table_index][$p]) . ' '
. $source_columns[$matching_table_index][$matching_tables_fields[$matching_table_index][$p]]['Type'] . ' Not Null ';
if ($p < (sizeof($matching_tables_keys[$matching_table_index]) - 1)) {
$query .= ', ';
@@ -1092,7 +1093,7 @@
if ($check) {
if ($display == true) {
echo '<p>' . $query . '</p>';
- }
+ }
PMA_DBI_try_query($query, $trg_link, 0);
}
}
@@ -1101,13 +1102,13 @@
* PMA_removeColumnsFromTargetTable() removes the columns which are present in target table but not in source table.
* @uses sizeof()
* @uses PMA_DBI_try_query()
-* @uses PMA_DBI_fetch_result()
-*
+* @uses PMA_DBI_fetch_result()
+*
* @param $trg_db name of target database
* @param $trg_link connection established with target server
* @param $matching_tables array containing names of matching tables
* @param $uncommon_columns array containing the names of the column which are to be dropped from the target table
-* @param $table_counter index of the matching table as in $matchiing_tables array
+* @param $table_counter index of the matching table as in $matchiing_tables array
* @param $display true/false value
*/
function PMA_removeColumnsFromTargetTable($trg_db, $trg_link, $matching_tables, $uncommon_columns, $table_counter, $display)
@@ -1116,67 +1117,67 @@
$drop_query = "ALTER TABLE " . PMA_backquote($trg_db) . "." . PMA_backquote($matching_tables[$table_counter]);
for ($a = 0; $a < sizeof($uncommon_columns[$table_counter]); $a++) {
//Checks if column to be removed is a foreign key in any table
- $pk_query = "SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE REFERENCED_TABLE_SCHEMA = '" . $trg_db . "'
+ $pk_query = "SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE REFERENCED_TABLE_SCHEMA = '" . $trg_db . "'
AND REFERENCED_TABLE_NAME = '" . $matching_tables[$table_counter]."' AND REFERENCED_COLUMN_NAME = '"
. $uncommon_columns[$table_counter][$a] . "' AND TABLE_NAME <> REFERENCED_TABLE_NAME;";
-
+
$pk_query_result = PMA_DBI_fetch_result($pk_query, null, null, $trg_link);
$result_size = sizeof($pk_query_result);
-
+
if ($result_size > 0) {
for ($b = 0; $b < $result_size; $b++) {
$drop_pk_query = "ALTER TABLE " . PMA_backquote($pk_query_result[$b]['TABLE_SCHEMA']) . "." . PMA_backquote($pk_query_result[$b]['TABLE_NAME']) . "
- DROP FOREIGN KEY " . $pk_query_result[$b]['CONSTRAINT_NAME'] . ", DROP COLUMN " . $pk_query_result[$b]['COLUMN_NAME'] . ";";
- PMA_DBI_try_query($drop_pk_query, $trg_link, 0);
- }
- }
- $query = "SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE TABLE_SCHEMA = '" . $trg_db . "' AND TABLE_NAME = '"
+ DROP FOREIGN KEY " . PMA_backquote($pk_query_result[$b]['CONSTRAINT_NAME']) . ", DROP COLUMN " . PMA_backquote($pk_query_result[$b]['COLUMN_NAME']) . ";";
+ PMA_DBI_try_query($drop_pk_query, $trg_link, 0);
+ }
+ }
+ $query = "SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE TABLE_SCHEMA = '" . $trg_db . "' AND TABLE_NAME = '"
. $matching_tables[$table_counter]. "' AND COLUMN_NAME = '" . $uncommon_columns[$table_counter][$a] . "'
AND TABLE_NAME <> REFERENCED_TABLE_NAME;";
$result = PMA_DBI_fetch_result($query, null, null, $trg_link);
if (sizeof($result) > 0) {
- $drop_query .= " DROP FOREIGN KEY " . $result[0]['CONSTRAINT_NAME'] . ",";
+ $drop_query .= " DROP FOREIGN KEY " . PMA_backquote($result[0]['CONSTRAINT_NAME']) . ",";
}
- $drop_query .= " DROP COLUMN " . $uncommon_columns[$table_counter][$a];
+ $drop_query .= " DROP COLUMN " . PMA_backquote($uncommon_columns[$table_counter][$a]);
if ($a < (sizeof($uncommon_columns[$table_counter]) - 1)) {
$drop_query .= " , " ;
- }
+ }
}
$drop_query .= ";" ;
-
+
if ($display == true) {
echo '<p>' . $drop_query . '</p>';
}
- PMA_DBI_try_query($drop_query, $trg_link, 0);
- }
-}
+ PMA_DBI_try_query($drop_query, $trg_link, 0);
+ }
+}
/**
* PMA_indexesDiffInTables() compares the source table indexes with target table indexes and keep the indexes to be added in target table in $add_indexes_array
* indexes to be altered in $alter_indexes_array and indexes to be removed from target table in $remove_indexes_array.
* Only keyname and uniqueness characteristic of the indexes are altered.
* @uses sizeof()
* @uses PMA_DBI_get_table_indexes()
-*
-* @param $src_db name of source database
+*
+* @param $src_db name of source database
* @param $trg_db name of target database
* @param $src_link connection established with source server
* @param $trg_link connection established with target server
* @param $matching_tables array containing the matching tables name
-* @param $source_indexes array containing the indexes of the source table
+* @param $source_indexes array containing the indexes of the source table
* @param $target_indexes array containing the indexes of the target table
* @param $add_indexes_array array containing the name of the column on which the index is to be added in the target table
* @param $alter_indexes_array array containing the key name which needs to be altered
* @param $remove_indexes_array array containing the key name of the index which is to be removed from the target table
-* @param $table_counter number of the matching table
+* @param $table_counter number of the matching table
*/
function PMA_indexesDiffInTables($src_db, $trg_db, $src_link, $trg_link, $matching_tables, &$source_indexes, &$target_indexes, &$add_indexes_array,
&$alter_indexes_array, &$remove_indexes_array, $table_counter)
{
//Gets indexes information for source and target table
$source_indexes[$table_counter] = PMA_DBI_get_table_indexes($src_db, $matching_tables[$table_counter],$src_link);
- $target_indexes[$table_counter] = PMA_DBI_get_table_indexes($trg_db, $matching_tables[$table_counter],$trg_link);
+ $target_indexes[$table_counter] = PMA_DBI_get_table_indexes($trg_db, $matching_tables[$table_counter],$trg_link);
for ($a = 0; $a < sizeof($source_indexes[$table_counter]); $a++) {
$found = false;
$z = 0;
@@ -1194,15 +1195,15 @@
}
}
}
- $z++;
+ $z++;
}
if ($found === false) {
if(! ($source_indexes[$table_counter][$a]['Key_name'] == 'PRIMARY')) {
- $add_indexes_array [$table_counter][] = $source_indexes[$table_counter][$a]['Column_name'];
+ $add_indexes_array [$table_counter][] = $source_indexes[$table_counter][$a]['Column_name'];
}
}
}
-
+
//Finds indexes that exist on target table but not on source table
for ($b = 0; $b < sizeof($target_indexes[$table_counter]); $b++) {
$found = false;
@@ -1212,31 +1213,31 @@
if ($target_indexes[$table_counter][$b]['Column_name'] == $source_indexes[$table_counter][$c]['Column_name']) {
$found = true;
}
- $c++;
+ $c++;
}
if ($found === false) {
- $remove_indexes_array[$table_counter][] = $target_indexes[$table_counter][$b]['Key_name'];
+ $remove_indexes_array[$table_counter][] = $target_indexes[$table_counter][$b]['Key_name'];
}
}
}
/**
-* PMA_applyIndexesDiff() create indexes, alters indexes and remove indexes.
+* PMA_applyIndexesDiff() create indexes, alters indexes and remove indexes.
* @uses sizeof()
* @uses PMA_DBI_try_query()
-*
+*
* @param $trg_db name of target database
* @param $trg_link connection established with target server
* @param $matching_tables array containing the matching tables name
-* @param $source_indexes array containing the indexes of the source table
+* @param $source_indexes array containing the indexes of the source table
* @param $target_indexes array containing the indexes of the target table
* @param $add_indexes_array array containing the column names on which indexes are to be created in target table
* @param $alter_indexes_array array containing the column names for which indexes are to be altered
* @param $remove_indexes_array array containing the key name of the indexes which are to be removed from the target table
-* @param $table_counter number of the matching table
+* @param $table_counter number of the matching table
* @param $display true/false value
*/
-function PMA_applyIndexesDiff ($trg_db, $trg_link, $matching_tables, $source_indexes, $target_indexes, $add_indexes_array, $alter_indexes_array,
+function PMA_applyIndexesDiff ($trg_db, $trg_link, $matching_tables, $source_indexes, $target_indexes, $add_indexes_array, $alter_indexes_array,
$remove_indexes_array, $table_counter, $display)
{
//Adds indexes on target table
@@ -1244,12 +1245,12 @@
$sql = "ALTER TABLE " . PMA_backquote($trg_db) . "." . PMA_backquote($matching_tables[$table_counter]) . " ADD" ;
for ($a = 0; $a < sizeof($source_indexes[$table_counter]); $a++) {
if (isset($add_indexes_array[$table_counter][$a])) {
- for ($b = 0; $b < sizeof($source_indexes[$table_counter]); $b++) {
+ for ($b = 0; $b < sizeof($source_indexes[$table_counter]); $b++) {
if ($source_indexes[$table_counter][$b]['Column_name'] == $add_indexes_array[$table_counter][$a]) {
if ($source_indexes[$table_counter][$b]['Non_unique'] == '0') {
$sql .= " UNIQUE ";
}
- $sql .= " INDEX " . $source_indexes[$table_counter][$b]['Key_name'] . " (" . $add_indexes_array[$table_counter][$a] . " );";
+ $sql .= " INDEX " . PMA_backquote($source_indexes[$table_counter][$b]['Key_name']) . " (" . $add_indexes_array[$table_counter][$a] . " );";
if ($display == true) {
echo '<p>' . $sql . '</p>';
}
@@ -1265,9 +1266,9 @@
$query = "ALTER TABLE " . PMA_backquote($trg_db) . "." . PMA_backquote($matching_tables[$table_counter]);
for ($a = 0; $a < sizeof($alter_indexes_array[$table_counter]); $a++) {
if (isset($alter_indexes_array[$table_counter][$a])) {
- $query .= ' DROP INDEX ' . PMA_backquote($alter_indexes_array[$table_counter][$a]) . " , ADD ";
+ $query .= ' DROP INDEX ' . PMA_backquote($alter_indexes_array[$table_counter][$a]) . " , ADD ";
$got_first_index_column = false;
- for ($z = 0; $z < sizeof($source_indexes[$table_counter]); $z++) {
+ for ($z = 0; $z < sizeof($source_indexes[$table_counter]); $z++) {
if ($source_indexes[$table_counter][$z]['Key_name'] == $alter_indexes_array[$table_counter][$a]) {
if (! $got_first_index_column) {
if ($source_indexes[$table_counter][$z]['Non_unique'] == '0') {
@@ -1294,26 +1295,26 @@
$drop_index_query = "ALTER TABLE " . PMA_backquote($trg_db) . "." . PMA_backquote($matching_tables[$table_counter]);
for ($a = 0; $a < sizeof($target_indexes[$table_counter]); $a++) {
if (isset($remove_indexes_array[$table_counter][$a])) {
- $drop_index_query .= " DROP INDEX " . $remove_indexes_array[$table_counter][$a];
+ $drop_index_query .= " DROP INDEX " . PMA_backquote($remove_indexes_array[$table_counter][$a]);
}
if ($a < (sizeof($remove_indexes_array[$table_counter]) - 1)) {
$drop_index_query .= " , " ;
}
}
- $drop_index_query .= " ; " ;
+ $drop_index_query .= " ; " ;
if ($display == true) {
echo '<p>' . $drop_index_query . '</p>';
}
- PMA_DBI_try_query($drop_index_query, $trg_link, 0);
+ PMA_DBI_try_query($drop_index_query, $trg_link, 0);
}
}
/**
* PMA_displayQuery() displays a query, taking the maximum display size
- * into account
- * @uses $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']
- *
- * @param $query the query to display
+ * into account
+ * @uses $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']
+ *
+ * @param $query the query to display
*/
function PMA_displayQuery($query) {
if (strlen($query) > $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) {
@@ -1323,18 +1324,18 @@
}
/**
- * PMA_syncDisplayHeaderSource() shows the header for source database
- * @uses $_SESSION['src_type']
- * @uses $_SESSION['src_server']['host']
+ * PMA_syncDisplayHeaderSource() shows the header for source database
+ * @uses $_SESSION['src_type']
+ * @uses $_SESSION['src_server']['host']
*
- * @param string $src_db source db name
+ * @param string $src_db source db name
*/
function PMA_syncDisplayHeaderSource($src_db) {
echo '<div id="serverstatus" style = "overflow: auto; width: 1020px; height: 220px; border-left: 1px gray solid; border-bottom: 1px gray solid; padding:0px; margin-bottom: 1em "> ';
echo '<table id="serverstatusconnections" class="data" width="55%">';
echo '<tr>';
- echo '<th>' . __('Source database') . ': ' . $src_db . '<br />(';
+ echo '<th>' . __('Source database') . ': ' . htmlspecialchars($src_db) . '<br />(';
if ('cur' == $_SESSION['src_type']) {
echo __('Current server');
} else {
@@ -1347,17 +1348,17 @@
/**
* PMA_syncDisplayHeaderTargetAndMatchingTables() shows the header for target database and the matching tables
- * @uses $_SESSION['trg_type']
- * @uses $_SESSION['trg_server']['host']
- *
- * @param string $trg_db target db name
+ * @uses $_SESSION['trg_type']
+ * @uses $_SESSION['trg_server']['host']
+ *
+ * @param string $trg_db target db name
* @param array $matching_tables
- * @return boolean $odd_row current value of this toggle
+ * @return boolean $odd_row current value of this toggle
*/
function PMA_syncDisplayHeaderTargetAndMatchingTables($trg_db, $matching_tables) {
echo '<table id="serverstatusconnections" class="data" width="43%">';
echo '<tr>';
- echo '<th>' . __('Target database') . ': '. $trg_db . '<br />(';
+ echo '<th>' . __('Target database') . ': '. htmlspecialchars($trg_db) . '<br />(';
if ('cur' == $_SESSION['trg_type']) {
echo __('Current server');
} else {
@@ -1375,10 +1376,10 @@
}
/**
- * PMA_syncDisplayBeginTableRow() displays the TR tag for alternating colors
- *
- * @param boolean $odd_row current status of the toggle
- * @return boolean $odd_row final status of the toggle
+ * PMA_syncDisplayBeginTableRow() displays the TR tag for alternating colors
+ *
+ * @param boolean $odd_row current status of the toggle
+ * @return boolean $odd_row final status of the toggle
*/
function PMA_syncDisplayBeginTableRow($odd_row) {
$odd_row = ! $odd_row;
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/libraries/sqlparser.data.php
^
|
@@ -657,6 +657,7 @@
'TO',
'TRAILING',
'TRANSACTIONAL', // 5.1 ?
+ 'TRUE',
'TRUNCATE',
'TYPE',
'TYPES',
@@ -684,7 +685,7 @@
*
* @global integer MySQL reserved words count
*/
-$PMA_SQPdata_reserved_word_cnt = 287;
+$PMA_SQPdata_reserved_word_cnt = 288;
/**
* words forbidden to be used as column or table name wihtout quotes
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/libraries/vendor_config.php
^
|
@@ -59,4 +59,10 @@
* Default value for check for version upgrades.
*/
define('VERSION_CHECK_DEFAULT', true);
+
+/**
+ * Path to gettext.inc file. Useful when you want php-gettext somewhere else,
+ * eg. /usr/share/php/gettext/gettext.inc.
+ */
+define('GETTEXT_INC', './libraries/php-gettext/gettext.inc');
?>
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/ar/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/be/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/be@latin/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/bg/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/bn/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/ca/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/cs/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/da/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/de/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/el/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/en_GB/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/es/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/et/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/fi/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/fr/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/gl/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/hi/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/hr/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/hu/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/id/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/it/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/ja/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/ka/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/lt/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/mn/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/nb/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/nl/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/pl/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/pt_BR/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/ro/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/ru/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/si/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/sk/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/sl/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/sr/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/sr@latin/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/sv/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/tr/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/uz/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/uz@latin/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/zh_CN/LC_MESSAGES/phpmyadmin.mo
^
|
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/locale/zh_TW/LC_MESSAGES/phpmyadmin.mo
^
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/tbl_indexes.php
^
|
@@ -200,7 +200,7 @@
|| preg_match('/(char|text)/i', $field_type)) {
echo '<option value="' . htmlspecialchars($field_name) . '"'
. (($field_name == $column->getName()) ? ' selected="selected"' : '') . '>'
- . htmlspecialchars($field_name) . ' [' . $field_type . ']'
+ . htmlspecialchars($field_name) . ' [' . htmlspecialchars($field_type) . ']'
. '</option>' . "\n";
}
} // end foreach $fields
@@ -222,7 +222,7 @@
<?php
foreach ($fields as $field_name => $field_type) {
echo '<option value="' . htmlspecialchars($field_name) . '">'
- . htmlspecialchars($field_name) . ' [' . $field_type . ']'
+ . htmlspecialchars($field_name) . ' [' . htmlspecialchars($field_type) . ']'
. '</option>' . "\n";
} // end foreach $fields
?>
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/tbl_select.php
^
|
@@ -124,7 +124,7 @@
?>
<tr class="noclick <?php echo $odd_row ? 'odd' : 'even'; $odd_row = ! $odd_row; ?>">
<th><?php echo htmlspecialchars($fields_list[$i]); ?></th>
- <td><?php echo $fields_type[$i]; ?></td>
+ <td><?php echo htmlspecialchars($fields_type[$i]); ?></td>
<td><?php echo $fields_collation[$i]; ?></td>
<td><select name="func[]">
<?php
@@ -190,7 +190,7 @@
<?php
} elseif (strncasecmp($fields_type[$i], 'enum', 4) == 0) {
// e n u m s
- $enum_value=explode(', ', str_replace("'", '', substr($fields_type[$i], 5, -1)));
+ $enum_value=explode(', ', str_replace("'", '', substr(htmlspecialchars($fields_type[$i]), 5, -1)));
$cnt_enum_value = count($enum_value);
echo ' <select name="fields[' . $i . '][]"'
.' multiple="multiple" size="' . min(3, $cnt_enum_value) . '">' . "\n";
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:vhcs2-2.4.8.rev894.tar.bz2/gui/tools/pma3/themes/pmahomme/css/theme_right.css.php
^
|
@@ -65,7 +65,10 @@
.data{
margin: 0 0 12px 0;
+}
+#table_results td.data {
+border-right: 1px solid #BBBBBB;
}
h3 {
@@ -372,9 +375,10 @@
}
/* even items 2,4,6,8,... */
+/* (tested on CRTs and ACLs) */
table tr.even th,
.even {
- background: #f3f3f3;
+ background: #DFDFDF;
}
/* odd table rows 1,3,5,7,... */
|