[v6r9] Portings from v6r10 - high priority

These changes have been tested with the help of https://github.com/fstagni/TestDIRAC/blob/master/System/TransformationSystem/TestClientTransformation.py

Some of them are a porting from https://github.com/DIRACGrid/DIRAC/pull/1731 and are necessary to ensure full compatibility between MyISAM and InnoDB schemas. This is just a must.