~olafvdspek/drizzle/refactor11

« back to all changes in this revision

Viewing changes to drizzled/session.cc

  • Committer: Mark Atwood
  • Date: 2011-10-19 00:10:47 UTC
  • mfrom: (2440.2.13 rf)
  • Revision ID: me@mark.atwood.name-20111019001047-atj0u8gedphon1tb
mergeĀ lp:~olafvdspek/drizzle/refactor5

Show diffs side-by-side

added added

removed removed

Lines of Context:
419
419
    assert(security_ctx);
420
420
    if (global_system_variables.log_warnings)
421
421
    {
422
 
      errmsg_printf(error::WARN, ER(ER_FORCING_CLOSE),
423
 
                    internal::my_progname,
424
 
                    thread_id,
425
 
                    security_ctx->username().c_str());
 
422
      errmsg_printf(error::WARN, ER(ER_FORCING_CLOSE), internal::my_progname, thread_id, security_ctx->username().c_str());
426
423
    }
427
424
 
428
425
    disconnect();
1686
1683
  current_global_counters.connections= 0;
1687
1684
}
1688
1685
 
1689
 
user_var_entry *Session::getVariable(lex_string_t &name, bool create_if_not_exists)
1690
 
{
1691
 
  return getVariable(to_string(name), create_if_not_exists);
1692
 
}
1693
 
 
1694
 
user_var_entry *Session::getVariable(const std::string  &name, bool create_if_not_exists)
 
1686
user_var_entry* Session::getVariable(str_ref name0, bool create_if_not_exists)
1695
1687
{
1696
1688
  if (cleanup_done)
1697
1689
    return NULL;
1698
1690
 
 
1691
  string name(name0.data(), name0.size());
1699
1692
  if (UserVars::mapped_type* iter= find_ptr(user_vars, name))
1700
1693
    return *iter;
1701
1694
 
1716
1709
 
1717
1710
void Session::setVariable(const std::string &name, const std::string &value)
1718
1711
{
1719
 
  user_var_entry *updateable_var= getVariable(name.c_str(), true);
1720
 
  if (updateable_var)
 
1712
  if (user_var_entry* var= getVariable(name, true))
1721
1713
  {
1722
 
    updateable_var->update_hash(false,
1723
 
                                (void*)value.c_str(),
1724
 
                                static_cast<uint32_t>(value.length()), STRING_RESULT,
1725
 
                                &my_charset_bin,
1726
 
                                DERIVATION_IMPLICIT, false);
 
1714
    var->update_hash(false, value, STRING_RESULT, &my_charset_bin, DERIVATION_IMPLICIT, false);
1727
1715
  }
1728
1716
}
1729
1717