12.0 sql fixes

Merged Jose Luis Zanotti requested to merge 12.0-sql-fixes into 12.0-stage

Merge request reports