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

(-)a/installer/data/mysql/updatedatabase.pl (-6 / +17 lines)
Lines 23670-23680 sub CheckVersion { Link Here
23670
23670
23671
sub sanitize_zero_date {
23671
sub sanitize_zero_date {
23672
    my ( $table_name, $column_name ) = @_;
23672
    my ( $table_name, $column_name ) = @_;
23673
    $dbh->do(qq|
23673
23674
        UPDATE $table_name
23674
    my (undef, $datatype) = $dbh->selectrow_array(qq|
23675
        SET $column_name = NULL
23675
        SHOW COLUMNS FROM $table_name WHERE Field = ?|, undef, $column_name);
23676
        WHERE CAST($column_name AS CHAR(10)) = '0000-00-00';
23676
23677
    |);
23677
    if ( $datatype eq 'date' ) {
23678
        $dbh->do(qq|
23679
            UPDATE $table_name
23680
            SET $column_name = NULL
23681
            WHERE CAST($column_name AS CHAR(10)) = '0000-00-00';
23682
        |);
23683
    } else {
23684
        $dbh->do(qq|
23685
            UPDATE $table_name
23686
            SET $column_name = NULL
23687
            WHERE CAST($column_name AS CHAR(19)) = '0000-00-00 00:00:00';
23688
        |);
23689
    }
23678
}
23690
}
23679
23691
23680
exit;
23692
exit;
23681
- 

Return to bug 27821