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

Shrink my_thread_id to uint32_t

    XMLWordPrintable

Details

    Description

      my_thread_id, the type of many thread_id variables/functions, is a readability typedef of uint64 de jure, but due to binary log format specifications, only 4 bytes are valid (MDEV-15089). In fact –

      In mysqld.cc, static recalculate_thread_id_range() places a grand limit of (0, UINT_MAX32) on my_thread_id next_thread_id(void) and aborts the program when there’re “2^32 connections”.

      To prevent inconsistent-size bugs (such as MDEV-35646) once and for all, we should change it to a typedef of uint32_t to reflect its de facto range.

      There appears to be thread_id-named variables/functions that don’tcan’t make use of the my_thread_id typedef – some are ulonglong (64-bit) and some ulong/unsigned long (64-bit on Linux, 32-bit on Windows) (including slave_proxy_id of sql/log_event.h, the old name of pseudo_thread_id).
      Any thread_id users among them should convert to my_thread_id to join the consistency’s cause.
      (I tried to do this as part of MDEV-35646; a few files in but none understood uintXX of my_global.h (nor uintXX_t of MDEV-35460).

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ParadoxV5 Jimmy Hú
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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