View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0016392 | mantisbt | db postgresql | public | 2013-09-19 18:56 | 2019-09-21 20:51 |
Reporter | dregad | Assigned To | dregad | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Target Version | 1.3.0-beta.1 | Fixed in Version | 1.3.0-beta.1 | ||
Summary | 0016392: Bool columns in pgsql system created before MantisBT 1.1.0 have smallint type in DB | ||||
Description | The ADOdb library bundled with MantisBT releases prior to 1.1.0 created type "L" columns in PostgreSQL as SMALLINT, whereas later versions (4.96+) created them as BOOLEAN. This leads to inconsistencies in the data model, and due to PostgreSQL's strong type and lack of automatic type cast between int and bool can trigger errors in Mantis. | ||||
Steps To Reproduce |
Check that all "L" columns (e.g. mantis_filters_table.is_public) are actually SMALLINT type
"L" columns are still SMALLINT
"L" columns are BOOLEAN | ||||
Tags | No tags attached. | ||||
To fix this, we must check all DB colums which we expect to be of BOOLEAN type, and if the actual type is different then the table structure must be updated. This should be done in the installer as part of the upgrade process. Systems newly installed with 1.1.0 or above are not affected by this. |
|
This is where we originally patched adodb to handle this, but those changes were pulled. We need to decide whether in 2.x we want to use boolean or small int for these fields. The obvious fix for 1.2.15 is too revert adodb back to the release where we included functionality to handle this, until we release 2.x |
|
1.2.15 has the fix in, it's only been pulled in master; the issue here is when upgrading from old releases of Mantis (pre 1.1.0) and the only fix is to apply some script on the DB to convert the columns, patching the code will do nothing (unless you mean reverting ADOdb type for L columns back to smallint, which IMO is not an option). |
|
smallint is the correct data type for adodb to be using: L: Integer field suitable for storing booleans (0 or 1) The use of "boolean" is really a mistake given that definition. Smallint is the easy solution - however, I think we might actually want 'bit' in postgresql as the correct field type in this scenario. |
|
Possibly, but the fact is that ADOdb has been using BOOLEAN since 4.96. I'm sure you'll agree that it's not worth the effort to go and argue the case with John Lim to change back to SMALLINT or anything else... |
|
MantisBT: master e2e0a9d4 2013-09-08 08:47 Details Diff |
Install: special processing for pgsql boolean columns The upgrade of ADOdb library to version 4.96 with Mantis release 1.1.0 introduced a change in the way type 'L' columns are created (SMALLINT before, BOOLEAN after). This requires special handling to fix the database schema, because the normal schema upgrade steps do not cover it (since from the MantisBT installer's perspective the column type has not changed). Fixes 0016392 |
Affected Issues 0016392 |
|
mod - admin/install.php | Diff File | ||
mod - core/install_helper_functions_api.php | Diff File | ||
MantisBT: master ddba1d9f 2013-09-08 09:12 Details Diff |
Install: pgsql bool check now handles nullable columns Issue 0016392 |
Affected Issues 0016392 |
|
mod - admin/install.php | Diff File | ||
mod - core/install_helper_functions_api.php | Diff File | ||
MantisBT: master 393bca8e 2019-09-04 02:29 Details Diff |
Install: redirect_delay is integer, not boolean check_pgsql_bool_columns() function incorrectly categorized column 'redirect_delay' in user_pref table as boolean, when in fact it it an integer (see issue 0016392). This prevents users from having a redirect delay > 1s on PostgreSQL. A follow-up fix will be required to ensure that the underlying column is indeed integer as expected by MantisBT. Fixes 0026109 |
Affected Issues 0016392, 0026109 |
|
mod - core/install_helper_functions_api.php | Diff File |