[MDEV-12844] numerous issues in MASTER_GTID_WAIT() Created: 2017-05-19  Updated: 2017-05-24  Resolved: 2017-05-24

Status: Closed
Project: MariaDB Server
Component/s: Replication
Affects Version/s: 10.1
Fix Version/s: 10.1.24, 10.2.7

Type: Bug Priority: Major
Reporter: Sergei Golubchik Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None


 Description   

class Item_master_gtid_wait :public Item_int_func
{
  longlong val_int();
  void fix_length_and_dec() { max_length=10+1+10+1+20+1; maybe_null=0;}
};
 
longlong Item_master_gtid_wait::val_int()
{
  if (args[0]->null_value)
  {
    null_value= 1;
    return 0;
  }
  String *gtid_pos = args[0]->val_str(&value);
}

Few issues here:

  • weird max_length for a integer function that can only ever return -1, 0, 1
  • it promises maybe_null=0 and returns NULL
  • it checks args[0]->null_value before args[0]->val_str()

Generated at Thu Feb 08 08:00:55 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.