From 2e0fa178fcf3838e3418a57b5ebec2e2819464a7 Mon Sep 17 00:00:00 2001 From: Yuichiro Date: Wed, 8 Jun 2011 11:39:51 +0200 Subject: [PATCH 01/18] Translation update done using Pootle. --- po/ja.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/po/ja.po b/po/ja.po index d495550ee4..cf7bc67a74 100644 --- a/po/ja.po +++ b/po/ja.po @@ -4,13 +4,13 @@ msgstr "" "Project-Id-Version: phpMyAdmin 3.5.0-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2011-06-07 06:41-0400\n" -"PO-Revision-Date: 2011-06-07 12:48+0200\n" +"PO-Revision-Date: 2011-06-08 11:39+0200\n" "Last-Translator: Yuichiro \n" "Language-Team: japanese \n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Pootle 2.0.5\n" @@ -3368,7 +3368,7 @@ msgstr "軽めのタブ" #: libraries/config/messages.inc.php:292 msgid "" "Maximum number of characters shown in any non-numeric column on browse view" -msgstr "ビューに表示される数値でないカラムの表示文字の最大数。" +msgstr "表示ページにおいて数値でないカラムの表示文字の最大数。" #: libraries/config/messages.inc.php:293 msgid "Limit column characters" From 13a0f6d1e157dc7f1985f54c62df20a4f9ce4875 Mon Sep 17 00:00:00 2001 From: Yuichiro Date: Wed, 8 Jun 2011 11:42:19 +0200 Subject: [PATCH 02/18] Translation update done using Pootle. --- po/ja.po | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/po/ja.po b/po/ja.po index cf7bc67a74..be2fdafd98 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@lists.sourceforge.net\n" "POT-Creation-Date: 2011-06-07 06:41-0400\n" -"PO-Revision-Date: 2011-06-08 11:39+0200\n" +"PO-Revision-Date: 2011-06-08 11:42+0200\n" "Last-Translator: Yuichiro \n" "Language-Team: japanese \n" "Language: ja\n" @@ -1025,10 +1025,9 @@ msgstr "パスワードが異なっています!" #: js/messages.php:54 server_privileges.php:1679 server_privileges.php:1703 #: server_privileges.php:2108 server_privileges.php:2302 -#, fuzzy #| msgid "Any user" msgid "Add user" -msgstr "すべてのユーザ" +msgstr "ユーザを追加する" #: js/messages.php:55 msgid "Reloading Privileges" From ab01575e896520511110768600c4ceaa7bb2a0df Mon Sep 17 00:00:00 2001 From: Yuichiro Date: Wed, 8 Jun 2011 11:55:45 +0200 Subject: [PATCH 03/18] Translation update done using Pootle. --- po/ja.po | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/po/ja.po b/po/ja.po index be2fdafd98..563e57e516 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@lists.sourceforge.net\n" "POT-Creation-Date: 2011-06-07 06:41-0400\n" -"PO-Revision-Date: 2011-06-08 11:42+0200\n" +"PO-Revision-Date: 2011-06-08 11:55+0200\n" "Last-Translator: Yuichiro \n" "Language-Team: japanese \n" "Language: ja\n" @@ -1099,10 +1099,9 @@ msgid "Create Table" msgstr "テーブルを作成" #: js/messages.php:82 -#, fuzzy #| msgid "Use Tables" msgid "Insert Table" -msgstr "利用するテーブル" +msgstr "テーブルを挿入する" #: js/messages.php:85 msgid "Searching" From 2ce2823d2608494548d80059390ff45df470816d Mon Sep 17 00:00:00 2001 From: Yuichiro Date: Wed, 8 Jun 2011 12:02:45 +0200 Subject: [PATCH 04/18] Translation update done using Pootle. --- po/ja.po | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/po/ja.po b/po/ja.po index 563e57e516..491ebba3b6 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@lists.sourceforge.net\n" "POT-Creation-Date: 2011-06-07 06:41-0400\n" -"PO-Revision-Date: 2011-06-08 11:55+0200\n" +"PO-Revision-Date: 2011-06-08 12:02+0200\n" "Last-Translator: Yuichiro \n" "Language-Team: japanese \n" "Language: ja\n" @@ -4011,7 +4011,6 @@ msgid "Display columns table" msgstr "表示するカラムためのテーブル" #: libraries/config/messages.inc.php:426 -#, fuzzy #| msgid "" #| "Leave blank for no user preferences storage in database, suggested: [kbd]" #| "pma_config[/kbd]" @@ -4019,8 +4018,8 @@ msgid "" "Leave blank for no \"persistent\" tables'UI preferences across sessions, " "suggested: [kbd]pma_table_uiprefs[/kbd]" msgstr "" -"データベースにユーザ設定の保存しない場合は空欄にします。[kbd]pma_config[/" -"kbd] としておくのがいいでしょう。" +"ユーザ設定をセッションを跨いで「永続的に」記憶しない場合は空欄にします。[kbd]pma_table_uiprefs[/kbd] " +"としておくのがいいでしょう。" #: libraries/config/messages.inc.php:427 #, fuzzy From 8a08124a580c208551e2df9dfd278f3a93fbb5f6 Mon Sep 17 00:00:00 2001 From: Yuichiro Date: Wed, 8 Jun 2011 12:03:08 +0200 Subject: [PATCH 05/18] Translation update done using Pootle. --- po/ja.po | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/po/ja.po b/po/ja.po index 491ebba3b6..b876a8d4bb 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@lists.sourceforge.net\n" "POT-Creation-Date: 2011-06-07 06:41-0400\n" -"PO-Revision-Date: 2011-06-08 12:02+0200\n" +"PO-Revision-Date: 2011-06-08 12:03+0200\n" "Last-Translator: Yuichiro \n" "Language-Team: japanese \n" "Language: ja\n" @@ -4022,7 +4022,6 @@ msgstr "" "としておくのがいいでしょう。" #: libraries/config/messages.inc.php:427 -#, fuzzy #| msgid "User preferences storage table" msgid "UI preferences table" msgstr "ユーザ設定保存テーブル" From af88f0d0622e251910f153d57ecf1b93753232d4 Mon Sep 17 00:00:00 2001 From: Yuichiro Date: Wed, 8 Jun 2011 12:05:54 +0200 Subject: [PATCH 06/18] Translation update done using Pootle. --- po/ja.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/po/ja.po b/po/ja.po index b876a8d4bb..d950496305 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@lists.sourceforge.net\n" "POT-Creation-Date: 2011-06-07 06:41-0400\n" -"PO-Revision-Date: 2011-06-08 12:03+0200\n" +"PO-Revision-Date: 2011-06-08 12:05+0200\n" "Last-Translator: Yuichiro \n" "Language-Team: japanese \n" "Language: ja\n" @@ -1662,7 +1662,7 @@ msgstr "テーブル %s を %s にリネームしました" #: libraries/Table.class.php:1250 msgid "Could not save table UI preferences" -msgstr "" +msgstr "テーブルにユーザ設定が保存できません" #: libraries/Theme.class.php:160 #, php-format From e3d9f792e07ac5c83f7eb9dbc941ca8d00eb7e0e Mon Sep 17 00:00:00 2001 From: Yuichiro Date: Wed, 8 Jun 2011 12:07:14 +0200 Subject: [PATCH 07/18] Translation update done using Pootle. --- po/ja.po | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/po/ja.po b/po/ja.po index d950496305..f54607fc5d 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@lists.sourceforge.net\n" "POT-Creation-Date: 2011-06-07 06:41-0400\n" -"PO-Revision-Date: 2011-06-08 12:05+0200\n" +"PO-Revision-Date: 2011-06-08 12:07+0200\n" "Last-Translator: Yuichiro \n" "Language-Team: japanese \n" "Language: ja\n" @@ -1790,10 +1790,9 @@ msgstr "" "ユーザ名ないしパスワードが間違っています。
アクセスは拒否されました" #: libraries/auth/signon.auth.lib.php:87 -#, fuzzy #| msgid "Config authentication" msgid "Can not find signon authentication script:" -msgstr "Config 認証" +msgstr "サインオン認証スクリプトが見つかりません:" #: libraries/auth/swekey/swekey.auth.lib.php:118 #, php-format From 5ea642c69e6c76b51cd5455475e618110be13dbf Mon Sep 17 00:00:00 2001 From: Yuichiro Date: Wed, 8 Jun 2011 12:15:52 +0200 Subject: [PATCH 08/18] Translation update done using Pootle. --- po/ja.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/po/ja.po b/po/ja.po index f54607fc5d..fc576eb08f 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@lists.sourceforge.net\n" "POT-Creation-Date: 2011-06-07 06:41-0400\n" -"PO-Revision-Date: 2011-06-08 12:07+0200\n" +"PO-Revision-Date: 2011-06-08 12:15+0200\n" "Last-Translator: Yuichiro \n" "Language-Team: japanese \n" "Language: ja\n" @@ -6218,7 +6218,7 @@ msgstr "最近使用したテーブルの永続的な記憶" #: libraries/relation.lib.php:147 msgid "Persistent tables' UI preferences" -msgstr "" +msgstr "永続的なテーブルのユーザ設定" #: libraries/relation.lib.php:155 msgid "User preferences" From 14bbe5d057e363f79434bb5b870e3f38ea87c861 Mon Sep 17 00:00:00 2001 From: Yuichiro Date: Wed, 8 Jun 2011 12:17:03 +0200 Subject: [PATCH 09/18] Translation update done using Pootle. --- po/ja.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/po/ja.po b/po/ja.po index fc576eb08f..433ff931e4 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@lists.sourceforge.net\n" "POT-Creation-Date: 2011-06-07 06:41-0400\n" -"PO-Revision-Date: 2011-06-08 12:15+0200\n" +"PO-Revision-Date: 2011-06-08 12:17+0200\n" "Last-Translator: Yuichiro \n" "Language-Team: japanese \n" "Language: ja\n" @@ -6214,7 +6214,7 @@ msgstr "SQL 履歴" #: libraries/relation.lib.php:143 #| msgid "Persistent connections" msgid "Persistent recently used tables" -msgstr "最近使用したテーブルの永続的な記憶" +msgstr "永続的な『最近使用したテーブル』" #: libraries/relation.lib.php:147 msgid "Persistent tables' UI preferences" From c3b98937da2912ba92c8283313b1f37c4ac64d96 Mon Sep 17 00:00:00 2001 From: Yuichiro Date: Wed, 8 Jun 2011 12:19:20 +0200 Subject: [PATCH 10/18] Translation update done using Pootle. --- po/ja.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/po/ja.po b/po/ja.po index 433ff931e4..7e392a7ea7 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@lists.sourceforge.net\n" "POT-Creation-Date: 2011-06-07 06:41-0400\n" -"PO-Revision-Date: 2011-06-08 12:17+0200\n" +"PO-Revision-Date: 2011-06-08 12:19+0200\n" "Last-Translator: Yuichiro \n" "Language-Team: japanese \n" "Language: ja\n" @@ -6218,7 +6218,7 @@ msgstr "永続的な『最近使用したテーブル』" #: libraries/relation.lib.php:147 msgid "Persistent tables' UI preferences" -msgstr "永続的なテーブルのユーザ設定" +msgstr "永続的な『テーブルのユーザ設定』" #: libraries/relation.lib.php:155 msgid "User preferences" From 3ac295d3bd6720484467dfff842bf13572f3bdc8 Mon Sep 17 00:00:00 2001 From: Burak Yavuz Date: Wed, 8 Jun 2011 16:19:33 +0200 Subject: [PATCH 11/18] Translation update done using Pootle. --- po/tr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/po/tr.po b/po/tr.po index 87b6ef2dbf..30a1b34228 100644 --- a/po/tr.po +++ b/po/tr.po @@ -4,13 +4,13 @@ msgstr "" "Project-Id-Version: phpMyAdmin 3.5.0-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2011-06-07 06:41-0400\n" -"PO-Revision-Date: 2011-06-06 18:49+0200\n" +"PO-Revision-Date: 2011-06-08 16:19+0200\n" "Last-Translator: Burak Yavuz \n" "Language-Team: turkish \n" +"Language: tr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: tr\n" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Pootle 2.0.5\n" @@ -4200,7 +4200,7 @@ msgid "" "Shows link to [a@http://php.net/manual/function.phpinfo.php]phpinfo()[/a] " "output" msgstr "" -"[a@http://php.net/manual/function.phpinfo.php]Phpinfo()[/a] çıktısına " +"[a@http://php.net/manual/function.phpinfo.php]phpinfo()[/a] çıktısına " "bağlantıyı gösterir" #: libraries/config/messages.inc.php:458 From e17e9b144f21c1e6a941dcb96f4de64a660b1ef4 Mon Sep 17 00:00:00 2001 From: Burak Yavuz Date: Wed, 8 Jun 2011 16:20:02 +0200 Subject: [PATCH 12/18] Translation update done using Pootle. --- po/tr.po | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/po/tr.po b/po/tr.po index 30a1b34228..ac6404fc8a 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@lists.sourceforge.net\n" "POT-Creation-Date: 2011-06-07 06:41-0400\n" -"PO-Revision-Date: 2011-06-08 16:19+0200\n" +"PO-Revision-Date: 2011-06-08 16:20+0200\n" "Last-Translator: Burak Yavuz \n" "Language-Team: turkish \n" "Language: tr\n" @@ -1024,10 +1024,9 @@ msgstr "Parolalar birbiriyle aynı değil!" #: js/messages.php:54 server_privileges.php:1679 server_privileges.php:1703 #: server_privileges.php:2108 server_privileges.php:2302 -#, fuzzy #| msgid "Any user" msgid "Add user" -msgstr "Herhangi kullanıcı" +msgstr "Kullanıcı ekle" #: js/messages.php:55 msgid "Reloading Privileges" From 0e6867b4483a29d1b5b729a787a656b8ecce1a38 Mon Sep 17 00:00:00 2001 From: Burak Yavuz Date: Wed, 8 Jun 2011 16:20:54 +0200 Subject: [PATCH 13/18] Translation update done using Pootle. --- po/tr.po | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/po/tr.po b/po/tr.po index ac6404fc8a..fe5445987b 100644 --- a/po/tr.po +++ b/po/tr.po @@ -1787,10 +1787,9 @@ msgid "Wrong username/password. Access denied." msgstr "Yanlış kullanıcı adı/parola girdiniz. Erişim engellendi." #: libraries/auth/signon.auth.lib.php:87 -#, fuzzy #| msgid "Config authentication" msgid "Can not find signon authentication script:" -msgstr "Yapılandırma kimlik doğrulaması" +msgstr "Oturum açma kimlik doğrulaması betiği bulunamıyor:" #: libraries/auth/swekey/swekey.auth.lib.php:118 #, php-format From b7fbd9e807e1daa85bf3c7412947826f8f00d77e Mon Sep 17 00:00:00 2001 From: Burak Yavuz Date: Wed, 8 Jun 2011 16:21:06 +0200 Subject: [PATCH 14/18] Translation update done using Pootle. --- po/tr.po | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/po/tr.po b/po/tr.po index fe5445987b..a1be8c0fe4 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@lists.sourceforge.net\n" "POT-Creation-Date: 2011-06-07 06:41-0400\n" -"PO-Revision-Date: 2011-06-08 16:20+0200\n" +"PO-Revision-Date: 2011-06-08 16:21+0200\n" "Last-Translator: Burak Yavuz \n" "Language-Team: turkish \n" "Language: tr\n" @@ -8021,10 +8021,9 @@ msgid "wildcard" msgstr "joker" #: server_privileges.php:2295 -#, fuzzy #| msgid "New user has been added." msgid "User has been added." -msgstr "Yeni kullanıcı eklendi." +msgstr "Kullanıcı eklendi." #: server_processlist.php:29 #, php-format From 2a10c7f4aa968122939dcd60123f9819e6c97efb Mon Sep 17 00:00:00 2001 From: Burak Yavuz Date: Wed, 8 Jun 2011 16:25:31 +0200 Subject: [PATCH 15/18] Translation update done using Pootle. --- po/tr.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/po/tr.po b/po/tr.po index a1be8c0fe4..61c405ce3b 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@lists.sourceforge.net\n" "POT-Creation-Date: 2011-06-07 06:41-0400\n" -"PO-Revision-Date: 2011-06-08 16:21+0200\n" +"PO-Revision-Date: 2011-06-08 16:25+0200\n" "Last-Translator: Burak Yavuz \n" "Language-Team: turkish \n" "Language: tr\n" @@ -1789,7 +1789,7 @@ msgstr "Yanlış kullanıcı adı/parola girdiniz. Erişim engellendi." #: libraries/auth/signon.auth.lib.php:87 #| msgid "Config authentication" msgid "Can not find signon authentication script:" -msgstr "Oturum açma kimlik doğrulaması betiği bulunamıyor:" +msgstr "Oturumu açma kimlik doğrulaması betiği bulunamıyor:" #: libraries/auth/swekey/swekey.auth.lib.php:118 #, php-format From 90099b7b5de240e5789ea8bfd29fcb03e867d825 Mon Sep 17 00:00:00 2001 From: Piotr Przybylski Date: Wed, 8 Jun 2011 19:23:58 +0200 Subject: [PATCH 16/18] Remove PMA_STR_binarySearchInArr in favor of isset and in_array --- libraries/common.lib.php | 2 +- libraries/sqlparser.data.php | 3 - libraries/sqlparser.lib.php | 201 ++++++++++++++++------------------- libraries/string.lib.php | 33 ------ 4 files changed, 95 insertions(+), 144 deletions(-) diff --git a/libraries/common.lib.php b/libraries/common.lib.php index b09570c630..999174bc55 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -827,7 +827,7 @@ function PMA_backquote($a_name, $do_it = true) if (! $do_it) { global $PMA_SQPdata_forbidden_word; - if(! PMA_STR_binarySearchInArr(strtoupper($a_name), $PMA_SQPdata_forbidden_word, count($PMA_SQPdata_forbidden_word))) { + if(! in_array(strtoupper($a_name), $PMA_SQPdata_forbidden_word)) { return $a_name; } } diff --git a/libraries/sqlparser.data.php b/libraries/sqlparser.data.php index 15fcb58d81..93132b39d7 100644 --- a/libraries/sqlparser.data.php +++ b/libraries/sqlparser.data.php @@ -11,9 +11,6 @@ * It has been extracted from the lex.h file in the MySQL BK tree * (around 4.0.2) as well as the MySQL documentation. * - * Note: before adding a value in the arrays, ensure that you respect - * proper sorting, especially with underscores. - * * It's easier to use only uppercase for proper sorting. In case of * doubt, use the test case to verify. * diff --git a/libraries/sqlparser.lib.php b/libraries/sqlparser.lib.php index 46ae2b2d5b..800588661f 100644 --- a/libraries/sqlparser.lib.php +++ b/libraries/sqlparser.lib.php @@ -198,8 +198,8 @@ if (! defined('PMA_MINIMUM_COMMON')) { */ function PMA_SQP_parse($sql) { - global $PMA_SQPdata_column_attrib, $PMA_SQPdata_reserved_word, $PMA_SQPdata_column_type; - global $PMA_SQPdata_function_name, $PMA_SQPdata_forbidden_word; + static $PMA_SQPdata_column_attrib, $PMA_SQPdata_reserved_word, $PMA_SQPdata_column_type; + static $PMA_SQPdata_function_name, $PMA_SQPdata_forbidden_word; global $mysql_charsets, $mysql_collations_flat; // Convert all line feeds to Unix style @@ -211,14 +211,14 @@ if (! defined('PMA_MINIMUM_COMMON')) { return array(); } - // Get counts of some arrays - $PMA_SQPdata_column_attrib_cnt = count($PMA_SQPdata_column_attrib); - $PMA_SQPdata_function_name_cnt = count($PMA_SQPdata_function_name); - $PMA_SQPdata_reserved_word_cnt = count($PMA_SQPdata_reserved_word); - $PMA_SQPdata_forbidden_word_cnt = count($PMA_SQPdata_forbidden_word); - $PMA_SQPdata_column_type_cnt = count($PMA_SQPdata_column_type); - $mysql_charsets_count = count($mysql_charsets); - $mysql_collations_count = count($mysql_collations_flat); + // Create local hashtables + if (!isset($PMA_SQPdata_column_attrib_cnt)) { + $PMA_SQPdata_column_attrib = array_flip($GLOBALS['PMA_SQPdata_column_attrib']); + $PMA_SQPdata_function_name = array_flip($GLOBALS['PMA_SQPdata_function_name']); + $PMA_SQPdata_reserved_word = array_flip($GLOBALS['PMA_SQPdata_reserved_word']); + $PMA_SQPdata_forbidden_word = array_flip($GLOBALS['PMA_SQPdata_forbidden_word']); + $PMA_SQPdata_column_type = array_flip($GLOBALS['PMA_SQPdata_column_type']); + } $sql_array = array(); $sql_array['raw'] = $sql; @@ -234,20 +234,19 @@ if (! defined('PMA_MINIMUM_COMMON')) { $digit_hexset = 'x'; $bracket_list = '()[]{}'; $allpunct_list = '-,;:!?/.^~\*&%+<=>|'; - $allpunct_list_pair = array ( - 0 => '!=', - 1 => '&&', - 2 => ':=', - 3 => '<<', - 4 => '<=', - 5 => '<=>', - 6 => '<>', - 7 => '>=', - 8 => '>>', - 9 => '||', - 10 => '==', + $allpunct_list_pair = array( + '!=' => 1, + '&&' => 1, + ':=' => 1, + '<<' => 1, + '<=' => 1, + '<=>' => 1, + '<>' => 1, + '>=' => 1, + '>>' => 1, + '||' => 1, + '==' => 1 ); - $allpunct_list_pair_size = 11; //count($allpunct_list_pair); $quote_list = '\'"`'; $arraysize = 0; @@ -608,7 +607,7 @@ if (! defined('PMA_MINIMUM_COMMON')) { break; } PMA_SQP_arrayAdd($sql_array, 'punct' . $t_suffix, $punct_data, $arraysize); - } elseif ($punct_data == $GLOBALS['sql_delimiter'] || PMA_STR_binarySearchInArr($punct_data, $allpunct_list_pair, $allpunct_list_pair_size)) { + } elseif ($punct_data == $GLOBALS['sql_delimiter'] || isset($allpunct_list_pair[$punct_data])) { // Ok, we have one of the valid combined punct expressions PMA_SQP_arrayAdd($sql_array, 'punct', $punct_data, $arraysize); } else { @@ -705,7 +704,7 @@ if (! defined('PMA_MINIMUM_COMMON')) { } elseif (($t_next == 'punct_qualifier') || ($t_prev == 'punct_qualifier')) { $t_suffix = '_identifier'; } elseif (($t_next == 'punct_bracket_open_round') - && PMA_STR_binarySearchInArr($d_cur_upper, $PMA_SQPdata_function_name, $PMA_SQPdata_function_name_cnt)) { + && isset($PMA_SQPdata_function_name[$d_cur_upper])) { /** * @todo 2005-10-16: in the case of a CREATE TABLE containing * a TIMESTAMP, since TIMESTAMP() is also a function, it's @@ -717,7 +716,7 @@ if (! defined('PMA_MINIMUM_COMMON')) { */ $t_suffix = '_functionName'; /* There are functions which might be as well column types */ - } elseif (PMA_STR_binarySearchInArr($d_cur_upper, $PMA_SQPdata_column_type, $PMA_SQPdata_column_type_cnt)) { + } elseif (isset($PMA_SQPdata_column_type[$d_cur_upper])) { $t_suffix = '_columnType'; /** @@ -745,9 +744,9 @@ if (! defined('PMA_MINIMUM_COMMON')) { // $sql_array[$i-1]['type'] = 'alpha_identifier'; //} - } elseif (PMA_STR_binarySearchInArr($d_cur_upper, $PMA_SQPdata_reserved_word, $PMA_SQPdata_reserved_word_cnt)) { + } elseif (isset($PMA_SQPdata_reserved_word[$d_cur_upper])) { $t_suffix = '_reservedWord'; - } elseif (PMA_STR_binarySearchInArr($d_cur_upper, $PMA_SQPdata_column_attrib, $PMA_SQPdata_column_attrib_cnt)) { + } elseif (isset($PMA_SQPdata_column_attrib[$d_cur_upper])) { $t_suffix = '_columnAttrib'; // INNODB is a MySQL table type, but in "SHOW INNODB STATUS", // it should be regarded as a reserved word. @@ -764,18 +763,18 @@ if (! defined('PMA_MINIMUM_COMMON')) { || ($d_bef_prev_upper == 'SET' && $d_prev_upper == '=') || ($d_bef_prev_upper == 'CHARSET' && $d_prev_upper == '=') || $d_prev_upper == 'CHARSET' - ) && PMA_STR_binarySearchInArr($d_cur, $mysql_charsets, count($mysql_charsets))) { + ) && in_array($d_cur, $mysql_charsets)) { $t_suffix = '_charset'; } - } elseif (PMA_STR_binarySearchInArr($d_cur, $mysql_charsets, $mysql_charsets_count) - || PMA_STR_binarySearchInArr($d_cur, $mysql_collations_flat, $mysql_collations_count) - || ($d_cur{0} == '_' && PMA_STR_binarySearchInArr(substr($d_cur, 1), $mysql_charsets, $mysql_charsets_count))) { + } elseif (in_array($d_cur, $mysql_charsets) + || in_array($d_cur, $mysql_collations_flat) + || ($d_cur{0} == '_' && in_array(substr($d_cur, 1), $mysql_charsets))) { $t_suffix = '_charset'; } else { // Do nothing } // check if present in the list of forbidden words - if ($t_suffix == '_reservedWord' && PMA_STR_binarySearchInArr($d_cur_upper, $PMA_SQPdata_forbidden_word, $PMA_SQPdata_forbidden_word_cnt)) { + if ($t_suffix == '_reservedWord' && isset($PMA_SQPdata_forbidden_word[$d_cur_upper])) { $sql_array[$i]['forbidden'] = true; } else { $sql_array[$i]['forbidden'] = false; @@ -988,49 +987,42 @@ if (! defined('PMA_MINIMUM_COMMON')) { // 'WHERE' // ); $words_ending_table_ref = array( - 'FOR', - 'GROUP', - 'HAVING', - 'LIMIT', - 'LOCK', - 'ORDER', - 'PROCEDURE', - 'UNION', - 'WHERE' + 'FOR' => 1, + 'GROUP' => 1, + 'HAVING' => 1, + 'LIMIT' => 1, + 'LOCK' => 1, + 'ORDER' => 1, + 'PROCEDURE' => 1, + 'UNION' => 1, + 'WHERE' => 1 ); - $words_ending_table_ref_cnt = 9; //count($words_ending_table_ref); $words_ending_clauses = array( - 'FOR', - 'LIMIT', - 'LOCK', - 'PROCEDURE', - 'UNION' + 'FOR' => 1, + 'LIMIT' => 1, + 'LOCK' => 1, + 'PROCEDURE' => 1, + 'UNION' => 1 ); - $words_ending_clauses_cnt = 5; //count($words_ending_clauses); - - - - // must be sorted $supported_query_types = array( - 'SELECT' + 'SELECT' => 1, /* // Support for these additional query types will come later on. - 'DELETE', - 'INSERT', - 'REPLACE', - 'TRUNCATE', - 'UPDATE' - 'EXPLAIN', - 'DESCRIBE', - 'SHOW', - 'CREATE', - 'SET', - 'ALTER' + 'DELETE' => 1, + 'INSERT' => 1, + 'REPLACE' => 1, + 'TRUNCATE' => 1, + 'UPDATE' => 1, + 'EXPLAIN' => 1, + 'DESCRIBE' => 1, + 'SHOW' => 1, + 'CREATE' => 1, + 'SET' => 1, + 'ALTER' => 1 */ ); - $supported_query_types_cnt = count($supported_query_types); // loop #1 for each token: select_expr, table_ref for SELECT @@ -1120,7 +1112,7 @@ if (! defined('PMA_MINIMUM_COMMON')) { } // end if (querytype was empty) // Check if we support this type of query - if (!PMA_STR_binarySearchInArr($subresult['querytype'], $supported_query_types, $supported_query_types_cnt)) { + if (!isset($supported_query_types[$subresult['querytype']])) { // Skip ahead to the next one if we don't $seek_queryend = true; continue; @@ -1410,7 +1402,7 @@ if (! defined('PMA_MINIMUM_COMMON')) { if (($i == $size-1) || ($arr[$i]['type'] == 'alpha_reservedWord' && !$in_group_concat - && PMA_STR_binarySearchInArr($upper_data, $words_ending_table_ref, $words_ending_table_ref_cnt))) { + && isset($words_ending_table_ref[$upper_data]))) { $seen_end_of_table_ref = true; // to be able to save the last table ref, but do not // set it true if we found a word like "ON" that has @@ -1653,7 +1645,7 @@ if (! defined('PMA_MINIMUM_COMMON')) { } // if we find one of the words that could end the clause - if (PMA_STR_binarySearchInArr($upper_data, $words_ending_clauses, $words_ending_clauses_cnt)) { + if (isset($words_ending_clauses[$upper_data])) { $in_group_by = false; $in_order_by = false; @@ -2134,51 +2126,46 @@ if (! defined('PMA_MINIMUM_COMMON')) { $space_alpha_reserved_word = ' '; $keywords_with_brackets_1before = array( - 'INDEX', - 'KEY', - 'ON', - 'USING' + 'INDEX' => 1, + 'KEY' => 1, + 'ON' => 1, + 'USING' => 1 ); - $keywords_with_brackets_1before_cnt = 4; $keywords_with_brackets_2before = array( - 'IGNORE', - 'INDEX', - 'INTO', - 'KEY', - 'PRIMARY', - 'PROCEDURE', - 'REFERENCES', - 'UNIQUE', - 'USE' + 'IGNORE' => 1, + 'INDEX' => 1, + 'INTO' => 1, + 'KEY' => 1, + 'PRIMARY' => 1, + 'PROCEDURE' => 1, + 'REFERENCES' => 1, + 'UNIQUE' => 1, + 'USE' => 1 ); - // $keywords_with_brackets_2before_cnt = count($keywords_with_brackets_2before); - $keywords_with_brackets_2before_cnt = 9; // These reserved words do NOT get a newline placed near them. $keywords_no_newline = array( - 'AS', - 'ASC', - 'DESC', - 'DISTINCT', - 'DUPLICATE', - 'HOUR', - 'INTERVAL', - 'IS', - 'LIKE', - 'NOT', - 'NULL', - 'ON', - 'REGEXP' + 'AS' => 1, + 'ASC' => 1, + 'DESC' => 1, + 'DISTINCT' => 1, + 'DUPLICATE' => 1, + 'HOUR' => 1, + 'INTERVAL' => 1, + 'IS' => 1, + 'LIKE' => 1, + 'NOT' => 1, + 'NULL' => 1, + 'ON' => 1, + 'REGEXP' => 1 ); - $keywords_no_newline_cnt = 12; // These reserved words introduce a privilege list $keywords_priv_list = array( - 'GRANT', - 'REVOKE' + 'GRANT' => 1, + 'REVOKE' => 1 ); - $keywords_priv_list_cnt = 2; if ($number_of_tokens == -1) { $number_of_tokens = $arr['len']; @@ -2228,9 +2215,9 @@ if (! defined('PMA_MINIMUM_COMMON')) { if (($typearr[1] == 'alpha_functionName') || ($typearr[1] == 'alpha_columnType') || ($typearr[1] == 'punct') || ($typearr[3] == 'digit_integer') || ($typearr[3] == 'digit_hex') || ($typearr[3] == 'digit_float') || (($typearr[0] == 'alpha_reservedWord') - && PMA_STR_binarySearchInArr(strtoupper($arr[$i - 2]['data']), $keywords_with_brackets_2before, $keywords_with_brackets_2before_cnt)) + && isset($keywords_with_brackets_2before[strtoupper($arr[$i - 2]['data'])])) || (($typearr[1] == 'alpha_reservedWord') - && PMA_STR_binarySearchInArr(strtoupper($arr[$i - 1]['data']), $keywords_with_brackets_1before, $keywords_with_brackets_1before_cnt)) + && isset($keywords_with_brackets_1before[strtoupper($arr[$i - 1]['data'])])) ) { $functionlevel++; $infunction = true; @@ -2420,9 +2407,9 @@ if (! defined('PMA_MINIMUM_COMMON')) { if ((($typearr[1] != 'alpha_reservedWord') || (($typearr[1] == 'alpha_reservedWord') - && PMA_STR_binarySearchInArr(strtoupper($arr[$i - 1]['data']), $keywords_no_newline, $keywords_no_newline_cnt))) + && isset($keywords_no_newline[strtoupper($arr[$i - 1]['data'])]))) && ($typearr[1] != 'punct_level_plus') - && (!PMA_STR_binarySearchInArr($arr[$i]['data'], $keywords_no_newline, $keywords_no_newline_cnt))) { + && (!isset($keywords_no_newline[$arr[$i]['data']]))) { // do not put a space before the first token, because // we use a lot of pattern matching checking for the // first reserved word at beginning of query @@ -2448,7 +2435,7 @@ if (! defined('PMA_MINIMUM_COMMON')) { } else { // on first keyword, check if it introduces a // privilege list - if (PMA_STR_binarySearchInArr($arr[$i]['data'], $keywords_priv_list, $keywords_priv_list_cnt)) { + if (isset($keywords_priv_list[$arr[$i]['data']])) { $in_priv_list = true; } } diff --git a/libraries/string.lib.php b/libraries/string.lib.php index 650a2efb51..96bfcfc216 100644 --- a/libraries/string.lib.php +++ b/libraries/string.lib.php @@ -124,37 +124,4 @@ function PMA_STR_isSqlIdentifier($c, $dot_is_valid = false) || ($dot_is_valid != false && $c == '.')); } // end of the "PMA_STR_isSqlIdentifier()" function - -/** - * Binary search of a value in a sorted array - * - * $arr MUST be sorted, due to binary search - * - * @param string string to search for - * @param array sorted array to search into - * @param integer size of sorted array to search into - * - * @return boolean whether the string has been found or not - */ -function PMA_STR_binarySearchInArr($str, $arr, $arrsize) -{ - $top = $arrsize - 1; - $bottom = 0; - $found = false; - - while ($top >= $bottom && $found == false) { - $mid = intval(($top + $bottom) / 2); - $res = strcmp($str, $arr[$mid]); - if ($res == 0) { - $found = true; - } elseif ($res < 0) { - $top = $mid - 1; - } else { - $bottom = $mid + 1; - } - } // end while - - return $found; -} // end of the "PMA_STR_binarySearchInArr()" function - ?> From 412bb22b3944339e77d0f2f5437955a80c44862a Mon Sep 17 00:00:00 2001 From: Yuichiro Date: Thu, 9 Jun 2011 09:09:49 +0200 Subject: [PATCH 17/18] Fix typo in documentation --- Documentation.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation.html b/Documentation.html index 6f66b64828..4db4ec086a 100644 --- a/Documentation.html +++ b/Documentation.html @@ -1329,7 +1329,7 @@ CREATE DATABASE,ALTER DATABASE,DROP DATABASE login credentials. This is alternative approach to session based single signon. The script needs to provide function get_login_credentials which returns list of username and - pasword, accepting single parameter of existing username (can be empty). + password, accepting single parameter of existing username (can be empty). See scripts/signon-script.php for an example.
$cfg['Servers'][$i]['SignonSession'] string
@@ -3533,7 +3533,7 @@ have either the APC extension

3.18 When I import a CSV file that contains multiple tables, they are lumped together into a single table.

- There is no reliable way to differetiate tables in CSV format. For the time being, you will have to break apart CSV files containing multiple tables. + There is no reliable way to differentiate tables in CSV format. For the time being, you will have to break apart CSV files containing multiple tables.

From cd5cddb2e4324094eae365e01422e8d165d372e8 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Thu, 9 Jun 2011 16:09:53 -0400 Subject: [PATCH 18/18] charset is now hardcoded --- browse_foreigners.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browse_foreigners.php b/browse_foreigners.php index 0b104841fe..c31d74ca8a 100644 --- a/browse_foreigners.php +++ b/browse_foreigners.php @@ -81,7 +81,7 @@ if (is_array($foreignData['disp_row'])) { phpMyAdmin - +