Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
409f7af3
Commit
409f7af3
authored
Nov 29, 2002
by
serg@serg.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make multi updates statistics visible in SHOW STATUS as Com_update_multi
parent
fcec0858
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
13 deletions
+22
-13
sql/mysqld.cc
sql/mysqld.cc
+2
-1
sql/sql_parse.cc
sql/sql_parse.cc
+16
-10
sql/sql_yacc.yy
sql/sql_yacc.yy
+4
-2
No files found.
sql/mysqld.cc
View file @
409f7af3
...
...
@@ -4010,7 +4010,7 @@ struct show_var_st status_vars[]= {
{
"Com_insert_select"
,
(
char
*
)
(
com_stat
+
(
uint
)
SQLCOM_INSERT_SELECT
),
SHOW_LONG
},
{
"Com_kill"
,
(
char
*
)
(
com_stat
+
(
uint
)
SQLCOM_KILL
),
SHOW_LONG
},
{
"Com_load"
,
(
char
*
)
(
com_stat
+
(
uint
)
SQLCOM_LOAD
),
SHOW_LONG
},
{
"Com_load_master_data"
,
(
char
*
)
(
com_stat
+
(
uint
)
SQLCOM_LOAD_MASTER_DATA
),
SHOW_LONG
},
{
"Com_load_master_data"
,
(
char
*
)
(
com_stat
+
(
uint
)
SQLCOM_LOAD_MASTER_DATA
),
SHOW_LONG
},
{
"Com_load_master_table"
,
(
char
*
)
(
com_stat
+
(
uint
)
SQLCOM_LOAD_MASTER_TABLE
),
SHOW_LONG
},
{
"Com_lock_tables"
,
(
char
*
)
(
com_stat
+
(
uint
)
SQLCOM_LOCK_TABLES
),
SHOW_LONG
},
{
"Com_optimize"
,
(
char
*
)
(
com_stat
+
(
uint
)
SQLCOM_OPTIMIZE
),
SHOW_LONG
},
...
...
@@ -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
},
...
...
sql/sql_parse.cc
View file @
409f7af3
...
...
@@ -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
++
;
...
...
sql/sql_yacc.yy
View file @
409f7af3
...
...
@@ -3051,8 +3051,8 @@ opt_insert_update:
/* Update rows in a table */
update:
UPDATE_SYM
{
UPDATE_SYM
{
LEX *lex= Lex;
lex->sql_command= SQLCOM_UPDATE;
lex->select_lex.init_order();
...
...
@@ -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;
}
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment