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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Ivlev
bugzilla
Commits
1d45e9b3
Commit
1d45e9b3
authored
Oct 05, 2002
by
matty%chariot.net.au
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #93667: Rewrite single cross checking.
parent
221ecd2b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
15 deletions
+16
-15
sanitycheck.cgi
sanitycheck.cgi
+16
-15
No files found.
sanitycheck.cgi
View file @
1d45e9b3
...
...
@@ -74,33 +74,34 @@ sub AlertBadVoteCache {
sub
CrossCheck
{
my
$table
=
shift
@_
;
my
$field
=
shift
@_
;
Status
(
"Checking references to $table.$field"
);
SendSQL
(
"SELECT DISTINCT $field FROM $table"
);
my
%
valid
;
while
(
MoreSQLData
())
{
$valid
{
FetchOneColumn
()}
=
1
;
}
while
(
@_
)
{
my
$ref
=
shift
@_
;
my
(
$
t2
,
$f2
,
$key2
,
$exceptions
)
=
@$ref
;
my
(
$
refertable
,
$referfield
,
$keyname
,
$exceptions
)
=
@$ref
;
$exceptions
||=
[]
;
my
%
exceptions
=
map
{
$_
=>
1
}
@$exceptions
;
Status
(
"... from $
t2.$f2
"
);
Status
(
"... from $
refertable.$referfield
"
);
SendSQL
(
"SELECT DISTINCT $f2"
.
(
$key2
?
", $key2"
:
''
)
.
" FROM $t2 "
.
"WHERE $f2 IS NOT NULL"
);
SendSQL
(
"SELECT DISTINCT $refertable.$referfield"
.
(
$keyname
?
", $refertable.$keyname"
:
''
)
.
" "
.
"FROM $refertable LEFT JOIN $table "
.
" ON $refertable.$referfield = $table.$field "
.
"WHERE $table.$field IS NULL "
.
" AND $refertable.$referfield IS NOT NULL"
);
while
(
MoreSQLData
())
{
my
(
$value
,
$key
)
=
FetchSQLData
();
if
(
!
$
valid
{
$value
}
&&
!
$
exceptions
{
$value
})
{
my
$alert
=
"Bad value $value found in $
t2.$f2
"
;
if
(
$key
2
)
{
if
(
$key
2
eq
'bug_id'
)
{
$alert
.=
qq{ (<a href="show_bug.cgi?id=$key">bug $key</a>)}
;
if
(
!
$exceptions
{
$value
})
{
my
$alert
=
"Bad value $value found in $
refertable.$referfield
"
;
if
(
$key
name
)
{
if
(
$key
name
eq
'bug_id'
)
{
$alert
.=
' (bug '
.
BugLink
(
$key
)
.
')'
;
}
else
{
$alert
.=
" ($key
2
== '$key')"
;
$alert
.=
" ($key
name
== '$key')"
;
}
}
Alert
(
$alert
);
...
...
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