test fixes

This commit is contained in:
Dennis Eichhorn 2023-10-22 13:55:10 +00:00
parent 5a1ea1ee49
commit a4f7d2e527
2 changed files with 12 additions and 1 deletions

View File

@ -60,6 +60,6 @@ class MysqlGrammar extends Grammar
$expression = '*';
}
return 'SELECT ' . $expression . ' ' . $this->compileFrom($query, $query->from) . ' ' . $this->compileWheres($query, $query->wheres) . ' ORDER BY \rand() ' . $this->compileLimit($query, $query->limit ?? 1);
return 'SELECT ' . $expression . ' ' . $this->compileFrom($query, $query->from) . ' ' . $this->compileWheres($query, $query->wheres) . ' ORDER BY RAND() ' . $this->compileLimit($query, $query->limit ?? 1);
}
}

View File

@ -84,6 +84,17 @@ final class Algebra
$temp += $value1[$i][$c] * $value2[$c];
}
$result[$i] = $temp;
}
} elseif (!$isMatrix1 && $isMatrix2) {
$result = [];
for ($i = 0; $i < $m1; ++$i) { // Row of 1
$temp = 0;
for ($c = 0; $c < $m2; ++$c) { // Row of 2
$temp += $value2[$i][$c] * $value1[$c];
}
$result[$i] = $temp;
}
} else {