edg_wll_ResetError(ctx);
if (lock_mode)
- trio_asprintf(&stmt, "select count(*) from jobs where jobid='%|Ss' for update", job);
+ trio_asprintf(&stmt, "select * from jobs where jobid='%|Ss' for update", job);
else
- trio_asprintf(&stmt, "select count(*) from jobs where jobid='%|Ss' lock in share mode", job);
+ trio_asprintf(&stmt, "select * from jobs where jobid='%|Ss' lock in share mode", job);
if ((nr = edg_wll_ExecSQL(ctx,stmt,&sh)) < 0) goto cleanup;
if (nr == 0) {
- edg_wll_SetError(ctx,ENOENT,"no state in DB");
+ char *err;
+
+ asprintf(&err,"jobid='%s' not registered in DB", job);
+ edg_wll_SetError(ctx,ENOENT, err);
+ free(err);
goto cleanup;
}