(1143, "SELECT command denied to user 'test_delete'@'localhost' for column 'id' in table 'agent_info'")
其實沒有,是由於5.6開始支持在線修改表結構。向新表追加dml log時會出現空洞重複java
參考
不規範
應使用 WHERE columnX IS NULL
sql
MySQL中WHERE columnX=NULL
等效WHERE columnX IS NULL
bash
SQL92規範中中WHERE columnX=NULL永遠不成立ide
參考
https://stackoverflow.com/questions/2747279/something-about-ansi-nullscode
https://stackoverflow.com/questions/4429319/you-cant-specify-target-table-for-update-in-from-clauseci
SELECT s.*,t.count FROM instance_summary AS s JOIN (SELECT COUNT(*) AS `count` FROM instance_summary) AS t
在5.7版本上比較常見
解決辦法: 先更新,後插入get
int affectRows = update(sql) if (affectRows ==0 ) { // 某些狀況下可能要先檢查行記錄是否存在,而後insert。經過主動採樣的方式減少異常發生 insert(sql) }
The following notes will be helpful for you, mysql_affected_rows() returns +0: a row wasn't updated or inserted (likely because the row already existed, but no field values were actually changed during the UPDATE). +1: a row was inserted +2: a row was updated -1: in case of error.