Closed Bug 300709 Opened 19 years ago Closed 19 years ago

Avoid the use of SELECT *

Categories

(Bugzilla :: Bugzilla-General, defect)

2.16.10
defect
Not set
trivial

Tracking

()

RESOLVED FIXED
Bugzilla 2.16

People

(Reporter: LpSolit, Assigned: LpSolit)

Details

Attachments

(3 files)

We have no idea what is returned by " SELECT * " without looking at the DB
itself, especially the order of the columns. When new columns are added by
checksetup.pl due to an upgrade, the order of these columns may be different
from the order obtained for a new installation which uses Bugzilla/DB/Schema.pm.
Attached patch patch, v1 β€” β€” Splinter Review
Attachment #189252 - Flags: review?(bugzilla)
Status: NEW → ASSIGNED
Target Milestone: --- → Bugzilla 2.20
Should we also have a runtests test for 'SELECT *' as well?
Comment on attachment 189252 [details] [diff] [review]
patch, v1

r=glob

i agree with GavinS, bonus points for a test.
Attachment #189252 - Flags: review?(bugzilla) → review+
(In reply to comment #2)
> Should we also have a runtests test for 'SELECT *' as well?

No need. It's the job of the reviewer to forbid such things IMO.
Flags: approval?
Flags: approval2.20?
(In reply to comment #4)
> No need. It's the job of the reviewer to forbid such things IMO.

  Yeah, just like unfiltered directives and tabs in code files! And some common
mispellings, too. In fact, who needs runtests at all, when you have reviewers? :-D

/me only did this because he knows LpSolit has a good sense of humor. :-)
Bonus points for backporting the collectstats chunk of this to 2.18 and 2.16.
(and freaking test it! :)

I don't know how this ever snuck in, but that's darn unreliable, and in code
that's collecting statistics even.  Nothing like inverted stats, eh?
Flags: blocking2.20+
Flags: blocking2.18.4+
Flags: blocking2.16.11+
The 2.16 version should use SendSQL of course...
Target Milestone: Bugzilla 2.20 → Bugzilla 2.16
Version: 2.21 → 2.16.10
Attached patch 2.18 backport, v1 β€” β€” Splinter Review
collectstats.pl is the single file to contain a "SELECT *" in 2.18.3.
Attachment #189604 - Flags: review?(bugzilla)
Attached patch 2.16 backport, v1 β€” β€” Splinter Review
Tested on 2.16.10. Works!
Attachment #189606 - Flags: review?(bugzilla)
Flags: approval? → approval+
Flags: approval2.20?
Flags: approval+
Comment on attachment 189604 [details] [diff] [review]
2.18 backport, v1

r=glob by inspection
Attachment #189604 - Flags: review?(bugzilla) → review+
Comment on attachment 189606 [details] [diff] [review]
2.16 backport, v1

r=glob by inspection
Attachment #189606 - Flags: review?(bugzilla) → review+
Flags: approval?
Flags: approval2.20?
Flags: approval2.18?
Flags: approval2.16?
Have you tested this in 2.18 and 2.20 as well?
Flags: approval?
Flags: approval2.20?
Flags: approval2.20+
Flags: approval2.18?
Flags: approval2.18+
Flags: approval2.16?
Flags: approval2.16+
Flags: approval+
tip:

Checking in collectstats.pl;
/cvsroot/mozilla/webtools/bugzilla/collectstats.pl,v  <--  collectstats.pl
new revision: 1.44; previous revision: 1.43
done
Checking in Bugzilla/User.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/User.pm,v  <--  User.pm
new revision: 1.64; previous revision: 1.63
done


2.20rc1:

Checking in collectstats.pl;
/cvsroot/mozilla/webtools/bugzilla/collectstats.pl,v  <--  collectstats.pl
new revision: 1.43.4.1; previous revision: 1.43
done
Checking in Bugzilla/User.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/User.pm,v  <--  User.pm
new revision: 1.61.2.3; previous revision: 1.61.2.2
done


2.18.3:

Checking in collectstats.pl;
/cvsroot/mozilla/webtools/bugzilla/collectstats.pl,v  <--  collectstats.pl
new revision: 1.38.2.3; previous revision: 1.38.2.2
done


2.16.10:

Checking in collectstats.pl;
/cvsroot/mozilla/webtools/bugzilla/collectstats.pl,v  <--  collectstats.pl
new revision: 1.20.12.3; previous revision: 1.20.12.2
done
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: