~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/object_creation_ctx.h

  • Committer: Grant Limberg
  • Date: 2008-08-12 21:29:49 UTC
  • mfrom: (322 drizzle)
  • mto: (322.1.1 codestyle)
  • mto: This revision was merged to the branch mainline in revision 324.
  • Revision ID: grant@glsoftware.net-20080812212949-i7vl3lz5y7u7tdry
Merge from trunk

Did a global search and replace for MYSQL_* variables.  Renamed to DRIZZLE_*.

Renamed value of DRIZZLE_CONFIG_NAME from "my" to "drizzled"

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2000-2003 MySQL AB
2
 
 
3
 
   This program is free software; you can redistribute it and/or modify
4
 
   it under the terms of the GNU General Public License as published by
5
 
   the Free Software Foundation; version 2 of the License.
6
 
 
7
 
   This program is distributed in the hope that it will be useful,
8
 
   but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10
 
   GNU General Public License for more details.
11
 
 
12
 
   You should have received a copy of the GNU General Public License
13
 
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
 
 
16
 
#ifndef DRIZZLE_SERVER_OBJECT_CREATION_CTX_H
17
 
#define DRIZZLE_SERVER_OBJECT_CREATION_CTX_H
18
 
 
19
 
/**
20
 
 Object_creation_ctx -- interface for creation context of database objects
21
 
 (views, stored routines, events, triggers). Creation context -- is a set
22
 
 of attributes, that should be fixed at the creation time and then be used
23
 
 each time the object is parsed or executed.
24
 
*/
25
 
class Object_creation_ctx
26
 
{
27
 
public:
28
 
  Object_creation_ctx *set_n_backup(THD *thd);
29
 
 
30
 
  void restore_env(THD *thd, Object_creation_ctx *backup_ctx);
31
 
 
32
 
protected:
33
 
  Object_creation_ctx() {}
34
 
  virtual Object_creation_ctx *create_backup_ctx(THD *thd) const = 0;
35
 
 
36
 
  virtual void change_env(THD *thd) const = 0;
37
 
 
38
 
public:
39
 
  virtual ~Object_creation_ctx()
40
 
  { }
41
 
};
42
 
 
43
 
/*************************************************************************/
44
 
 
45
 
/**
46
 
 Default_object_creation_ctx -- default implementation of
47
 
 Object_creation_ctx.
48
 
*/
49
 
 
50
 
class Default_object_creation_ctx : public Object_creation_ctx
51
 
{
52
 
public:
53
 
  const CHARSET_INFO *get_client_cs()
54
 
  {
55
 
    return m_client_cs;
56
 
  }
57
 
 
58
 
  const CHARSET_INFO *get_connection_cl()
59
 
  {
60
 
    return m_connection_cl;
61
 
  }
62
 
 
63
 
protected:
64
 
  Default_object_creation_ctx(THD *thd);
65
 
 
66
 
  Default_object_creation_ctx(const CHARSET_INFO * const client_cs,
67
 
                              const CHARSET_INFO * const connection_cl);
68
 
 
69
 
protected:
70
 
  virtual Object_creation_ctx *create_backup_ctx(THD *thd) const;
71
 
 
72
 
  virtual void change_env(THD *thd) const;
73
 
 
74
 
protected:
75
 
  /**
76
 
    client_cs stores the value of character_set_client session variable.
77
 
    The only character set attribute is used.
78
 
 
79
 
    Client character set is included into query context, because we save
80
 
    query in the original character set, which is client character set. So,
81
 
    in order to parse the query properly we have to switch client character
82
 
    set on parsing.
83
 
  */
84
 
  const CHARSET_INFO *m_client_cs;
85
 
 
86
 
  /**
87
 
    connection_cl stores the value of collation_connection session
88
 
    variable. Both character set and collation attributes are used.
89
 
 
90
 
    Connection collation is included into query context, becase it defines
91
 
    the character set and collation of text literals in internal
92
 
    representation of query (item-objects).
93
 
  */
94
 
  const CHARSET_INFO *m_connection_cl;
95
 
};
96
 
 
97
 
#endif /* DRIZZLE_SERVER_OBJECT_CREATION_CTX_H */