(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.