userstat.patch has several bugs (incorrectly ported from Google Tools for MySQL)
Bug #924872 reported by
Oleg Tsarev
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS | Status tracked in 5.7 | |||||
5.1 |
Won't Fix
|
Medium
|
Unassigned | |||
5.5 |
Triaged
|
Medium
|
Unassigned | |||
5.6 |
Triaged
|
Medium
|
Unassigned | |||
5.7 |
Triaged
|
Medium
|
Unassigned |
Bug Description
userstat.patch has several bugs:
* WHERE and LIKE don't work with SHOW syntax (i.e. doesn't work (for example) SHOW CLIENT_STATISTICS LIKE 'client_name%')
* Counter from *_STATISTICS don't update while connection live (updates from connection go to statistics just after connection close)
* Incorrectly counted the kind of queries (Other/Select/etc)
Related branches
lp://staging/~tsarev/percona-server/5.1_fix_bug_924872
On hold
for merging
into
lp://staging/percona-server/5.1
- Laurynas Biveinis (community): Needs Fixing
-
Diff: 6527 lines (+4423/-975)35 files modifiedPercona-Server/mysql-test/include/show_stats.inc (+78/-0)
Percona-Server/mysql-test/include/show_table_index_stats.inc (+20/-0)
Percona-Server/mysql-test/r/access_denied.result (+330/-0)
Percona-Server/mysql-test/r/show_stats.result (+1735/-0)
Percona-Server/mysql-test/r/user_stats.result (+90/-0)
Percona-Server/mysql-test/r/userstat_bug602047.result (+2/-0)
Percona-Server/mysql-test/t/access_denied.test (+559/-0)
Percona-Server/mysql-test/t/show_stats.test (+484/-0)
Percona-Server/mysql-test/t/user_stats.test (+135/-0)
Percona-Server/mysql-test/t/userstat_bug602047.test (+2/-0)
Percona-Server/sql/handler.cc (+112/-64)
Percona-Server/sql/handler.h (+7/-4)
Percona-Server/sql/item.cc (+1/-0)
Percona-Server/sql/mysql_priv.h (+1/-1)
Percona-Server/sql/mysqld.cc (+0/-3)
Percona-Server/sql/set_var.cc (+3/-0)
Percona-Server/sql/sp_head.cc (+1/-0)
Percona-Server/sql/sql_acl.cc (+5/-0)
Percona-Server/sql/sql_base.cc (+1/-0)
Percona-Server/sql/sql_class.cc (+102/-76)
Percona-Server/sql/sql_class.h (+20/-35)
Percona-Server/sql/sql_connect.cc (+473/-524)
Percona-Server/sql/sql_db.cc (+1/-0)
Percona-Server/sql/sql_delete.cc (+2/-2)
Percona-Server/sql/sql_insert.cc (+2/-2)
Percona-Server/sql/sql_parse.cc (+30/-21)
Percona-Server/sql/sql_prepare.cc (+6/-6)
Percona-Server/sql/sql_show.cc (+134/-97)
Percona-Server/sql/sql_trigger.cc (+1/-0)
Percona-Server/sql/sql_update.cc (+2/-2)
Percona-Server/sql/sql_view.cc (+3/-0)
Percona-Server/sql/sql_yacc.yy (+5/-5)
Percona-Server/sql/structs.h (+49/-133)
Percona-Server/sql/table.cc (+1/-0)
Percona-Server/storage/myisam/ha_myisam.cc (+26/-0)
summary: |
- userstat.patch has many bugs (incorrectly ported from Google Tools for - MySQL) + userstat.patch has several bugs (incorrectly ported from Google Tools + for MySQL) |
description: | updated |
tags: | added: i24564 |
tags: | added: userstat |
To post a comment you must log in.
Tested on PS 5.5:
1)
SHOW CLIENT_STATISTICS like '%localhost%'\G ******* ******* ****** 1. row ******* ******* ******* ******
Client: localhost connections: 2 connections: 0
Connected_ time: 24
Busy_ time: 0
Cpu_time: 0
Bytes_ received: 243
Bytes_ sent: 0 bytes_written: 0
Rows_ fetched: 4
Rows_ updated: 0
Table_rows_ read: 0
Select_ commands: 4
Update_ commands: 0
Other_ commands: 1 transactions: 0 transactions: 0 connections: 0 connections: 0
Access_ denied: 0
Empty_ queries: 0 ssl_connections : 0
*******
Total_
Concurrent_
Binlog_
Commit_
Rollback_
Denied_
Lost_
Total_
1 row in set (0.00 sec)
mysql> SHOW CLIENT_STATISTICS like '%localhost%'\G ******* ******* ****** 1. row ******* ******* ******* ******
Client: localhost connections: 2 connections: 0
Connected_ time: 122
Busy_ time: 0
Cpu_time: 0
Bytes_ received: 289
Bytes_ sent: 0 bytes_written: 0
Rows_ fetched: 5
Rows_ updated: 0
Table_rows_ read: 0
Select_ commands: 5
Update_ commands: 0
Other_ commands: 1 transactions: 0 transactions: 0 connections: 0 connections: 0
Access_ denied: 0
Empty_ queries: 0 ssl_connections : 0
*******
Total_
Concurrent_
Binlog_
Commit_
Rollback_
Denied_
Lost_
Total_
1 row in set (0.00 sec)
mysql> SHOW CLIENT_STATISTICS like '%localhost%'\G ******* ******* ****** 1. row ******* ******* ******* ******
Client: localhost connections: 2 connections: 0
Connected_ time: 124
Busy_ time: 0
Cpu_time: 0
Bytes_ received: 335
Bytes_ sent: 0 bytes_written: 0
Rows_ fetched: 6
Rows_ updated: 0
Table_rows_ read: 0
Select_ commands: 6
Update_ commands: 0
Other_ commands: 1 transactions: 0 transactions: 0 connections: 0 connections: 0
Access_ denied: 0
Empty_ queries: 0 ssl_connections : 0
*******
Total_
Concurrent_
Binlog_
Commit_
Rollback_
Denied_
Lost_
Total_
1 row in set (0.00 sec)
2)
select * from table_statistics\G ******* ******* ****** 1. row ******* ******* ******* ******
TABLE_ SCHEMA: mysql
TABLE_ NAME: user
ROWS_ READ: 7
ROWS_ CHANGED: 0 X_INDEXES: 0 ******* ******* ****** 2. row ******* ******* ******* ******
TABLE_ SCHEMA: mysql
TABLE_ NAME: proxies_priv
ROWS_ READ: 2
ROWS_ CHANGED: 0 X_INDEXES: 0 ******* ******* ****** 3. row ******* ******* ******* ******
TABLE_ SCHEMA: mysql
TABLE_ NAME: db
ROWS_ READ: 2
ROWS_ CHANGED: 0 X_INDEXES: 0
*******
ROWS_CHANGED_
*******
ROWS_CHANGED_
*******
ROWS_CHANGED_
3 rows in set (0.00 sec)
mysql> select * from mysql.user\G
..........
.........
mysql> select * from table_statistics\G ******* ******* ****** 1. row ******* ******* ******* ******
TABLE_ SCHEMA: mysql
TABLE_ NAME: user
ROWS_ READ: 14
ROWS_ CHANGED: 0 X_INDEXES: 0 ******* ******* ****** 2. row *********...
*******
ROWS_CHANGED_
*******