~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/flush.cc

  • Committer: Brian Aker
  • Date: 2011-01-22 18:52:16 UTC
  • mfrom: (2098.4.1 catalogs)
  • Revision ID: brian@tangent.org-20110122185216-18and6vncipd7x72
Session encapsulation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
     *
44
44
     * Presumably, RESET and binlog writing doesn't require synchronization
45
45
     */
46
 
    write_bin_log(session, *session->getQueryString());
47
 
    session->my_ok();
 
46
    write_bin_log(getSession(), *getSession()->getQueryString());
 
47
    getSession()->my_ok();
48
48
  }
49
49
 
50
50
  return false;
53
53
bool statement::Flush::reloadCache()
54
54
{
55
55
  bool result= false;
56
 
  TableList *tables= (TableList *) session->lex->select_lex.table_list.first;
 
56
  TableList *tables= (TableList *) getSession()->lex->select_lex.table_list.first;
57
57
 
58
58
  if (flush_log)
59
59
  {
68
68
  */
69
69
  if (flush_tables || flush_tables_with_read_lock)
70
70
  {
71
 
    if (session && flush_tables_with_read_lock)
 
71
    if (getSession() && flush_tables_with_read_lock)
72
72
    {
73
 
      if (session->lockGlobalReadLock())
 
73
      if (getSession()->lockGlobalReadLock())
74
74
      {
75
75
        return true; /* Killed */
76
76
      }
77
 
      result= session->close_cached_tables(tables, true, true);
 
77
      result= getSession()->close_cached_tables(tables, true, true);
78
78
 
79
 
      if (session->makeGlobalReadLockBlockCommit()) /* Killed */
 
79
      if (getSession()->makeGlobalReadLockBlockCommit()) /* Killed */
80
80
      {
81
81
        /* Don't leave things in a half-locked state */
82
 
        session->unlockGlobalReadLock();
 
82
        getSession()->unlockGlobalReadLock();
83
83
        return true;
84
84
      }
85
85
    }
86
86
    else
87
87
    {
88
 
      result= session->close_cached_tables(tables, true, false);
 
88
      result= getSession()->close_cached_tables(tables, true, false);
89
89
    }
90
90
  }
91
91
 
92
 
  if (session && flush_status)
 
92
  if (getSession() && flush_status)
93
93
  {
94
 
    session->refresh_status();
 
94
    getSession()->refresh_status();
95
95
  }
96
96
 
97
 
  if (session && flush_global_status)
 
97
  if (getSession() && flush_global_status)
98
98
  {
99
99
    memset(&current_global_counters, 0, sizeof(current_global_counters));
100
 
    plugin::Logging::resetStats(session);
101
 
    session->refresh_status();
 
100
    plugin::Logging::resetStats(getSession());
 
101
    getSession()->refresh_status();
102
102
  }
103
103
 
104
104
  return result;