[Bb-trac] Re: [bbPress] #689: More flexible joining of topic meta
tables in BB_Query class
bbPress
bb-trac at lists.bbpress.org
Tue Jul 17 09:19:10 GMT 2007
#689: More flexible joining of topic meta tables in BB_Query class
-------------------------+--------------------------------------------------
Reporter: sambauers | Owner: mdawaffe
Type: enhancement | Status: new
Priority: high | Milestone: 0.8.3 & XML-RPC
Component: Back-end | Version: 1.0-alpha (trunk)
Severity: major | Resolution:
Keywords: has-patch |
-------------------------+--------------------------------------------------
Comment (by sambauers):
Replying to [comment:3 mdawaffe]:
> I'd rather not have a join_type option. This problem only exists in
topicmeta (at the moment anyway), so it seems a bit over the top to have
more options. Why don't we just detect which join we want by
{{{strpos}}}ing for 'NULL'?
I've changed the patch to do this detection.
> Also, what do you think about doing the null stuff outside of
{{{parse_value()}}}? That method gets called a lot (so the less it does
the better), and (at the moment anyway) we only care about null stuff on
topicmeta joins.
We could do that, but the addition to {{{parse_value()}}} is only four
extra if/else statements and the conditions being checked are just
string/boolean comparisons (no extra function calls at all). It looks like
more code, but performance wise the additional overhead is negligible I
think. Plus, the ability to specify NULL or -NULL is added to all
{{{parse_value()}}} calls.
I gave it a go and it started to get very inelegant very quickly, for what
in my opinion is very little gain. But if you feel strongly about it I'll
give it more of a hack.
The new patch also fixes the AND/OR error you mentioned earlier. As well
as fixing an unrelated bug which kept the "-" minus sign in front of the
meta_key a couple of lines up from where I was working. You'll see it as
the first change in the patch.
--
Ticket URL: <http://trac.bbpress.org/ticket/689#comment:4>
bbPress <http://bbpress.org/>
Innovative forum development
More information about the Bb-trac
mailing list