diff options
Diffstat (limited to 'Bugzilla/DB')
-rw-r--r-- | Bugzilla/DB/Mysql.pm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Bugzilla/DB/Mysql.pm b/Bugzilla/DB/Mysql.pm index 4e0a3e5b2..ae24d13bc 100644 --- a/Bugzilla/DB/Mysql.pm +++ b/Bugzilla/DB/Mysql.pm @@ -117,6 +117,20 @@ sub sql_interval { return "INTERVAL $interval"; } +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))"; + } +} + sub bz_lock_tables { my ($self, @tables) = @_; |