Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
1463ef15
Commit
1463ef15
authored
Mar 24, 2007
by
mkanat%bugzilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 374016: Use transactions to create bugs
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
parent
fce3b962
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
Bug.pm
Bugzilla/Bug.pm
+8
-5
No files found.
Bugzilla/Bug.pm
View file @
1463ef15
...
...
@@ -264,6 +264,8 @@ sub create {
my
$class
=
shift
;
my
$dbh
=
Bugzilla
->
dbh
;
$dbh
->
bz_start_transaction
();
$class
->
check_required_create_fields
(
@_
);
my
$params
=
$class
->
run_create_validators
(
@_
);
...
...
@@ -291,10 +293,6 @@ sub create {
my
$timestamp
=
$params
->
{
creation_ts
};
delete
$params
->
{
creation_ts
};
$dbh
->
bz_lock_tables
(
'bugs WRITE'
,
'bug_group_map WRITE'
,
'longdescs WRITE'
,
'cc WRITE'
,
'keywords WRITE'
,
'dependencies WRITE'
,
'bugs_activity WRITE'
,
'fielddefs READ'
);
my
$bug
=
$class
->
insert_create_data
(
$params
);
# Add the group restrictions
...
...
@@ -342,6 +340,12 @@ sub create {
$sth_bug_time
->
execute
(
$timestamp
,
$blocked_id
);
}
$dbh
->
bz_commit_transaction
();
# Because MySQL doesn't support transactions on the longdescs table,
# we do this after we've committed the transaction. That way we're
# fairly sure we're inserting a good Bug ID.
# And insert the comment. We always insert a comment on bug creation,
# but sometimes it's blank.
my
@columns
=
qw(bug_id who bug_when thetext)
;
...
...
@@ -357,7 +361,6 @@ sub create {
$dbh
->
do
(
'INSERT INTO longdescs ('
.
join
(
','
,
@columns
)
.
")
VALUES ($qmarks)"
,
undef
,
@values
);
$dbh
->
bz_unlock_tables
();
return
$bug
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment