~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/flush.cc

  • Committer: Monty Taylor
  • Date: 2010-10-08 17:32:00 UTC
  • mto: This revision was merged to the branch mainline in revision 1833.
  • Revision ID: mordred@inaugust.com-20101008173200-iq22jo2nic48noa3
Updated pandora-build files to version 0.157

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include <drizzled/lock.h>
25
25
#include <drizzled/statement/flush.h>
26
26
#include "drizzled/sql_table.h"
27
 
#include "drizzled/plugin/logging.h"
28
27
 
29
28
namespace drizzled
30
29
{
35
34
   * reloadCache() will tell us if we are allowed to write to the
36
35
   * binlog or not.
37
36
   */
38
 
  if (not reloadCache())
 
37
  if (! reloadCache())
39
38
  {
40
39
    /*
41
40
     * We WANT to write and we CAN write.
43
42
     *
44
43
     * Presumably, RESET and binlog writing doesn't require synchronization
45
44
     */
46
 
    write_bin_log(session, *session->getQueryString());
 
45
    write_bin_log(session, session->query.c_str());
47
46
    session->my_ok();
48
47
  }
49
48
 
70
69
  {
71
70
    if (session && flush_tables_with_read_lock)
72
71
    {
73
 
      if (session->lockGlobalReadLock())
 
72
      if (lock_global_read_lock(session))
74
73
      {
75
74
        return true; /* Killed */
76
75
      }
77
76
      result= session->close_cached_tables(tables, true, true);
78
77
 
79
 
      if (session->makeGlobalReadLockBlockCommit()) /* Killed */
 
78
      if (make_global_read_lock_block_commit(session)) /* Killed */
80
79
      {
81
80
        /* Don't leave things in a half-locked state */
82
 
        session->unlockGlobalReadLock();
 
81
        unlock_global_read_lock(session);
83
82
        return true;
84
83
      }
85
84
    }
94
93
    session->refresh_status();
95
94
  }
96
95
 
97
 
  if (session && flush_global_status)
98
 
  {
99
 
    memset(&current_global_counters, 0, sizeof(current_global_counters));
100
 
    plugin::Logging::resetStats(session);
101
 
    session->refresh_status();
102
 
  }
103
 
 
104
 
  return result;
 
96
 return result;
105
97
}
106
98
 
107
99
}