Package: mantis
Version: 1.0.8-4
Severity: normal
Tags: patch

When applying a filter (search), a database error is returned. This is
the error returned when searching for the string "HELO_LH_HOME":

Database query failed. Error received from database was #-1: ERROR:
operator does not exist: integer ~~ unknown
LINE 8: OR
(mantis_bug_table.id LIKE '%HELO_LH_HOME%')
^
HINT: No operator matches
the given name and argument type(s). You might need to add explicit type
casts. for the query: SELECT DISTINCT mantis_bug_table.id AS id
FROM
mantis_bug_text_table, mantis_project_table, mantis_bug_table
INNER JOIN
mantis_bugnote_table ON mantis_bugnote_table.bug_id =
mantis_bug_table.id INNER JOIN mantis_bugnote_text_table ON
mantis_bugnote_text_table.id =
mantis_bugnote_table.bugnote_text_id
WHERE mantis_project_table.enabled
= 1 AND mantis_project_table.id = mantis_bug_table.project_id AND (
mantis_bug_table.status in (10, 20, 30, 40, 50, 80) ) AND
(mantis_bug_text_table.id = mantis_bug_table.bug_text_id) AND ((summary
LIKE '%HELO_LH_HOME%')
OR (mantis_bug_text_table.description LIKE
'%HELO_LH_HOME%')
OR (mantis_bug_text_table.steps_to_reproduce LIKE
'%HELO_LH_HOME%')
OR (mantis_bug_text_table.additional_information LIKE
'%HELO_LH_HOME%')
OR (mantis_bug_table.id LIKE '%HELO_LH_HOME%')
OR
(mantis_bugnote_text_table.note LIKE '%HELO_LH_HOME%'))

The following patch fixes the problem:

# diff /usr/share/mantis/www/core/filter_api.php.debian
# /usr/share/mantis/www/core/filter_api.php
705c705
<                                                        OR
($t_bug_table.id LIKE '%$c_search%')
---
>                                                        OR
>                                                        (CAST($t_bug_table.id
>                                                        AS text) LIKE
>                                                        '%$c_search%')

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (1, 'experimental')
Architecture: i386 (x86_64)

Kernel: Linux 2.6.24-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages mantis depends on:
ii  apache2-mpm-prefork [httpd]   2.2.8-3    Traditional model for Apache HTTPD
ii  dbconfig-common               1.8.37     common framework for packaging dat
ii  debconf                       1.5.20     Debian configuration management sy
ii  libapache2-mod-php5           5.2.5-3    server-side, HTML-embedded scripti
ii  libphp-adodb                  4.96-1     The ADOdb database abstraction lay
ii  libphp-phpmailer              1.73-6     full featured email transfer class
ii  mysql-client-5.0 [mysql-clien 5.0.51a-3  MySQL database client binaries
ii  php5-cli                      5.2.5-3    command-line interpreter for the p
ii  php5-mysql                    5.2.5-3    MySQL module for php5

mantis recommends no packages.

-- debconf information excluded


Reply via email to