6.0.0-git
2021-01-18

[#6751] Issue with bitwise comparisons in native SQL share drivers (with postgres db-backend)
Summary Issue with bitwise comparisons in native SQL share drivers (with postgres db-backend)
Queue Horde Framework Packages
Queue Version HEAD
Type Bug
State Resolved
Priority 2. Medium
Owners mrubinsk (at) horde (dot) org
Requester josef (at) netzagentur (dot) at
Created 2008-05-24 (4622 days ago)
Due
Updated 2008-05-24 (4622 days ago)
Assigned 2008-05-24 (4622 days ago)
Resolved 2008-05-24 (4622 days ago)
Milestone Horde 3.2
Patch No

History
2008-05-24 17:44:54 Michael Rubinsky Comment #11
State ⇒ Resolved
Reply to this comment
....and merging as we speak.
2008-05-24 17:43:25 Michael Rubinsky Comment #10 Reply to this comment
Fixed in CVS.
I forgot to say: thank You for Your work!
Your welcome, and thank _you_ for the feedback and testing :)
2008-05-24 17:27:35 josef (at) netzagentur (dot) at Comment #9 Reply to this comment
For documentation:

the error was:



horde=> SELECT s.*  FROM ansel_shares s  LEFT JOIN ansel_shares_users 
AS u ON u.share_id = s.share_id LEFT JOIN ansel_shares_groups AS g ON 
g.share_id = s.share_id WHERE s.share_owner = 'josef@netzagentur' OR 
s.perm_creator & 8 OR s.perm_default & 8 OR ( u.user_uid = 
'josef@netzagentur' AND u.perm & 8) OR ( g.group_uid IN 
("cn=www-data@netzagentur.at,dc=netzagentur","cn=edvteam@netzagentur,dc=netzagentur") AND g.perm & 8) ORDER BY s.share_name 
DESC;



FEHLER:  Argument von OR muss Typ boolean haben, nicht Typ integer

horde=>


2008-05-24 17:21:49 josef (at) netzagentur (dot) at Comment #8 Reply to this comment
I forgot to say: thank You for Your work!
2008-05-24 17:20:18 josef (at) netzagentur (dot) at Comment #7 Reply to this comment
Instead of casting it, can you see if the following will work on your DB:

$where .= 'OR (s.perm_creator & ' . $perm . ') <> 0';

for all the boolean comparisons?
YES - it work's this way. So I suppose, You will apply this to CVS, 
since this seems to be ANSI-SQL.
2008-05-24 14:38:55 Michael Rubinsky Taken from Horde DevelopersHorde Developers
Summary ⇒ Issue with bitwise comparisons in native SQL share drivers (with postgres db-backend)
 
2008-05-24 14:36:04 Michael Rubinsky Comment #6
State ⇒ Feedback
Reply to this comment
Instead of casting it, can you see if the following will work on your DB:



$where .= 'OR (s.perm_creator & ' . $perm . ') <> 0';



for all the boolean comparisons?


2008-05-24 13:49:31 Michael Rubinsky Comment #5
Assigned to Horde DevelopersHorde Developers
Summary ⇒ Issue with boolean comparisons in native SQL share drivers (with postgres db-backend)
Milestone ⇒ Horde 3.2
Reply to this comment
...and finally, I'm setting this to a 3.2 milestone, since these 
should really be resolved before 3.2 release.
2008-05-24 13:45:38 Michael Rubinsky Comment #4
Version ⇒ HEAD
Queue ⇒ Horde Framework Packages
Reply to this comment
I'm also assigning this to the Framework queue since it's really not 
an issue specific to Ansel, but to the hierarchical (and possibly the 
native sql driver as well).
2008-05-24 13:43:54 Michael Rubinsky Comment #3
Assigned to Michael Rubinsky
State ⇒ Assigned
Priority ⇒ 2. Medium
Reply to this comment
I'm looking at this, but I am sadly not very familiar with pgsql, so 
if any other devs can chime in here, I'd appreciate it.
2008-05-24 08:15:51 josef (at) netzagentur (dot) at Comment #2 Reply to this comment
I forgot to mention: my Postgres Version is 8.3
2008-05-24 08:13:56 josef (at) netzagentur (dot) at Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 3. High
Summary ⇒ Gallery list doesn't work (with postgres db-backend)
Queue ⇒ Ansel
Milestone ⇒
Patch ⇒ No
Reply to this comment
there is a problem with a select statement in

/usr/share/php/Horde/sql_hierarchical.php (framework)

in the function _getShareCriteria

when I put explicit CAST-Conversion in there,

the problem seems to be solved - for me, but maybe not for any other 
DB-Backend:

$where .= ' OR s.perm_creator & ' . $perm;

$where .= ' OR (s.perm_creator & ' . $perm . ')::boolean';



there are some further boolean comparisons, which I modified - and so 
ANSEL does it's job again.

Saved Queries