at the moment I am migrating from mysql to postgres and so far everything has gone smoothly.
However, when I go to /admin/system_utils.php and want to "Show database statistics" to see if the number of entries matches the old mysql database, I get the following error message:
Code: Select all
Database query failed. Error received from database was #-18: ERROR: relation "sql_parts" does not exist
LINE 1: SELECT COUNT(*) FROM sql_parts
^ for the query: SELECT COUNT(*) FROM sql_parts.
PHP Version 8.2.26
MantisBT Database Information
Database Schema Version 213
ADOdb Version 5.22.7
Postgresql Version 15
OS Debian12
Webserver Apache2.4 with php-fpm 8.2
With the mysql database the error does not occur.
This error also occures with a fresh installation (new instance and database) with postgresql not only with my migrated database. (For the migration from mysql to postgres I used pgloader)
Upon closer inspection of the db_stats.php file I saw that the tables get retrieved by a call to db_get_table_list() which makes a call to $g_db->MetaTables( 'TABLE' ) from ADOdb. It seems all tables are retrieved correctly but when using postgresql the sql_parts table is additionally retrieved. This does not happen when using mysql. This causes the problem because when mantis executes the query to get the stats of the table it does not exist because to access the table correctly "information_schema.sql_parts" has to be used but only sql_parts is in the tables array. However the table should not get retrieved by db_get_table_list() anyway. I also looked into the ADOdb source code and found out that for the pdo_pgsql driver the following query is executed for the MetaTables function:
Code: Select all
select tablename,'T' from pg_tables
where tablename not like 'pg\_%' and schemaname not in ( 'pg_catalog','information_schema')
union
select viewname,'V' from pg_views
where viewname not like 'pg\_%' and schemaname not in ( 'pg_catalog','information_schema')
Can any of you reproduce the error? Is this a bug in the current mantis version or is something wrong on my end? (e.g with my postgresql installation)
Any help is appreciated. I want to be sure what causes this error and if it can be ignored for now that I can safely migrate to postgresql and avoid future problems e.g when updating the mantis version.Thanks in advance.
What lets me believe that it is a bug in the current mantis version is the following:
I downgraded the mantis version of the new install that I used for testing (mentioned eralier) with the freshly created postgresql database. With the following setup the problem does not occur:
MantisBT Version 2.25.2
PHP Version 8.2.26
MantisBT Database Information
Schema Version 213
ADOdb Version 5.20.20
However if I bump the versions back up to the newest ones (like mentioned ealier in this thread) I get the error again.
Kind regards