← Back to team overview

randgen team mailing list archive

Re: [Bug 1074485] Re: Reproducibility issue: stored procedures/functions not correctly prefixed with delimiters in query log

 

Hi Saikumar,

Good to be in contact again!

Hmm looks like I missed seeing this.

Did you test the changes you suggested? Does it work well?

Thanks


On Mon, Nov 5, 2012 at 7:45 PM, Saikumar <saikumar.v@xxxxxxxxxx> wrote:

> Hi Roel,
>
> Vote: to have this in lib/GenTest/Executor/MySQL.pm,
>
> Just a few suggestions,
>
> Applying your patch noticed that the entire query would be added DELIMITER
> before and after with the required syntax, however i had difficulty using
> such a queries in MySQL, Also i noticed the query contained quite a few
> other parts of SQL like DROP/CALL of procedure which may not require a
> DELIMITER, could we instead look at only isolating the procedure block
> which requires the delimiter , something like:
>
>         if ($query =~ m{CREATE (PROCEDURE|FUNCTION)}sgio) {
>             my $proc_func_query = $query;
>             $proc_func_query =~ s/CREATE (PROCEDURE|FUNCTION)/DELIMITER |
> CREATE $1/sgio;
>             $proc_func_query =~ s/END(.*?);/END | DELIMITER ;/sgio;
>                 print "$proc_func_query;\n";
>         } else {
>                 print "$query;\n";
>         }
>
> Secondly, since this would apply for both erroneous and non-erroneous
> queries would it be good to have the condition for the entire sqltrace
> block instead?
>
> Thanks
> Saikumar
>
>
> On Saturday 03 November 2012 02:36 AM, RoelV wrote:
>
>> Proposed patch
>>
>> === modified file 'lib/GenTest/Executor/MySQL.**pm'
>> --- lib/GenTest/Executor/MySQL.pm       2012-10-01 09:56:06 +0000
>> +++ lib/GenTest/Executor/MySQL.pm       2012-11-02 21:05:34 +0000
>> @@ -645,7 +645,13 @@
>>                 $trace_query =~ s/\n/\n# [sqltrace]    /g;
>>                 print '# [sqltrace] ERROR '.$err.": $trace_query;\n";
>>             } else {
>> -               print "$query;\n";
>> +               if ($query =~ m{(procedure|function)}sgio) {
>> +                       pring "DELIMITER |\n";
>> +                       print "$query|\n";
>> +                       pring "DELIMITER ;\n";
>> +               } else {
>> +                       print "$query;\n";
>> +               }
>>             }
>>         }
>>
>>
>
> ______________________________**_________________
> Mailing list: https://launchpad.net/~randgen
> Post to     : randgen@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~randgen
> More help   : https://help.launchpad.net/**ListHelp<https://help.launchpad.net/ListHelp>
>



-- 

Kind Regards,
God Bless,
-- 
Roel Van de Paar, CMDBA/CMDEV  QA Lead, Percona Inc.
Tel: +61 2 8004 1288 (UTC+10)
Mob: +61 427 141 635 (UTC+10)
Skype: roel.mysql
http://www.percona.com/services.html
http://www.mysqlperformanceblog.com/

<http://www.percona.com/live/mysql-conference-2013/sessions/crash-testcase-debugging-primer>
   <http://posscon.org/presentation/crash-testcase-debugging-primer/>

References