fixes public table + removed SQLViewAPI CDB-2601
fixes wrapped query when the sql is for write CDB-1602
Merge CDB-2601 into release/2.13.3