From 7c5bee8c6533675e8bca3042d46f0a6b9c68b7ba Mon Sep 17 00:00:00 2001 From: Andrew Lukoshko Date: Wed, 22 Jul 2026 14:27:47 +0200 Subject: [PATCH] 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. --- ...1-EL9-sqlite-upsert-and-perl532-signatures.patch | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/SOURCES/0001-EL9-sqlite-upsert-and-perl532-signatures.patch b/SOURCES/0001-EL9-sqlite-upsert-and-perl532-signatures.patch index 5478952..d42c6c8 100644 --- a/SOURCES/0001-EL9-sqlite-upsert-and-perl532-signatures.patch +++ b/SOURCES/0001-EL9-sqlite-upsert-and-perl532-signatures.patch @@ -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 = ?