| 9785 | */ |
| 9786 | |
| 9787 | bool insert_precheck(THD *thd, TABLE_LIST *tables) |
| 9788 | { |
| 9789 | LEX *lex= thd->lex; |
| 9790 | DBUG_ENTER("insert_precheck"); |
| 9791 | |
| 9792 | /* |
| 9793 | Check that we have modify privileges for the first table and |
| 9794 | select privileges for the rest |
| 9795 | */ |
| 9796 | privilege_t privilege= (INSERT_ACL | |
| 9797 | (lex->duplicates == DUP_REPLACE ? DELETE_ACL : NO_ACL) | |
| 9798 | (lex->value_list.elements ? UPDATE_ACL : NO_ACL)); |
| 9799 | |
| 9800 | if (check_one_table_access(thd, privilege, tables)) |
| 9801 | DBUG_RETURN(TRUE); |
| 9802 | |
| 9803 | if (lex->update_list.elements != lex->value_list.elements) |
| 9804 | { |
| 9805 | my_message(ER_WRONG_VALUE_COUNT, ER_THD(thd, ER_WRONG_VALUE_COUNT), MYF(0)); |
| 9806 | DBUG_RETURN(TRUE); |
| 9807 | } |
| 9808 | DBUG_RETURN(FALSE); |
| 9809 | } |
| 9810 | |
| 9811 | |
| 9812 | /** |
no test coverage detected