parser should return an array in case of errors, thanks to Thomas Pulickal

This commit is contained in:
Marc Delisle
2009-09-17 17:05:14 +00:00
parent 08c6c4a57d
commit a4dcf806cc

View File

@@ -345,7 +345,7 @@ if (! defined('PMA_MINIMUM_COMMON')) {
$debugstr = $GLOBALS['strSQPBugUnclosedQuote'] . ' @ ' . $startquotepos. "\n" $debugstr = $GLOBALS['strSQPBugUnclosedQuote'] . ' @ ' . $startquotepos. "\n"
. 'STR: ' . htmlspecialchars($quotetype); . 'STR: ' . htmlspecialchars($quotetype);
PMA_SQP_throwError($debugstr, $sql); PMA_SQP_throwError($debugstr, $sql);
return $sql; return $sql_array;
} }
// If the quote is the first character, it can't be // If the quote is the first character, it can't be
@@ -496,7 +496,7 @@ if (! defined('PMA_MINIMUM_COMMON')) {
$debugstr = $GLOBALS['strSQPBugInvalidIdentifer'] . ' @ ' . ($count1+1) . "\n" $debugstr = $GLOBALS['strSQPBugInvalidIdentifer'] . ' @ ' . ($count1+1) . "\n"
. 'STR: ' . htmlspecialchars(PMA_substr($sql, $count1, $count2 - $count1)); . 'STR: ' . htmlspecialchars(PMA_substr($sql, $count1, $count2 - $count1));
PMA_SQP_throwError($debugstr, $sql); PMA_SQP_throwError($debugstr, $sql);
return $sql; return $sql_array;
} }
} }
if ($is_digit && (!$is_hex_digit) && (($c2 == 'e') || ($c2 == 'E'))) { if ($is_digit && (!$is_hex_digit) && (($c2 == 'e') || ($c2 == 'E'))) {
@@ -613,7 +613,7 @@ if (! defined('PMA_MINIMUM_COMMON')) {
$debugstr = $GLOBALS['strSQPBugUnknownPunctuation'] . ' @ ' . ($count1+1) . "\n" $debugstr = $GLOBALS['strSQPBugUnknownPunctuation'] . ' @ ' . ($count1+1) . "\n"
. 'STR: ' . htmlspecialchars($punct_data); . 'STR: ' . htmlspecialchars($punct_data);
PMA_SQP_throwError($debugstr, $sql); PMA_SQP_throwError($debugstr, $sql);
return $sql; return $sql_array;
} }
PMA_SQP_arrayAdd($sql_array, 'punct', $punct_data, $arraysize); PMA_SQP_arrayAdd($sql_array, 'punct', $punct_data, $arraysize);
continue; continue;
@@ -627,7 +627,7 @@ if (! defined('PMA_MINIMUM_COMMON')) {
$debugstr = 'C1 C2 LEN: ' . $count1 . ' ' . $count2 . ' ' . $len . "\n" $debugstr = 'C1 C2 LEN: ' . $count1 . ' ' . $count2 . ' ' . $len . "\n"
. 'STR: ' . $GLOBALS['PMA_substr']($sql, $count1, $count2 - $count1) . "\n"; . 'STR: ' . $GLOBALS['PMA_substr']($sql, $count1, $count2 - $count1) . "\n";
PMA_SQP_bug($debugstr, $sql); PMA_SQP_bug($debugstr, $sql);
return $sql; return $sql_array;
} // end while ($count2 < $len) } // end while ($count2 < $len)