Make scheduled-product note update PG13-compatible

t/api/02-iso.t failed on stock EL9 PostgreSQL 13 because update_note used
jsonb subscripting (results['note']=?), which needs PG14+. Rewrite it with
jsonb_set(coalesce(results,'{}'), '{note}', ?::jsonb) so it works on PG13+.
openqa %check now passes on the default EL9 PostgreSQL 13 (no PG upgrade
needed). Folded into the existing EL9 patch alongside the SQLite upsert and
Perl 5.32 signatures fixes.
This commit is contained in:
Andrew Lukoshko 2026-07-22 14:27:47 +02:00
parent fcc3b55361
commit 7c5bee8c65

View File

@ -1,4 +1,4 @@
--- a/b/lib/OpenQA/CacheService/Model/Cache.pm 2026-06-04 10:30:53.000000000 +0200
--- a/lib/OpenQA/CacheService/Model/Cache.pm 2026-06-04 10:30:53.000000000 +0200
+++ b/lib/OpenQA/CacheService/Model/Cache.pm 2026-07-21 19:12:03.848668944 +0200
@@ -182,13 +182,13 @@
}
@ -36,3 +36,14 @@
has pid => 1;
has errored => 0;
has is_running => 1;
--- a/lib/OpenQA/Schema/ResultSet/ScheduledProducts.pm 2026-06-04 10:30:53.000000000 +0200
+++ b/lib/OpenQA/Schema/ResultSet/ScheduledProducts.pm 2026-07-22 14:16:01.434881645 +0200
@@ -34,7 +34,7 @@
sub update_note ($self, $distri, $version, $flavor, $arch, $build, $note) {
my $sth = $self->result_source->schema->storage->dbh->prepare(
<<~'END_SQL'
- UPDATE scheduled_products SET results['note'] = ? where id = (
+ UPDATE scheduled_products SET results = jsonb_set(coalesce(results, '{}'::jsonb), '{note}', ?::jsonb) where id = (
SELECT id
FROM scheduled_products
WHERE distri = ? and version = ? and flavor = ? and arch = ? and build = ?