diff --git a/4dev/tests/CoreLibsDBIOTest.php b/4dev/tests/CoreLibsDBIOTest.php index 0994c5bf..50cd0c46 100644 --- a/4dev/tests/CoreLibsDBIOTest.php +++ b/4dev/tests/CoreLibsDBIOTest.php @@ -3384,6 +3384,23 @@ final class CoreLibsDBIOTest extends TestCase ); } + // if this is a select query, db dbReturn, dbReturnRow, dbReturnArray too + if (preg_match("/^(select|show|with) /i", $query)) { + $res = $db->dbReturn($query); + $this->assertEquals( + $expected_rows, + $db->dbGetNumRows() + ); + $this->assertEquals( + $expected_cols, + $db->dbGetNumFields() + ); + $this->assertEquals( + $expected_col_names, + $db->dbGetFieldNames() + ); + } + // reset all data $db->dbExec("TRUNCATE table_with_primary_key"); $db->dbExec("TRUNCATE table_without_primary_key"); diff --git a/www/lib/CoreLibs/DB/IO.php b/www/lib/CoreLibs/DB/IO.php index c4254575..974b8ded 100644 --- a/www/lib/CoreLibs/DB/IO.php +++ b/www/lib/CoreLibs/DB/IO.php @@ -2874,7 +2874,7 @@ class IO */ public function dbGetInsertPKName(): string { - return $this->insert_id_pk_name; + return (string)$this->insert_id_pk_name; } /**