Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-stable
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
emulab
emulab-stable
Commits
003c1dc4
Commit
003c1dc4
authored
Nov 04, 2014
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow lookup of deleted images/osinfos when looking up by numeric id and
version number.
parent
04c35b0b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
10 deletions
+13
-10
db/Image.pm.in
db/Image.pm.in
+8
-6
db/OSinfo.pm.in
db/OSinfo.pm.in
+5
-4
No files found.
db/Image.pm.in
View file @
003c1dc4
...
...
@@ -122,7 +122,7 @@ sub Lookup($$;$$)
"left join image_versions as v on "
.
" v.imageid=i.imageid "
.
"where i.pid='$1' and i.imagename='$2' and "
.
" v.version='$3'
and v.deleted is null
"
);
" v.version='$3'"
);
return
undef
if
(
!$result || !$result->numrows);
...
...
@@ -161,13 +161,15 @@ sub Lookup($$;$$)
}
elsif
(
!defined($arg3)) {
if
($
arg1
=~
/^\
d
+$/
&&
$
arg2
=~
/^\
d
+$/)
{
#
#
This
will
get
deleted
images
,
but
that
is
okay
.
#
my
$
result
=
DBQueryWarn
(
"select i.*,v.*,i.uuid as image_uuid "
.
" from image
s as i
"
.
"left join image
_versions as v
on "
.
" from image
_versions as v
"
.
"left join image
s as i
on "
.
" v.imageid=i.imageid "
.
"where i.imageid='$arg1' and v.version='$arg2' "
.
" and v.deleted is null"
);
"where v.imageid='$arg1' and v.version='$arg2'"
);
return
undef
if
(
! $result || !$result->numrows);
...
...
@@ -209,7 +211,7 @@ sub Lookup($$;$$)
"left join image_versions as v on "
.
" v.imageid=i.imageid "
.
"where i.pid='$arg1' and i.imagename='$arg2' and "
.
" v.version='$arg3'
and v.deleted is null
"
);
" v.version='$arg3'"
);
return
undef
if
(
!$result || !$result->numrows);
...
...
db/OSinfo.pm.in
View file @
003c1dc4
...
...
@@ -184,11 +184,12 @@ sub Lookup($$;$$)
}
elsif
(
!defined($arg3)) {
if
($
arg1
=~
/^\
d
+$/
&&
$
arg2
=~
/^\
d
+$/)
{
#
#
This
will
get
deleted
OSs
,
but
that
is
okay
.
#
my
$
result
=
DBQueryWarn
(
"select v.* from os_info as o "
.
"left join os_info_versions as v on "
.
" v.osid=o.osid "
.
"where o.osid='$arg1' and v.vers='$arg2'"
);
DBQueryWarn
(
"select v.* from os_info_versions as v "
.
"where v.osid='$arg1' and v.vers='$arg2'"
);
return
undef
if
(
! $result || !$result->numrows);
...
...
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