Fix appending LIMIT when there are comments.
This commit is contained in:
@@ -67,6 +67,7 @@ $Source$
|
|||||||
* libraries/import/sql.php: Fix query parsing when there is comment or
|
* libraries/import/sql.php: Fix query parsing when there is comment or
|
||||||
string at the end.
|
string at the end.
|
||||||
* import.php: Reenable LIMIT appending (bug #1318624).
|
* import.php: Reenable LIMIT appending (bug #1318624).
|
||||||
|
* sql.php: Fix appending LIMIT when there are comments.
|
||||||
|
|
||||||
2005-10-07 Marc Delisle <lem9@users.sourceforge.net>
|
2005-10-07 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
* libraries/check_user_privileges.lib.php: bug #1313821, dbname containing a
|
* libraries/check_user_privileges.lib.php: bug #1313821, dbname containing a
|
||||||
|
4
sql.php
4
sql.php
@@ -331,7 +331,7 @@ else {
|
|||||||
&& !preg_match('@[[:space:]]LIMIT[[:space:]0-9,-]+$@i', $sql_query)) {
|
&& !preg_match('@[[:space:]]LIMIT[[:space:]0-9,-]+$@i', $sql_query)) {
|
||||||
$sql_limit_to_append = " LIMIT $pos, ".$cfg['MaxRows'] . " ";
|
$sql_limit_to_append = " LIMIT $pos, ".$cfg['MaxRows'] . " ";
|
||||||
|
|
||||||
$full_sql_query = $analyzed_sql[0]['section_before_limit'] . $sql_limit_to_append . $analyzed_sql[0]['section_after_limit'];
|
$full_sql_query = $analyzed_sql[0]['section_before_limit'] . "\n" . $sql_limit_to_append . $analyzed_sql[0]['section_after_limit'];
|
||||||
// FIXME: pretty printing of this modified query
|
// FIXME: pretty printing of this modified query
|
||||||
|
|
||||||
if (isset($display_query)) {
|
if (isset($display_query)) {
|
||||||
@@ -341,7 +341,7 @@ else {
|
|||||||
|
|
||||||
if (!empty($analyzed_sql[0]['section_after_limit'])) {
|
if (!empty($analyzed_sql[0]['section_after_limit'])) {
|
||||||
$analyzed_display_query = PMA_SQP_analyze(PMA_SQP_parse($display_query));
|
$analyzed_display_query = PMA_SQP_analyze(PMA_SQP_parse($display_query));
|
||||||
$display_query = $analyzed_display_query[0]['section_before_limit'] . $sql_limit_to_append . $analyzed_display_query[0]['section_after_limit'];
|
$display_query = $analyzed_display_query[0]['section_before_limit'] . "\n" . $sql_limit_to_append . $analyzed_display_query[0]['section_after_limit'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user