-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Description
When trying to get a field that does not exist in a table, I get an Unknown column 'NULL' in 'field list' error.
As you can see below, it seems that BaseBuilder is not taking into account that NULL is not a field (then backticks are not needed).
My function is:
public function joinExpedientes() {
return $this->select('NULL as fecha_salida')
->join('expedientes', 'movimientos_entradas.id_expediente = expedientes.id_expediente');
}And what BaseBuilder gets is:
SELECT `NULL` as `fecha_salida`
FROM `movimientos_entradas`
JOIN `expedientes` ON `movimientos_entradas`.`id_expediente` = `expedientes`.`id_expediente`Obviously, when you try this select (without the backticks) in MySQL, it works fine.
Maybe there is a way to escape NULL in active record select, but if that's the case, I do not know how.
Metadata
Metadata
Assignees
Labels
No labels