afsql: validate fix

Signed-off-by: Laszlo Budai <stentor.bgyk@gmail.com>