Hi All,


I’ve just generated a Pull Request that would include some of the DB API changes in functionality for use alongside the existing format.


There’s a twofold reason for doing this:


a)      It helps us to extend and support 1.3 long term. We can start dropping the use of db_get_table() in core, whilst keeping it for plugin authors etc in 1.3. Plugin authors will be able to update their plugins, keeping compatibility with 1.3, and also adding compatibility for “2.0” – which we’ve already said will be released shortly after 1.3 with the DB API changes.

b)      It reduces the size of the patch set waiting to hit master after we branch into our normal master-1.3 status – in the past, we’ve given ourselves grief by ending up with big differences between master and master-1.2 within days of a release.  (as a side note, this is part of my rationale for spending some time recently to try to standardise our code, so we don’t end up doing this with the 1.3 release. I’d like to see things like the example from a week ago of https://github.com/mantisbt/mantisbt/commit/83e1cfde28459f74fd34aa8a2e233ccd7c6385dd a thing of the past ;))


Assuming that the small change in https://github.com/mantisbt/mantisbt/pull/216 passes review, I’ll generate a PR that implements the use of the new syntax over db_get_table for review.


I’m deliberately doing this as a two step process so that people can test and review that the above change is a standard alone change with no impact on the existing code base.


Details of PR below:


Backport from DB API changes functionality to set table name.


This would allow the use of the new syntax i.e.:


-$t_query = 'SELECT COUNT(*) AS unused_user_count FROM ' . $t_user_table . '

+$t_query = 'SELECT COUNT(*) AS unused_user_count FROM {user}


Whilst still allowing use of the old syntax, to give developers and plugin

authors the opportunity to start migrating code to the new syntax ready

for the 2.x.


By doing this, it also helps us extend the life of 1.3 - as it stands, if we

release test versions of mantis with the new DB layer about within a month of

the final 1.3 release as previously agreed, we could reach the stage where we

have support issues from our side for the 1.3 release.