6.0.0-alpha14
7/3/25

[#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 05/24/2008 (6249 days ago)
Due
Updated 05/24/2008 (6249 days ago)
Assigned 05/24/2008 (6249 days ago)
Resolved 05/24/2008 (6249 days ago)
Github Issue Link
Github Pull Request
Milestone Horde 3.2
Patch No

History
05/24/2008 05:44:54 PM Michael Rubinsky Comment #11
State ⇒ Resolved
Reply to this comment
....and merging as we speak.
05/24/2008 05:43:25 PM 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 :)
05/24/2008 05:27:35 PM 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=>


05/24/2008 05:21:49 PM josef (at) netzagentur (dot) at Comment #8 Reply to this comment
I forgot to say: thank You for Your work!
05/24/2008 05:20:18 PM 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.
05/24/2008 02:38:55 PM Michael Rubinsky Taken from Horde DevelopersHorde Developers
Summary ⇒ Issue with bitwise comparisons in native SQL share drivers (with postgres db-backend)
 
05/24/2008 02:36:04 PM 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?


05/24/2008 01:49:31 PM Michael Rubinsky Comment #5
Assigned to Horde DevelopersHorde Developers
Milestone ⇒ Horde 3.2
Summary ⇒ Issue with boolean comparisons in native SQL share drivers (with postgres db-backend)
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.
05/24/2008 01:45:38 PM 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).
05/24/2008 01:43:54 PM Michael Rubinsky Comment #3
State ⇒ Assigned
Priority ⇒ 2. Medium
Assigned to Michael Rubinsky
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.
05/24/2008 08:15:51 AM josef (at) netzagentur (dot) at Comment #2 Reply to this comment
I forgot to mention: my Postgres Version is 8.3
05/24/2008 08:13:56 AM josef (at) netzagentur (dot) at Comment #1
Priority ⇒ 3. High
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Queue ⇒ Ansel
Summary ⇒ Gallery list doesn't work (with postgres db-backend)
Type ⇒ Bug
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