~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/message/command_transform.h

  • Committer: Jay Pipes
  • Date: 2009-10-07 23:59:47 UTC
  • mto: (1234.1.1 push) (1237.2.10 push)
  • mto: This revision was merged to the branch mainline in revision 1193.
  • Revision ID: jpipes@serialcoder-20091007235947-18simrecnzwv8t1q
Phase 2 new replication work:

* Removes old replication.proto file, old command_transform library
* Removes use of korr.h macro calls in favor of GPB's CodedOutputStream
  API.
* Updates transaction_log, default_replicator, and filtered_replicator module
  to use new Transaction message.
* Updates ReplicationServices to construct the new Transaction messages and
  associated Statement sub-messages
* Corrects transaction boundaries.  AUTOCOMMIT now works properly, and I have
  added a new test case to verify AUTOCOMMIT variable modification of the way
  in which Transaction messages are bundled up and sent across to replicators.

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
 
 *  Authors:
7
 
 *
8
 
 *    Jay Pipes <joinfu@sun.com>
9
 
 *
10
 
 *  This program is free software; you can redistribute it and/or modify
11
 
 *  it under the terms of the GNU General Public License as published by
12
 
 *  the Free Software Foundation; version 2 of the License.
13
 
 *
14
 
 *  This program is distributed in the hope that it will be useful,
15
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 
 *  GNU General Public License for more details.
18
 
 *
19
 
 *  You should have received a copy of the GNU General Public License
20
 
 *  along with this program; if not, write to the Free Software
21
 
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
22
 
 */
23
 
 
24
 
/**
25
 
 * @file
26
 
 *
27
 
 * Declarations of various routines that can be used to convert
28
 
 * Command messages to other formats, including SQL statements.
29
 
 */
30
 
 
31
 
#ifndef DRIZZLED_MESSAGE_COMMAND_TRANSFORM_H
32
 
#define DRIZZLED_MESSAGE_COMMAND_TRANSFORM_H
33
 
 
34
 
#include <string>
35
 
#include <bitset>
36
 
 
37
 
namespace drizzled
38
 
{
39
 
namespace message
40
 
{
41
 
/* some forward declarations */
42
 
class Command;
43
 
 
44
 
enum CommandTransformSqlVariant
45
 
{
46
 
  ANSI,
47
 
  MYSQL_4,
48
 
  MYSQL_5,
49
 
  DRIZZLE
50
 
};
51
 
 
52
 
/**
53
 
 * This function looks at the Command
54
 
 * message and appends a correctly-formatted SQL
55
 
 * statement to the supplied destination string.
56
 
 *
57
 
 * @param Command message to transform
58
 
 * @param Destination string to append SQL to
59
 
 */
60
 
void transformCommand2Sql(const Command &source,
61
 
                          std::string *destination,
62
 
                          enum CommandTransformSqlVariant sql_variant= DRIZZLE);
63
 
 
64
 
} /* end namespace drizzled::message */
65
 
} /* end namespace drizzled */
66
 
 
67
 
#endif /* DRIZZLED_MESSAGE_COMMAND_TRANSFORM_H */