~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sys_var.cc

Merge in Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
1675
1675
/**
1676
1676
  Find a user set-table variable.
1677
1677
 
1678
 
  @param str       Name of system variable to find
1679
 
  @param length    Length of variable.  zero means that we should use strlen()
1680
 
                   on the variable
1681
 
  @param no_error  Refuse to emit an error, even if one occurred.
 
1678
  @param name      Name of system variable to find
1682
1679
 
1683
1680
  @retval
1684
1681
    pointer     pointer to variable definitions
1686
1683
    0           Unknown variable (error message is given)
1687
1684
*/
1688
1685
 
1689
 
sys_var *intern_find_sys_var(const char *str, uint32_t, bool no_error)
 
1686
sys_var *find_sys_var(const std::string &name)
1690
1687
{
1691
 
  string lower_name(str);
 
1688
  string lower_name(name);
1692
1689
  transform(lower_name.begin(), lower_name.end(),
1693
1690
            lower_name.begin(), ::tolower);
1694
1691
 
1700
1697
    result= (*iter).second;
1701
1698
  } 
1702
1699
 
1703
 
  /*
1704
 
    This function is only called from the sql_plugin.cc.
1705
 
    A lock on LOCK_system_variable_hash should be held
1706
 
  */
1707
1700
  if (result == NULL)
1708
1701
  {
1709
 
    if (no_error)
1710
 
    {
1711
 
      return NULL;
1712
 
    }
1713
 
    else
1714
 
    {
1715
 
      my_error(ER_UNKNOWN_SYSTEM_VARIABLE, MYF(0), (char*) str);
1716
 
      return NULL;
1717
 
    }
 
1702
    my_error(ER_UNKNOWN_SYSTEM_VARIABLE, MYF(0), name.c_str());
 
1703
    return NULL;
1718
1704
  }
1719
1705
 
1720
1706
  return result;