← Back to team overview

maria-developers team mailing list archive

Re: [Branch ~maria-captains/maria/5.1] Rev 2726: Updated documentation files to reflect MariaDB and not the Maria storage engine or MySQL

 

noreply@xxxxxxxxxxxxx writes:

> Merge authors:
>   Michael Widenius (monty)
> ------------------------------------------------------------
> revno: 2726 [merge]
> committer: Michael Widenius <monty@xxxxxxxxx>
> branch nick: maria
> timestamp: Thu 2009-09-03 17:56:46 +0300
> message:
>   Updated documentation files to reflect MariaDB and not the Maria storage engine or MySQL
>   Added (rewritten) patch from Percona to get extended statistics in slow.log:

> === modified file 'sql/log.cc'
> --- sql/log.cc	2009-04-25 10:05:32 +0000
> +++ sql/log.cc	2009-09-03 14:05:38 +0000

> @@ -987,6 +987,17 @@
>        query_length= command_name[thd->command].length;
>      }
>  
> +    if (!query_length) 
> +    {
> +      /*
> +        Not a real query; Reset counts for slow query logging
> +        (QQ: Wonder if this is really needed)
> +      */
> +      thd->sent_row_count= thd->examined_row_count= 0;
> +      thd->query_plan_flags= QPLAN_INIT;
> +      thd->query_plan_fsort_passes= 0;
> +    }

This part of the patch makes me wonder. Isn't this dead code? Just above, the
code does this:

    if (!query)
    {
      is_command= TRUE;
      query= command_name[thd->command].str;
      query_length= command_name[thd->command].length;
    }

So the above part of the patch will only run when query!=0 && query_length==0.
Can this ever happen?

If not, the code should probably be removed. If so, maybe add a comment
explaining when this happens (and change it to be in an else {} clause of the
if statement just before it).

 - Kristian.