Closed
Bug 358228
Opened 19 years ago
Closed 19 years ago
tr_install.pl: tr_AddGroup() is broken on PostgreSQL
Categories
(Testopia :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: tlast, Assigned: vrb)
References
Details
Attachments
(1 file, 1 obsolete file)
|
2.80 KB,
patch
|
gregaryh
:
review+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060413 Red Hat/1.0.8-1.4.1 Firefox/1.0.8
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060413 Red Hat/1.0.8-1.4.1 Firefox/1.0.8
in sub tr_AddGroup,
my $sth = $dbh->prepare('INSERT INTO groups
- (name, description, userregexp, isbuggroup)
- VALUES (?, ?, ?, ?)');
- $sth->execute($name, $desc, '', 0);
+ $sth = $dbh->prepare('INSERT INTO groups
+ (name, description, userregexp, isbuggroup, last_changed)
+ VALUES (?, ?, ?, ?, NOW())');
+ $sth->execute($name, $desc, "''", 0);
Reproducible: Always
Install will fail at "Adding group name" due to:
last_changed field being null
userregexp being ''
and postgres has no "last_insert_id()"
Summary: Install will fail at "Adding group name" due to last_changed field being null → tr_AddGroup is broken on PostgreSQL
Updated•19 years ago
|
Assignee: ghendricks → vrb
| Assignee | ||
Updated•19 years ago
|
Summary: tr_AddGroup is broken on PostgreSQL → tr_install.pl: tr_AddGroup() is broken on PostgreSQL
| Assignee | ||
Updated•19 years ago
|
Status: NEW → ASSIGNED
| Assignee | ||
Comment 2•19 years ago
|
||
Picked up fixes from checksetup.pl:AddGroup()
Simplified GroupDoesExist() down to one line.
BTW, this statement will not work with mysql:
$sth->execute($name, $desc, "''", 0);
Instead, we use this:
$sth->execute($name, $desc, "", 0);
Attachment #243836 -
Flags: review?(ghendricks)
Comment 3•19 years ago
|
||
Comment on attachment 243836 [details] [diff] [review]
patch version 1
>- return $id;
>+ return $dbh->selectrow_array("SELECT COUNT(*) FROM groups WHERE name='$name'");
> }
Is there a reason why you are not using placeholders here?
| Assignee | ||
Comment 4•19 years ago
|
||
I guess I was looking at a bad example. :-) Bugzilla still contains several SELECT COUNT statements that look like this.
I'll fix it.
| Assignee | ||
Comment 5•19 years ago
|
||
Use placeholder in GroupDoesExist()
Attachment #243836 -
Attachment is obsolete: true
Attachment #243839 -
Flags: review?(ghendricks)
Attachment #243836 -
Flags: review?(ghendricks)
Updated•19 years ago
|
Attachment #243839 -
Flags: review?(ghendricks) → review+
| Assignee | ||
Comment 6•19 years ago
|
||
r2335 | vrb | 2006-10-27 14:57:24 -0600 (Fri, 27 Oct 2006) | 4 lines
Changed paths:
M /trunk/tr_install.pl
Use placeholder in GroupDoesExist()
Comment 7•19 years ago
|
||
Checking in tr_install.pl;
/cvsroot/mozilla/webtools/testopia/tr_install.pl,v <-- tr_install.pl
new revision: 1.9; previous revision: 1.8
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.
Description
•