~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/flush.h

  • Committer: Mats Kindahl
  • Date: 2008-08-26 07:32:59 UTC
  • mto: (489.1.2 codestyle)
  • mto: This revision was merged to the branch mainline in revision 491.
  • Revision ID: mats@mysql.com-20080826073259-9k4evtajgldgolli
Replaced use of thd_proc_info() macro with calls to
set_proc_info() and get_proc_info() internally.  Introduced
functions set_thd_proc_info() and get_thd_proc_info() for
external users, i.e., plug-ins.

The set_thd_proc_info() accepted callers info that can be used to
print debug output, but the information was not used. The return
value was changed to void and the old value is not fetched any
more. To be able to get the value of proc_info for external
users, the function get_thd_proc_info() was introduced.

The thd_proc_info() macro called set_thd_proc_info() but almost
never used the return value of set_thd_proc_info() so the macro
was replaced with a call of THD::set_proc_info().

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 
 *
4
 
 *  Copyright (C) 2009 Sun Microsystems
5
 
 *
6
 
 *  This program is free software; you can redistribute it and/or modify
7
 
 *  it under the terms of the GNU General Public License as published by
8
 
 *  the Free Software Foundation; either version 2 of the License, or
9
 
 *  (at your option) any later version.
10
 
 *
11
 
 *  This program is distributed in the hope that it will be useful,
12
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 
 *  GNU General Public License for more details.
15
 
 *
16
 
 *  You should have received a copy of the GNU General Public License
17
 
 *  along with this program; if not, write to the Free Software
18
 
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
 
 */
20
 
 
21
 
#ifndef DRIZZLED_STATEMENT_FLUSH_H
22
 
#define DRIZZLED_STATEMENT_FLUSH_H
23
 
 
24
 
#include <drizzled/statement.h>
25
 
 
26
 
namespace drizzled
27
 
{
28
 
class Session;
29
 
 
30
 
namespace statement
31
 
{
32
 
 
33
 
class Flush : public Statement
34
 
{
35
 
public:
36
 
  Flush(Session *in_session)
37
 
    :
38
 
    Statement(in_session),
39
 
    flush_log(false),
40
 
    flush_tables(false),
41
 
    flush_tables_with_read_lock(false),
42
 
    flush_status(false),
43
 
    flush_global_status(false)
44
 
  {}
45
 
 
46
 
  bool execute();
47
 
 
48
 
private:
49
 
  bool flush_log;
50
 
  bool flush_tables;
51
 
  bool flush_tables_with_read_lock;
52
 
  bool flush_status;
53
 
  bool flush_global_status;
54
 
 
55
 
public:
56
 
  void setFlushLog(bool f) { flush_log= f; }
57
 
  void setFlushTables(bool f) { flush_tables= f; }
58
 
  void setFlushTablesWithReadLock(bool f) {
59
 
    flush_tables= flush_tables_with_read_lock= f;
60
 
  }
61
 
  void setFlushStatus(bool f) { flush_status= f; }
62
 
  void setFlushGlobalStatus(bool f) { flush_global_status= f; }
63
 
 
64
 
private:
65
 
 
66
 
  /**
67
 
   * Reload/resets privileges and the different caches.
68
 
   *
69
 
   * @note Depending on 'options', it may be very bad to write the
70
 
   * query to the binlog (e.g. FLUSH SLAVE); this is a
71
 
   * pointer where reloadCache() will put 0 if
72
 
   * it thinks we really should not write to the binlog.
73
 
   * Otherwise it will put 1.
74
 
   * 
75
 
   * @return Error status code
76
 
   * @retval 0 Ok
77
 
   * @retval !=0  Error; session->killed is set or session->is_error() is true
78
 
   */
79
 
  bool reloadCache();
80
 
};
81
 
 
82
 
} /* namespace statement */
83
 
 
84
 
} /* namespace drizzled */
85
 
 
86
 
#endif /* DRIZZLED_STATEMENT_FLUSH_H */