Added parser SQL syntax check for invalid VARCHAR column definition. #729
Triggered via pull request
September 30, 2026 11:34
Status
Success
Total duration
1m 47s
Artifacts
–
Annotations
10 warnings and 1 notice
|
Mutation tests with PHP 8.2:
src/Parsers/AlterOperations.php#L365
Escaped Mutant for Mutator "LogicalOrSingleSubExprNegation":
@@ @@
}
$isFirstUnknownToken = false;
- if (is_string($token->value) || is_int($token->value)) {
+ if (is_string($token->value) || !is_int($token->value)) {
$arrayKey = $token->value;
} else {
$arrayKey = $token->token;
|
|
Mutation tests with PHP 8.2:
src/Parsers/AlterOperations.php#L365
Escaped Mutant for Mutator "LogicalOrSingleSubExprNegation":
@@ @@
}
$isFirstUnknownToken = false;
- if (is_string($token->value) || is_int($token->value)) {
+ if (!is_string($token->value) || is_int($token->value)) {
$arrayKey = $token->value;
} else {
$arrayKey = $token->token;
|
|
Mutation tests with PHP 8.2:
src/Parsers/AlterOperations.php#L365
Escaped Mutant for Mutator "LogicalOrNegation":
@@ @@
}
$isFirstUnknownToken = false;
- if (is_string($token->value) || is_int($token->value)) {
+ if (!(is_string($token->value) || is_int($token->value))) {
$arrayKey = $token->value;
} else {
$arrayKey = $token->token;
|
|
Mutation tests with PHP 8.2:
src/Parsers/AlterOperations.php#L365
Escaped Mutant for Mutator "LogicalOrAllSubExprNegation":
@@ @@
}
$isFirstUnknownToken = false;
- if (is_string($token->value) || is_int($token->value)) {
+ if (!is_string($token->value) || !is_int($token->value)) {
$arrayKey = $token->value;
} else {
$arrayKey = $token->token;
|
|
Mutation tests with PHP 8.2:
src/Parsers/AlterOperations.php#L365
Escaped Mutant for Mutator "LogicalOr":
@@ @@
}
$isFirstUnknownToken = false;
- if (is_string($token->value) || is_int($token->value)) {
+ if (is_string($token->value) && is_int($token->value)) {
$arrayKey = $token->value;
} else {
$arrayKey = $token->token;
|
|
Mutation tests with PHP 8.2:
src/Parsers/AlterOperations.php#L364
Escaped Mutant for Mutator "FalseValue":
@@ @@
DataTypes::parse($parser, clone $list);
}
- $isFirstUnknownToken = false;
+ $isFirstUnknownToken = true;
if (is_string($token->value) || is_int($token->value)) {
$arrayKey = $token->value;
} else {
|
|
Mutation tests with PHP 8.2:
src/Parsers/AlterOperations.php#L359
Escaped Mutant for Mutator "LogicalAnd":
@@ @@
$state = 2;
} elseif ($state === 2) {
- if ($isFirstUnknownToken && $ret->options?->has('ADD') === true && $token->keyword === 'VARCHAR') {
+ if (($isFirstUnknownToken || $ret->options?->has('ADD') === true) && $token->keyword === 'VARCHAR') {
// Validate the column type while preserving the original tokens used to build ALTER.
DataTypes::parse($parser, clone $list);
}
|
|
Mutation tests with PHP 8.2:
src/Parsers/AlterOperations.php#L359
Escaped Mutant for Mutator "NullSafeMethodCall":
@@ @@
$state = 2;
} elseif ($state === 2) {
- if ($isFirstUnknownToken && $ret->options?->has('ADD') === true && $token->keyword === 'VARCHAR') {
+ if ($isFirstUnknownToken && $ret->options->has('ADD') === true && $token->keyword === 'VARCHAR') {
// Validate the column type while preserving the original tokens used to build ALTER.
DataTypes::parse($parser, clone $list);
}
|
|
Mutation tests with PHP 8.2:
src/Parsers/AlterOperations.php#L319
Escaped Mutant for Mutator "LessThan":
@@ @@
// 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 === TokenType::Delimiter) {
break;
}
|
|
Mutation tests with PHP 8.2:
src/Parsers/AlterOperations.php#L305
Escaped Mutant for Mutator "DecrementInteger":
@@ @@
// Skipping whitespaces.
if ($token->type === TokenType::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.2
"The ubuntu-latest label will migrate to Ubuntu 26 beginning October 19, 2026. For more information, see https://github.com/actions/runner-images/issues/14748"
|