Bugzilla – Attachment 182101 Details for
Bug 38330
Make bib-level suppression a biblio table field instead of part of a MARC tag
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38330: (QA follow-up) Improve resilience of DB update
Bug-38330-QA-follow-up-Improve-resilience-of-DB-up.patch (text/plain), 2.93 KB, created by
Martin Renvoize (ashimema)
on 2025-05-08 16:39:03 UTC
(
hide
)
Description:
Bug 38330: (QA follow-up) Improve resilience of DB update
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-05-08 16:39:03 UTC
Size:
2.93 KB
patch
obsolete
>From 17222d5fcd5eb29ec1bf326d1fd8f321e137a1a7 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >Date: Thu, 8 May 2025 17:26:55 +0100 >Subject: [PATCH] Bug 38330: (QA follow-up) Improve resilience of DB update > >David considered using boolean, but this would catch 'no' and 0 as >truthy. I instead look for common values here more explicitly. >--- > .../data/mysql/atomicupdate/bug_38330.pl | 24 +++++++++---------- > 1 file changed, 12 insertions(+), 12 deletions(-) > >diff --git a/installer/data/mysql/atomicupdate/bug_38330.pl b/installer/data/mysql/atomicupdate/bug_38330.pl >index 73eaba9d516..62d0a9ad5f0 100755 >--- a/installer/data/mysql/atomicupdate/bug_38330.pl >+++ b/installer/data/mysql/atomicupdate/bug_38330.pl >@@ -18,15 +18,15 @@ return { > > $dbh->do( > q{ >- UPDATE biblio b >- JOIN biblio_metadata m ON b.biblionumber = m.biblionumber >- SET b.opac_suppressed = >- CASE >- WHEN ExtractValue(m.metadata, '//datafield[@tag="942"]/subfield[@code="n"]') REGEXP '^[01]$' THEN >- ExtractValue(m.metadata, '//datafield[@tag="942"]/subfield[@code="n"]') >- ELSE 0 >- END >- WHERE m.metadata LIKE '%<datafield tag="942">%'; >+ UPDATE biblio b >+ JOIN biblio_metadata m ON b.biblionumber = m.biblionumber >+ SET b.opac_suppressed = >+ CASE >+ WHEN LOWER(TRIM(ExtractValue(m.metadata, '//datafield[@tag="942"]/subfield[@code="n"]'))) IN ('1', 'yes', 'true') THEN 1 >+ WHEN LOWER(TRIM(ExtractValue(m.metadata, '//datafield[@tag="942"]/subfield[@code="n"]'))) IN ('0', 'no', 'false', '') THEN 0 >+ ELSE 0 >+ END >+ WHERE m.metadata LIKE '%<datafield tag="942">%'; > } > ); > >@@ -45,10 +45,10 @@ return { > q{ > UPDATE deletedbiblio b > JOIN deletedbiblio_metadata m ON b.biblionumber = m.biblionumber >- SET b.opac_suppressed = >+ SET b.opac_suppressed = > CASE >- WHEN ExtractValue(m.metadata, '//datafield[@tag="942"]/subfield[@code="n"]') REGEXP '^[01]$' THEN >- ExtractValue(m.metadata, '//datafield[@tag="942"]/subfield[@code="n"]') >+ WHEN LOWER(TRIM(ExtractValue(m.metadata, '//datafield[@tag="942"]/subfield[@code="n"]'))) IN ('1', 'yes', 'true') THEN 1 >+ WHEN LOWER(TRIM(ExtractValue(m.metadata, '//datafield[@tag="942"]/subfield[@code="n"]'))) IN ('0', 'no', 'false', '') THEN 0 > ELSE 0 > END > WHERE m.metadata LIKE '%<datafield tag="942">%'; >-- >2.49.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 38330
:
175648
|
175649
|
175650
|
175651
|
175767
|
175768
|
175769
|
175770
|
179335
|
179336
|
179337
|
179338
|
179339
|
179340
|
179341
|
182094
|
182095
|
182096
|
182097
|
182098
|
182099
|
182100
|
182101
|
182102
|
182135
|
182136
|
182137
|
182138
|
182139
|
182140
|
182141
|
182142
|
182143
|
182144
|
182145