You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: withDriver() without a prefix breaks sqlStatement() #307
ActiveQuery::withDriver($driver) without a prefix leaves the query unusable. The $prefix parameter defaults to null and is stored as is (src/Query/ActiveQuery.php:33), but the compiler later expects a string prefix, so a subsequent sqlStatement() fails.
Is this a regression?
Not checked.
To Reproduce
$query = (new SelectQuery())->from('users')->withDriver($driver);
$query->sqlStatement();
TypeError from the compiler (string expected, null given).
Expected behaviour
No prefix means an empty prefix: store $prefix ?? '', or make the parameter default to ''.
Found while raising coverage in #304. A related crash, where('x', 'between', $a, <subquery or fragment>) throwing TypeError in Compiler::condition(), is mentioned in #300.
Activity