Fix #478 - ALTER TABLE … MODIFY … ENUM('<reserved_keyword>')
is being wrongly parsed
#422
This run and associated checks have been archived and are scheduled for deletion.
Learn more about checks retention
Annotations
11 warnings
Mutation tests with PHP 8.1:
src/Components/AlterOperation.php#L354
Escaped Mutant for Mutator "Continue_":
--- Original
+++ New
@@ @@
}
// Skipping comments.
if ($token->type === Token::TYPE_COMMENT) {
- continue;
+ break;
}
// Skipping whitespaces.
if ($token->type === Token::TYPE_WHITESPACE) {
|
Mutation tests with PHP 8.1:
src/Components/AlterOperation.php#L359
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
}
// Skipping whitespaces.
if ($token->type === Token::TYPE_WHITESPACE) {
- if ($state === 2) {
+ if ($state === 1) {
// When parsing the unknown part, the whitespaces are
// included to not break anything.
$ret->unknown[] = $token;
|
Mutation tests with PHP 8.1:
src/Components/AlterOperation.php#L373
Escaped Mutant for Mutator "LessThan":
--- Original
+++ New
@@ @@
// Not only when aliasing but also when parsing the body of an event, we just list the tokens of the
// body in the unknown tokens list, as they define their own statements.
if ($ret->options->has('AS') || $ret->options->has('DO')) {
- for (; $list->idx < $list->count; ++$list->idx) {
+ for (; $list->idx <= $list->count; ++$list->idx) {
if ($list->tokens[$list->idx]->type === Token::TYPE_DELIMITER) {
break;
}
|
Mutation tests with PHP 8.1:
src/Components/AlterOperation.php#L413
Escaped Mutant for Mutator "LogicalOr":
--- Original
+++ New
@@ @@
}
$state = 2;
} elseif ($state === 2) {
- if (is_string($token->value) || is_numeric($token->value)) {
+ if (is_string($token->value) && is_numeric($token->value)) {
$arrayKey = $token->value;
} else {
$arrayKey = $token->token;
|
Mutation tests with PHP 8.1:
src/Components/AlterOperation.php#L413
Escaped Mutant for Mutator "LogicalOrAllSubExprNegation":
--- Original
+++ New
@@ @@
}
$state = 2;
} elseif ($state === 2) {
- if (is_string($token->value) || is_numeric($token->value)) {
+ if (!is_string($token->value) || !is_numeric($token->value)) {
$arrayKey = $token->value;
} else {
$arrayKey = $token->token;
|
Mutation tests with PHP 8.1:
src/Components/AlterOperation.php#L413
Escaped Mutant for Mutator "LogicalOrNegation":
--- Original
+++ New
@@ @@
}
$state = 2;
} elseif ($state === 2) {
- if (is_string($token->value) || is_numeric($token->value)) {
+ if (!(is_string($token->value) || is_numeric($token->value))) {
$arrayKey = $token->value;
} else {
$arrayKey = $token->token;
|
Mutation tests with PHP 8.1:
src/Components/AlterOperation.php#L413
Escaped Mutant for Mutator "LogicalOrSingleSubExprNegation":
--- Original
+++ New
@@ @@
}
$state = 2;
} elseif ($state === 2) {
- if (is_string($token->value) || is_numeric($token->value)) {
+ if (!is_string($token->value) || is_numeric($token->value)) {
$arrayKey = $token->value;
} else {
$arrayKey = $token->token;
|
Mutation tests with PHP 8.1:
src/Components/AlterOperation.php#L413
Escaped Mutant for Mutator "LogicalOrSingleSubExprNegation":
--- Original
+++ New
@@ @@
}
$state = 2;
} elseif ($state === 2) {
- if (is_string($token->value) || is_numeric($token->value)) {
+ if (is_string($token->value) || !is_numeric($token->value)) {
$arrayKey = $token->value;
} else {
$arrayKey = $token->token;
|
Mutation tests with PHP 8.1:
src/Components/AlterOperation.php#L433
Escaped Mutant for Mutator "LogicalAnd":
--- Original
+++ New
@@ @@
$list->idx++;
// Ignore the current token
$nextToken = $list->getNext();
- if (in_array($token->value, ['SET', 'ENUM'], true) && $nextToken !== null && $nextToken->value === '(') {
+ if ((in_array($token->value, ['SET', 'ENUM'], true) || $nextToken !== null) && $nextToken->value === '(') {
// To avoid adding the tokens between the SET() or ENUM() parentheses to the unknown tokens
$list->getNextOfTypeAndValue(Token::TYPE_OPERATOR, ')');
} elseif (in_array($token->value, ['SET', 'ENUM'], true) && $nextToken !== null && $nextToken->value === 'DEFAULT') {
|
Mutation tests with PHP 8.1:
src/Components/AlterOperation.php#L440
Escaped Mutant for Mutator "LogicalAnd":
--- Original
+++ New
@@ @@
if (in_array($token->value, ['SET', 'ENUM'], true) && $nextToken !== null && $nextToken->value === '(') {
// To avoid adding the tokens between the SET() or ENUM() parentheses to the unknown tokens
$list->getNextOfTypeAndValue(Token::TYPE_OPERATOR, ')');
- } elseif (in_array($token->value, ['SET', 'ENUM'], true) && $nextToken !== null && $nextToken->value === 'DEFAULT') {
+ } elseif ((in_array($token->value, ['SET', 'ENUM'], true) || $nextToken !== null) && $nextToken->value === 'DEFAULT') {
// to avoid adding the `DEFAULT` token to the unknown tokens.
++$list->idx;
} else {
|
Mutation tests with PHP 8.1
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|