mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
make multi updates statistics visible in SHOW STATUS as Com_update_multi
This commit is contained in:
@ -4048,6 +4048,7 @@ struct show_var_st status_vars[]= {
|
||||
{"Com_truncate", (char*) (com_stat+(uint) SQLCOM_TRUNCATE),SHOW_LONG},
|
||||
{"Com_unlock_tables", (char*) (com_stat+(uint) SQLCOM_UNLOCK_TABLES),SHOW_LONG},
|
||||
{"Com_update", (char*) (com_stat+(uint) SQLCOM_UPDATE),SHOW_LONG},
|
||||
{"Com_update_multi", (char*) (com_stat+(uint) SQLCOM_UPDATE_MULTI),SHOW_LONG},
|
||||
{"Connections", (char*) &thread_id, SHOW_LONG_CONST},
|
||||
{"Created_tmp_disk_tables", (char*) &created_tmp_disk_tables,SHOW_LONG},
|
||||
{"Created_tmp_tables", (char*) &created_tmp_tables, SHOW_LONG},
|
||||
|
@ -1894,8 +1894,6 @@ 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,
|
||||
@ -1903,15 +1901,23 @@ mysql_execute_command(THD *thd)
|
||||
(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)
|
||||
{
|
||||
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++;
|
||||
|
||||
|
@ -3061,6 +3061,8 @@ update:
|
||||
SET update_list where_clause opt_order_clause delete_limit_clause
|
||||
{
|
||||
Select->set_lock_for_tables($3);
|
||||
if (lex->select_lex->table_list.elements > 1)
|
||||
lex->sql_command=SQLCOM_UPDATE_MULTI;
|
||||
}
|
||||
;
|
||||
|
||||
|
Reference in New Issue
Block a user