Conversion of boolean conditions in SQL statements for better db independence

RESOLVED FIXED in Bugzilla 2.18

Status

()

P3
normal
RESOLVED FIXED
15 years ago
6 years ago

People

(Reporter: dkl, Assigned: dkl)

Tracking

(Blocks: 1 bug)

2.17.7
Bugzilla 2.18
Dependency tree / graph
Bug Flags:
approval +

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

15 years ago
Even though alot have been eliminated, a few instances of having boolean
conditions in SQL statements exist. I have created a patch to convert these to
equality tests instead for better database independence. For example:

    SendSQL("
         SELECT DISTINCT  groups.id, name, description, isactive
                    FROM  groups, user_group_map
-                  WHERE  user_id = $userid AND NOT isbless
+                  WHERE  user_id = $userid AND isbless = 0
                     AND  user_group_map.group_id = groups.id
-                    AND  isbuggroup
+                    AND  isbuggroup = 1
                ORDER BY  description ");

I am also making this report a blocker on the PostgresSQL support bug.
(Assignee)

Updated

15 years ago
Blocks: 98304
That's so simple and obviously correct, I think we should just ask for review on
it right now and get it checked in. I'll bet bbaetz could do it; he's usually
interested in things that block PgSQL. :-)

Comment 3

15 years ago
Comment on attachment 151391 [details] [diff] [review]
Boolean conversion patch for better db independence

r=joel
Attachment #151391 - Flags: review+

Updated

15 years ago
Priority: -- → P3
Target Milestone: --- → Bugzilla 2.20

Updated

15 years ago
Assignee: justdave → dkl
Flags: approval?

Updated

15 years ago
OS: Linux → All
Hardware: PC → All
Target Milestone: Bugzilla 2.20 → Bugzilla 2.18

Updated

15 years ago
Blocks: 189947
Flags: approval? → approval+

Comment 4

15 years ago
dkl: are you checking this in? I could do it for you if you don't have the time,
just let me know. Thanks!
Status: NEW → ASSIGNED
(Assignee)

Comment 5

15 years ago
Sure. Be my guest. Been swamped here this week with updates. Also am not sure if
I can checkin anymore yet since I have yet to send Myk my public key for CVS
access. I need to get on that.

Dave

Comment 6

15 years ago
Checking in buglist.cgi;
/cvsroot/mozilla/webtools/bugzilla/buglist.cgi,v  <--  buglist.cgi
new revision: 1.253; previous revision: 1.252
done
Checking in editgroups.cgi;
/cvsroot/mozilla/webtools/bugzilla/editgroups.cgi,v  <--  editgroups.cgi
new revision: 1.37; previous revision: 1.36
done
Checking in request.cgi;
/cvsroot/mozilla/webtools/bugzilla/request.cgi,v  <--  request.cgi
new revision: 1.13; previous revision: 1.12
done
Checking in Bugzilla/Bug.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Bug.pm,v  <--  Bug.pm
new revision: 1.36; previous revision: 1.35
done
Status: ASSIGNED → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → FIXED

Comment 7

15 years ago
Posted patch Aditional patch (obsolete) — Splinter Review
Oooops, missed one :-).

Comment 8

15 years ago
I can't reopen this one, so someone else please...

Comment 9

15 years ago
Thomas,  -- open another bug.  If re reopened this one, it would be impossible
to tell whicj patch had approval, etc...

Updated

15 years ago
Attachment #152673 - Attachment is obsolete: true

Comment 10

15 years ago
Comment on attachment 152673 [details] [diff] [review]
Aditional patch

Moved to bug 250832
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.