[sr-dev] pua module db query bug

Juha Heinanen jh at tutpro.com
Sun Oct 12 11:59:08 CEST 2014


Daniel-Constantin Mierla writes:

> Either here the condition should be on hentity->etag.s being not null as 
> well or the update_record_puadb() shoudl have its own safety check on 
> etag (-- or even both for performance/safety).

i placed hentity->etag.s test before the update stuff and after that my
tests worked ok:

	if (hentity->etag.s) {
		if (pua_dbf.affected_rows != NULL || dbmode != PUA_DB_ONLY) {
			if (find_and_update_record(hentity, hash_code,
						   lexpire, &etag) > 0)
				goto done;
		}
		else if ((db_presentity =
			  get_record_puadb(hentity->id, &hentity->etag,
					   &dbpres, &res)) != NULL)
		{
			update_record_puadb(hentity, lexpire, &etag);
			goto done;
		}
	}

-- juha



More information about the sr-dev mailing list