Re: [Bacula-devel] Something amiss in bacula-9.6.7: Possible race condition

2021-01-18 Thread Martin Simmons
> On Fri, 15 Jan 2021 14:18:32 -0500, Phil Stracchino said: > > The proper way to fix this is as follows: > > INSERT IGNORE into the table. > If mysql_affected_rows() returns 1, i.e we inserted exactly one row; > return mysql_insert_id(), which will be correct. > If mysql_affected_rows() retu

Re: [Bacula-devel] Something amiss in bacula-9.6.7: Possible race condition

2021-01-18 Thread Phil Stracchino
On 1/18/21 2:08 PM, Martin Simmons wrote: > Looks reasonable to me. (*) > > If the INSERT failed for some other reason then the original mysql_query() > should have failed rather than mysql_affected_rows() returning 0. I think if > a subsequent SELECT returns a PathId then it would be safe to as