View Issue Details

IDProjectCategoryView StatusLast Update
0028015mantisbtdb schemapublic2021-03-13 05:43
Reporterdregad Assigned Todregad  
PrioritynormalSeveritymajorReproducibilityN/A
Status assignedResolutionopen 
Target Version2.26.0 
Summary0028015: Update ADOdb to 5.21.0
Description

New ADOdb release https://github.com/ADOdb/ADOdb/blob/v5.21.0/docs/changelog.md

This needs to be tested carefully, as there's been quite a lot of changes since 5.20.x, particularly on mssql and to a lesser extent pgsql drivers.

Additional Information

https://github.com/mantisbt/mantisbt/pull/1745

Tagsadodb, upstream

Relationships

related to 0026837 closeddregad Update ADOdb to 5.20.20 
parent of 0028068 assigneddregad Impossible to insert child records with ADOdb 5.21.0 on mssql 
parent of 0028069 assigneddregad PHP notices leading to unusable system with ADOdb 5.21.0 on pgsql 
Not all the children of this issue are yet resolved or closed.

Activities

dregad

dregad

2021-03-08 08:54

developer   ~0065202

Last edited: 2021-03-08 08:56

Breaks PostgreSQL - there are many notices as shown below, which cause other, sometimes fatal errors down the line

SYSTEM NOTICE: 'Undefined index: protected' in '/home/dregad/dev/mantisbt/core/database_api.php' line 408

The regression was introduced by https://github.com/ADOdb/ADOdb/pull/367

screenshot_20210308-145218.png (79,916 bytes)   
screenshot_20210308-145218.png (79,916 bytes)   
obmsch

obmsch

2021-03-08 19:14

reporter   ~0065205

Last edited: 2021-03-09 02:31

@dregad Did some Tests on 2.24.5 (with ADOdb 5.21) for mssqlnative (SQLServer 2016, driver 5.9.0)

1) All views are Ok.
2) Add Issue (all required fields filled)

   Message: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Cannot insert the value NULL into column 'bug_text_id', table 'MantisBT.dbo.mantis_bug_table'; column does not allow nulls. INSERT fails.
   Stack trace
        0   M:\www.root\MantisBT\core\classes\DbQuery.class.php     293     -   -   trigger_error   <string>'401', <integer>256
        1   M:\www.root\MantisBT\core\classes\DbQuery.class.php     788     DbQuery     ->  db_execute  <integer>-1, <integer>-1
        2   M:\www.root\MantisBT\core\database_api.php  313     DbQuery     ::  compat_db_query     <string>'INSERT INTO {bug} ( project_id,reporter_id, handler_id,duplicate_id, priority,severity, reproducibility,status, resolution,projection, category_id,date_submitted, last_updated,eta, bug_text_id, os, os_build,platform, version,build, profile_id, summary, view_state, sponsorship_total, sticky, fixed_in_version, target_version, due_date ) VALUES ( ?,?,?,?, ?,?,?,?, ?,?,?,?, ?,?,?,?, ?,?,?,?, ?,?,?,?, ?,?,?,?)', <array> { [0] => 61, [1] => 3, [2] => 3, [3] => 0, [4] => 30, [5] => 50, [6] => 70, [7] => 50, [8] => 10, [9] => 10, [10] => 1, [11] => 1615244578, [12] => 1615244578, [13] => 10, [14] => NULL, [15] => 'Windows 10 Enterprise (64)', [16] => '1909, 18363.x', [17] => 'Ryzen 3700X, 32GB CBS LT 3200', [18] => '', [19] => '', [20] => 2, [21] => '123', [22] => 10, [23] => 0, [24] => 0, [25] => '', [26] => '1.1.x', [27] => 1 }, <integer>-1, <integer>-1, <boolean>true
        3   M:\www.root\MantisBT\core\bug_api.php   581     -   -   db_query    <string>'INSERT INTO {bug} ( project_id,reporter_id, handler_id,duplicate_id, priority,severity, reproducibility,status, resolution,projection, category_id,date_submitted, last_updated,eta, bug_text_id, os, os_build,platform, version,build, profile_id, summary, view_state, sponsorship_total, sticky, fixed_in_version, target_version, due_date ) VALUES ( ?,?,?,?, ?,?,?,?, ?,?,?,?, ?,?,?,?, ?,?,?,?, ?,?,?,?, ?,?,?,?)', <array> { [0] => 61, [1] => 3, [2] => 3, [3] => 0, [4] => 30, [5] => 50, [6] => 70, [7] => 50, [8] => 10, [9] => 10, [10] => 1, [11] => 1615244578, [12] => 1615244578, [13] => 10, [14] => NULL, [15] => 'Windows 10 Enterprise (64)', [16] => '1909, 18363.x', [17] => 'Ryzen 3700X, 32GB CBS LT 3200', [18] => '', [19] => '', [20] => 2, [21] => '123', [22] => 10, [23] => 0, [24] => 0, [25] => '', [26] => '1.1.x', [27] => 1 }
        4   M:\www.root\MantisBT\core\commands\IssueAddCommand.php  346     BugData     ->  create  -
        5   M:\www.root\MantisBT\core\commands\Command.php  137     IssueAddCommand     ->  process     -
        6   M:\www.root\MantisBT\bug_report.php     256     Command     ->  execute     -   

3) Add Project Ok
4) Add Project -> SubProject

   APPLICATION ERROR 0000700: Projekt „“ nicht gefunden.
   Stack trace
        0   M:\www.root\MantisBT\core\commands\Command.php  136     ProjectHierarchyAddCommand  ->  validate    -
        1   M:\www.root\MantisBT\manage_proj_create.php     91  Command     ->  execute     -

5) Add Note to Issue

   Message: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Cannot insert the value NULL into column 'bugnote_text_id', table 'MantisBT.dbo.mantis_bugnote_table'; column does not allow nulls. INSERT fails.
   Stack trace
        0   M:\www.root\MantisBT\core\classes\DbQuery.class.php     293     -   -   trigger_error   <string>'401', <integer>256
        1   M:\www.root\MantisBT\core\classes\DbQuery.class.php     788     DbQuery     ->  db_execute  <integer>-1, <integer>-1
        2   M:\www.root\MantisBT\core\database_api.php  313     DbQuery     ::  compat_db_query     <string>'INSERT INTO {bugnote} (bug_id, reporter_id, bugnote_text_id, view_state, date_submitted, last_modified, note_type, note_attr, time_tracking) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ? )', <array> { [0] => 827, [1] => 3, [2] => NULL, [3] => 10, [4] => 1615246171, [5] => 1615246171, [6] => 0, [7] => '', [8] => 0 }, <integer>-1, <integer>-1, <boolean>true
        3   M:\www.root\MantisBT\core\bugnote_api.php   298     -   -   db_query    <string>'INSERT INTO {bugnote} (bug_id, reporter_id, bugnote_text_id, view_state, date_submitted, last_modified, note_type, note_attr, time_tracking) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ? )', <array> { [0] => 827, [1] => 3, [2] => NULL, [3] => 10, [4] => 1615246171, [5] => 1615246171, [6] => 0, [7] => '', [8] => 0 }
        4   M:\www.root\MantisBT\core\commands\IssueNoteAddCommand.php  248     -   -   bugnote_add     <integer>827, <string>'asasdasdasdad', <string>'0:00', <boolean>false, <integer>0, <string>'', <integer>3, <boolean>false, <integer>0, <integer>0, <boolean>false, <boolean>true, <boolean>false
        5   M:\www.root\MantisBT\core\commands\Command.php  137     IssueNoteAddCommand     ->  process     -
        6   M:\www.root\MantisBT\bugnote_add.php    64  Command     ->  execute     -

Might be more. I'll check, but I doubt this is just mssql. Anything special about mysql not running into this?

BTW: 2.24.5 (with ADOdb 5.20.20) for mssqlnative (SQLServer 2016, driver 5.9.0), no problems so far.

Martin

EDIT (dregad): added markdown

dregad

dregad

2021-03-09 02:39

developer   ~0065206

Thanks for testing and reporting these details @obmsch, I'll look into it.

Anything special about mysql not running into this?

I have not done much manual testing yet. I just let the phpunit tests run via CI [1] and focused on the PostgreSQL failure so it is quite possible there are issues with MySQL too, but keep in mind that the latter is usually more error-tolerant so it would not be the first time that something fails on MSSQL but works just fine on MySQL.

obmsch

obmsch

2021-03-09 07:51

reporter   ~0065207

@dregad Looks like the Id (Identity) of an INSERT is not set/retrieved.

Have to check, what has changed in the driver.

obmsch

obmsch

2021-03-09 14:37

reporter   ~0065208

Last edited: 2021-03-10 03:59

As thought, its a problem with the mssqlnative driver and its handling of the last inserted Id (Identity).
Reverting solves the problems. I've filed an issue upstream.

EDIT (dregad) added link to upstream issue.

dregad

dregad

2021-03-10 04:02

developer   ~0065212

Thanks Martin. As mentioned upstream [1]

we need to analyze whether the inserts can be modified per @mnewnham's suggestion (i.e. modify MantisBT code to get an early reading of the insert id), as I'd rather avoid having to override and maintain MantisBT-specific ADOdb methods...