List:Commits« Previous MessageNext Message »
From:Davi Arnaut Date:March 11 2009 8:22pm
Subject:Re: bzr commit into mysql-5.1-bugteam branch (Davi.Arnaut:2827)
Bug#36540
View as plain text  
On 3/11/09 4:56 PM, Mats Kindahl wrote:
> Hi Davi!
>
> I just have two comments below. Could you check them?
>
> Just my few cents,
> Mats Kindahl
>
> Davi Arnaut wrote:
>> #At file:///data0/my/darnaut/mysql-repo/work/36540-5.1/ based on
> revid:msvensson@stripped
>>
>>   2827 Davi Arnaut	2009-02-27
>>        Bug#36540: CREATE EVENT and ALTER EVENT statements fail with large
> server_id
>>
>>        The problem is that creating a event could fail if the value of
>>        the variable server_id didn't fit in the originator column of
>>        the event system table. The cause is two-fold: it was possible
>>        to set server_id to a value outside the documented range (from
>>        0 to 2^32-1) and the originator column of the event table didn't
>>        have enough room for values in this range.
>>
>>        The log tables (general_log and slow_log) also don't have a proper
>>        column type to store the server_id and having a large server_id
>>        value could prevent queries from being logged.
>>
>>        The solution is to ensure that all system tables that store the
>>        server_id value have a proper column type (int unsigned) and that
>>        the variable can't be set to a value that is not within the range.
>
> [snip]
>
>> === modified file 'mysql-test/r/variables.result'
>> --- a/mysql-test/r/variables.result	2009-02-27 08:24:57 +0000
>> +++ b/mysql-test/r/variables.result	2009-02-27 12:23:38 +0000
>> @@ -1389,3 +1389,27 @@ SET @@session.thread_stack= 7;
>>   ERROR HY000: Variable 'thread_stack' is a read only variable
>>   SET @@global.thread_stack= 7;
>>   ERROR HY000: Variable 'thread_stack' is a read only variable
>> +SET @old_server_id = @@GLOBAL.server_id;
>> +SET GLOBAL server_id = (1 << 32) - 1;
>> +SELECT @@GLOBAL.server_id;
>> +@@GLOBAL.server_id
>> +4294967295
>> +SET GLOBAL server_id = (1 << 32);
>> +Warnings:
>> +Warning	1292	Truncated incorrect server-id value: '4294967296'
>> +SELECT @@GLOBAL.server_id;
>> +@@GLOBAL.server_id
>> +4294967295
>> +SET GLOBAL server_id = (1 << 64);
>> +SELECT @@GLOBAL.server_id;
>> +@@GLOBAL.server_id
>> +0
>
> Shouldn't this one give a warning instead of truncating the value to 0?

Kind of. I missed that (1 << 64) is zero, should be (1 << 60)

>> +SET GLOBAL server_id = 0;
>> +SELECT @@GLOBAL.server_id;
>> +@@GLOBAL.server_id
>> +0
>> +SET GLOBAL server_id = -1;
>> +SELECT @@GLOBAL.server_id;
>> +@@GLOBAL.server_id
>> +0
>
> Same here?
>

This is Bug#40657. Was pushed to the team tree after I committed this patch.

Regards,

-- Davi Arnaut
Thread
bzr commit into mysql-5.1-bugteam branch (Davi.Arnaut:2827) Bug#36540Davi Arnaut27 Feb
  • Re: bzr commit into mysql-5.1-bugteam branch (Davi.Arnaut:2827)Bug#36540Mats Kindahl11 Mar
    • Re: bzr commit into mysql-5.1-bugteam branch (Davi.Arnaut:2827)Bug#36540Davi Arnaut11 Mar