corrections and tests for VECTOR_LAYERS_QUERY sql.