appserver: fixed db_functions.c bug