View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0014385 | mantisbt | db postgresql | public | 2012-06-12 08:54 | 2014-09-23 18:05 |
Reporter | dregad | Assigned To | dregad | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 1.2.11 | ||||
Target Version | 1.2.12 | Fixed in Version | 1.2.12 | ||
Summary | 0014385: Impossible to create a new project with fresh install on PostgreSQL | ||||
Description | This problem is new with 1.2.11, and is caused by column mantis_project_table.inherit_global, which is defined as unsigned int in schema.php, but treated as boolean in the code. APPLICATION ERROR 401 | ||||
Steps To Reproduce |
| ||||
Additional Information | Similar behavior occurs when adding a subproject (this time due to mantis_project_hierarchy_table.inherit_parent), for the same reason:
| ||||
Tags | No tags attached. | ||||
related to | 0014288 | closed | dregad | Manage User not reachable due to error in PostgreSQL |
related to | 0015721 | closed | grangeway | Functionality to consider porting to master-2.0.x |
has duplicate | 0014427 | closed | atrol | Cannot create a project on a fresh install |
related to | 0014375 | closed | dregad | Postgres SQL error: smallint vs. boolean |
related to | 0014398 | closed | dregad | Support for PostgreSQL broken in 1.3 |
The issue has been introduced by commit b8d4b503. |
|
Possible workarounds:
ALTER TABLE mantis_project_hierarchy_table ALTER COLUMN inherit_parent DROP DEFAULT; |
|
A fix for 1.2.x branch is available on github [1], testing and feedback would be appreciated. For 1.3, the proper solution would be to amend the schema, but the ADOdb AlterColumnSQL function does not work properly (see upstream bug report [2] and also 0014398 [1] https://github.com/dregad/mantisbt/tree/fix-14385 |
|
@Artefact2 - would appreciate if you could test the fix mentioned in my previous post. Let me know if you need assistance for that. |
|
I tried your branch, and project creation works now. However, when I try to update the project (here I tried unticking the "inherit global categories"), I still have a similar error: "Database query failed. Error received from database was #-1: ERROR: invalid input syntax for integer: "'0'" for the query: UPDATE mantis_project_table Thanks for the quick response, though, it's appreciated! |
|
Thank you for testing. The second issue you reported has the same root cause. I pushed another commit to the same branch to address it; kindly test again and let me know how it goes. |
|
Seems to work now, thanks! |
|
Excellent. Let me know if you face any other issues with postgres on 1.2.11 |
|
Please note as mentioned in the commit message, that the fix applied in 1.2.x branch is just a workaround. The permanent fix requires a schema change, and its implementation in 1.3.x branch has to be deferred to a later time, as it depends on the implementation of several bug fixes in the ADOdb library (see 0013713:0032135) Work-in-progress for the 1.3 fixes: https://github.com/dregad/mantisbt/tree/adodb-upg-master |
|
Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch |
|
MantisBT currently supports Mysql and has support for other database engines. The support for other databases is known to be problematic. Having implemented the current database layer into Mantis 10 years ago, I'm currently working on replacing the current layer. If you are interested in using Mantis with non-mysql databases - for example, Oracle, PGSQL or MSSQL, and would be willing to help out testing the new database layer, please drop me an email at paul@mantisforge.org In the meantime, I'd advise running Mantis with Mysql Only to avoid issues. Thanks |
|
MantisBT: master-1.2.x b8d4b503 2012-05-24 05:21 Details Diff |
Fix PostgreSQL errors with boolean fields PostgreSQL triggers an error when comparing a boolean field with an integer value. This happens frequently in MantisBT as AdoDB stores boolean fields as integers for most RDBMS. This could prevent for example manage_user_page.php from loading. To fix the problem, db_prepare_bool() has been modified to return 'true' or 'false' as appropriate when the DB is PostgreSQL, through use of AdoDB qstr() function. Behavior for other RDMBS is unchanged. The where clause condition in manage_user_page.php has been modified to use db_prepare_bool() instead of hardcoding 'enabled = 1'. Following code cleanup was also performed: - Uses of db_prepare_bool() in filter_api.php and mc_api.php that would have caused incorrect behavior with the modified function have been removed - Removed non-existant 2nd parameter in call to db_prepare_bool() in filter_api.php - Fix whitespace in mc_api.php Fixes 0014288 |
Affected Issues 0014288, 0014385 |
|
mod - api/soap/mc_api.php | Diff File | ||
mod - core/database_api.php | Diff File | ||
mod - core/filter_api.php | Diff File | ||
mod - manage_user_page.php | Diff File | ||
MantisBT: master-1.2.x ba71cf96 2012-06-18 02:52 Details Diff |
Fix PostgreSQL error when adding project/subproject Release 1.2.11 (see commit b8d4b5039598248d0b0c78619450c51d4dc98df2 and issue 0014288) introduced a regression preventing the user from creating a new project or adding a subproject. The error is caused by columns mantis_project_table.inherit_global and mantis_project_hierarchy_table.inherit_parent, which are defined as unsigned int in schema.php, but treated as boolean in the code. This is a problem with PostgreSQL due to strict type checking, but not on MySQL as type cast is done automatically. This commit is a workaround for the problem (sending an int to the DB instead of a bool if using PostgreSQL), as fixing the root cause would require a schema change which is not possible in 1.2.x. Fixes 0014385 |
Affected Issues 0014288, 0014385 |
|
mod - core/project_api.php | Diff File | ||
mod - core/project_hierarchy_api.php | Diff File | ||
MantisBT: master-1.2.x ef24c0f3 2012-06-27 01:30 Details Diff |
Fix PostgreSQL error when updating a project Release 1.2.11 (see commit b8d4b5039598248d0b0c78619450c51d4dc98df2 and issue 0014288) introduced a regression preventing the user from updating an existing project. This commit is a workaround for the problem (sending an int to the DB instead of a bool if using PostgreSQL), as fixing the root cause would require a schema change which is not possible in 1.2.x. Fixes 0014385 |
Affected Issues 0014288, 0014385 |
|
mod - core/project_api.php | Diff File |