Fails if supplied PDO has default mode set FETCH_ASSOC
Open
Nobody has claimed this yet.
enhancement
- Dominant language
- PHP
- Stars
- 4.5k
- Forks
- 884
- PR merge metrics
- No merged PRs in 30d
Description
Obvious work around - dont supply pdo connection with PDO::FETCH_ASSOC set as default. But... it could be a little more resilient.
trips over:
SQLiteAdapter.php -- public function hasTable($tableName)
...
$rows = $this->fetchAll(sprintf('SELECT name FROM sqlite_master WHERE ...
foreach ($rows as $row) {
$tables[] = strtolower($row[0]); <<<< oops
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with SQLiteAdapter.php, specifically public function hasTable($tableName), and inspect how fetchAll handles the supplied PDO fetch mode. Reproduce the failure with PDO::FETCH_ASSOC; done when hasTable works with that default mode instead of failing while reading the returned rows.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, sqlite
- Domain
- database
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100