Skip to content

Commit

Permalink
Fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Dec 16, 2024
1 parent 714af3a commit cfa96ea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Db/Adapter/MysqlAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -830,8 +830,8 @@ protected function getForeignKeys(string $tableName): array
REFERENCED_COLUMN_NAME
FROM information_schema.KEY_COLUMN_USAGE
WHERE REFERENCED_TABLE_NAME IS NOT NULL
AND TABLE_SCHEMA = %s
AND TABLE_NAME = '%s'
AND TABLE_SCHEMA = ?
AND TABLE_NAME = ?
ORDER BY POSITION_IN_UNIQUE_CONSTRAINT",
$params
)->fetchAll('assoc');
Expand Down
11 changes: 7 additions & 4 deletions src/Db/Adapter/SqliteAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,12 +326,15 @@ protected function resolveTable(string $tableName): array
} else {
$master = sprintf('%s.%s', $this->quoteColumnName($schema), 'sqlite_master');
}
$rows = [];
try {
$params = [$table];
$rows = $this->query(
$result = $this->query(
"SELECT name FROM {$master} WHERE type = 'table' AND lower(name) = ?",
$params
)->fetchAll('assoc');
[$table]
);
if ($result) {

Check failure on line 335 in src/Db/Adapter/SqliteAdapter.php

View workflow job for this annotation

GitHub Actions / cs-stan / Coding Standard & Static Analysis

If condition is always true.
$rows = $result->fetchAll('assoc');
}
} catch (PDOException $e) {
// an exception can occur if the schema part of the table refers to a database which is not attached
break;
Expand Down

0 comments on commit cfa96ea

Please sign in to comment.