Skip to content

Bug: Database tests failed #9668

Description

@neznaika0

PHP Version

8.4

CodeIgniter4 Version

4.6.3

CodeIgniter4 Installation Method

Git

Which operating systems have you tested for this bug?

Linux

Which server did you use?

cli-server (PHP built-in webserver)

Database

11.7.2-MariaDB, SQLite3 3.50.0

What happened?

Run composer test ./tests/system/Database/Live:

There were 93 errors:

1) CodeIgniter\Database\Live\GroupTest::testGroupBy
CodeIgniter\Database\Exceptions\DatabaseException: Unable to prepare statement: no such table: db_migrations

/home/neznaika0/www/codeigniter/development/system/Database/BaseConnection.php:684
/home/neznaika0/www/codeigniter/development/system/Database/BaseBuilder.php:1649
/home/neznaika0/www/codeigniter/development/system/Database/MigrationRunner.php:693
/home/neznaika0/www/codeigniter/development/system/Database/MigrationRunner.php:233
/home/neznaika0/www/codeigniter/development/system/Test/DatabaseTestTrait.php:147
/home/neznaika0/www/codeigniter/development/system/Test/DatabaseTestTrait.php:114
/home/neznaika0/www/codeigniter/development/system/Test/DatabaseTestTrait.php:60
/home/neznaika0/www/codeigniter/development/system/Test/CIUnitTestCase.php:251

Caused by
CodeIgniter\Database\Exceptions\DatabaseException: Unable to prepare statement: no such table: db_migrations

/home/neznaika0/www/codeigniter/development/system/Database/SQLite3/Connection.php:181
/home/neznaika0/www/codeigniter/development/system/Database/BaseConnection.php:729
/home/neznaika0/www/codeigniter/development/system/Database/BaseConnection.php:646
/home/neznaika0/www/codeigniter/development/system/Database/BaseBuilder.php:1649
/home/neznaika0/www/codeigniter/development/system/Database/MigrationRunner.php:693
/home/neznaika0/www/codeigniter/development/system/Database/MigrationRunner.php:233
/home/neznaika0/www/codeigniter/development/system/Test/DatabaseTestTrait.php:147
/home/neznaika0/www/codeigniter/development/system/Test/DatabaseTestTrait.php:114
/home/neznaika0/www/codeigniter/development/system/Test/DatabaseTestTrait.php:60
/home/neznaika0/www/codeigniter/development/system/Test/CIUnitTestCase.php:251
...
2) CodeIgniter\Database\Live\GroupTest::testHavingBy
CodeIgniter\Database\Exceptions\DatabaseException: Unable to prepare statement: no such table: db_migrations
...
3) CodeIgniter\Database\Live\GroupTest::testOrHavingBy
CodeIgniter\Database\Exceptions\DatabaseException: Unable to prepare statement: no such table: db_migrations
...

The error trace is the same - the problem is cleaning the database.

The file writable/database.db is created, tests are performed individually. This may be related to :memory: for SQLite?

Steps to Reproduce

Clone development repo and run tests.

Expected Output

The tests must be successful.

Anything else?

My PC:
Linux arch-pc 6.15.8-arch1-2
11.7.2-MariaDB
SQLite3 3.50.0
PHP 8.4.7

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugVerified issues on the current code behavior or pull requests that will fix them

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions