Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-12844

numerous issues in MASTER_GTID_WAIT()

Details

    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()

      Attachments

        Activity

          serg Sergei Golubchik created issue -
          serg Sergei Golubchik made changes -
          Field Original Value New Value
          Description {code:c++}
          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);
          }
          {code}

          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()}}
          {code:c++}
          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);
          }
          {code}

          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()}}
          serg Sergei Golubchik made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          serg Sergei Golubchik made changes -
          Status In Progress [ 3 ] Stalled [ 10000 ]
          serg Sergei Golubchik made changes -
          Fix Version/s 10.1.24 [ 22541 ]
          Fix Version/s 10.2.7 [ 22543 ]
          Fix Version/s 10.1 [ 16100 ]
          Resolution Fixed [ 1 ]
          Status Stalled [ 10000 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 80850 ] MariaDB v4 [ 152176 ]

          People

            serg Sergei Golubchik
            serg Sergei Golubchik
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.