View | Details | Raw Unified | Return to bug 14030
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_14030-Add_Georgian_fix_Kannada_code.sql (+22 lines)
Lines 7-14 UPDATE language_descriptions SET subtag = 'kn', lang = 'kn' WHERE subtag = 'ka' Link Here
7
UPDATE language_descriptions SET subtag = 'kn' WHERE subtag = 'ka' AND description = 'Kannada';
7
UPDATE language_descriptions SET subtag = 'kn' WHERE subtag = 'ka' AND description = 'Kannada';
8
8
9
INSERT IGNORE INTO language_subtag_registry( subtag, type, description, added) VALUES ( 'ka', 'language', 'Georgian','2015-04-20');
9
INSERT IGNORE INTO language_subtag_registry( subtag, type, description, added) VALUES ( 'ka', 'language', 'Georgian','2015-04-20');
10
DELETE FROM language_subtag_registry
11
       WHERE NOT id IN
12
         (SELECT id FROM
13
           (SELECT MIN(id) as id,subtag,type,description,added
14
            FROM language_subtag_registry
15
            GROUP BY subtag,type,description,added)
16
           AS subtable);
17
10
18
11
INSERT IGNORE INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) VALUES ( 'ka', 'geo');
19
INSERT IGNORE INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) VALUES ( 'ka', 'geo');
20
DELETE FROM language_rfc4646_to_iso639
21
       WHERE NOT id IN
22
         (SELECT id FROM
23
           (SELECT MIN(id) as id,rfc4646_subtag,iso639_2_code
24
            FROM language_rfc4646_to_iso639
25
            GROUP BY rfc4646_subtag,iso639_2_code)
26
           AS subtable);
12
27
13
INSERT IGNORE INTO language_descriptions(subtag, type, lang, description) VALUES ( 'ka', 'language', 'ka', 'ქართული');
28
INSERT IGNORE INTO language_descriptions(subtag, type, lang, description) VALUES ( 'ka', 'language', 'ka', 'ქართული');
14
29
Lines 19-21 INSERT IGNORE INTO language_descriptions(subtag, type, lang, description) VALUES Link Here
19
INSERT IGNORE INTO language_descriptions(subtag, type, lang, description) VALUES ( 'ka', 'language', 'de', 'Georgische');
34
INSERT IGNORE INTO language_descriptions(subtag, type, lang, description) VALUES ( 'ka', 'language', 'de', 'Georgische');
20
35
21
INSERT IGNORE INTO language_descriptions(subtag, type, lang, description) VALUES ( 'ka', 'language', 'es', 'Georgiano');
36
INSERT IGNORE INTO language_descriptions(subtag, type, lang, description) VALUES ( 'ka', 'language', 'es', 'Georgiano');
37
38
DELETE FROM language_descriptions
39
       WHERE NOT id IN
40
         (SELECT id FROM
41
           (SELECT MIN(id) as id,subtag,type,lang,description
42
            FROM language_descriptions GROUP BY subtag,type,lang,description)
43
           AS subtable);
(-)a/t/db_dependent/Languages.t (-2 / +34 lines)
Lines 6-12 Link Here
6
use strict;
6
use strict;
7
use warnings;
7
use warnings;
8
8
9
use Test::More tests => 13;
9
use Test::More tests => 16;
10
use List::Util qw(first);
10
use List::Util qw(first);
11
use Data::Dumper;
11
use Data::Dumper;
12
use Test::Warn;
12
use Test::Warn;
Lines 57-60 my @currentcheck2 = map { $_->{current} } @$translatedlanguages2; Link Here
57
$onlyzeros = first { $_ != 0 } @currentcheck2;
57
$onlyzeros = first { $_ != 0 } @currentcheck2;
58
ok($onlyzeros, "There is a $onlyzeros\n");
58
ok($onlyzeros, "There is a $onlyzeros\n");
59
59
60
# Language Descriptions
61
my $sth = $dbh->prepare("SELECT DISTINCT subtag,type,lang,description from language_descriptions;");
62
$sth->execute();
63
my $DistinctLangDesc = $sth->fetchall_arrayref({});
64
65
$sth = $dbh->prepare("SELECT subtag,type,lang,description from language_descriptions;");
66
$sth->execute();
67
my $LangDesc = $sth->fetchall_arrayref({});
68
69
is(scalar(@$LangDesc),scalar(@$DistinctLangDesc),"No unexpected language_description duplicates.");
70
71
# Language_subtag_registry
72
$sth = $dbh->prepare("SELECT DISTINCT subtag,type,description,added FROM language_subtag_registry;");
73
$sth->execute();
74
my $DistinctLangReg = $sth->fetchall_arrayref({});
75
76
$sth = $dbh->prepare("SELECT subtag,type,description,added FROM language_subtag_registry;");
77
$sth->execute();
78
my $LangReg = $sth->fetchall_arrayref({});
79
80
is(scalar(@$LangReg),scalar(@$DistinctLangReg),"No unexpected language_subtag_registry duplicates.");
81
82
# Language RFC4646 to ISO639
83
$sth = $dbh->prepare("SELECT DISTINCT rfc4646_subtag,iso639_2_code FROM language_rfc4646_to_iso639;");
84
$sth->execute();
85
my $DistinctLangRfc4646 = $sth->fetchall_arrayref({});
86
87
$sth = $dbh->prepare("SELECT rfc4646_subtag,iso639_2_code FROM language_rfc4646_to_iso639;");
88
$sth->execute();
89
my $LangRfc4646 = $sth->fetchall_arrayref({});
90
91
is(scalar(@$LangRfc4646),scalar(@$DistinctLangRfc4646),"No unexpected language_rfc4646_to_iso639 duplicates.");
92
60
$dbh->rollback;
93
$dbh->rollback;
61
- 

Return to bug 14030