Fixed bug #583236 (LIMIT error)

This commit is contained in:
Loïc Chapeaux
2002-07-19 12:21:04 +00:00
parent 1c56b7f215
commit 1640a47d91
2 changed files with 2 additions and 1 deletions

View File

@@ -8,6 +8,7 @@ $Source$
2002-07-19 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* pdf_page.php3; libraries/common.lib.php3: PHP3 fixes.
* tbl_properties_structure.php3: coding standards.
* sql.php3, line 302: fixed bug 583236 (LIMIT error)
2002-07-18 Alexander M. Turek <rabus@users.sourceforge.net>
* libraries/common.lib.php3, libraries/select_lang.lib.php3: Don't include

View File

@@ -299,7 +299,7 @@ else {
&& $is_select
&& !($is_count || $is_export || $is_func || $is_analyse)
&& eregi('[[:space:]]FROM[[:space:]]', $sql_query)
&& !eregi('[[:space:]]LIMIT[[:space:]0-9,]+$', $sql_query)) {
&& !eregi('[[:space:]]LIMIT[[:space:]0-9,-]+$', $sql_query)) {
$sql_limit_to_append = " LIMIT $pos, ".$cfg['MaxRows'];
if (eregi('(.*)([[:space:]](PROCEDURE[[:space:]](.*)|FOR[[:space:]]+UPDATE|LOCK[[:space:]]+IN[[:space:]]+SHARE[[:space:]]+MODE))$', $sql_query, $regs)) {
$full_sql_query = $regs[1] . $sql_limit_to_append . $regs[2];