From d0d088b354edd3a791210cfae5c7279ff6cd9340 Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Thu, 1 Jun 2023 11:05:25 +0900 Subject: [PATCH] DB\IO bug fixes --- src/DB/IO.php | 4 ++-- test/phpunit/Logging/CoreLibsLoggingLoggingTest.php | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/DB/IO.php b/src/DB/IO.php index a383710..39dd0d0 100644 --- a/src/DB/IO.php +++ b/src/DB/IO.php @@ -382,7 +382,7 @@ class IO /** @var array */ private array $pk_name_table = []; /** @var string internal primary key name, for cross calls in async */ - private string $pk_name; + private string $pk_name = ''; /** @var bool if we use RETURNING in the INSERT call */ private bool $returning_id = false; /** @var string if a sync is running holds the hash key of the query */ @@ -1267,7 +1267,7 @@ class IO // ONLY insert with set pk name ($this->__checkQueryForInsert($this->query, true) && $this->pk_name != 'NULL') || // insert or update with returning add - ($this->__checkQueryForInsert($this->query) && $this->returning_id) + ($this->__checkQueryForInsert($this->query) && $this->returning_id) ) { $this->__dbSetInsertId( $this->returning_id, diff --git a/test/phpunit/Logging/CoreLibsLoggingLoggingTest.php b/test/phpunit/Logging/CoreLibsLoggingLoggingTest.php index af88535..1f637e1 100644 --- a/test/phpunit/Logging/CoreLibsLoggingLoggingTest.php +++ b/test/phpunit/Logging/CoreLibsLoggingLoggingTest.php @@ -24,6 +24,11 @@ final class CoreLibsLoggingLoggingTest extends TestCase . "\[\w+\]\s{1}" // run id . "{[\w\\\\]+(::\w+)?}\s{1}"; // class + public static function tearDownAfterClass(): void + { + array_map('unlink', glob(self::LOG_FOLDER . '*.log')); + } + /** * test set for options BASIC *