Closed (fixed)
Project:
Taxonomy Access Control
Version:
4.7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Nov 2006 at 15:45 UTC
Updated:
20 Jul 2008 at 11:09 UTC
Jump to comment: Most recent file
Comments
Comment #1
msackman commentedBother, I meant line 699, not 705. Sorry.
Comment #2
keve commentedThanks for your comment.
I thought this has been solved already.
I just found duplicate: http://drupal.org/node/72965.
The problem with your suggested code is that: hook_db_rewrite_sql will allow ALL terms listed, instead of NONE.
Instead of 'WHERE t.tid IN('')', your suggestion nulls the whole WHERE clause.
Can you test this patch with pgsql?
(I put tid=-1 since tid can be only positive number).
Do you have a better suggestion?
Comment #3
msackman commentedMmm. The -1 for tid is dangerous because if you're just following the logs you have no way to tell whether you're hitting this magic case and tid is intentionally -1 or whether something is really broken.
I would suggest false:
This works in postgres but not in mysql. Mysql in fact doesn't understand expressions at all, so can't do 'where 0 = 1', or 'where 1 not in (1)' or anything particularly sane... I guess the -1 solution at least works. Clearly it's a bad idea to start detecting which sql db is being used so should just stick to the SQL standard but then that would mean mysql couldn't be used at all. WIN! ;)
Comment #4
msackman commentedAhh yes, having done some testing, I do at least understand why the 'where false' is correct and the nulling of the first where clause is wrong. Your patch does work in postgres so I suggest you push that out. I personally don't like it greatly because I think it's unsafe but until MySQL gets a clue it's probably the best solution.
Comment #5
msackman commentedAgh! Apologies for the spam and for my rubbishing of MySQL: it can handle proper expressions *so long as there's a "from" clause* ! I was testing with things like:
which doesn't work, but if you put a "from" clause in then it's ok:
So I would definately therefore suggest:
Comment #6
keve commentedThanks for your suggestion.
'WHERE (FALSE)' seems the clearest solution.
I commited for both cvs and 4.7.
Comment #7
keve commentedI re-open this.
This solution caused an sql error in mysql4.
Can you check you the fix commited in: http://drupal.org/node/97115 ?
Comment #8
keve commentedTAC for Drupal 4.6 or 4.7 is no longer supported.
Try using latest 5.x-2.x-dev or 6.x-dev version , the module has been totally rewritten.