Merge lp:~brianaker/drizzle/fix-equal-bad-proto-elliot into lp:drizzle/7.0

Proposed by Brian Aker
Status: Merged
Approved by: Brian Aker
Approved revision: 2241
Merged at revision: 2240
Proposed branch: lp:~brianaker/drizzle/fix-equal-bad-proto-elliot
Merge into: lp:drizzle/7.0
Diff against target: 205 lines (+63/-31)
6 files modified
drizzled/include.am (+1/-0)
drizzled/message.h (+1/-17)
drizzled/message/replication_options.h (+47/-0)
drizzled/message/table.proto (+1/-1)
drizzled/sql_yacc.yy (+12/-12)
plugin/innobase/dict/create_replication.cc (+1/-1)
To merge this branch: bzr merge lp:~brianaker/drizzle/fix-equal-bad-proto-elliot
Reviewer Review Type Date Requested Status
Drizzle Developers Pending
Review via email: mp+54461@code.launchpad.net

Description of the change

This fixes two issues in the GA:

1) In the parser we were using wrong = for some cases of options.

2) For the replication table we used the original proto option over the one that was used in the final GA.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'drizzled/include.am'
2--- drizzled/include.am 2011-03-08 19:26:05 +0000
3+++ drizzled/include.am 2011-03-23 03:28:29 +0000
4@@ -299,6 +299,7 @@
5 drizzled/message.h \
6 drizzled/message/cache.h \
7 drizzled/message/catalog.h \
8+ drizzled/message/replication_options.h \
9 drizzled/message/schema.h \
10 drizzled/message/table.h \
11 drizzled/module/context.h \
12
13=== modified file 'drizzled/message.h'
14--- drizzled/message.h 2011-03-14 05:40:28 +0000
15+++ drizzled/message.h 2011-03-23 03:28:29 +0000
16@@ -22,6 +22,7 @@
17
18 #include <drizzled/message/table.h>
19 #include <drizzled/message/schema.h>
20+#include <drizzled/message/replication_options.h>
21 #if 0
22 #include <drizzled/message/transaction.pb.h>
23 #include <google/protobuf/text_format.h>
24@@ -46,23 +47,6 @@
25 const std::string &type(drizzled::message::Table::ForeignKeyConstraint::ForeignKeyMatchOption type);
26 const std::string &type(drizzled::message::Table::TableType type);
27
28-template<class T> bool is_replicated(const T& reference)
29-{
30- if (reference.has_replication_options() and
31- reference.replication_options().has_is_replicated())
32- {
33- return reference.replication_options().is_replicated();
34- }
35-
36- return true;
37-}
38-
39-template<class T> void set_is_replicated(T& reference, bool arg)
40-{
41- message::ReplicationOptions *options= reference.mutable_replication_options();
42- options->set_is_replicated(arg);
43-}
44-
45 #if 0
46 std::ostream& operator<<(std::ostream& output, const message::Transaction &message);
47 std::ostream& operator<<(std::ostream& output, const message::Table &message);
48
49=== added file 'drizzled/message/replication_options.h'
50--- drizzled/message/replication_options.h 1970-01-01 00:00:00 +0000
51+++ drizzled/message/replication_options.h 2011-03-23 03:28:29 +0000
52@@ -0,0 +1,47 @@
53+/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
54+ * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
55+ *
56+ * Copyright (C) 2011 Brian Aker
57+ *
58+ * This program is free software; you can redistribute it and/or modify
59+ * it under the terms of the GNU General Public License as published by
60+ * the Free Software Foundation; either version 2 of the License, or
61+ * (at your option) any later version.
62+ *
63+ * This program is distributed in the hope that it will be useful,
64+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
65+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
66+ * GNU General Public License for more details.
67+ *
68+ * You should have received a copy of the GNU General Public License
69+ * along with this program; if not, write to the Free Software
70+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
71+ */
72+
73+#pragma once
74+
75+#include <drizzled/message/replication_options.pb.h>
76+
77+namespace drizzled {
78+namespace message {
79+
80+template<class T> bool is_replicated(const T& reference)
81+{
82+ if (reference.has_replication_options() and
83+ reference.replication_options().has_is_replicated())
84+ {
85+ return reference.replication_options().is_replicated();
86+ }
87+
88+ return true;
89+}
90+
91+template<class T> void set_is_replicated(T& reference, bool arg)
92+{
93+ message::ReplicationOptions *options= reference.mutable_replication_options();
94+ options->set_is_replicated(arg);
95+}
96+
97+} /* namespace message */
98+} /* namespace drizzled */
99+
100
101=== modified file 'drizzled/message/table.proto'
102--- drizzled/message/table.proto 2011-02-16 22:38:23 +0000
103+++ drizzled/message/table.proto 2011-03-23 03:28:29 +0000
104@@ -35,7 +35,7 @@
105 optional bool checksum = 17;
106 optional bool page_checksum = 18;
107 optional bool delay_key_write = 19;
108- optional bool dont_replicate = 20;
109+ optional bool unused = 20;
110 }
111
112 message ForeignKeyConstraint {
113
114=== modified file 'drizzled/sql_yacc.yy'
115--- drizzled/sql_yacc.yy 2011-03-11 19:18:45 +0000
116+++ drizzled/sql_yacc.yy 2011-03-23 03:28:29 +0000
117@@ -991,19 +991,19 @@
118 statement::CreateSchema *statement= (statement::CreateSchema *)Lex.statement;
119 statement->schema_message.mutable_engine()->add_options()->set_name($1.str);
120 }
121- | REPLICATE opt_equal TRUE_SYM
122+ | REPLICATE '=' TRUE_SYM
123 {
124 parser::buildReplicationOption(&Lex, true);
125 }
126- | REPLICATE opt_equal FALSE_SYM
127+ | REPLICATE '=' FALSE_SYM
128 {
129 parser::buildReplicationOption(&Lex, false);
130 }
131- | ident_or_text equal ident_or_text
132+ | ident_or_text '=' ident_or_text
133 {
134 parser::buildSchemaOption(&Lex, $1.str, $3);
135 }
136- | ident_or_text equal ulonglong_num
137+ | ident_or_text '=' ulonglong_num
138 {
139 parser::buildSchemaOption(&Lex, $1.str, $3);
140 }
141@@ -1038,7 +1038,7 @@
142 custom_engine_option;
143
144 custom_engine_option:
145- ENGINE_SYM equal ident_or_text
146+ ENGINE_SYM '=' ident_or_text
147 {
148 Lex.table()->mutable_engine()->set_name($3.str);
149 }
150@@ -1050,27 +1050,27 @@
151 {
152 Lex.table()->mutable_options()->set_auto_increment_value($3);
153 }
154- | REPLICATE opt_equal TRUE_SYM
155+ | REPLICATE '=' TRUE_SYM
156 {
157 message::set_is_replicated(*Lex.table(), true);
158 }
159- | REPLICATE opt_equal FALSE_SYM
160+ | REPLICATE '=' FALSE_SYM
161 {
162 message::set_is_replicated(*Lex.table(), false);
163 }
164- | ROW_FORMAT_SYM equal row_format_or_text
165+ | ROW_FORMAT_SYM '=' row_format_or_text
166 {
167 parser::buildEngineOption(&Lex, "ROW_FORMAT", $3);
168 }
169- | FILE_SYM equal TEXT_STRING_sys
170+ | FILE_SYM '=' TEXT_STRING_sys
171 {
172 parser::buildEngineOption(&Lex, "FILE", $3);
173 }
174- | ident_or_text equal engine_option_value
175+ | ident_or_text '=' engine_option_value
176 {
177 parser::buildEngineOption(&Lex, $1.str, $3);
178 }
179- | ident_or_text equal ulonglong_num
180+ | ident_or_text '=' ulonglong_num
181 {
182 parser::buildEngineOption(&Lex, $1.str, $3);
183 }
184@@ -4334,7 +4334,7 @@
185
186 opt_equal:
187 /* empty */ {}
188- | equal {}
189+ | '=' {}
190 ;
191
192 no_braces:
193
194=== modified file 'plugin/innobase/dict/create_replication.cc'
195--- plugin/innobase/dict/create_replication.cc 2011-02-22 23:59:05 +0000
196+++ plugin/innobase/dict/create_replication.cc 2011-03-23 03:28:29 +0000
197@@ -128,7 +128,7 @@
198 drizzled::message::Table::TableOptions *options= table_message->mutable_options();
199 options->set_collation_id(drizzled::my_charset_bin.number);
200 options->set_collation(drizzled::my_charset_bin.name);
201- options->set_dont_replicate(true);
202+ drizzled::message::set_is_replicated(*table_message, false);
203
204 drizzled::message::Table::Field *field= table_message->add_field();
205 field->set_name("ID");

Subscribers

People subscribed via source and target branches