-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]: Column 'o_obj_id' doesn't make part of the column map #14488
Labels
Comments
I have verified this with a test. |
Side effect from fixing #13552 . |
niden
added a commit
that referenced
this issue
Dec 1, 2019
niden
added a commit
that referenced
this issue
Dec 1, 2019
Resolved in #14566 Thank you @Deathamns |
These column aliasing bugs are haunting me... Phalcon v4.0.3. <?php
class Cities extends \Phalcon\Mvc\Model
{
public $city_id;
public $municipality;
public $city_name;
}
$di = new \Phalcon\Di\FactoryDefault;
$di['db'] = new \Phalcon\Db\Adapter\Pdo\Mysql([
'dbname' => 'test',
'username' => 'test',
'password' => 'test',
]);
(new \Phalcon\Mvc\Model\Query\Builder([
'models' => ['c' => Cities::class],
'columns' => ['c.city_id', 'c.city_name', 'd.city_name'],
'order' => 'IFNULL(d.city_name, c.city_name), c.city_name',
'joins' => [[Cities::class, 'c.municipality = d.city_id', 'd', 'LEFT']]
]))->getQuery()->execute()->getFirst(); CREATE DATABASE IF NOT EXISTS `test`;
USE `test`;
CREATE TABLE `cities` (
`city_id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`municipality` INT(10) UNSIGNED NULL,
`city_name` VARCHAR(50) NOT NULL COLLATE 'utf8mb4_unicode_ci',
PRIMARY KEY (`city_id`) USING BTREE
) COLLATE='utf8mb4_bin' ENGINE=InnoDB; Giving an alias to |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
The mentioned error from the title occurs when selecting a column that also has the table/model name before it (an alias or just the full model name).
This is a problem since Phalcon v4.0.0-alpha1, v3.4.4 works fine.
The value of
phalcon.orm.column_renaming
global doesn't seem to have any effect.Maybe related: issue / change.
To Reproduce
Expected behavior
To be able to run the query without errors (and access the columns by their own names preferably).
Details
The text was updated successfully, but these errors were encountered: