Permalink
Browse files

Increased the TEXT index size on MySQL from 32 to 256 characters. Thi…

…s is to stop duplicate errors when using long strings like URLs as unique indexes. Closes #26.
  • Loading branch information...
1 parent 4908d7d commit be205429c450fe1cf957248b2b156af8873978eb @chancemedia chancemedia committed May 28, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 backend/mysql.pl
View
@@ -205,6 +205,7 @@ sub backend_mysql_update_index {
open(SQL, "replication/CreateIndexes.sql");
chomp(my @lines = <SQL>);
+ my $index_size = 256;
foreach my $line (@lines) {
$line = mbz_trim($line);
my $pos_index = index($line, 'INDEX ');
@@ -236,7 +237,7 @@ sub backend_mysql_update_index {
my @columns = split(",", $cols);
for(my $i = 0; $i < @columns; ++$i) {
if(backend_mysql_get_column_type($table_name, mbz_trim($columns[$i])) eq 'text') {
- $columns[$i] = "`" . mbz_trim(mbz_remove_quotes($columns[$i])) . "`(32)";
+ $columns[$i] = "`" . mbz_trim(mbz_remove_quotes($columns[$i])) . "`($index_size)";
} else {
$columns[$i] = "`" . mbz_trim(mbz_remove_quotes($columns[$i])) . "`";
}

0 comments on commit be20542

Please sign in to comment.