fix sql errors highlighted by mysql strict settings