View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0014375 | mantisbt | db postgresql | public | 2012-06-09 06:12 | 2014-05-16 15:02 |
Reporter | dhaun | Assigned To | dregad | ||
Priority | normal | Severity | crash | Reproducibility | always |
Status | closed | Resolution | duplicate | ||
Product Version | 1.2.11 | ||||
Summary | 0014375: Postgres SQL error: smallint vs. boolean | ||||
Description | After logging in to a freshly upgraded MantisBT 1.2.11, I am confronted with this error message: --- snip --- Database query failed. Error received from database was #-1: ERROR: operator does not exist: smallint = boolean This is MantisBT running on PostgreSQL (8.2.6 if that matters). It seems the field is_public isn't really a boolean but a smallint. | ||||
Additional Information | I've tracked the error down to the SQL query in function filter_db_get_available_queries() in core/filter_api.php Replacing AND (is_public = " . db_prepare_bool(true) . " with AND (is_public = " . ((int) true) . " fixes the issue for now. Note: The same SQL query is also in function mci_filter_db_get_available_queries() in api/soap/mc_api.php and can be fixed in the same way. | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
This was introduced by commit c8a0c592. However, I'm surprised by your statement "It seems the field is_public isn't really a boolean but a smallint." - as per schema definition (admin/schema.php), the field's type is "L" which should translate to bool. |
|
is_public is a smallint in our database. Maybe something went wrong during the update (from MantisBT 1.2.10)? I didn't see any error messages during the update, though. So would you suggest I'd change is_public to a boolean manually and revert the changes I mentioned above? |
|
I just did a fresh install of mantisbt 1.2.11 on Postgres (9.1, but I don't think that should not make any difference), and the mantis_filters_table.is_public column is of type bool
I did find other issues with int/bool type mismatches in the code though, e.g. |
|
dhaun, You are probably best to run mysql if you can for a bit - the postgres/oracle/mssql support is fairly broken in 1.2 atm (IMO at least) For the next major version of mantis, we are looking at replacing the db layer to try to fix these sorts of issues. Paul |
|
In relation to my earlier note 0014375:0032069, please refer to issue 0014385. There is a good chance that the issue you experience was also introduced by the same commit b8d4b503; can you please try to revert it and report here if that fixes the problem. It may also be useful if you could provide step-by-step instructions to reproduce your problem. |
|
I thought some more about it, and since this column was never defined as anything other than "L" in the schema definition (which translates to boolean in postgres) since the installation code creation back in 2005, I can only conclude that you having it as smallint is the result of a manual update or a very old (pre 1.0.0) upgrade that was not properly executed. Therefore I suggest that you alter the column definition to boolean, and disregard my previous suggestion to revert b8d4b503. |
|
Based on analysis in 0015440, this is due to changes in ADOdb data dictionary for postgres. Due to this, MantisBT versions < 1.1.0 created all "L" type columns as SMALLINT, whereas later releases used the BOOLEAN type. |
|
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 |
|