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

my_sys DYNAMIC_ARRAY and DYNAMIC_STRING inconsistancy

Details

    • Task
    • Status: Closed (View Workflow)
    • Trivial
    • Resolution: Fixed
    • 10.7.1
    • Server
    • None

    Description

      Consider:

      extern my_bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_str,   
                                         size_t init_alloc,size_t alloc_increment);
      

      vs:

      extern my_bool init_dynamic_array2(PSI_memory_key psi_key, DYNAMIC_ARRAY *array,
                                         uint element_size, void *init_buffer,        
                                         uint init_alloc, uint alloc_increment,       
                                         myf my_flags);
      

      I expect the values of init_alloc and alloc_increment to be size_t for DYNAMIC_ARRAY just like they are for DYNAMIC_STRING.

      Attachments

        Issue Links

          Activity

            Eric_Herman Eric Herman created issue -
            Eric_Herman Eric Herman made changes -
            Field Original Value New Value
            Description Consider:

            {code:C}
            extern my_bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_str,
                                               size_t init_alloc,size_t alloc_increment);
            {code}
            vs:
            {code:C}
            extern my_bool init_dynamic_array2(PSI_memory_key psi_key, DYNAMIC_ARRAY *array,
                                               uint element_size, void *init_buffer,
                                               uint init_alloc, uint alloc_increment,
                                               myf my_flags);
            {code}

            I expect the values of {{monospaced}}init_alloc{{monospaced}} and {{monospaced}}alloc_increment{{monospaced}} to be {{monospaced}}size_t{{monospaced}} for {{monospaced}}DYNAMIC_ARRAY{{monospaced}} just like they are for {{monospaced}}DYNAMIC_STRING{{monospaced}}.
            Consider:

            {code:C}
            extern my_bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_str,
                                               size_t init_alloc,size_t alloc_increment);
            {code}
            vs:
            {code:C}
            extern my_bool init_dynamic_array2(PSI_memory_key psi_key, DYNAMIC_ARRAY *array,
                                               uint element_size, void *init_buffer,
                                               uint init_alloc, uint alloc_increment,
                                               myf my_flags);
            {code}

            I expect the values of {{init_alloc}} and {{alloc_increment}} to be {{size_t}} for {{DYNAMIC_ARRAY}} just like they are for {{DYNAMIC_STRING}}.
            Eric_Herman Eric Herman made changes -
            Priority Major [ 3 ] Trivial [ 5 ]
            Eric_Herman Eric Herman added a comment -

            The underlying structs also reflect this same inconsistency:

            typedef struct st_dynamic_array                                                 
            {                                                                               
              uchar *buffer;                                                                
              uint elements,max_element;                                                    
              uint alloc_increment;                                                         
              uint size_of_element;                                                         
              PSI_memory_key m_psi_key;                                                     
              myf malloc_flags;                                                             
            } DYNAMIC_ARRAY;                                                                
                                                                                                                                                                            
            typedef struct st_dynamic_string                                                
            {                                                                               
              char *str;                                                                    
              size_t length,max_length,alloc_increment;                                     
            } DYNAMIC_STRING;
            

            Eric_Herman Eric Herman added a comment - The underlying structs also reflect this same inconsistency: typedef struct st_dynamic_array { uchar *buffer; uint elements,max_element; uint alloc_increment; uint size_of_element; PSI_memory_key m_psi_key; myf malloc_flags; } DYNAMIC_ARRAY; typedef struct st_dynamic_string { char *str; size_t length,max_length,alloc_increment; } DYNAMIC_STRING;
            Eric_Herman Eric Herman added a comment - https://github.com/MariaDB/server/pull/1899
            cvicentiu Vicențiu Ciorbaru made changes -
            Assignee Vicențiu Ciorbaru [ cvicentiu ]
            cvicentiu Vicențiu Ciorbaru made changes -
            Fix Version/s 10.7 [ 24805 ]
            cvicentiu Vicențiu Ciorbaru made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            cvicentiu Vicențiu Ciorbaru made changes -
            Status In Progress [ 3 ] In Review [ 10002 ]
            cvicentiu Vicențiu Ciorbaru made changes -
            Status In Review [ 10002 ] Stalled [ 10000 ]
            cvicentiu Vicențiu Ciorbaru added a comment - Fixed with https://github.com/MariaDB/server/commit/401ff6994d842a4072b7b155e5a958e178e6497a
            cvicentiu Vicențiu Ciorbaru made changes -
            Component/s Server [ 13907 ]
            Fix Version/s 10.7.1 [ 26120 ]
            Fix Version/s 10.7 [ 24805 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 123815 ] MariaDB v4 [ 134456 ]
            elenst Elena Stepanova made changes -
            ParadoxV5 Jimmy Hú made changes -

            People

              cvicentiu Vicențiu Ciorbaru
              Eric_Herman Eric Herman
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.