Mantis and mysql 4.0

General discussion of Mantis.

Moderators: Developer, Contributor

Post Reply
hazzit
Posts: 2
Joined: 19 Mar 2008, 01:16

Mantis and mysql 4.0

Post by hazzit »

I noticed that Mantis 1.1.1 needs mysql >=4.1. Since my host (for whatever reason) still uses 4.0.27, I couldn't run it online, while my local XAMPP test installation worked perfectly. So I thought I'd give it a try and see what problems I run into.

ISSUE #1
The database doesn't like the "SET NAMES UTF8" statement.

I set the default language in config_inc.php to "german_8859-1" instead of just "german". That solved it by using an 8bit character set instead of unicode.


ISSUE #2
The Tag-selector-box produces an "Application Error" - I forgot the number. It is caused by a nested SQL statement, that mysql 4.0 doesn't like, which is part of the print_api.php (print_tag_option_list, line #327 )

That line used to say:

Code: Select all

$query .= " WHERE id NOT IN ( SELECT tag_id FROM $t_bug_tag_table WHERE bug_id='$c_bug_id' ) ";
I changed to the equivalent:

Code: Select all

$query .= " LEFT JOIN mantis_bug_tag_table ON mantis_tag_table.id = mantis_bug_tag_table.tag_id AND bug_id='$c_bug_id' WHERE mantis_bug_tag_table.tag_id IS NULL ORDER BY name ASC ";
I know the former is easier to read, but subquerys are a no-go with 4.0, and often are the cause of performence problems (although certainly not in this case).

I have yet to run into any other problems with mysql 4.0, but I've just started to test the system on that server.

By the way: I've had to read my way through a number of php projects, and must admit that Mantis is one of the easiest to follow. Your code documentation and file system structure rulez!

Regards,

Hazzit
vboctor
Site Admin
Posts: 1304
Joined: 13 Feb 2005, 22:11
Location: Redmond, Washington
Contact:

Re: Mantis and mysql 4.0

Post by vboctor »

Thanks for the feedback and for sharing the steps for getting Mantis to work with MySQL 4.0. I am sure this would be useful for some others.
Migrate your MantisBT to the MantisHub Cloud
Stefaaaaan
Posts: 2
Joined: 25 Jun 2008, 11:21

Re: Mantis and mysql 4.0

Post by Stefaaaaan »

OK, i did it, too (mantis version 1.1.2 with mysql 4.0)....

But the default language "german_8859-1" didnt work!!!
I placed

Code: Select all

$g_default_language		= 'german_8859-1';
into my config_inc.php file but the Application Error was still there.
So I disabled line #76 in database_api....

Code: Select all

	#db_query( 'SET NAMES UTF8' );
I know that move isnt very nice but now it looks like it works now.
If anybody knows a better solution... please post it

I think it should be a good idea making mantis to support any mysql database version... :mrgreen:
Post Reply