Changeset 1303

Show
Ignore:
Timestamp:
10/14/09 06:43:10 (6 weeks ago)
Author:
dormando
Message:

Default to 64-bit things in MySQL

We always trip people up a few years down the line when they have more than 4b
file revisions, or try to store a really big file. Lets just flip the defaults
to make it simpler for people down the road...

Location:
trunk/server/lib/MogileFS
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/server/lib/MogileFS/Store.pm

    r1283 r1303  
    482482    UNIQUE dkey  (dmid, dkey), 
    483483 
    484     length        INT UNSIGNED,        # 4GB limit 
     484    length        BIGINT UNSIGNED,   # big limit 
    485485 
    486486    classid       TINYINT UNSIGNED NOT NULL, 
  • trunk/server/lib/MogileFS/Store/MySQL.pm

    r1264 r1303  
    147147    if ($create && $create =~ /\bbigint\b/i) { 
    148148        return $self->{_fid_type} = "BIGINT"; 
    149     } 
    150  
    151     # else, use 32-bit ints for the fid type 
    152     return $self->{_fid_type} = "INT"; 
     149    } else { 
     150        # Old installs might not have raised the fid type size yet. 
     151        return $self->{_fid_type} = "INT"; 
     152    } 
     153 
     154    # Used to default to 32bit ints, but this always bites people 
     155    # a few years down the road. So default to 64bit. 
     156    return $self->{_fid_type} = "BIGINT"; 
    153157} 
    154158