Bug: [QueryBuilder] select() TypeError: trim(): Argument #1 ($string) must be of type string, CodeIgniter\Database\RawSql given #9007
Labels
bug
Verified issues on the current code behavior or pull requests that will fix them
PHP Version
8.1
CodeIgniter4 Version
4.5.3
CodeIgniter4 Installation Method
Composer (as dependency to an existing project)
Which operating systems have you tested for this bug?
Windows, Linux
Which server did you use?
apache
Database
MySQL (ver. 8.3.0)
What happened?
I encountered a TypeError when running a test that involves selecting columns using RawSql in combination with string column names. The error message indicates that the
trim()
function is receiving aCodeIgniter\Database\RawSql
object instead of a string.Steps to Reproduce
Expected Output
Anything else?
If only
RawSql
objects are passed to the select method, it works fine. However, when combiningRawSql
objects with strings, the error occurs.I temporarily resolved the issue by chaining the select method calls separately for RawSql and string columns:
The text was updated successfully, but these errors were encountered: