summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoruid623 <>2006-06-08 06:50:13 +0200
committeruid623 <>2006-06-08 06:50:13 +0200
commit5235c544da71c27467ad7f7f15a743c7bbe94110 (patch)
treeee5a8d3e7e9e206f368fb4290dd804b784d6cbaf
parenta609c6c3f0ac219b997dbaf4d1aaa6c7778c5939 (diff)
downloadbugzilla-5235c544da71c27467ad7f7f15a743c7bbe94110.tar.gz
bugzilla-5235c544da71c27467ad7f7f15a743c7bbe94110.tar.xz
Patch for bug 329178: Remove old code specific to MySQL 3.x from DB::Mysql as we no longer support it; patch by Vlad Dascalu <vladd@bugzilla.org>, r=mkanat, a=myk.
-rw-r--r--Bugzilla/DB/Mysql.pm17
1 files changed, 3 insertions, 14 deletions
diff --git a/Bugzilla/DB/Mysql.pm b/Bugzilla/DB/Mysql.pm
index 9493fb099..72e32fcde 100644
--- a/Bugzilla/DB/Mysql.pm
+++ b/Bugzilla/DB/Mysql.pm
@@ -158,14 +158,10 @@ sub sql_position {
my ($self, $fragment, $text) = @_;
# mysql 4.0.1 and lower do not support CAST
- # mysql 3.*.* had a case-sensitive INSTR
# (checksetup has a check for unsupported versions)
+
my $server_version = $self->bz_server_version;
- if ($server_version =~ /^3\./) {
- return "INSTR($text, $fragment)";
- } else {
- return "INSTR(CAST($text AS BINARY), CAST($fragment AS BINARY))";
- }
+ return "INSTR(CAST($text AS BINARY), CAST($fragment AS BINARY))";
}
sub sql_group_by {
@@ -640,23 +636,16 @@ sub bz_index_info_real {
# 6 = Cardinality. Either a number or undef.
# 7 = sub_part. Usually undef. Sometimes 1.
# 8 = "packed". Usually undef.
- # MySQL 3
- # -------
- # 9 = comments. Usually an empty string. Sometimes 'FULLTEXT'.
- # MySQL 4
- # -------
# 9 = Null. Sometimes undef, sometimes 'YES'.
# 10 = Index_type. The type of the index. Usually either 'BTREE' or 'FULLTEXT'
# 11 = 'Comment.' Usually undef.
- my $is_mysql3 = ($self->bz_server_version() =~ /^3/);
- my $index_type_loc = $is_mysql3 ? 9 : 10;
while (my $raw_def = $sth->fetchrow_arrayref) {
if ($raw_def->[2] eq $index) {
push(@fields, $raw_def->[4]);
# No index can be both UNIQUE and FULLTEXT, that's why
# this is written this way.
$index_type = $raw_def->[1] ? '' : 'UNIQUE';
- $index_type = $raw_def->[$index_type_loc] eq 'FULLTEXT'
+ $index_type = $raw_def->[10] eq 'FULLTEXT'
? 'FULLTEXT' : $index_type;
}
}