[MDEV-4686] Temporary variable for sub_id is 32-bit, should be 64-bit Created: 2013-06-20  Updated: 2013-06-20  Resolved: 2013-06-20

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.0.3
Fix Version/s: 10.0.4

Type: Bug Priority: Minor
Reporter: Jeremy Cole Assignee: Kristian Nielsen
Resolution: Fixed Votes: 0
Labels: gtid


 Description   

In sql/rpl_gtid.cc, the temporary sub_id variable is declared as uint32, but should be uint64 (as sub_id is everywhere else):

 464 uint64
 465 rpl_slave_state::next_subid(uint32 domain_id)
 466 {
 467   uint32 sub_id= 0;
 468   element *elem;
 469 
 470   lock();
 471   elem= get_element(domain_id);
 472   if (elem)
 473     sub_id= ++elem->last_sub_id;
 474   unlock();
 475 
 476   return sub_id;
 477 }

That would be a fun bug to diagnose on a server with a 1-year uptime.

(Also, please rename subid to sub_id everywhere, otherwise grep is less useful.)



 Comments   
Comment by Kristian Nielsen [ 2013-06-20 ]

Good catch! Thanks.

Pushed to 10.0-base.

Generated at Thu Feb 08 06:58:21 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.