~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_plugin.cc

  • Committer: Monty Taylor
  • Date: 2008-12-07 23:42:51 UTC
  • mto: This revision was merged to the branch mainline in revision 670.
  • Revision ID: monty@inaugust.com-20081207234251-yxtbg06jpylwej29
Finally removed all of the my_malloc stuff.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1753
1753
 
1754
1754
    if (new_size > global_variables_dynamic_size)
1755
1755
    {
1756
 
      global_system_variables.dynamic_variables_ptr= (char*)
1757
 
        my_realloc(global_system_variables.dynamic_variables_ptr, new_size,
1758
 
                   MYF(MY_WME | MY_FAE | MY_ALLOW_ZERO_PTR));
1759
 
      max_system_variables.dynamic_variables_ptr= (char*)
1760
 
        my_realloc(max_system_variables.dynamic_variables_ptr, new_size,
1761
 
                   MYF(MY_WME | MY_FAE | MY_ALLOW_ZERO_PTR));
 
1756
      if (!global_system_variables.dynamic_variables_ptr)
 
1757
        global_system_variables.dynamic_variables_ptr= 
 
1758
          (char *)malloc(new_size);
 
1759
      else
 
1760
        global_system_variables.dynamic_variables_ptr=
 
1761
          (char *)realloc(global_system_variables.dynamic_variables_ptr,
 
1762
                          new_size); 
 
1763
      if (!max_system_variables.dynamic_variables_ptr)
 
1764
        max_system_variables.dynamic_variables_ptr= 
 
1765
          (char *)malloc(new_size);
 
1766
      else
 
1767
        max_system_variables.dynamic_variables_ptr=
 
1768
          (char *)realloc(max_system_variables.dynamic_variables_ptr,
 
1769
                          new_size); 
 
1770
           
1762
1771
      /*
1763
1772
        Clear the new variable value space. This is required for string
1764
1773
        variables. If their value is non-NULL, it must point to a valid
1818
1827
 
1819
1828
    pthread_rwlock_rdlock(&LOCK_system_variables_hash);
1820
1829
 
1821
 
    session->variables.dynamic_variables_ptr= (char*)
1822
 
      my_realloc(session->variables.dynamic_variables_ptr,
1823
 
                 global_variables_dynamic_size,
1824
 
                 MYF(MY_WME | MY_FAE | MY_ALLOW_ZERO_PTR));
 
1830
    session->variables.dynamic_variables_ptr=
 
1831
      (session->variables.dynamic_variables_ptr)
 
1832
        ? (char *)realloc(session->variables.dynamic_variables_ptr,
 
1833
                          global_variables_dynamic_size)
 
1834
        : (char *)malloc(global_variables_dynamic_size);
1825
1835
 
1826
1836
    if (global_lock)
1827
1837
      pthread_mutex_lock(&LOCK_global_system_variables);