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

(-)a/installer/data/mysql/atomicupdate/bug_33300.pl (-1 / +32 lines)
Line 0 Link Here
0
- 
1
use Modern::Perl;
2
3
return {
4
    bug_number => "33300",
5
    description => "Fix missing wrong system preference 'AutomaticWrongTransfer'",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
        my ($wrong_syspref_exists) = $dbh->selectrow_array(q{
10
            SELECT COUNT(*) FROM systempreferences WHERE variable='AutomaticWrongTransfer'
11
        });
12
        if ($wrong_syspref_exists) {
13
            # Correct preference may have been generated via interface
14
            my ($correct_syspref_exists) = $dbh->selectrow_array(q{
15
                SELECT COUNT(*) FROM systempreferences WHERE variable='AutomaticConfirmTransfer'
16
            });
17
            if ( $correct_syspref_exists ) {
18
                $dbh->do(q{
19
                    DELETE FROM systempreferences WHERE variable='AutomaticWrongTransfer'
20
                });
21
                say $out "Wrong system preference 'AutomaticWrongTransfer' deleted";
22
            } else {
23
                $dbh->do(q{
24
                    UPDATE systempreferences SET variable='AutomaticConfirmTransfer' WHERE variable='AutomaticWrongTransfer'
25
                });
26
                say $out "Wrong system preference 'AutomaticWrongTransfer' renamed 'AutomaticConfirmTransfer'";
27
            }
28
        } else {
29
            say $out "Wrong system preference 'AutomaticWrongTransfer' does not exist";
30
        }
31
    },
32
};

Return to bug 33300