Welcome Guest, Not a member yet? Register   Sign In
Bug in join db method?
#1

[eluser]yoast[/eluser]
Hi, I am using wanwizards excellent datamapper orm, but in my situation it generates a wrong query. I traced it back (after some help) to the join method of codeigniter. When you do something like this:

Code:
$db->join('group group', 'group.id = user.group_id', 'LEFT OUTER');

then CI generates the following SQL:

LEFT OUTER JOIN `group` group ON `group`.`id` = `user`.`group_id`

The table group is given the alias "group" without the quotes. It escapes the first "group", but the second one (the alias) is not. Obviously that should be escaped too.

An additional question: How can I submit a bug? I do not seem te have access to the bugtracker...
#2

[eluser]yoast[/eluser]
bump
#3

[eluser]WanWizard[/eluser]
I don't have the time to read every post.

If you don't post in the Datamapper topic, or the subject doesn't have Datamapper in it, it is likely I will skip it.

It is the task of the join() method to escape it, which it looks like it doesn't do properly if you specify an alias yourself. Since DM just calls CI's join() method, it's a bug in CI (might be already fixed in their development branch), so you have to report it there.

#4

[eluser]yoast[/eluser]
Hi Wanwizard,

Yes, that's why I am posting here. It is not a datamapper related problem, otherwise I would post elsewhere. :-)

I have searched where I could post a bugreport, but could not find the proper procedure. At bitbucket I do not have sufficient rights.
#5

[eluser]WanWizard[/eluser]
CI moved to github: https://github.com/ellislab/codeigniter/issues




Theme © iAndrew 2016 - Forum software by © MyBB