Given the following example:
$mysqli->query("SELECT * FROM `table`");
$mysqli->query("INSERT INTO `table` SET `x` = 'y' WHERE `x` = 2");
I have no guarantee that all queries are necessarily executed subsequently. Another process may intercept and a deadlock may occur.
Does MySQL guarantee that they are executed subsequently without any other process making a query in between?
Please do not suggest transactions / locks. This question is regarding multi_query and its specifics.
Example Code in PHP:
$query = "SELECT * FROM `table`;";
$query .= "INSERT INTO `table` SET `x` = 'y' WHERE `x` = 2;";
$mysqli->multi_query($query);