I've been executing the following query in MySQL console:
INSERT INTO pixel_window
SELECT id
FROM pixels
WHERE pixel_id='type2'
ORDER BY id DESC
LIMIT 5;
And got:
Query OK, 5 rows affected, 1 warning (0.00 sec)
Records: 5 Duplicates: 0 Warnings: 0
mysql> SHOW WARNINGS\G
*************************** 1. row ***************************
Level: Note
Code: 1592
Message: Statement may not be safe to log in statement format.
1 row in set (0.00 sec)
I've played a little with the query, and found out that when LIMIT
is omitted the warning disappears.
What does this warning mean? Why is LIMIT
a problem in this subquery?
It's considered a bug.
A warning can be thrown when you don't define 'order by' clause in your update. In your case, it is considered safe since you order by ID (asuming id is a unique id?)
Read more on the bugreport here: http://bugs.mysql.com/bug.php?id=42415
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With