Queries fix to use clob/longtext and on duplicate key update for filemetadata. Fixes #4389

It fixes #4389 and what was discussed here : https://github.com/dmwm/CRABServer/pull/4362