diff options
author | unknown <serg@serg.mysql.com> | 2002-11-29 13:17:54 +0100 |
---|---|---|
committer | unknown <serg@serg.mysql.com> | 2002-11-29 13:17:54 +0100 |
commit | 5234e49baf684e5e81127c549fa9f9fd78efcb05 (patch) | |
tree | 21facc6d0dfa09605b96430a6e531cf54ba7715e /sql/sql_parse.cc | |
parent | 76a634b763fc78b70e6109ab065127c33944f4d5 (diff) | |
download | mariadb-git-5234e49baf684e5e81127c549fa9f9fd78efcb05.tar.gz |
make multi updates statistics visible in SHOW STATUS as Com_update_multi
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r-- | sql/sql_parse.cc | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 11f1c59fd45..70fb5acdffd 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1894,24 +1894,30 @@ mysql_execute_command(THD *thd) send_error(thd,ER_WRONG_VALUE_COUNT); DBUG_VOID_RETURN; } - if (select_lex->table_list.elements == 1) + res= mysql_update(thd,tables, + select_lex->item_list, + lex->value_list, + select_lex->where, + (ORDER *) select_lex->order_list.first, + select_lex->select_limit, + lex->duplicates); + break; + case SQLCOM_UPDATE_MULTI: + if (check_access(thd,UPDATE_ACL,tables->db,&tables->grant.privilege)) + goto error; + if (grant_option && check_grant(thd,UPDATE_ACL,tables)) + goto error; + if (select_lex->item_list.elements != lex->value_list.elements) { - res= mysql_update(thd,tables, - select_lex->item_list, - lex->value_list, - select_lex->where, - (ORDER *) select_lex->order_list.first, - select_lex->select_limit, - lex->duplicates); + send_error(thd,ER_WRONG_VALUE_COUNT); + DBUG_VOID_RETURN; } - else { multi_update *result; uint table_count; TABLE_LIST *auxi; const char *msg=0; - lex->sql_command=SQLCOM_UPDATE_MULTI; for (auxi= (TABLE_LIST*) tables, table_count=0 ; auxi ; auxi=auxi->next) table_count++; |