Perl's "" quotes, and corresponding <<END constructs, do
\-interpolation, so remove these \ which we carefully added in
e7a408dd01184df0a57ae5d9072d15225c52a99f
SQL: Change LIKE E'...\\_...' to LIKE '...\_...'
This is only not a performance problem due to query mismathes with the
available indices, because the test indices are still present in the
Massachusetts instance.
I have verified that this has the intended chanve everywhere by
1. Double-checking that eacbh of these instances is within <<END
or "" or equivalent.
2. Running git-ls-files | xargs perl -i -pe 's/\\\\_/\\_/g'
and manually examining the diff against this patch's parent.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
$querytext .= <<END;
JOIN runvars r USING (flight)
WHERE name=?
- AND name LIKE 'revision\_%'
+ AND name LIKE 'revision\\_%'
AND val=?
AND ${\ main_revision_job_cond('r.job') }
END
my $qtxt_common_rev_ok = sub {
my ($table) = @_;
[<<END];
- ($table.name LIKE 'built\_revision\_%' OR
- $table.name LIKE 'revision\_%')
+ ($table.name LIKE 'built\\_revision\\_%' OR
+ $table.name LIKE 'revision\\_%')
END
};
my $qtxt_common_tree_ok = sub {
my ($table) = @_;
[<<END];
- $table.name LIKE 'tree\_%'
+ $table.name LIKE 'tree\\_%'
END
};
INTO TEMP bisection_runvars
FROM runvars
WHERE flight=? AND job=? AND synth='f'
- AND name NOT LIKE 'revision\_%'
+ AND name NOT LIKE 'revision\\_%'
AND name NOT LIKE '%host'
END
my (@trevisions) = split / /, $choose->{Rtuple};
FROM rv url
JOIN rv built
ON url.job = built.job
- AND url.name LIKE 'tree\_%'
+ AND url.name LIKE 'tree\\_%'
AND built.name = 'built_revision_' || substring(url.name, 6)
WHERE url.val = ?
END
SELECT val, synth
FROM runvars
WHERE flight=? AND job=?
- AND (name LIKE '%\_host' OR name='host')
+ AND (name LIKE '%\\_host' OR name='host')
END
my $finishq = db_prepare(<<END);
JOIN runvars r$ri USING (flight)
END
$runvars_conds .= <<END;
- AND r$ri.name LIKE 'built\_revision\_%'
+ AND r$ri.name LIKE 'built\\_revision\\_%'
AND r$ri.name = ?
AND r$ri.val= ?
END
my $revh= db_prepare(<<END);
SELECT * FROM runvars
WHERE flight=$flight AND job='$j->{job}'
- AND name LIKE 'built\_revision\_%'
+ AND name LIKE 'built\\_revision\\_%'
ORDER BY name
END
# We report in jobtext revisions in non-main-revision jobs, too.
open DEBUG, ">/dev/null";
-my $namecond= "(name = 'host' OR name LIKE '%\_host')";
+my $namecond= "(name = 'host' OR name LIKE '%\\_host')";
csreadconfig();
while (@ARGV && $ARGV[0] =~ m/^-/) {
SELECT flight, job, name, status
FROM runvars
JOIN jobs USING (flight, job)
- WHERE (name = 'host' OR name LIKE '%\_host')
+ WHERE (name = 'host' OR name LIKE '%\\_host')
AND val = ?
AND $flightcond
AND $restrictflight_cond
FROM runvars
WHERE flight=? AND job=?
AND (
- name LIKE (? || '\_power\_%')
+ name LIKE (? || '\\_power\\_%')
)
END
SELECT DISTINCT val
FROM runvars
WHERE flight=?
- AND (name = 'host' OR name LIKE '%\_host')
+ AND (name = 'host' OR name LIKE '%\\_host')
END
$hostsinflightq->execute($flight);
while (my $row = $hostsinflightq->fetchrow_hashref()) {
our $revisionsq= db_prepare(<<END);
SELECT * FROM runvars
WHERE flight=? AND job=?
- AND name LIKE 'built\_revision\_%'
+ AND name LIKE 'built\\_revision\\_%'
END
# (We report on non-main-revision jobs just as for main-revision ones.)
sub find_guests () {
my $sth= $dbh_tests->prepare(<<END);
SELECT name FROM runvars WHERE flight=? AND job=?
- AND name LIKE '%\_domname'
+ AND name LIKE '%\\_domname'
ORDER BY name
END
$sth->execute($flight, $job);