Hello,

I am currently working with OG, doing some custom modules that does heavy query rewriting using the hook_db_rewrite_sql(). For some weird use case, I add some JOIN statements in OG queries joining to itself SELECT ... FROM {og} og JOIN {og} ogb ... WHERE ... This works greats except with two of your queries in og.module which do not prefix the moderate field name in their WHERE clauses, which cause the queries to fail because of ambigous WHERE clause.

See patch attached.

CommentFileSizeAuthor
og.module-6.x-2.1-ambigous_where.patch1.11 KBpounard

Comments

pounard’s picture

Title: Non aliased WHERE clause, breaks when using with hook_db_rewrite_sql() » Non aliased WHERE clause, breaks hook_db_rewrite_sql() usage

Better title.

amitaibu’s picture

Version: 6.x-2.1 » 6.x-2.x-dev
Status: Needs review » Fixed

Committed, thanks.

pounard’s picture

Thanks to you!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.