Libs changes for php 8.x
This commit is contained in:
@@ -59,7 +59,7 @@ class SQLProcessor extends SQLChunkProcessor {
|
||||
$prev_category = "";
|
||||
$token_category = "";
|
||||
$skip_next = 0;
|
||||
$out = false;
|
||||
$out = array();
|
||||
|
||||
// $tokens may come as a numeric indexed array starting with an index greater than 0 (or as a boolean)
|
||||
$tokenCount = count($tokens);
|
||||
@@ -242,7 +242,6 @@ class SQLProcessor extends SQLChunkProcessor {
|
||||
case 'DELETE':
|
||||
case 'ALTER':
|
||||
case 'INSERT':
|
||||
case 'TRUNCATE':
|
||||
case 'OPTIMIZE':
|
||||
case 'GRANT':
|
||||
case 'REVOKE':
|
||||
@@ -264,6 +263,17 @@ class SQLProcessor extends SQLChunkProcessor {
|
||||
$out[$upper][0] = $trim;
|
||||
continue 2;
|
||||
|
||||
case 'TRUNCATE':
|
||||
if ($prev_category === '') {
|
||||
// set the category in case these get subclauses in a future version of MySQL
|
||||
$token_category = $upper;
|
||||
$out[$upper][0] = $trim;
|
||||
continue 2;
|
||||
}
|
||||
// part of the CREATE TABLE statement or a function
|
||||
$out[$prev_category][] = $trim;
|
||||
continue 2;
|
||||
|
||||
case 'REPLACE':
|
||||
if ($prev_category === '') {
|
||||
// set the category in case these get subclauses in a future version of MySQL
|
||||
@@ -400,7 +410,7 @@ class SQLProcessor extends SQLChunkProcessor {
|
||||
break;
|
||||
|
||||
case 'FOR':
|
||||
if ($prev_category === 'SHOW') {
|
||||
if ($prev_category === 'SHOW' || $token_category === 'FROM') {
|
||||
break;
|
||||
}
|
||||
$skip_next = 1;
|
||||
@@ -509,6 +519,10 @@ class SQLProcessor extends SQLChunkProcessor {
|
||||
$prev_category = $token_category;
|
||||
}
|
||||
|
||||
if (count($out) === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return parent::process($out);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user