Add handling of index hints on join clauses too. Fixes #593 and #497. #645
Annotations
1 error and 11 warnings
Mutation tests with PHP 8.2
Process completed with exit code 1.
|
Mutation tests with PHP 8.2
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/
|
Mutation tests with PHP 8.2:
src/Components/JoinKeyword.php#L95
Escaped Mutant for Mutator "Concat":
--- Original
+++ New
@@ @@
}
public function build() : string
{
- return array_search($this->type, self::JOINS) . ' ' . $this->expr . ($this->indexHints !== [] ? ' ' . IndexHints::buildAll($this->indexHints) : '') . (!empty($this->on) ? ' ON ' . Conditions::buildAll($this->on) : '') . (!empty($this->using) ? ' USING ' . $this->using->build() : '');
+ return array_search($this->type, self::JOINS) . ' ' . $this->expr . ($this->indexHints !== [] ? ' ' . IndexHints::buildAll($this->indexHints) : '') . (!empty($this->using) ? ' USING ' . $this->using->build() : '') . (!empty($this->on) ? ' ON ' . Conditions::buildAll($this->on) : '');
}
public function __toString() : string
{
|
Mutation tests with PHP 8.2:
src/Components/JoinKeyword.php#L95
Escaped Mutant for Mutator "ConcatOperandRemoval":
--- Original
+++ New
@@ @@
}
public function build() : string
{
- return array_search($this->type, self::JOINS) . ' ' . $this->expr . ($this->indexHints !== [] ? ' ' . IndexHints::buildAll($this->indexHints) : '') . (!empty($this->on) ? ' ON ' . Conditions::buildAll($this->on) : '') . (!empty($this->using) ? ' USING ' . $this->using->build() : '');
+ return array_search($this->type, self::JOINS) . ' ' . $this->expr . ($this->indexHints !== [] ? ' ' . IndexHints::buildAll($this->indexHints) : '') . (!empty($this->on) ? ' ON ' . Conditions::buildAll($this->on) : '');
}
public function __toString() : string
{
|
Mutation tests with PHP 8.2:
src/Components/JoinKeyword.php#L98
Escaped Mutant for Mutator "Concat":
--- Original
+++ New
@@ @@
}
public function build() : string
{
- return array_search($this->type, self::JOINS) . ' ' . $this->expr . ($this->indexHints !== [] ? ' ' . IndexHints::buildAll($this->indexHints) : '') . (!empty($this->on) ? ' ON ' . Conditions::buildAll($this->on) : '') . (!empty($this->using) ? ' USING ' . $this->using->build() : '');
+ return array_search($this->type, self::JOINS) . ' ' . $this->expr . ($this->indexHints !== [] ? ' ' . IndexHints::buildAll($this->indexHints) : '') . (!empty($this->on) ? ' ON ' . Conditions::buildAll($this->on) : '') . (!empty($this->using) ? $this->using->build() . ' USING ' : '');
}
public function __toString() : string
{
|
Mutation tests with PHP 8.2:
src/Components/JoinKeyword.php#L98
Escaped Mutant for Mutator "ConcatOperandRemoval":
--- Original
+++ New
@@ @@
}
public function build() : string
{
- return array_search($this->type, self::JOINS) . ' ' . $this->expr . ($this->indexHints !== [] ? ' ' . IndexHints::buildAll($this->indexHints) : '') . (!empty($this->on) ? ' ON ' . Conditions::buildAll($this->on) : '') . (!empty($this->using) ? ' USING ' . $this->using->build() : '');
+ return array_search($this->type, self::JOINS) . ' ' . $this->expr . ($this->indexHints !== [] ? ' ' . IndexHints::buildAll($this->indexHints) : '') . (!empty($this->on) ? ' ON ' . Conditions::buildAll($this->on) : '') . (!empty($this->using) ? $this->using->build() : '');
}
public function __toString() : string
{
|
Mutation tests with PHP 8.2:
src/Components/JoinKeyword.php#L98
Escaped Mutant for Mutator "ConcatOperandRemoval":
--- Original
+++ New
@@ @@
}
public function build() : string
{
- return array_search($this->type, self::JOINS) . ' ' . $this->expr . ($this->indexHints !== [] ? ' ' . IndexHints::buildAll($this->indexHints) : '') . (!empty($this->on) ? ' ON ' . Conditions::buildAll($this->on) : '') . (!empty($this->using) ? ' USING ' . $this->using->build() : '');
+ return array_search($this->type, self::JOINS) . ' ' . $this->expr . ($this->indexHints !== [] ? ' ' . IndexHints::buildAll($this->indexHints) : '') . (!empty($this->on) ? ' ON ' . Conditions::buildAll($this->on) : '') . (!empty($this->using) ? ' USING ' : '');
}
public function __toString() : string
{
|
Mutation tests with PHP 8.2:
src/Parsers/JoinKeywords.php#L77
Escaped Mutant for Mutator "LessThan":
--- Original
+++ New
@@ @@
if ($list->idx > 0) {
--$list->idx;
}
- for (; $list->idx < $list->count; ++$list->idx) {
+ for (; $list->idx <= $list->count; ++$list->idx) {
/**
* Token parsed at this moment.
*/
|
Mutation tests with PHP 8.2:
src/Parsers/JoinKeywords.php#L89
Escaped Mutant for Mutator "LogicalOr":
--- Original
+++ New
@@ @@
break;
}
// Skipping whitespaces and comments.
- if ($token->type === TokenType::Whitespace || $token->type === TokenType::Comment) {
+ if ($token->type === TokenType::Whitespace && $token->type === TokenType::Comment) {
continue;
}
if ($state === 0) {
|
Mutation tests with PHP 8.2:
src/Parsers/JoinKeywords.php#L105
Escaped Mutant for Mutator "SharedCaseRemoval":
--- Original
+++ New
@@ @@
$state = 4;
break;
case 'USE':
- case 'IGNORE':
case 'FORCE':
// Adding index hint on the JOIN clause.
$expr->indexHints = IndexHints::parse($parser, $list);
|
Mutation tests with PHP 8.2:
src/Parsers/JoinKeywords.php#L110
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
$state = 3;
break;
case 'USING':
- $state = 4;
+ $state = 5;
break;
case 'USE':
case 'IGNORE':
|
Mutation tests with PHP 8.2:
src/Parsers/JoinKeywords.php#L141
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
$expr->using = ArrayObjs::parse($parser, $list);
$ret[] = $expr;
$expr = new JoinKeyword();
- $state = 0;
+ $state = -1;
}
}
if (!empty($expr->type)) {
|