mysql error

mysql: ERROR 1093 - You can't specify target table 'foo' for update in FROM clause

UPDATE `foo` SET item_value = ( SELECT item_value FROM `foo` WHERE item_id = 3) WHERE item_id = 2896

Generated the following error:
#1093 - You can't specify target table 'foo' for update in FROM clause

You cannot change a table (DELETE or UPDATE) and SELECT from it at the same time. Given the way mysql treats sub-queries, there is no guarantee of the state the table will be during the SELECT stage.

Instead, use two queries: one to SELECT the value, the second to UPDATE it.

mysql user warning: Can't generate a unique log-filename

This error may happen when the MySQL server cannot create a new binary file, either because there is no space left in the device, or because you have moved or manipulated the binary logs in violation of the proper procedure. Check https://linux.overshoot.tv/wiki/mysql_binary_logs_administration for more information on mysql binary log administration. (You may edit this page to provide more accurate information on what precisely lead to the given error)

Syndicate content