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-devel
Commits
b5341514
Commit
b5341514
authored
Dec 17, 2003
by
Robert Ricci
Browse files
Fix TBExptSetThumbNail() so that it fails more gracefully if the
experiment no longer exists.
parent
3b61d244
Changes
1
Hide whitespace changes
Inline
Side-by-side
db/libdb.pm.in
View file @
b5341514
...
@@ -2792,7 +2792,8 @@ sub TBExptSetSwapUID($$$)
...
@@ -2792,7 +2792,8 @@ sub TBExptSetSwapUID($$$)
#
#
# Set the thumbnail for an experiment. Comes in as a binary string, which
# Set the thumbnail for an experiment. Comes in as a binary string, which
# must be quoted before DB insertion.
# must be quoted before DB insertion. Returns 1 if the thumbnail was
# succesfully updated, 0 if it was not.
#
#
sub TBExptSetThumbNail($$$)
sub TBExptSetThumbNail($$$)
{
{
...
@@ -2805,12 +2806,18 @@ sub TBExptSetThumbNail($$$)
...
@@ -2805,12 +2806,18 @@ sub TBExptSetThumbNail($$$)
DBQueryFatal("select rsrcidx from experiments as e ".
DBQueryFatal("select rsrcidx from experiments as e ".
"left join experiment_stats as s on e.idx=s.exptidx ".
"left join experiment_stats as s on e.idx=s.exptidx ".
"where e.pid='$pid' and e.eid='$eid'");
"where e.pid='$pid' and e.eid='$eid'");
if ($query_result->num_rows() != 1) {
return 0;
}
my ($rsrcidx) = $query_result->fetchrow_array();
my ($rsrcidx) = $query_result->fetchrow_array();
# Now do the insert.
# Now do the insert.
return
DBQueryFatal("update experiment_resources set thumbnail=$bindata ".
DBQueryFatal("update experiment_resources set thumbnail=$bindata ".
"where idx=$rsrcidx");
"where idx=$rsrcidx");
#
# Since the above is a QueryFatal, if it failed, we won't even get here
#
return 1;
}
}
#
#
...
...
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