From 251e88de8d0b64f99f217ddadefb0867874fbdc6 Mon Sep 17 00:00:00 2001 From: Dieter Adriaenssens Date: Sat, 25 May 2013 13:57:34 +0200 Subject: [PATCH 1/5] Translated using Weblate (Dutch) Currently translated at 100.0% (2603 of 2603) --- po/nl.po | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/po/nl.po b/po/nl.po index f06af3529c..693fee8253 100644 --- a/po/nl.po +++ b/po/nl.po @@ -4,13 +4,13 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.0.3-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2013-05-25 07:30-0400\n" -"PO-Revision-Date: 2013-05-23 15:16+0200\n" +"PO-Revision-Date: 2013-05-25 13:57+0200\n" "Last-Translator: Dieter Adriaenssens \n" "Language-Team: Dutch \n" +"Language: nl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: nl\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: Weblate 1.6-dev\n" @@ -10816,20 +10816,18 @@ msgid "Instructions/Setup" msgstr "Instructies/Setup" #: server_status_monitor.php:483 -#, fuzzy #| msgid "Done rearranging/editing charts" msgid "Done dragging (rearranging) charts" -msgstr "Klaar met herschikken/bewerken van de grafieken" +msgstr "Klaar met slepen (herschikken) van de grafieken" #: server_status_monitor.php:489 server_status_monitor.php:606 msgid "Add chart" msgstr "Een grafiek toevoegen" #: server_status_monitor.php:492 -#, fuzzy #| msgid "Enable highlighting" msgid "Enable charts dragging" -msgstr "Markeren inschakelen" +msgstr "Grafieken verslepen ingeschakeld" #: server_status_monitor.php:496 msgid "Refresh rate" From df37fd140f7d0efbcbf19af19380b3a453873d91 Mon Sep 17 00:00:00 2001 From: Chanaka Indrajith Date: Sun, 26 May 2013 16:07:00 +0530 Subject: [PATCH 2/5] Fixed bug 3912 --- ChangeLog | 3 ++- libraries/database_interface.lib.php | 32 ++++++++++++++++++++++++++++ tbl_export.php | 15 +++++++++++-- 3 files changed, 47 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 121ac219e3..5dfd3fc22c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,7 +5,8 @@ phpMyAdmin - ChangeLog - bug #3941 Recent tables list always empty - bug #3933 Do not translate "Open Document" in export settings - bug #3927 List of tables is missing after expanding in the navigation frame -- bug #3942 Warnings about reserved word for many non reserved words +- bug #3942 Warnings about reserved word for many non reserved words +- bug #3912 Exporting row selection, resulted by ORDER BY query 4.0.2.0 (2013-05-24) - bug #3902 Cannot browse when table name contains keyword "call" diff --git a/libraries/database_interface.lib.php b/libraries/database_interface.lib.php index 0a43ce44a1..e224113ee9 100644 --- a/libraries/database_interface.lib.php +++ b/libraries/database_interface.lib.php @@ -2099,4 +2099,36 @@ function PMA_is_system_schema($schema_name, $test_for_mysql_schema = false) || (PMA_DRIZZLE && strtolower($schema_name) == 'data_dictionary') || ($test_for_mysql_schema && !PMA_DRIZZLE && $schema_name == 'mysql'); } + +/** + * Get regular expression which occur first inside the given sql query. + * + * @param Array $regex_array Comparing regular expressions. + * @param String $query SQL query to be checked. + * + * @return String Matching regular expression. + */ +function PMA_getFirstOccuringRegularExpression($regex_array, $query) +{ + + $minimum_first_occurance_index = null; + $regex = null; + + for ($i=0; $i diff --git a/tbl_export.php b/tbl_export.php index 557dcb352b..aa4880b9e0 100644 --- a/tbl_export.php +++ b/tbl_export.php @@ -37,14 +37,25 @@ if (! empty($sql_query)) { // Need to generate WHERE clause? if (isset($where_clause)) { - $temp_sql_array = preg_split("/\bwhere\b/i", $sql_query); + // Regular expressions which can appear in sql query, + // before the sql segment which remains as it is. + $regex_array = array( + '/\bwhere\b/i', '/\bgroup by\b/i', '/\bhaving\b/i', '/\border by\b/i' + ); + + $first_occuring_regex = PMA_getFirstOccuringRegularExpression( + $regex_array, $sql_query + ); // The part "SELECT `id`, `name` FROM `customers`" // is not modified by the next code segment, when exporting // the result set from a query such as // "SELECT `id`, `name` FROM `customers` WHERE id NOT IN // ( SELECT id FROM companies WHERE name LIKE '%u%')" - $sql_query = $temp_sql_array[0]; + if (! is_null($first_occuring_regex)) { + $temp_sql_array = preg_split($first_occuring_regex, $sql_query); + $sql_query = $temp_sql_array[0]; + } // Append the where clause using the primary key of each row if (is_array($where_clause) && (count($where_clause) > 0)) { From efbe4874689eb72efdb7db0ca3c325f6abd15c0e Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sun, 26 May 2013 09:36:17 -0400 Subject: [PATCH 3/5] Fix typos --- libraries/database_interface.lib.php | 10 +++++----- tbl_export.php | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libraries/database_interface.lib.php b/libraries/database_interface.lib.php index e224113ee9..56c4766ae9 100644 --- a/libraries/database_interface.lib.php +++ b/libraries/database_interface.lib.php @@ -2108,20 +2108,20 @@ function PMA_is_system_schema($schema_name, $test_for_mysql_schema = false) * * @return String Matching regular expression. */ -function PMA_getFirstOccuringRegularExpression($regex_array, $query) +function PMA_getFirstOccurringRegularExpression($regex_array, $query) { - $minimum_first_occurance_index = null; + $minimum_first_occurence_index = null; $regex = null; for ($i=0; $i Date: Sun, 26 May 2013 09:37:42 -0400 Subject: [PATCH 4/5] Code cleanup --- libraries/database_interface.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/database_interface.lib.php b/libraries/database_interface.lib.php index 56c4766ae9..de697ec119 100644 --- a/libraries/database_interface.lib.php +++ b/libraries/database_interface.lib.php @@ -2114,7 +2114,7 @@ function PMA_getFirstOccurringRegularExpression($regex_array, $query) $minimum_first_occurence_index = null; $regex = null; - for ($i=0; $i Date: Sun, 26 May 2013 09:52:34 -0400 Subject: [PATCH 5/5] Add unset() statement to help for future refactoring --- tbl_export.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tbl_export.php b/tbl_export.php index a89217dd32..fbc585c6e9 100644 --- a/tbl_export.php +++ b/tbl_export.php @@ -46,6 +46,7 @@ if (! empty($sql_query)) { $first_occurring_regex = PMA_getFirstOccurringRegularExpression( $regex_array, $sql_query ); + unset($regex_array); // The part "SELECT `id`, `name` FROM `customers`" // is not modified by the next code segment, when exporting @@ -56,6 +57,7 @@ if (! empty($sql_query)) { $temp_sql_array = preg_split($first_occurring_regex, $sql_query); $sql_query = $temp_sql_array[0]; } + unset($first_occurring_regex, $temp_sql_array); // Append the where clause using the primary key of each row if (is_array($where_clause) && (count($where_clause) > 0)) {