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
86055e42
Commit
86055e42
authored
Apr 15, 2024
by
Elena Stepanova
Committed by
Sergei Golubchik
May 27, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-33913 TABLE_STATISTICS increments ROWS_CHANGED twice upon UPDATE and does not count DELETE
parent
94033fcf
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
1 deletion
+5
-1
mysql-test/main/information_schema_stats.result
mysql-test/main/information_schema_stats.result
+3
-0
mysql-test/main/information_schema_stats.test
mysql-test/main/information_schema_stats.test
+1
-0
plugin/userstat/table_stats.cc
plugin/userstat/table_stats.cc
+1
-1
No files found.
mysql-test/main/information_schema_stats.result
View file @
86055e42
...
@@ -39,6 +39,9 @@ id first_name last_name address phone email
...
@@ -39,6 +39,9 @@ id first_name last_name address phone email
select * from just_a_test force index(primary) where id=8;
select * from just_a_test force index(primary) where id=8;
id first_name last_name address phone email
id first_name last_name address phone email
update just_a_test set first_name="unlucky" where id=5;
update just_a_test set first_name="unlucky" where id=5;
select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test';
TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES ROWS_INSERTED ROWS_UPDATED ROWS_DELETED KEY_READ_HITS KEY_READ_MISSES
test just_a_test 31 6 6 5 1 0 4 1
delete from just_a_test where id=5;
delete from just_a_test where id=5;
select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test';
select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test';
TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES ROWS_INSERTED ROWS_UPDATED ROWS_DELETED KEY_READ_HITS KEY_READ_MISSES
TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES ROWS_INSERTED ROWS_UPDATED ROWS_DELETED KEY_READ_HITS KEY_READ_MISSES
...
...
mysql-test/main/information_schema_stats.test
View file @
86055e42
...
@@ -27,6 +27,7 @@ select * from information_schema.index_statistics where table_schema='test' and
...
@@ -27,6 +27,7 @@ select * from information_schema.index_statistics where table_schema='test' and
select
*
from
just_a_test
force
index
(
primary
)
where
id
between
1
and
2
;
select
*
from
just_a_test
force
index
(
primary
)
where
id
between
1
and
2
;
select
*
from
just_a_test
force
index
(
primary
)
where
id
=
8
;
select
*
from
just_a_test
force
index
(
primary
)
where
id
=
8
;
update
just_a_test
set
first_name
=
"unlucky"
where
id
=
5
;
update
just_a_test
set
first_name
=
"unlucky"
where
id
=
5
;
select
*
from
information_schema
.
table_statistics
where
table_schema
=
'test'
and
table_name
=
'just_a_test'
;
delete
from
just_a_test
where
id
=
5
;
delete
from
just_a_test
where
id
=
5
;
select
*
from
information_schema
.
table_statistics
where
table_schema
=
'test'
and
table_name
=
'just_a_test'
;
select
*
from
information_schema
.
table_statistics
where
table_schema
=
'test'
and
table_name
=
'just_a_test'
;
select
*
from
information_schema
.
index_statistics
where
table_schema
=
'test'
and
table_name
=
'just_a_test'
;
select
*
from
information_schema
.
index_statistics
where
table_schema
=
'test'
and
table_name
=
'just_a_test'
;
...
...
plugin/userstat/table_stats.cc
View file @
86055e42
...
@@ -48,7 +48,7 @@ static int table_stats_fill(THD *thd, TABLE_LIST *tables, COND *cond)
...
@@ -48,7 +48,7 @@ static int table_stats_fill(THD *thd, TABLE_LIST *tables, COND *cond)
continue
;
continue
;
rows_changed
=
(
rows_stats
->
inserted
+
rows_stats
->
updated
+
rows_changed
=
(
rows_stats
->
inserted
+
rows_stats
->
updated
+
rows_stats
->
upda
ted
);
rows_stats
->
dele
ted
);
table
->
field
[
0
]
->
store
(
table_stats
->
table
,
schema_length
,
table
->
field
[
0
]
->
store
(
table_stats
->
table
,
schema_length
,
system_charset_info
);
system_charset_info
);
table
->
field
[
1
]
->
store
(
table_stats
->
table
+
schema_length
+
1
,
table
->
field
[
1
]
->
store
(
table_stats
->
table
+
schema_length
+
1
,
...
...
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