For example: insert into test (id, name) select (select ifnull (Max (id), 0) + 1 from test), 'li Ming' where not the exists (select 1 from the test where id=(select ifnull (Max (id), 0) + 1 from test))
This statement has two local call Max function, in the case of high concurrency Max (id) inconsistent would happen?