Git
Threads by month
- ----- 2025 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- 13 participants
- 38624 discussions

[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_7_1-23167-g29e658a
by Marc Delisle 21 Nov '11
by Marc Delisle 21 Nov '11
21 Nov '11
The branch, master has been updated
via 29e658a1f796fe7a843faaa49e0c4942fd4ed2fc (commit)
via e2b6af5a99b9a053609ff76724fdc4a6a48dd14e (commit)
from a26e706378806eb428bf32038b590612784141e6 (commit)
- Log -----------------------------------------------------------------
commit 29e658a1f796fe7a843faaa49e0c4942fd4ed2fc
Merge: a26e706 e2b6af5
Author: Marc Delisle <marc(a)infomarc.info>
Date: Mon Nov 21 12:42:07 2011 -0500
Merge branch 'QA_3_4'
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 1 +
libraries/auth/cookie.auth.lib.php | 4 ++++
libraries/auth/http.auth.lib.php | 4 ++++
3 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 74fb791..7cbd315 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -78,6 +78,7 @@ phpMyAdmin - ChangeLog
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
3.4.7.1 (2011-11-10)
- [security] Fixed possible local file inclusion in XML import
diff --git a/libraries/auth/cookie.auth.lib.php b/libraries/auth/cookie.auth.lib.php
index c21dbd6..4012db8 100644
--- a/libraries/auth/cookie.auth.lib.php
+++ b/libraries/auth/cookie.auth.lib.php
@@ -480,6 +480,10 @@ function PMA_auth_set_user()
$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
diff --git a/libraries/auth/http.auth.lib.php b/libraries/auth/http.auth.lib.php
index 147a507..7a84eea 100644
--- a/libraries/auth/http.auth.lib.php
+++ b/libraries/auth/http.auth.lib.php
@@ -207,6 +207,10 @@ function PMA_auth_set_user()
$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
hooks/post-receive
--
phpMyAdmin
1
0

[Phpmyadmin-git] [SCM] phpMyAdmin branch, QA_3_4, updated. RELEASE_3_4_7_1-33-ge2b6af5
by Marc Delisle 21 Nov '11
by Marc Delisle 21 Nov '11
21 Nov '11
The branch, QA_3_4 has been updated
via e2b6af5a99b9a053609ff76724fdc4a6a48dd14e (commit)
from e7877fba46743be0b351c526ccac216731ab8c1e (commit)
- Log -----------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 1 +
libraries/auth/cookie.auth.lib.php | 4 ++++
libraries/auth/http.auth.lib.php | 4 ++++
3 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 7d5cf3d..c4817ff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -18,6 +18,7 @@ phpMyAdmin - ChangeLog
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
3.4.7.1 (2011-11-10)
- [security] Fixed possible local file inclusion in XML import
diff --git a/libraries/auth/cookie.auth.lib.php b/libraries/auth/cookie.auth.lib.php
index c04d5a2..93b567a 100644
--- a/libraries/auth/cookie.auth.lib.php
+++ b/libraries/auth/cookie.auth.lib.php
@@ -549,6 +549,10 @@ function PMA_auth_set_user()
$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
diff --git a/libraries/auth/http.auth.lib.php b/libraries/auth/http.auth.lib.php
index b3d305a..b4bc030 100644
--- a/libraries/auth/http.auth.lib.php
+++ b/libraries/auth/http.auth.lib.php
@@ -207,6 +207,10 @@ function PMA_auth_set_user()
$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
hooks/post-receive
--
phpMyAdmin
1
0

[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_7_1-23165-ga26e706
by Rouslan Placella 21 Nov '11
by Rouslan Placella 21 Nov '11
21 Nov '11
The branch, master has been updated
via a26e706378806eb428bf32038b590612784141e6 (commit)
via b9cc59f43ebeb2417e8e9a7eea932f64e43b0ecb (commit)
from 000f8878d24b36497f7b8bcb392eee1523837908 (commit)
- Log -----------------------------------------------------------------
commit a26e706378806eb428bf32038b590612784141e6
Author: Rouslan Placella <rouslan(a)placella.com>
Date: Mon Nov 21 14:47:41 2011 +0000
Regenerated sprites
commit b9cc59f43ebeb2417e8e9a7eea932f64e43b0ecb
Author: Rouslan Placella <rouslan(a)placella.com>
Date: Mon Nov 21 14:25:09 2011 +0000
Updated the disabled versions of icons
-----------------------------------------------------------------------
Summary of changes:
themes/pmahomme/img/b_empty.png | Bin 326 -> 615 bytes
themes/pmahomme/img/bd_browse.png | Bin 157 -> 431 bytes
themes/pmahomme/img/bd_deltbl.png | Bin 278 -> 510 bytes
themes/pmahomme/img/bd_drop.png | Bin 205 -> 560 bytes
themes/pmahomme/img/bd_empty.png | Bin 186 -> 511 bytes
themes/pmahomme/img/bd_firstpage.png | Bin 125 -> 613 bytes
themes/pmahomme/img/bd_ftext.png | Bin 175 -> 473 bytes
themes/pmahomme/img/bd_index.png | Bin 207 -> 560 bytes
themes/pmahomme/img/bd_lastpage.png | Bin 128 -> 603 bytes
themes/pmahomme/img/bd_nextpage.png | Bin 110 -> 302 bytes
themes/pmahomme/img/bd_prevpage.png | Bin 114 -> 303 bytes
themes/pmahomme/img/bd_primary.png | Bin 257 -> 476 bytes
themes/pmahomme/img/bd_sbrowse.png | Bin 122 -> 431 bytes
themes/pmahomme/img/bd_select.png | Bin 375 -> 536 bytes
themes/pmahomme/img/bd_spatial.png | Bin 344 -> 375 bytes
themes/pmahomme/img/bd_unique.png | Bin 175 -> 508 bytes
themes/pmahomme/img/sprites.png | Bin 57711 -> 60124 bytes
themes/pmahomme/sprites.lib.php | 16 ++++++++--------
18 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/themes/pmahomme/img/b_empty.png b/themes/pmahomme/img/b_empty.png
index a751d51..fd6ec8d 100644
Binary files a/themes/pmahomme/img/b_empty.png and b/themes/pmahomme/img/b_empty.png differ
diff --git a/themes/pmahomme/img/bd_browse.png b/themes/pmahomme/img/bd_browse.png
index 18a1211..d21edab 100644
Binary files a/themes/pmahomme/img/bd_browse.png and b/themes/pmahomme/img/bd_browse.png differ
diff --git a/themes/pmahomme/img/bd_deltbl.png b/themes/pmahomme/img/bd_deltbl.png
index 3f91af2..e7e4e59 100644
Binary files a/themes/pmahomme/img/bd_deltbl.png and b/themes/pmahomme/img/bd_deltbl.png differ
diff --git a/themes/pmahomme/img/bd_drop.png b/themes/pmahomme/img/bd_drop.png
index 97a3da5..4b10084 100644
Binary files a/themes/pmahomme/img/bd_drop.png and b/themes/pmahomme/img/bd_drop.png differ
diff --git a/themes/pmahomme/img/bd_empty.png b/themes/pmahomme/img/bd_empty.png
index 7c4ae3e..cffb040 100644
Binary files a/themes/pmahomme/img/bd_empty.png and b/themes/pmahomme/img/bd_empty.png differ
diff --git a/themes/pmahomme/img/bd_firstpage.png b/themes/pmahomme/img/bd_firstpage.png
index dbb0223..d2943fc 100644
Binary files a/themes/pmahomme/img/bd_firstpage.png and b/themes/pmahomme/img/bd_firstpage.png differ
diff --git a/themes/pmahomme/img/bd_ftext.png b/themes/pmahomme/img/bd_ftext.png
index fb0c302..a0bdcc6 100644
Binary files a/themes/pmahomme/img/bd_ftext.png and b/themes/pmahomme/img/bd_ftext.png differ
diff --git a/themes/pmahomme/img/bd_index.png b/themes/pmahomme/img/bd_index.png
index d6e417c..25141bc 100644
Binary files a/themes/pmahomme/img/bd_index.png and b/themes/pmahomme/img/bd_index.png differ
diff --git a/themes/pmahomme/img/bd_lastpage.png b/themes/pmahomme/img/bd_lastpage.png
index ed79351..1827ee9 100644
Binary files a/themes/pmahomme/img/bd_lastpage.png and b/themes/pmahomme/img/bd_lastpage.png differ
diff --git a/themes/pmahomme/img/bd_nextpage.png b/themes/pmahomme/img/bd_nextpage.png
index f8e25f5..244cdbd 100644
Binary files a/themes/pmahomme/img/bd_nextpage.png and b/themes/pmahomme/img/bd_nextpage.png differ
diff --git a/themes/pmahomme/img/bd_prevpage.png b/themes/pmahomme/img/bd_prevpage.png
index 7f94284..e0073cf 100644
Binary files a/themes/pmahomme/img/bd_prevpage.png and b/themes/pmahomme/img/bd_prevpage.png differ
diff --git a/themes/pmahomme/img/bd_primary.png b/themes/pmahomme/img/bd_primary.png
index 58f9cfd..792bfa7 100644
Binary files a/themes/pmahomme/img/bd_primary.png and b/themes/pmahomme/img/bd_primary.png differ
diff --git a/themes/pmahomme/img/bd_sbrowse.png b/themes/pmahomme/img/bd_sbrowse.png
index 8539599..d21edab 100644
Binary files a/themes/pmahomme/img/bd_sbrowse.png and b/themes/pmahomme/img/bd_sbrowse.png differ
diff --git a/themes/pmahomme/img/bd_select.png b/themes/pmahomme/img/bd_select.png
index 1659a65..412926a 100644
Binary files a/themes/pmahomme/img/bd_select.png and b/themes/pmahomme/img/bd_select.png differ
diff --git a/themes/pmahomme/img/bd_spatial.png b/themes/pmahomme/img/bd_spatial.png
index d1ee4d6..c974720 100644
Binary files a/themes/pmahomme/img/bd_spatial.png and b/themes/pmahomme/img/bd_spatial.png differ
diff --git a/themes/pmahomme/img/bd_unique.png b/themes/pmahomme/img/bd_unique.png
index ee0fde9..28227cb 100644
Binary files a/themes/pmahomme/img/bd_unique.png and b/themes/pmahomme/img/bd_unique.png differ
diff --git a/themes/pmahomme/img/sprites.png b/themes/pmahomme/img/sprites.png
index aa196ce..21b5205 100644
Binary files a/themes/pmahomme/img/sprites.png and b/themes/pmahomme/img/sprites.png differ
diff --git a/themes/pmahomme/sprites.lib.php b/themes/pmahomme/sprites.lib.php
index 615bbce..a5d3355 100644
--- a/themes/pmahomme/sprites.lib.php
+++ b/themes/pmahomme/sprites.lib.php
@@ -82,7 +82,7 @@ function PMA_sprites() {
'bd_firstpage' => array(
'position' => '16',
'width' => '16',
- 'height' => '13'
+ 'height' => '16'
),
'bd_ftext' => array(
'position' => '17',
@@ -102,12 +102,12 @@ function PMA_sprites() {
'bd_lastpage' => array(
'position' => '20',
'width' => '16',
- 'height' => '13'
+ 'height' => '16'
),
'bd_nextpage' => array(
'position' => '21',
- 'width' => '8',
- 'height' => '13'
+ 'width' => '16',
+ 'height' => '16'
),
'b_docs' => array(
'position' => '22',
@@ -121,8 +121,8 @@ function PMA_sprites() {
),
'bd_prevpage' => array(
'position' => '24',
- 'width' => '8',
- 'height' => '13'
+ 'width' => '16',
+ 'height' => '16'
),
'bd_primary' => array(
'position' => '25',
@@ -136,8 +136,8 @@ function PMA_sprites() {
),
'bd_sbrowse' => array(
'position' => '27',
- 'width' => '10',
- 'height' => '10'
+ 'width' => '16',
+ 'height' => '16'
),
'bd_select' => array(
'position' => '28',
hooks/post-receive
--
phpMyAdmin
1
0

[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_7_1-23163-g000f887
by Michal Čihař 21 Nov '11
by Michal Čihař 21 Nov '11
21 Nov '11
The branch, master has been updated
via 000f8878d24b36497f7b8bcb392eee1523837908 (commit)
via 3139ec6eadcee340b041224c7eb3a4b689a22b16 (commit)
via 5e0a2fc7c75bbe8d875e3c54a9310fb110c9893a (commit)
via f2b1b9e7e05138741f093517c0aadb930be8e055 (commit)
via f2c35ea0bdd1d3d2c98f3bfbcf3dcaaf2a78edd0 (commit)
via 54928e3ef865902ecd7724c0b69da2bc9c9b33c3 (commit)
via 92acfd569087c5375e530a9dd1ee986fb3af4e57 (commit)
via 7ea7668b0dbf35641cbc8c80ff0da94f6efba4f1 (commit)
via 39200b7d05e2b9bd154b6b31701971eca85fa3c5 (commit)
via 6690a7e486c209502ea8069801653f806a4359a6 (commit)
via dc07a2cb0b91a986c6e632316771a48a48f17297 (commit)
via e5117db2c596ccadfb5820200e5f5334e2c1a93c (commit)
via 29138343d53c750cbbd8e72716b1368da7c3f023 (commit)
via d0cb322404f2d46c3c228f78640c7c612a7c0347 (commit)
via bc367652cf2bddc3595821ea390b995e49bbc78a (commit)
via 5e12ddff239c51902e78b6b1c2302e5e36bbf49e (commit)
via a8a5e27822fb3cdf54399eb379329b173d44233d (commit)
via 3f00a394e1b644c265bac793a5ebfa8dee9f5332 (commit)
via aab32181e8286db41844cde5e5824070928ec032 (commit)
via 8cb035837f328ab7a8c98a33c060dac9815fd4d8 (commit)
via 8a1b89391112b3b4dd2769e9542a02f46e7ed8c6 (commit)
via ef64d2b02e4f3a74e2b0058b54d2ce76ca72fc9e (commit)
via 1a71a47dbfc0a580c23546dd0a9593f8fa8bddf5 (commit)
via 9210558c642f894e59449d5d0df7b5f5f0898686 (commit)
via f0d108fd53be7e1b94acd6d97243f7122a09911c (commit)
via 134adfd565b67d664bdec4cc7e6eb3596af8bbde (commit)
via 0a8e77a42fe12425e189162d3386fbd79f1339a7 (commit)
via 34802de9ee208c263266255a395b2fd0ca1f0bf3 (commit)
via 30b9efd330744aaeb5679d9e8b629b670eafdbcb (commit)
via 36d2e929252b463c6dd74789506f579beebba079 (commit)
via 3144e1ebfb39296ec9948a58a8f58924cdeb56aa (commit)
via df99d6be725fbaa8994fafb3a6863cd8adf081cf (commit)
via 8c8c31a00f4c57d7f8e1c677e681fce775f568cb (commit)
via e57961d5584af3e95237af24a8b7dfe45d9b540e (commit)
from 7962d72a46a006e293691181af82f889ecfa5e02 (commit)
- Log -----------------------------------------------------------------
commit 000f8878d24b36497f7b8bcb392eee1523837908
Author: Michal Čihař <michal(a)cihar.com>
Date: Mon Nov 21 12:36:43 2011 +0100
Fix format string
commit 3139ec6eadcee340b041224c7eb3a4b689a22b16
Author: Burak Yavuz <hitowerdigit(a)hotmail.com>
Date: Mon Nov 21 12:52:05 2011 +0200
Translation update done using Pootle.
commit 5e0a2fc7c75bbe8d875e3c54a9310fb110c9893a
Author: Burak Yavuz <hitowerdigit(a)hotmail.com>
Date: Mon Nov 21 12:51:41 2011 +0200
Translation update done using Pootle.
commit f2b1b9e7e05138741f093517c0aadb930be8e055
Author: Burak Yavuz <hitowerdigit(a)hotmail.com>
Date: Mon Nov 21 12:51:24 2011 +0200
Translation update done using Pootle.
commit f2c35ea0bdd1d3d2c98f3bfbcf3dcaaf2a78edd0
Author: Burak Yavuz <hitowerdigit(a)hotmail.com>
Date: Mon Nov 21 12:51:09 2011 +0200
Translation update done using Pootle.
commit 54928e3ef865902ecd7724c0b69da2bc9c9b33c3
Author: Burak Yavuz <hitowerdigit(a)hotmail.com>
Date: Mon Nov 21 12:50:46 2011 +0200
Translation update done using Pootle.
commit 92acfd569087c5375e530a9dd1ee986fb3af4e57
Author: Yuichiro <yuichiro(a)pop07.odn.ne.jp>
Date: Mon Nov 21 12:06:34 2011 +0200
Translation update done using Pootle.
commit 7ea7668b0dbf35641cbc8c80ff0da94f6efba4f1
Author: Yuichiro <yuichiro(a)pop07.odn.ne.jp>
Date: Mon Nov 21 11:54:02 2011 +0200
Translation update done using Pootle.
commit 39200b7d05e2b9bd154b6b31701971eca85fa3c5
Author: Yuichiro <yuichiro(a)pop07.odn.ne.jp>
Date: Mon Nov 21 11:53:28 2011 +0200
Translation update done using Pootle.
commit 6690a7e486c209502ea8069801653f806a4359a6
Author: Yuichiro <yuichiro(a)pop07.odn.ne.jp>
Date: Mon Nov 21 11:53:04 2011 +0200
Translation update done using Pootle.
commit dc07a2cb0b91a986c6e632316771a48a48f17297
Author: Yuichiro <yuichiro(a)pop07.odn.ne.jp>
Date: Mon Nov 21 11:48:26 2011 +0200
Translation update done using Pootle.
commit e5117db2c596ccadfb5820200e5f5334e2c1a93c
Author: Yuichiro <yuichiro(a)pop07.odn.ne.jp>
Date: Mon Nov 21 11:46:57 2011 +0200
Translation update done using Pootle.
commit 29138343d53c750cbbd8e72716b1368da7c3f023
Author: Yuichiro <yuichiro(a)pop07.odn.ne.jp>
Date: Mon Nov 21 11:26:04 2011 +0200
Translation update done using Pootle.
commit d0cb322404f2d46c3c228f78640c7c612a7c0347
Author: Yuichiro <yuichiro(a)pop07.odn.ne.jp>
Date: Mon Nov 21 11:24:37 2011 +0200
Translation update done using Pootle.
commit bc367652cf2bddc3595821ea390b995e49bbc78a
Author: Yuichiro <yuichiro(a)pop07.odn.ne.jp>
Date: Mon Nov 21 11:22:49 2011 +0200
Translation update done using Pootle.
commit 5e12ddff239c51902e78b6b1c2302e5e36bbf49e
Author: Yuichiro <yuichiro(a)pop07.odn.ne.jp>
Date: Mon Nov 21 11:21:18 2011 +0200
Translation update done using Pootle.
commit a8a5e27822fb3cdf54399eb379329b173d44233d
Author: Yuichiro <yuichiro(a)pop07.odn.ne.jp>
Date: Mon Nov 21 11:20:54 2011 +0200
Translation update done using Pootle.
commit 3f00a394e1b644c265bac793a5ebfa8dee9f5332
Author: Yuichiro <yuichiro(a)pop07.odn.ne.jp>
Date: Mon Nov 21 11:20:00 2011 +0200
Translation update done using Pootle.
commit aab32181e8286db41844cde5e5824070928ec032
Author: Yuichiro <yuichiro(a)pop07.odn.ne.jp>
Date: Mon Nov 21 11:19:39 2011 +0200
Translation update done using Pootle.
commit 8cb035837f328ab7a8c98a33c060dac9815fd4d8
Author: Yuichiro <yuichiro(a)pop07.odn.ne.jp>
Date: Mon Nov 21 11:18:59 2011 +0200
Translation update done using Pootle.
commit 8a1b89391112b3b4dd2769e9542a02f46e7ed8c6
Author: Yuichiro <yuichiro(a)pop07.odn.ne.jp>
Date: Mon Nov 21 11:18:42 2011 +0200
Translation update done using Pootle.
commit ef64d2b02e4f3a74e2b0058b54d2ce76ca72fc9e
Author: Yuichiro <yuichiro(a)pop07.odn.ne.jp>
Date: Mon Nov 21 11:16:55 2011 +0200
Translation update done using Pootle.
commit 1a71a47dbfc0a580c23546dd0a9593f8fa8bddf5
Author: Yuichiro <yuichiro(a)pop07.odn.ne.jp>
Date: Mon Nov 21 11:16:40 2011 +0200
Translation update done using Pootle.
commit 9210558c642f894e59449d5d0df7b5f5f0898686
Author: Yuichiro <yuichiro(a)pop07.odn.ne.jp>
Date: Mon Nov 21 11:16:22 2011 +0200
Translation update done using Pootle.
commit f0d108fd53be7e1b94acd6d97243f7122a09911c
Author: Yuichiro <yuichiro(a)pop07.odn.ne.jp>
Date: Mon Nov 21 11:15:40 2011 +0200
Translation update done using Pootle.
commit 134adfd565b67d664bdec4cc7e6eb3596af8bbde
Author: Yuichiro <yuichiro(a)pop07.odn.ne.jp>
Date: Mon Nov 21 11:13:51 2011 +0200
Translation update done using Pootle.
commit 0a8e77a42fe12425e189162d3386fbd79f1339a7
Author: Yuichiro <yuichiro(a)pop07.odn.ne.jp>
Date: Mon Nov 21 11:13:32 2011 +0200
Translation update done using Pootle.
commit 34802de9ee208c263266255a395b2fd0ca1f0bf3
Merge: 30b9efd 7962d72
Author: Pootle server <pootle(a)cihar.com>
Date: Sun Nov 20 20:40:11 2011 +0100
Merge remote-tracking branch 'origin/master'
commit 30b9efd330744aaeb5679d9e8b629b670eafdbcb
Merge: 36d2e92 b5c2473
Author: Pootle server <pootle(a)cihar.com>
Date: Sun Nov 20 18:40:16 2011 +0100
Merge remote-tracking branch 'origin/master'
commit 36d2e929252b463c6dd74789506f579beebba079
Author: Matías Bellone <matiasbellone(a)gmail.com>
Date: Sun Nov 20 19:31:35 2011 +0200
Translation update done using Pootle.
commit 3144e1ebfb39296ec9948a58a8f58924cdeb56aa
Author: Matías Bellone <matiasbellone(a)gmail.com>
Date: Sun Nov 20 19:31:21 2011 +0200
Translation update done using Pootle.
commit df99d6be725fbaa8994fafb3a6863cd8adf081cf
Author: Matías Bellone <matiasbellone(a)gmail.com>
Date: Sun Nov 20 19:31:07 2011 +0200
Translation update done using Pootle.
commit 8c8c31a00f4c57d7f8e1c677e681fce775f568cb
Author: Matías Bellone <matiasbellone(a)gmail.com>
Date: Sun Nov 20 19:30:46 2011 +0200
Translation update done using Pootle.
commit e57961d5584af3e95237af24a8b7dfe45d9b540e
Author: Matías Bellone <matiasbellone(a)gmail.com>
Date: Sun Nov 20 19:30:36 2011 +0200
Translation update done using Pootle.
-----------------------------------------------------------------------
Summary of changes:
po/es.po | 18 +++++--------
po/ja.po | 80 +++++++++++++++++++++++++------------------------------------
po/tr.po | 18 +++++--------
3 files changed, 47 insertions(+), 69 deletions(-)
diff --git a/po/es.po b/po/es.po
index 2ae849c..4cc28de 100644
--- a/po/es.po
+++ b/po/es.po
@@ -4,7 +4,7 @@ msgstr ""
"Project-Id-Version: phpMyAdmin 3.5.0-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel(a)lists.sourceforge.net\n"
"POT-Creation-Date: 2011-11-20 15:13+0100\n"
-"PO-Revision-Date: 2011-11-13 17:22+0200\n"
+"PO-Revision-Date: 2011-11-20 19:31+0200\n"
"Last-Translator: Matías Bellone <matiasbellone(a)gmail.com>\n"
"Language-Team: spanish <es(a)li.org>\n"
"Language: es\n"
@@ -1118,16 +1118,15 @@ msgid "Add Index"
msgstr "Agregar índice"
#: js/messages.php:47
-#, fuzzy
#| msgid "Edit mode"
msgid "Edit Index"
-msgstr "Modalidad de edición"
+msgstr "Editar índice"
#: js/messages.php:48 tbl_indexes.php:286
-#, fuzzy, php-format
+#, php-format
#| msgid "Add %s column(s)"
msgid "Add %d column(s) to index"
-msgstr "Agregar %s columna(s)"
+msgstr "Agregar %d columna(s) al índice"
#. l10n: Default description for the y-Axis of Charts
#: js/messages.php:52
@@ -1851,16 +1850,14 @@ msgid "Select two different columns"
msgstr "Seleccionar dos columnas distintas"
#: js/messages.php:290
-#, fuzzy
#| msgid "Query results operations"
msgid "Query results"
-msgstr "Operaciones sobre los resultados de la consulta"
+msgstr "Resultados de la consulta"
#: js/messages.php:291
-#, fuzzy
#| msgid "Data pointer size"
msgid "Data point content"
-msgstr "Tamaño del puntero de datos"
+msgstr "Contenido del punto de datos"
#: js/messages.php:294 tbl_change.php:312 tbl_indexes.php:221
#: tbl_indexes.php:248
@@ -11530,10 +11527,9 @@ msgid "Add index"
msgstr "Agregar índice"
#: tbl_indexes.php:175
-#, fuzzy
#| msgid "Edit mode"
msgid "Edit index"
-msgstr "Modalidad de edición"
+msgstr "Editar índice"
#: tbl_indexes.php:186
msgid "Index name:"
diff --git a/po/ja.po b/po/ja.po
index 5e9a824..d38a265 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -4,7 +4,7 @@ msgstr ""
"Project-Id-Version: phpMyAdmin 3.5.0-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel(a)lists.sourceforge.net\n"
"POT-Creation-Date: 2011-11-20 15:13+0100\n"
-"PO-Revision-Date: 2011-11-20 09:44+0200\n"
+"PO-Revision-Date: 2011-11-21 11:54+0200\n"
"Last-Translator: Yuichiro <yuichiro(a)pop07.odn.ne.jp>\n"
"Language-Team: japanese <jp(a)li.org>\n"
"Language: ja\n"
@@ -916,21 +916,20 @@ msgstr "線分"
#: gis_data_editor.php:223 gis_data_editor.php:279 js/messages.php:304
msgid "Outer Ring"
-msgstr ""
+msgstr "外輪"
#: gis_data_editor.php:225 gis_data_editor.php:281 js/messages.php:303
msgid "Inner Ring"
-msgstr ""
+msgstr "内輪"
#: gis_data_editor.php:252
msgid "Add a linestring"
msgstr "線分を追加する"
#: gis_data_editor.php:252 gis_data_editor.php:304 js/messages.php:306
-#, fuzzy
#| msgid "Add a new User"
msgid "Add an inner ring"
-msgstr "新しいユーザを追加する"
+msgstr "内輪を追加する"
#: gis_data_editor.php:266 js/messages.php:301
msgid "Polygon"
@@ -1104,16 +1103,15 @@ msgid "Add Index"
msgstr "インデックスを追加する"
#: js/messages.php:47
-#, fuzzy
#| msgid "Edit mode"
msgid "Edit Index"
-msgstr "編集モード"
+msgstr "インデックスを編集する"
#: js/messages.php:48 tbl_indexes.php:286
-#, fuzzy, php-format
+#, php-format
#| msgid "Add %s column(s)"
msgid "Add %d column(s) to index"
-msgstr "%s 個のカラムを追加する"
+msgstr "インデックスに %d 個のカラムを追加する"
#. l10n: Default description for the y-Axis of Charts
#: js/messages.php:52
@@ -1480,10 +1478,9 @@ msgstr "グラフの題名"
#. l10n: As in differential values
#: js/messages.php:160
-#, fuzzy
#| msgid "Difference"
msgid "Differential"
-msgstr "差分"
+msgstr "差分値"
#: js/messages.php:161
#, php-format
@@ -1582,7 +1579,7 @@ msgstr "ページの再読み込み"
#: js/messages.php:187
msgid "Affected rows:"
-msgstr ""
+msgstr "変更された行:"
#: js/messages.php:189
msgid "Failed parsing config file. It doesn't seem to be valid JSON code"
@@ -1829,10 +1826,9 @@ msgid "Select two different columns"
msgstr "異なるカラムを 2 つ選択してください"
#: js/messages.php:290
-#, fuzzy
#| msgid "Query results operations"
msgid "Query results"
-msgstr "クエリ結果操作"
+msgstr "クエリの結果"
#: js/messages.php:291
#, fuzzy
@@ -8212,15 +8208,13 @@ msgid ""
"will prevent wrapping and ensure that the output appears all on one line "
"(Default 1)."
msgstr ""
-"LINUX のみ: 外部アプリケーションを起動して標準入力経由でフィールドデータを渡"
-"します。アプリケーションの標準出力が返ります。デフォルトは Tidy です (これは "
-"HTML コードを綺麗にするためのものです)。セキュリティ上の理由から libraries/"
-"transformations/text_plain__external.inc.php を自分で編集して利用したいツール"
-"を明記しておく必要があります。最初のオプションは利用したいプログラムの数で、"
-"2 つ目のオプションはプログラムのパラメータです。3 つ目のオプションが 1 に設定"
-"されている場合は htmlspecialchars() を用いて出力を変換します(デフォルトは 1 "
-"です)。4 つ目のオプションが 1 に設定されている場合は禁則処理をせず出力全体が "
-"1 行に収まるようにします (デフォルトは 1 です)"
+"LINUX のみ: 外部アプリケーションを起動して標準入力経由でカラムデータを渡します。アプリケーションの標準出力が返ります。デフォルトは Tidy "
+"です (これは HTML コードを綺麗にするためのものです)。セキュリティ上の理由から "
+"libraries/transformations/text_plain__external.inc.php "
+"を自分で編集して利用したいツールを明記しておく必要があります。最初のオプションは利用したいプログラムの数で、2 "
+"つ目のオプションはプログラムのパラメータです。3 つ目のオプションが 1 に設定されている場合は htmlspecialchars() "
+"を用いて出力を変換します (デフォルトは 1 です)。4 つ目のオプションが 1 に設定されている場合は禁則処理をせず出力全体が 1 "
+"行に収まるようにします (デフォルトは 1 です)。"
#: libraries/transformations/text_plain__formatted.inc.php:10
msgid ""
@@ -11261,10 +11255,9 @@ msgid "Add index"
msgstr "インデックスを追加する"
#: tbl_indexes.php:175
-#, fuzzy
#| msgid "Edit mode"
msgid "Edit index"
-msgstr "編集モード"
+msgstr "インデックスを編集する"
#: tbl_indexes.php:186
msgid "Index name:"
@@ -12550,21 +12543,18 @@ msgstr ""
"インデックスの使用が想定されるものがないか確認してみてください。"
#: po/advisory_rules.php:168
-#, fuzzy, php-format
+#, php-format
msgid "max %% MyISAM key buffer ever used: %s, this value should be above 95%%"
-msgstr ""
-"常用される MyISAM キーバッファの最大比率: この値は、95%% 以上がいいと言われて"
-"います。"
+msgstr "常用される MyISAM キーバッファの最大比率: %s。この値は、95%% 以上がいいと言われています。"
#: po/advisory_rules.php:170
msgid "Percentage of MyISAM key buffer used"
msgstr "MyISAM キーバッファの使用比率"
#: po/advisory_rules.php:173
-#, fuzzy, php-format
+#, php-format
msgid "%% MyISAM key buffer used: %s, this value should be above 95%%"
-msgstr ""
-"MyISAM キーバッファの使用比率: この値は、95%% 以上がいいと言われています。"
+msgstr "MyISAM キーバッファの使用比率: %s。この値は、95%% 以上がいいと言われています。"
#: po/advisory_rules.php:175
msgid "Percentage of index reads from memory"
@@ -12580,11 +12570,9 @@ msgid "You may need to increase {key_buffer_size}."
msgstr "{key_buffer_size} を増やす必要があるかもしれません。"
#: po/advisory_rules.php:178
-#, fuzzy, php-format
+#, php-format
msgid "Index reads from memory: %s%%, this value should be above 95%%"
-msgstr ""
-"メモリから読み込まれるインデックスの比率: この値は、95%% 以上がいいと言われて"
-"います。"
+msgstr "メモリから読み込まれるインデックスの比率: %s%%。この値は、95%% 以上がいいと言われています。"
#: po/advisory_rules.php:180
msgid "Rate of table open"
@@ -12721,45 +12709,43 @@ msgid "Increase {thread_cache_size}."
msgstr "{thread_cache_size} を増やしてください。"
#: po/advisory_rules.php:213
-#, fuzzy, php-format
+#, php-format
msgid "Thread cache hitrate: %s%%, this value should be above 80%%"
-msgstr ""
-"スレッドキャッシュのヒット率: この値は、80%% 以上がいいと言われています。"
+msgstr "スレッドキャッシュのヒット率: %s%%。この値は、80%% 以上がいいと言われています。"
#: po/advisory_rules.php:215
msgid "Threads that are slow to launch"
-msgstr ""
+msgstr "起動が遅いスレッド"
#: po/advisory_rules.php:216
-#, fuzzy
#| msgid "The number of threads that are not sleeping."
msgid "There are too many threads that are slow to launch."
-msgstr "スリープしていないスレッドの数"
+msgstr "起動が遅いスレッドが沢山あります。"
#: po/advisory_rules.php:217
msgid ""
"This generally happens in case of general system overload as it is pretty "
"simple operations. You might want to monitor your system load carefully."
-msgstr ""
+msgstr "一般的に、比較的単純な操作なわりには、システム全体に負荷がかかっている状態です。お使いのシステムの負荷を入念にモニタしてみてください。"
#: po/advisory_rules.php:218
#, php-format
msgid "%s thread(s) took longer than %s seconds to start, it should be 0"
-msgstr ""
+msgstr "%s スレッドの開始に %s 秒以上かかっています。この値は、0 がいいと言われています。"
#: po/advisory_rules.php:220
msgid "Slow launch time"
-msgstr ""
+msgstr "遅い起動時間"
#: po/advisory_rules.php:221
msgid "Slow_launch_threads is above 2s"
-msgstr ""
+msgstr "Slow_launch_threads が 2 秒を超えています。"
#: po/advisory_rules.php:222
msgid ""
"Set slow_launch_time to 1s or 2s to correctly count threads that are slow to "
"launch"
-msgstr ""
+msgstr "起動が遅いスレッドなくなるように、slow_launch_time を 1 秒か 2 秒に設定してください。"
#: po/advisory_rules.php:223
#, php-format
diff --git a/po/tr.po b/po/tr.po
index c7668f3..64a4a89 100644
--- a/po/tr.po
+++ b/po/tr.po
@@ -4,7 +4,7 @@ msgstr ""
"Project-Id-Version: phpMyAdmin 3.5.0-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel(a)lists.sourceforge.net\n"
"POT-Creation-Date: 2011-11-20 15:13+0100\n"
-"PO-Revision-Date: 2011-11-17 15:57+0200\n"
+"PO-Revision-Date: 2011-11-21 12:51+0200\n"
"Last-Translator: Burak Yavuz <hitowerdigit(a)hotmail.com>\n"
"Language-Team: turkish <tr(a)li.org>\n"
"Language: tr\n"
@@ -1105,16 +1105,15 @@ msgid "Add Index"
msgstr "İndeks ekle"
#: js/messages.php:47
-#, fuzzy
#| msgid "Edit mode"
msgid "Edit Index"
-msgstr "Düzenleme kipi"
+msgstr "İndeksi düzenle"
#: js/messages.php:48 tbl_indexes.php:286
-#, fuzzy, php-format
+#, php-format
#| msgid "Add %s column(s)"
msgid "Add %d column(s) to index"
-msgstr "%s sütun ekle"
+msgstr "İndekse %d sütun ekle"
#. l10n: Default description for the y-Axis of Charts
#: js/messages.php:52
@@ -1835,16 +1834,14 @@ msgid "Select two different columns"
msgstr "İki farklı sütun seçin"
#: js/messages.php:290
-#, fuzzy
#| msgid "Query results operations"
msgid "Query results"
-msgstr "Sorgu sonuçları işlemleri"
+msgstr "Sorgu sonuçları"
#: js/messages.php:291
-#, fuzzy
#| msgid "Data pointer size"
msgid "Data point content"
-msgstr "Veri imleci boyutu"
+msgstr "Veri imleci içeriği"
#: js/messages.php:294 tbl_change.php:312 tbl_indexes.php:221
#: tbl_indexes.php:248
@@ -11355,10 +11352,9 @@ msgid "Add index"
msgstr "İndeks ekle"
#: tbl_indexes.php:175
-#, fuzzy
#| msgid "Edit mode"
msgid "Edit index"
-msgstr "Düzenleme kipi"
+msgstr "İndeksi düzenle"
#: tbl_indexes.php:186
msgid "Index name:"
hooks/post-receive
--
phpMyAdmin
1
0

[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_7_1-23129-g7962d72
by Madhura Jayaratne 20 Nov '11
by Madhura Jayaratne 20 Nov '11
20 Nov '11
The branch, master has been updated
via 7962d72a46a006e293691181af82f889ecfa5e02 (commit)
via e7877fba46743be0b351c526ccac216731ab8c1e (commit)
from b5c2473afa5171ea67490bd500009d5dc39ff84c (commit)
- Log -----------------------------------------------------------------
commit 7962d72a46a006e293691181af82f889ecfa5e02
Merge: b5c2473 e7877fb
Author: Madhura Jayaratne <madhura.cj(a)gmail.com>
Date: Sun Nov 20 23:37:22 2011 +0530
Merge branch 'QA_3_4'
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 1 +
js/tbl_structure.js | 5 +++++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 8e75172..74fb791 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -77,6 +77,7 @@ phpMyAdmin - ChangeLog
- [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
3.4.7.1 (2011-11-10)
- [security] Fixed possible local file inclusion in XML import
diff --git a/js/tbl_structure.js b/js/tbl_structure.js
index f02572f..c49165a 100644
--- a/js/tbl_structure.js
+++ b/js/tbl_structure.js
@@ -41,6 +41,10 @@ $(document).ready(function() {
*/
var curr_column_name = $(curr_row).children('th').children('label').text();
/**
+ * @var $after_field_item Corresponding entry in the 'After' field.
+ */
+ var $after_field_item = $("select[name='after_field'] option[value='" + curr_column_name + "']");
+ /**
* @var question String containing the question to be asked for confirmation
*/
var question = PMA_messages['strDoYouReally'] + ' :\n ALTER TABLE `' + escapeHtml(curr_table_name) + '` DROP `' + escapeHtml(curr_column_name) + '`';
@@ -52,6 +56,7 @@ $(document).ready(function() {
$.get(url, {'is_js_confirmed' : 1, 'ajax_request' : true}, function(data) {
if(data.success == true) {
PMA_ajaxShowMessage(data.message);
+ $after_field_item.remove();
$(curr_row).hide("medium").remove();
}
else {
hooks/post-receive
--
phpMyAdmin
1
0

[Phpmyadmin-git] [SCM] phpMyAdmin branch, QA_3_4, updated. RELEASE_3_4_7_1-32-ge7877fb
by Madhura Jayaratne 20 Nov '11
by Madhura Jayaratne 20 Nov '11
20 Nov '11
The branch, QA_3_4 has been updated
via e7877fba46743be0b351c526ccac216731ab8c1e (commit)
from 81f6766f962d6cea3742f3936032d234e6ce9d53 (commit)
- Log -----------------------------------------------------------------
commit e7877fba46743be0b351c526ccac216731ab8c1e
Author: Madhura Jayaratne <madhura.cj(a)gmail.com>
Date: Sun Nov 20 23:30:30 2011 +0530
bug #3425156 [interface] Add column after drop
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 1 +
js/tbl_structure.js | 5 +++++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 6bbc4e6..7d5cf3d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,6 +17,7 @@ phpMyAdmin - ChangeLog
- [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
3.4.7.1 (2011-11-10)
- [security] Fixed possible local file inclusion in XML import
diff --git a/js/tbl_structure.js b/js/tbl_structure.js
index 493f0eb..97ec6c2 100644
--- a/js/tbl_structure.js
+++ b/js/tbl_structure.js
@@ -42,6 +42,10 @@ $(document).ready(function() {
*/
var curr_column_name = $(curr_row).children('th').children('label').text();
/**
+ * @var $after_field_item Corresponding entry in the 'After' field.
+ */
+ var $after_field_item = $("select[name='after_field'] option[value='" + curr_column_name + "']");
+ /**
* @var question String containing the question to be asked for confirmation
*/
var question = PMA_messages['strDoYouReally'] + ' :\n ALTER TABLE `' + escapeHtml(curr_table_name) + '` DROP `' + escapeHtml(curr_column_name) + '`';
@@ -53,6 +57,7 @@ $(document).ready(function() {
$.get(url, {'is_js_confirmed' : 1, 'ajax_request' : true}, function(data) {
if(data.success == true) {
PMA_ajaxShowMessage(data.message);
+ $after_field_item.remove();
$(curr_row).hide("medium").remove();
}
else {
hooks/post-receive
--
phpMyAdmin
1
0

[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_7_1-23127-gb5c2473
by Madhura Jayaratne 20 Nov '11
by Madhura Jayaratne 20 Nov '11
20 Nov '11
The branch, master has been updated
via b5c2473afa5171ea67490bd500009d5dc39ff84c (commit)
from 6e2f6f71d38966da33ba4a68e76176a88faf2685 (commit)
- Log -----------------------------------------------------------------
commit b5c2473afa5171ea67490bd500009d5dc39ff84c
Author: Madhura Jayaratne <madhura.cj(a)gmail.com>
Date: Sun Nov 20 23:01:58 2011 +0530
bug #3431427: Fix for enum and set columns
-----------------------------------------------------------------------
Summary of changes:
js/tbl_change.js | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/js/tbl_change.js b/js/tbl_change.js
index 8cb710a..bfe5934 100644
--- a/js/tbl_change.js
+++ b/js/tbl_change.js
@@ -26,10 +26,9 @@ function nullify(theType, urlField, md5Field, multi_edit)
rowForm.elements['funcs' + multi_edit + '[' + md5Field + ']'].selectedIndex = -1;
}
- // "SET" field , "ENUM" field with more than 20 characters
- // or foreign key field (drop-down)
- if (theType == 1 || theType == 3 || theType == 4) {
- rowForm.elements['fields' + multi_edit + '[' + md5Field + ']'].selectedIndex = -1;
+ // "ENUM" field with more than 20 characters
+ if (theType == 1) {
+ rowForm.elements['fields' + multi_edit + '[' + md5Field + ']'][1].selectedIndex = -1;
}
// Other "ENUM" field
else if (theType == 2) {
@@ -45,6 +44,14 @@ function nullify(theType, urlField, md5Field, multi_edit)
} // end if
}
+ // "SET" field
+ else if (theType == 3) {
+ rowForm.elements['fields' + multi_edit + '[' + md5Field + '][]'].selectedIndex = -1;
+ }
+ // Foreign key field (drop-down)
+ else if (theType == 4) {
+ rowForm.elements['fields' + multi_edit + '[' + md5Field + ']'].selectedIndex = -1;
+ }
// foreign key field (with browsing icon for foreign values)
else if (theType == 6) {
rowForm.elements['fields' + multi_edit + '[' + md5Field + ']'].value = '';
hooks/post-receive
--
phpMyAdmin
1
0

[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_7_1-23126-g6e2f6f7
by Madhura Jayaratne 20 Nov '11
by Madhura Jayaratne 20 Nov '11
20 Nov '11
The branch, master has been updated
via 6e2f6f71d38966da33ba4a68e76176a88faf2685 (commit)
via 8fa909da78fe17fe9e829e2030ef4990ec4b89f9 (commit)
via 81f6766f962d6cea3742f3936032d234e6ce9d53 (commit)
via b5c45d0d35c203fe1b8e1c720ae8af7e40f4ce6c (commit)
via 7d2718801e0c6d7388a57e09a52d58b69e52f350 (commit)
from af322da95a8b043e94ca6f51c8b82d0fe117dc6b (commit)
- Log -----------------------------------------------------------------
commit 6e2f6f71d38966da33ba4a68e76176a88faf2685
Merge: 8fa909d af322da
Author: Madhura Jayaratne <madhura.cj(a)gmail.com>
Date: Sun Nov 20 22:35:04 2011 +0530
Merge branch 'master' of ssh://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin
commit 8fa909da78fe17fe9e829e2030ef4990ec4b89f9
Merge: 7d27188 81f6766
Author: Madhura Jayaratne <madhura.cj(a)gmail.com>
Date: Sun Nov 20 22:33:02 2011 +0530
Merge branch 'QA_3_4'
Conflicts:
libraries/server_synchronize.lib.php
commit 7d2718801e0c6d7388a57e09a52d58b69e52f350
Author: Madhura Jayaratne <madhura.cj(a)gmail.com>
Date: Sun Nov 20 18:30:56 2011 +0530
Coding style improvements
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 1 +
libraries/server_synchronize.lib.php | 306 ++++++++++++++++++----------------
2 files changed, 161 insertions(+), 146 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 38cfe69..8e75172 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -76,6 +76,7 @@ phpMyAdmin - ChangeLog
- 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
3.4.7.1 (2011-11-10)
- [security] Fixed possible local file inclusion in XML import
diff --git a/libraries/server_synchronize.lib.php b/libraries/server_synchronize.lib.php
index 3a07674..ffe0cc0 100644
--- a/libraries/server_synchronize.lib.php
+++ b/libraries/server_synchronize.lib.php
@@ -137,10 +137,10 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link, &$matching
. 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 ";
}
@@ -155,10 +155,10 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link, &$matching
. 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] . "'";
} elseif (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 ";
}
@@ -311,10 +311,10 @@ function PMA_findDeleteRowsFromTargetTables(&$delete_array, $matching_table, $ma
$all_keys_match = 1;
for ($a = 0; $a < sizeof($trg_keys[$matching_table_index]); $a++) {
if (isset($trg_keys[$matching_table_index][$a])) {
- if (! (in_array($trg_keys[$matching_table_index][$a], $src_keys[$matching_table_index]))) {
- $all_keys_match = 0;
- }
- }
+ 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)) {
@@ -323,9 +323,9 @@ function PMA_findDeleteRowsFromTargetTables(&$delete_array, $matching_table, $ma
}
if (isset($trg_keys[$matching_table_index])) {
if ((sizeof($trg_keys[$matching_table_index]) == 1) && $all_keys_match) {
- $row = 0;
- if (isset($target_key_values)) {
- for ($i = 0; $i < sizeof($target_key_values); $i++) {
+ $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++;
@@ -367,27 +367,28 @@ function PMA_findDeleteRowsFromTargetTables(&$delete_array, $matching_table, $ma
* @param string $src_db name of source database
* @param mixed $src_link connection established with source server
* @param int $index index of a table from $matching_table array
- * @param array $row_count number of rows
+ * @param array &$row_count number of rows
+ *
+ * @return nothing
*/
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];
}
/**
* PMA_updateTargetTables() sets the updated field values to target table rows using $update_array[$matching_table_index]
*
- *
- * @param array $table Matching tables' names
- * @param array $update_array A three dimensional array containing field
+ * @param array $table Matching tables' names
+ * @param array $update_array A three dimensional array containing field
* value updates required for each matching table
- * @param string $src_db Name of source database
- * @param string $trg_db Name of target database
- * @param mixed $trg_link Connection established with target server
- * @param int $matching_table_index index of matching table in matching_table_array
- * @param array $matching_table_keys
+ * @param string $src_db Name of source database
+ * @param string $trg_db Name of target database
+ * @param mixed $trg_link Connection established with target server
+ * @param int $matching_table_index index of matching table in matching_table_array
+ * @param array $matching_table_keys
* @param boolean $display
*/
function PMA_updateTargetTables($table, $update_array, $src_db, $trg_db, $trg_link, $matching_table_index, $matching_table_keys, $display)
@@ -398,35 +399,34 @@ function PMA_updateTargetTables($table, $update_array, $src_db, $trg_db, $trg_li
for ($update_row = 0; $update_row < sizeof($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) {
+ $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 ";
- 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] . "'";
- }
- if ($update_field < ($update_fields_num - 2)) {
- $query .= ", ";
- }
- }
- $query .= " WHERE ";
- if (isset($matching_table_keys[$matching_table_index])) {
- 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]] . "'";
+ 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 .= PMA_backquote($update_array[$matching_table_index][$update_row][$update_field]) . "='" . $update_array[$matching_table_index][$update_row][$update_field+1] . "'";
}
- if ($key < (sizeof($matching_table_keys[$matching_table_index]) - 1)) {
- $query .= " AND ";
+ if ($update_field < ($update_fields_num - 2)) {
+ $query .= ", ";
}
}
- }
- $query .= ';';
- if ($display == true) {
- echo "<p>" . $query . "</p>";
- }
- PMA_DBI_try_query($query, $trg_link, 0);
+ $query .= " WHERE ";
+ if (isset($matching_table_keys[$matching_table_index])) {
+ for ($key = 0; $key < sizeof($matching_table_keys[$matching_table_index]); $key++) {
+ if (isset($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 ";
+ }
+ }
+ }
+ $query .= ';';
+ if ($display == true) {
+ echo "<p>" . $query . "</p>";
+ }
+ PMA_DBI_try_query($query, $trg_link, 0);
}
}
}
@@ -484,12 +484,11 @@ function PMA_insertIntoTargetTable($matching_table, $src_db, $trg_db, $src_link,
}
}
$select_query .= "; ";
- $result = PMA_DBI_fetch_result ($select_query, null, null, $src_link);
+ $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++)
- {
- $insert_query .= $table_fields[$matching_table_index][$field_index];
+ for ($field_index = 0; $field_index < sizeof($table_fields[$matching_table_index]); $field_index++) {
+ $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 = '" .
@@ -497,13 +496,14 @@ function PMA_insertIntoTargetTable($matching_table, $src_db, $trg_db, $src_link,
$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++)
- {
+ 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);
+ 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]]);
}
if (isset($uncommon_columns[$table_index[0]])) {
@@ -511,37 +511,49 @@ function PMA_insertIntoTargetTable($matching_table, $src_db, $trg_db, $src_link,
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);
+ 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_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,
- $matching_tables_fields, $criteria, $matching_tables_keys, $target_tables_keys, $uncommon_tables, $uncommon_tables_fields,
- $table_index[0], $uncommon_cols, $display);
+ 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]])
- || 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);
+ 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
+ );
unset($add_indexes_array[$table_index[0]]);
unset($alter_indexes_array[$table_index[0]]);
unset($remove_indexes_array[$table_index[0]]);
}
if (isset($update_array[$table_index[0]])) {
- PMA_updateTargetTables($matching_tables, $update_array, $src_db, $trg_db, $trg_link, $table_index[0], $matching_table_keys,
- $display);
+ PMA_updateTargetTables(
+ $matching_tables, $update_array, $src_db, $trg_db, $trg_link,
+ $table_index[0], $matching_table_keys, $display
+ );
unset($update_array[$table_index[0]]);
}
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);
+ 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
+ );
unset($array_insert[$table_index[0]]);
}
}
@@ -613,20 +625,19 @@ function PMA_createTargetTables($src_db, $trg_db, $src_link, $trg_link, &$uncomm
$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++)
- {
+ 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_createTargetTables($src_db, $trg_db, $trg_link, $src_link, $uncommon_tables, $table_index[0], $uncommon_tables_fields, $display);
unset($uncommon_tables[$table_index[0]]);
}
}
- }
- $Create_Table_Query .= ';';
- if ($display == true) {
- echo '<p>' . $Create_Table_Query . '</p>';
- }
- PMA_DBI_try_query($Create_Table_Query, $trg_link, 0);
+ }
+ $Create_Table_Query .= ';';
+ if ($display == true) {
+ echo '<p>' . $Create_Table_Query . '</p>';
+ }
+ PMA_DBI_try_query($Create_Table_Query, $trg_link, 0);
}
}
/**
@@ -672,12 +683,12 @@ function PMA_populateTargetTables($src_db, $trg_db, $src_link, $trg_link, $uncom
/**
* PMA_deleteFromTargetTable() delete rows from target table
*
- * @param string $trg_db name of target database
- * @param mixed $trg_link connection established with target server
- * @param array $matching_tables matching table names
- * @param int $table_index index of table in matching_table_array
- * @param array $target_tables_keys primary key names of the target tables
- * @param array $delete_array key values of rows that are to be deleted
+ * @param string $trg_db name of target database
+ * @param mixed $trg_link connection established with target server
+ * @param array $matching_tables matching table names
+ * @param int $table_index index of table in matching_table_array
+ * @param array $target_tables_keys primary key names of the target tables
+ * @param array $delete_array key values of rows that are to be deleted
* @param bool $display
*/
function PMA_deleteFromTargetTable($trg_db, $trg_link, $matching_tables, $table_index, $target_tables_keys, $delete_array, $display)
@@ -686,7 +697,7 @@ function PMA_deleteFromTargetTable($trg_db, $trg_link, $matching_tables, $table_
if (isset($target_tables_keys[$table_index])) {
$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] . "'";
@@ -705,7 +716,7 @@ function PMA_deleteFromTargetTable($trg_db, $trg_link, $matching_tables, $table_
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);
}
}
@@ -761,7 +772,8 @@ function PMA_structureDiffInTables($src_db, $trg_db, $src_link, $trg_link, $matc
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]] == '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]];
}
}
@@ -813,7 +825,7 @@ function PMA_addColumnsInTargetTable($src_db, $trg_db, $src_link, $trg_link, $ma
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 ';
@@ -836,7 +848,7 @@ function PMA_addColumnsInTargetTable($src_db, $trg_db, $src_link, $trg_link, $ma
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 " ;
@@ -844,7 +856,7 @@ function PMA_addColumnsInTargetTable($src_db, $trg_db, $src_link, $trg_link, $ma
}
$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 .= " , " ;
}
@@ -875,7 +887,7 @@ function PMA_addColumnsInTargetTable($src_db, $trg_db, $src_link, $trg_link, $ma
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]] . "
+ "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'] . ");";
@@ -907,8 +919,10 @@ function PMA_checkForeignKeys($src_db, $src_link, $trg_db, $trg_link, $reference
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]]);
}
@@ -954,7 +968,7 @@ function PMA_alterTargetTableStructure($trg_db, $trg_link, $matching_tables, &$s
}
$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 .= " , " ;
}
@@ -971,10 +985,9 @@ function PMA_alterTargetTableStructure($trg_db, $trg_link, $matching_tables, &$s
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'];
+ 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++)
- {
+ 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;
if (($criteria[$i] == 'Type') && (! isset($alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]][$criteria[$i+1]]))) {
@@ -1035,7 +1048,7 @@ function PMA_alterTargetTableStructure($trg_db, $trg_link, $matching_tables, &$s
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 .= ', ';
@@ -1054,11 +1067,11 @@ function PMA_alterTargetTableStructure($trg_db, $trg_link, $matching_tables, &$s
/**
* PMA_removeColumnsFromTargetTable() removes the columns which are present in target table but not in source table.
*
- * @param string $trg_db name of target database
- * @param mixed $trg_link connection established with target server
- * @param array $matching_tables names of matching tables
- * @param array $uncommon_columns array containing the names of the column which are to be dropped from the target table
- * @param int $table_counter index of the matching table as in $matchiing_tables array
+ * @param string $trg_db name of target database
+ * @param mixed $trg_link connection established with target server
+ * @param array $matching_tables names of matching tables
+ * @param array $uncommon_columns array containing the names of the column which are to be dropped from the target table
+ * @param int $table_counter index of the matching table as in $matchiing_tables array
* @param bool $display
*/
function PMA_removeColumnsFromTargetTable($trg_db, $trg_link, $matching_tables, $uncommon_columns, $table_counter, $display)
@@ -1077,7 +1090,7 @@ function PMA_removeColumnsFromTargetTable($trg_db, $trg_link, $matching_tables,
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'] . ";";
+ 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);
}
}
@@ -1088,9 +1101,9 @@ function PMA_removeColumnsFromTargetTable($trg_db, $trg_link, $matching_tables,
$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 .= " , " ;
}
@@ -1109,17 +1122,17 @@ function PMA_removeColumnsFromTargetTable($trg_db, $trg_link, $matching_tables,
* 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.
*
- * @param string $src_db name of source database
- * @param string $trg_db name of target database
- * @param mixed $src_link connection established with source server
- * @param mixed $trg_link connection established with target server
- * @param array $matching_tables matching tables name
- * @param array &$source_indexes indexes of the source table
- * @param array &$target_indexes indexes of the target table
- * @param array &$add_indexes_array name of the column on which the index is to be added in the target table
- * @param array &$alter_indexes_array key name which needs to be altered
- * @param array &$remove_indexes_array key name of the index which is to be removed from the target table
- * @param int $table_counter number of the matching table
+ * @param string $src_db name of source database
+ * @param string $trg_db name of target database
+ * @param mixed $src_link connection established with source server
+ * @param mixed $trg_link connection established with target server
+ * @param array $matching_tables matching tables name
+ * @param array &$source_indexes indexes of the source table
+ * @param array &$target_indexes indexes of the target table
+ * @param array &$add_indexes_array name of the column on which the index is to be added in the target table
+ * @param array &$alter_indexes_array key name which needs to be altered
+ * @param array &$remove_indexes_array key name of the index which is to be removed from the target table
+ * @param int $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)
@@ -1134,8 +1147,7 @@ function PMA_indexesDiffInTables($src_db, $trg_db, $src_link, $trg_link, $matchi
/*
* @todo compare the length of each sub part
*/
- while (($z <= sizeof($target_indexes[$table_counter])) && ($found == false))
- {
+ while (($z <= sizeof($target_indexes[$table_counter])) && ($found == false)) {
if (isset($source_indexes[$table_counter][$a]) && isset($target_indexes[$table_counter][$z]) && $source_indexes[$table_counter][$a]['Key_name'] == $target_indexes[$table_counter][$z]['Key_name']) {
$found = true;
if (($source_indexes[$table_counter][$a]['Column_name'] != $target_indexes[$table_counter][$z]['Column_name']) || ($source_indexes[$table_counter][$a]['Non_unique'] != $target_indexes[$table_counter][$z]['Non_unique'])) {
@@ -1157,8 +1169,7 @@ function PMA_indexesDiffInTables($src_db, $trg_db, $src_link, $trg_link, $matchi
for ($b = 0; $b < sizeof($target_indexes[$table_counter]); $b++) {
$found = false;
$c = 0;
- while (($c <= sizeof($source_indexes[$table_counter])) && ($found == false))
- {
+ while (($c <= sizeof($source_indexes[$table_counter])) && ($found == false)) {
if ($target_indexes[$table_counter][$b]['Column_name'] == $source_indexes[$table_counter][$c]['Column_name']) {
$found = true;
}
@@ -1173,15 +1184,15 @@ function PMA_indexesDiffInTables($src_db, $trg_db, $src_link, $trg_link, $matchi
/**
* PMA_applyIndexesDiff() create indexes, alters indexes and remove indexes.
*
- * @param string $trg_db name of target database
- * @param mixed $trg_link connection established with target server
- * @param array $matching_tables matching tables name
- * @param array $source_indexes indexes of the source table
- * @param array $target_indexes indexes of the target table
- * @param array $add_indexes_array column names on which indexes are to be created in target table
- * @param array $alter_indexes_array column names for which indexes are to be altered
- * @param array $remove_indexes_array key name of the indexes which are to be removed from the target table
- * @param int $table_counter number of the matching table
+ * @param string $trg_db name of target database
+ * @param mixed $trg_link connection established with target server
+ * @param array $matching_tables matching tables name
+ * @param array $source_indexes indexes of the source table
+ * @param array $target_indexes indexes of the target table
+ * @param array $add_indexes_array column names on which indexes are to be created in target table
+ * @param array $alter_indexes_array column names for which indexes are to be altered
+ * @param array $remove_indexes_array key name of the indexes which are to be removed from the target table
+ * @param int $table_counter number of the matching table
* @param $display
*/
function PMA_applyIndexesDiff ($trg_db, $trg_link, $matching_tables, $source_indexes, $target_indexes, $add_indexes_array, $alter_indexes_array,
@@ -1197,7 +1208,7 @@ function PMA_applyIndexesDiff ($trg_db, $trg_link, $matching_tables, $source_ind
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>';
}
@@ -1243,7 +1254,7 @@ function PMA_applyIndexesDiff ($trg_db, $trg_link, $matching_tables, $source_ind
$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 .= " , " ;
@@ -1261,7 +1272,9 @@ function PMA_applyIndexesDiff ($trg_db, $trg_link, $matching_tables, $source_ind
* PMA_displayQuery() displays a query, taking the maximum display size
* into account
*
- * @param string $query the query to display
+ * @param string $query the query to display
+ *
+ * @return nothing
*/
function PMA_displayQuery($query)
{
@@ -1274,8 +1287,10 @@ function PMA_displayQuery($query)
/**
* PMA_syncDisplayHeaderCompare() shows the header for source database
*
- * @param string $src_db source db name
- * @param string $trg_db target db name
+ * @param string $src_db source db name
+ * @param string $trg_db target db name
+ *
+ * @return nothing
*/
function PMA_syncDisplayHeaderCompare($src_db, $trg_db)
{
@@ -1347,20 +1362,19 @@ function PMA_syncDisplayDataCompare($rows)
/**
* array PMA_get_column_values (string $database, string $table, string $column , mysql db link $link = null)
*
- * @param string $database name of database
- * @param string $table name of table to retrieve columns from
- * @param string $column name of the column to retrieve data from
- * @param mixed $link mysql link resource
- * @return array $field_values
+ * @param string $database name of database
+ * @param string $table name of table to retrieve columns from
+ * @param string $column name of the column to retrieve data from
+ * @param mixed $link mysql link resource
+ *
+ * @return array $field_values
*/
function PMA_get_column_values($database, $table, $column, $link = null)
{
$query = 'SELECT ';
- for ($i=0; $i< sizeof($column); $i++)
- {
+ for ($i=0; $i< sizeof($column); $i++) {
$query.= PMA_backquote($column[$i]);
- if ($i < (sizeof($column)-1))
- {
+ if ($i < (sizeof($column)-1)) {
$query.= ', ';
}
}
hooks/post-receive
--
phpMyAdmin
1
0

[Phpmyadmin-git] [SCM] phpMyAdmin branch, QA_3_4, updated. RELEASE_3_4_7_1-31-g81f6766
by Madhura Jayaratne 20 Nov '11
by Madhura Jayaratne 20 Nov '11
20 Nov '11
The branch, QA_3_4 has been updated
via 81f6766f962d6cea3742f3936032d234e6ce9d53 (commit)
via b5c45d0d35c203fe1b8e1c720ae8af7e40f4ce6c (commit)
from 8219f7c544c8ffd2ba0df2034900a7f591af3219 (commit)
- Log -----------------------------------------------------------------
commit 81f6766f962d6cea3742f3936032d234e6ce9d53
Author: Madhura Jayaratne <madhura.cj(a)gmail.com>
Date: Sun Nov 20 22:18:55 2011 +0530
bug #3439292 [core] Fail to synchronize column with name of keyword
commit b5c45d0d35c203fe1b8e1c720ae8af7e40f4ce6c
Author: Madhura Jayaratne <madhura.cj(a)gmail.com>
Date: Sun Nov 20 21:52:22 2011 +0530
White space cleanup
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 1 +
libraries/server_synchronize.lib.php | 635 +++++++++++++++++-----------------
2 files changed, 319 insertions(+), 317 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 9940711..6bbc4e6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -16,6 +16,7 @@ phpMyAdmin - ChangeLog
- 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
3.4.7.1 (2011-11-10)
- [security] Fixed possible local file inclusion in XML import
diff --git a/libraries/server_synchronize.lib.php b/libraries/server_synchronize.lib.php
index c9f1242..c1b9159 100644
--- a/libraries/server_synchronize.lib.php
+++ b/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 @@ function PMA_getMatchingTables($trg_tables, $src_tables, &$matching_tables, &$un
/**
* 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 @@ function PMA_getNonMatchingTargetTables($trg_tables, $matching_tables, &$uncommo
* 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 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link, &$matching
$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 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link, &$matching
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 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link, &$matching
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 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link, &$matching
}
}
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 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link, &$matching
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 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link, &$matching
} 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 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link, &$matching
$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 @@ function PMA_findDeleteRowsFromTargetTables(&$delete_array, $matching_table, $ma
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 @@ function PMA_findDeleteRowsFromTargetTables(&$delete_array, $matching_table, $ma
}
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 @@ function PMA_findDeleteRowsFromTargetTables(&$delete_array, $matching_table, $ma
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 @@ function PMA_findDeleteRowsFromTargetTables(&$delete_array, $matching_table, $ma
}
$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_findDeleteRowsFromTargetTables(&$delete_array, $matching_table, $ma
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 @@ function PMA_dataDiffInUncommonTables($source_tables_uncommon, $src_db, $src_lin
*
* @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 @@ function PMA_updateTargetTables($table, $update_array, $src_db, $trg_db, $trg_li
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 @@ function PMA_updateTargetTables($table, $update_array, $src_db, $trg_db, $trg_li
}
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 @@ function PMA_updateTargetTables($table, $update_array, $src_db, $trg_db, $trg_li
* @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 @@ function PMA_insertIntoTargetTable($matching_table, $src_db, $trg_db, $src_link,
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 @@ function PMA_insertIntoTargetTable($matching_table, $src_db, $trg_db, $src_link,
}
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 @@ function PMA_createTargetTables($src_db, $trg_db, $src_link, $trg_link, &$uncomm
$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 @@ function PMA_createTargetTables($src_db, $trg_db, $src_link, $trg_link, &$uncomm
$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 @@ function PMA_createTargetTables($src_db, $trg_db, $src_link, $trg_link, &$uncomm
* @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 @@ function PMA_populateTargetTables($src_db, $trg_db, $src_link, $trg_link, $uncom
}
}
/**
-* 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 @@ function PMA_deleteFromTargetTable($trg_db, $trg_link, $matching_tables, $table_
* 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 @@ function PMA_structureDiffInTables($src_db, $trg_db, $src_link, $trg_link, $matc
//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 @@ function PMA_structureDiffInTables($src_db, $trg_db, $src_link, $trg_link, $matc
* @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 @@ function PMA_structureDiffInTables($src_db, $trg_db, $src_link, $trg_link, $matc
* @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 @@ function PMA_addColumnsInTargetTable($src_db, $trg_db, $src_link, $trg_link, $ma
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 @@ function PMA_addColumnsInTargetTable($src_db, $trg_db, $src_link, $trg_link, $ma
$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 @@ function PMA_addColumnsInTargetTable($src_db, $trg_db, $src_link, $trg_link, $ma
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 @@ function PMA_addColumnsInTargetTable($src_db, $trg_db, $src_link, $trg_link, $ma
* @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 @@ function PMA_checkForeignKeys($src_db, $src_link, $trg_db, $trg_link ,$reference
* @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 @@ function PMA_checkForeignKeys($src_db, $src_link, $trg_db, $trg_link ,$reference
* @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 @@ function PMA_alterTargetTableStructure($trg_db, $trg_link, $matching_tables, &$s
}
$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 @@ function PMA_alterTargetTableStructure($trg_db, $trg_link, $matching_tables, &$s
} 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 @@ function PMA_alterTargetTableStructure($trg_db, $trg_link, $matching_tables, &$s
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 @@ function PMA_alterTargetTableStructure($trg_db, $trg_link, $matching_tables, &$s
if ($check) {
if ($display == true) {
echo '<p>' . $query . '</p>';
- }
+ }
PMA_DBI_try_query($query, $trg_link, 0);
}
}
@@ -1101,13 +1102,13 @@ function PMA_alterTargetTableStructure($trg_db, $trg_link, $matching_tables, &$s
* 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 @@ function PMA_removeColumnsFromTargetTable($trg_db, $trg_link, $matching_tables,
$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 @@ function PMA_indexesDiffInTables($src_db, $trg_db, $src_link, $trg_link, $matchi
}
}
}
- $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 @@ function PMA_indexesDiffInTables($src_db, $trg_db, $src_link, $trg_link, $matchi
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 @@ function PMA_applyIndexesDiff ($trg_db, $trg_link, $matching_tables, $source_ind
$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 @@ function PMA_applyIndexesDiff ($trg_db, $trg_link, $matching_tables, $source_ind
$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 @@ function PMA_applyIndexesDiff ($trg_db, $trg_link, $matching_tables, $source_ind
$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,11 +1324,11 @@ function PMA_displayQuery($query) {
}
/**
- * 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 "> ';
@@ -1347,12 +1348,12 @@ function PMA_syncDisplayHeaderSource($src_db) {
/**
* 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%">';
@@ -1375,10 +1376,10 @@ function PMA_syncDisplayHeaderTargetAndMatchingTables($trg_db, $matching_tables)
}
/**
- * 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;
hooks/post-receive
--
phpMyAdmin
1
0

[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_7_1-23121-gaf322da
by Rouslan Placella 20 Nov '11
by Rouslan Placella 20 Nov '11
20 Nov '11
The branch, master has been updated
via af322da95a8b043e94ca6f51c8b82d0fe117dc6b (commit)
from 008ef66027f4a55d962bda74dd3c3094498ac628 (commit)
- Log -----------------------------------------------------------------
commit af322da95a8b043e94ca6f51c8b82d0fe117dc6b
Author: Rouslan Placella <rouslan(a)placella.com>
Date: Sun Nov 20 15:04:09 2011 +0000
Fixed IE bug in the new index editor
-----------------------------------------------------------------------
Summary of changes:
tbl_indexes.php | 47 +++++++++++++++++-------------
themes/pmahomme/css/theme_right.css.php | 11 ++++++-
2 files changed, 37 insertions(+), 21 deletions(-)
diff --git a/tbl_indexes.php b/tbl_indexes.php
index 3a1a863..b576e10 100644
--- a/tbl_indexes.php
+++ b/tbl_indexes.php
@@ -179,26 +179,33 @@ if ($GLOBALS['is_ajax_request'] != true) {
<?php
}
?>
-<div>
-<table class='index_info'>
-<tr><td>
-<strong>
-<label for="input_index_name"><?php echo __('Index name:'); ?></label>
-</strong>
-<?php echo PMA_showhint(PMA_Message::notice(__('("PRIMARY" <b>must</b> be the name of and <b>only of</b> a primary key!)'))); ?>
-</td><td>
-<input type="text" name="index[Key_name]" id="input_index_name" size="25"
- value="<?php echo htmlspecialchars($index->getName()); ?>" onfocus="this.select()" />
-</td></tr><tr><td>
-<strong>
-<label for="select_index_type"><?php echo __('Index type:'); ?></label>
-</strong>
-<?php echo PMA_showMySQLDocu('SQL-Syntax', 'ALTER_TABLE'); ?>
-</td><td>
-<select name="index[Index_type]" id="select_index_type" >
- <?php echo $index->generateIndexSelector(); ?>
-</select>
-</td></tr></table>
+<div class='index_info'>
+ <div>
+ <div class="label">
+ <strong>
+ <label for="input_index_name">
+ <?php echo __('Index name:'); ?>
+ <?php echo PMA_showhint(PMA_Message::notice(__('("PRIMARY" <b>must</b> be the name of and <b>only of</b> a primary key!)'))); ?>
+ </label>
+ </strong>
+ </div>
+ <input type="text" name="index[Key_name]" id="input_index_name" size="25"
+ value="<?php echo htmlspecialchars($index->getName()); ?>" onfocus="this.select()" />
+ </div>
+ <div>
+ <div class="label">
+ <strong>
+ <label for="select_index_type">
+ <?php echo __('Index type:'); ?>
+ <?php echo PMA_showMySQLDocu('SQL-Syntax', 'ALTER_TABLE'); ?>
+ </label>
+ </strong>
+ </div>
+ <select name="index[Index_type]" id="select_index_type" >
+ <?php echo $index->generateIndexSelector(); ?>
+ </select>
+ </div>
+ <div class="clearfloat"></div>
</div>
<table id="index_columns">
diff --git a/themes/pmahomme/css/theme_right.css.php b/themes/pmahomme/css/theme_right.css.php
index db300f3..5d4c3f3 100644
--- a/themes/pmahomme/css/theme_right.css.php
+++ b/themes/pmahomme/css/theme_right.css.php
@@ -2132,13 +2132,22 @@ td.more_opts {
*/
#index_frm .index_info input,
#index_frm .index_info select {
- width: 100%;
+ width: 14em;
box-sizing: border-box;
-ms-box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
+#index_frm .index_info div {
+ padding: 0.2em 0;
+}
+
+#index_frm .index_info .label {
+ float: left;
+ min-width: 12em;
+}
+
#index_frm .slider {
width: 10em;
margin: 0.6em;
hooks/post-receive
--
phpMyAdmin
1
0