Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-stable
Commits
49e3f711
Commit
49e3f711
authored
Dec 09, 2008
by
Leigh B. Stoller
Browse files
Add a sanity check to make sure that the uuid is really unique
locally.
parent
95f63aaa
Changes
1
Hide whitespace changes
Inline
Side-by-side
db/Experiment.pm.in
View file @
49e3f711
...
@@ -579,6 +579,23 @@ sub Create($$$$)
...
@@ -579,6 +579,23 @@ sub Create($$$$)
}
}
}
}
#
#
Lets
be
real
sure
that
the
UUID
is
really
unique
.
#
$
query_result
=
DBQueryWarn
(
"select pid,eid,idx from experiment_stats "
.
"where eid_uuid='$uuid'"
);
if
(
! $query_result) {
DBQueryWarn
(
"unlock tables"
);
return
undef
;
}
if
($
query_result
->
numrows
)
{
DBQueryWarn
(
"unlock tables"
);
tberror
(
"Experiment uuid $uuid already exists; "
.
"this is bad!"
);
return
undef
;
}
#
#
#
Insert
the
record
.
This
reserves
the
pid
/
eid
for
us
.
#
Insert
the
record
.
This
reserves
the
pid
/
eid
for
us
.
#
#
...
...
Write
Preview
Supports
Markdown
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