Bugzilla – Attachment 158373 Details for
Bug 34328
Add Scottish Gaelic to the advanced search options
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34328: Make update idempotent
Bug-34328-Make-update-idempotent.patch (text/plain), 3.65 KB, created by
Katrin Fischer
on 2023-11-04 12:02:28 UTC
(
hide
)
Description:
Bug 34328: Make update idempotent
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2023-11-04 12:02:28 UTC
Size:
3.65 KB
patch
obsolete
>From a0336f942653af217e1c4022eff33346944dd228 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 6 Oct 2023 10:41:20 +0100 >Subject: [PATCH] Bug 34328: Make update idempotent > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >Perltidied the atomic update. >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > .../data/mysql/atomicupdate/bug_34328.pl | 68 ++++++++++++------- > 1 file changed, 44 insertions(+), 24 deletions(-) > >diff --git a/installer/data/mysql/atomicupdate/bug_34328.pl b/installer/data/mysql/atomicupdate/bug_34328.pl >index 5fbf7cdee2..82a1ce5ef3 100755 >--- a/installer/data/mysql/atomicupdate/bug_34328.pl >+++ b/installer/data/mysql/atomicupdate/bug_34328.pl >@@ -6,45 +6,65 @@ return { > up => sub { > my ($args) = @_; > my ( $dbh, $out ) = @$args{qw(dbh out)}; >- $dbh->do(q{ >- INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) >+ >+ # Unique key on subtag + code.. use INSERT IGNORE >+ $dbh->do( >+ q{ >+ INSERT IGNORE INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) > VALUES ( 'gd','gla' ) >- }); >+ } >+ ); > >- $dbh->do(q{ >- INSERT INTO language_subtag_registry( subtag, type, description, added) >+ # Unique key on subtag + type.. use INSERT IGNORE >+ $dbh->do( >+ q{ >+ INSERT IGNORE INTO language_subtag_registry( subtag, type, description, added) > VALUES ( 'gd', 'language', 'Scottish Gaelic', NOW() ) >- }); >+ } >+ ); > >- $dbh->do(q{ >- INSERT INTO language_descriptions(subtag, type, lang, description) >+ # Unique key on subtag + type + lang.. use INSERT IGNORE >+ $dbh->do( >+ q{ >+ INSERT IGNORE INTO language_descriptions(subtag, type, lang, description) > VALUES ( 'gd', 'language', 'en', 'Scottish Gaelic') >- }); >+ } >+ ); > >- $dbh->do(q{ >- INSERT INTO language_descriptions(subtag, type, lang, description) >+ $dbh->do( >+ q{ >+ INSERT IGNORE INTO language_descriptions(subtag, type, lang, description) > VALUES ( 'gd', 'language', 'en_GB', 'Scottish Gaelic') >- }); >+ } >+ ); > >- $dbh->do(q{ >- INSERT INTO language_descriptions(subtag, type, lang, description) >+ $dbh->do( >+ q{ >+ INSERT IGNORE INTO language_descriptions(subtag, type, lang, description) > VALUES ( 'gd', 'language', 'gd', 'Gà idhlig') >- }); >+ } >+ ); > >- $dbh->do(q{ >- INSERT INTO language_descriptions(subtag, type, lang, description) >+ $dbh->do( >+ q{ >+ INSERT IGNORE INTO language_descriptions(subtag, type, lang, description) > VALUES ( 'gd', 'language', 'fr', 'Gaélique écossais') >- }); >+ } >+ ); > >- $dbh->do(q{ >- INSERT INTO language_descriptions(subtag, type, lang, description) >+ $dbh->do( >+ q{ >+ INSERT IGNORE INTO language_descriptions(subtag, type, lang, description) > VALUES ( 'gd', 'language', 'de', 'Schottisch-Gälisch') >- }); >+ } >+ ); > >- $dbh->do(q{ >- INSERT INTO language_descriptions(subtag, type, lang, description) >+ $dbh->do( >+ q{ >+ INSERT IGNORE INTO language_descriptions(subtag, type, lang, description) > VALUES ( 'gd', 'language', 'pl', 'JÄzyk szkocki gaelicki') >- }); >+ } >+ ); > > say $out "Added new language 'Scottish Gaelic'"; > }, >-- >2.30.2
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 34328
:
153728
|
153754
|
153755
|
156593
|
156594
|
156595
|
158371
|
158372
| 158373