"SHOW ..." statements update "Rows_fetched" value in "information_schema.user_statistics"

Bug #1510953 reported by Yura Sorokin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Fix Released
High
Yura Sorokin
5.1
Won't Fix
Low
Yura Sorokin
5.5
Fix Released
High
Yura Sorokin
5.6
Fix Released
High
Yura Sorokin

Bug Description

When user stats are enabled ("SET GLOBAL userstat = ON"), after executing any statement of the "SHOW ..." family that produces non-empty result, the total number of the sent rows ("Rown_fetched") is updated in the "information_schema.user_statistics".

This happens because of the invalid "if" condition in the "void THD::update_stats(bool ran_command)" ("sql_class.cc")
**************************************************************************
      else if (!sql_command_flags[lex->sql_command] & CF_STATUS_COMMAND)
**************************************************************************
which is always "false" and therefore gets optimized out.

Revision history for this message
Yura Sorokin (yura-sorokin) wrote :

Also, this condition is considered suspicious and generates compiler's warning on newer versions of GCC (observed on 5.2.1 , Ubuntu 15.10 64-bit).
This could lead to build failures when"-Werror" is enabled.

no longer affects: percona-server/5.7
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-937

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.