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

64-bit server with 32-bit limits on variables

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.0.5, 5.5.33a
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      CentOS 6 64-bit

      Description

      Looks like some variables have a maximum value of an unsigned 32bit integer, but the docs say they should be 64 bit.

      https://mariadb.com/kb/en/server-system-variables/#delayed_insert_limit

      In question:

      delayed_insert_limit
      delayed_queue_size
      key_cache_age_threshold
      log_warnings
      max_seeks_for_key
      min_examined_row_limit
      net_retry_count
      progress_report_time
      query_alloc_block_size
      query_cache_limit
      query_cache_min_res_unit
      query_prealloc_size
      transaction_alloc_block_size
      transaction_prealloc_size

      Example:

      MariaDB [(none)]> \! uname -a
      Linux dev-100-11 2.6.32-358.23.2.el6.x86_64 #1 SMP Wed Oct 16 18:37:12 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
      
      MariaDB [(none)]> \! rpm -qa|grep "MariaDB"
      MariaDB-client-10.0.5-1.x86_64
      MariaDB-compat-10.0.5-1.x86_64
      MariaDB-server-10.0.5-1.x86_64
      MariaDB-common-10.0.5-1.x86_64
      
      MariaDB [(none)]> SELECT VERSION();
      +----------------+
      | VERSION()      |
      +----------------+
      | 10.0.5-MariaDB |
      +----------------+
      1 row in set (0.00 sec)
      
      MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'delayed_insert_limit';
      +----------------------+-------+
      | Variable_name        | Value |
      +----------------------+-------+
      | delayed_insert_limit | 100   |
      +----------------------+-------+
      1 row in set (0.00 sec)
      
      MariaDB [(none)]> SET GLOBAL delayed_insert_limit = 18446744073709547520;
      Query OK, 0 rows affected, 1 warning (0.00 sec)
      
      MariaDB [(none)]> SHOW WARNINGS;
      +---------+------+------------------------------------------------------------------------+
      | Level   | Code | Message                                                                |
      +---------+------+------------------------------------------------------------------------+
      | Warning | 1292 | Truncated incorrect delayed_insert_limit value: '18446744073709547520' |
      +---------+------+------------------------------------------------------------------------+
      1 row in set (0.00 sec)
      
      MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'delayed_insert_limit';
      +----------------------+------------+
      | Variable_name        | Value      |
      +----------------------+------------+
      | delayed_insert_limit | 4294967295 |
      +----------------------+------------+
      1 row in set (0.00 sec)
      
      MariaDB [(none)]> 
      

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            serg Sergei Golubchik added a comment -

            Ian, could you please update the manual to match the code?

            Variables are defined in the sys_vars.cc file and you can easily see from there what is the valid range of values for every variable. Note, that UINT_MAX is 4294967295

            Show
            serg Sergei Golubchik added a comment - Ian, could you please update the manual to match the code? Variables are defined in the sys_vars.cc file and you can easily see from there what is the valid range of values for every variable. Note, that UINT_MAX is 4294967295
            Hide
            greenman Ian Gilfillan added a comment -

            Thanks, I see this. Why is the limit ULONG_MAX on MySQL, and UINT_MAX on MariaDB?

            Show
            greenman Ian Gilfillan added a comment - Thanks, I see this. Why is the limit ULONG_MAX on MySQL, and UINT_MAX on MariaDB?
            Hide
            serg Sergei Golubchik added a comment -

            Win64 portability. Win64 is 64 bit, but ulong is 32-bit, and ULONG_MAX is 4294967295. So some variables are truly 32-bit, others are truly 64-bit. And some (ulong) variables are 32-bit on 32-bit platforms and Win64 and 64-bit on 64-bit platforms excluding Win64. This was proven to be problematic in certain cases.

            We've basically removed all ULONG_MAX from system variable limits, so all ulong variables have now fixed architecture-independent limits.

            Show
            serg Sergei Golubchik added a comment - Win64 portability. Win64 is 64 bit, but ulong is 32-bit, and ULONG_MAX is 4294967295. So some variables are truly 32-bit, others are truly 64-bit. And some (ulong) variables are 32-bit on 32-bit platforms and Win64 and 64-bit on 64-bit platforms excluding Win64. This was proven to be problematic in certain cases. We've basically removed all ULONG_MAX from system variable limits, so all ulong variables have now fixed architecture-independent limits.

              People

              • Assignee:
                greenman Ian Gilfillan
                Reporter:
                wfong Will Fong
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: