Commit 2879da7f authored by unknown's avatar unknown

Unreported minor bug: We start numbering query IDs at zero, which

is a special case in "SHOW PROFILE FOR QUERY n".  No one can get
the zero item (which is always the statement that turns on profiling),
because zero represents the final item, internally.

Now, order the queries starting at one.


mysql-test/r/profiling.result:
  Renumber the query IDs.
sql/sql_profile.cc:
  Start the profile_id_counter at 1, to overstep the special-case 
  value of zero.
  
  Unrelated, but looks similar: don't use -1 to initialize an unsigned 
  integer field.  That causes warnings in some environments.
parent 46503d16
This diff is collapsed.
......@@ -158,7 +158,7 @@ void PROFILE_ENTRY::collect()
QUERY_PROFILE::QUERY_PROFILE(PROFILING *profiling_arg, char *query_source_arg,
uint query_length_arg)
:profiling(profiling_arg), server_query_id(-1), profiling_query_id(-1),
:profiling(profiling_arg), server_query_id(0), profiling_query_id(0),
query_source(NULL)
{
profile_end= &profile_start;
......@@ -445,7 +445,7 @@ bool QUERY_PROFILE::show(uint options)
}
PROFILING::PROFILING()
:profile_id_counter(0), keeping(1), current(NULL), last(NULL)
:profile_id_counter(1), keeping(1), current(NULL), last(NULL)
{
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment