SQL: Change "... LIKE '...\_...' ..." to "... LIKE '...\\_...' ..."
PATCH 1/1 SQL: Change "... LIKE '...\_...' ..." to "... LIKE '...\\_...' ..."
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 <[email protected]>
--- Osstest/Executive.pm | 2 +- cs-bisection-step | 8 ++++---- mg-force-push | 2 +- mg-report-host-usage-collect | 2 +- sg-report-flight | 4 ++-- sg-report-host-history | 8 ++++---- sg-report-job-history | 2 +- ts-logs-capture | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-)
Osstest/Executive.pm +1 -1
@@ -444,7 +444,7 @@ END $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
cs-bisection-step +4 -4
@@ -185,15 +185,15 @@ sub flight_rmap ($$) { 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 };
@@ -1226,7 +1226,7 @@ sub preparejob ($$$$) { 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};
mg-force-push +1 -1
@@ -54,7 +54,7 @@ END 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
mg-report-host-usage-collect +1 -1
@@ -166,7 +166,7 @@ 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);
sg-report-flight +2 -2
@@ -253,7 +253,7 @@ 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
@@ -639,7 +639,7 @@ 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.
sg-report-host-history +4 -4
@@ -39,7 +39,7 @@ our @blessings; 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/^-/) {
@@ -172,7 +172,7 @@ sub mainquery ($) { 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
@@ -246,7 +246,7 @@ END FROM runvars WHERE flight=? AND job=? AND ( - name LIKE (? || '\_power\_%') + name LIKE (? || '\\_power\\_%') ) END
@@ -449,7 +449,7 @@ foreach my $host (@ARGV) { 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()) {
sg-report-job-history +1 -1
@@ -92,7 +92,7 @@ if (defined($flight)) { 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.)
ts-logs-capture +1 -1
@@ -44,7 +44,7 @@ our (@allguests, @guests); 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);
Signature · 1 line
2.20.1