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
=== modified file 'drizzled/include.am'
--- drizzled/include.am 2011-03-08 19:26:05 +0000
+++ drizzled/include.am 2011-03-23 03:28:29 +0000
@@ -299,6 +299,7 @@
299 drizzled/message.h \299 drizzled/message.h \
300 drizzled/message/cache.h \300 drizzled/message/cache.h \
301 drizzled/message/catalog.h \301 drizzled/message/catalog.h \
302 drizzled/message/replication_options.h \
302 drizzled/message/schema.h \303 drizzled/message/schema.h \
303 drizzled/message/table.h \304 drizzled/message/table.h \
304 drizzled/module/context.h \305 drizzled/module/context.h \
305306
=== modified file 'drizzled/message.h'
--- drizzled/message.h 2011-03-14 05:40:28 +0000
+++ drizzled/message.h 2011-03-23 03:28:29 +0000
@@ -22,6 +22,7 @@
2222
23#include <drizzled/message/table.h>23#include <drizzled/message/table.h>
24#include <drizzled/message/schema.h>24#include <drizzled/message/schema.h>
25#include <drizzled/message/replication_options.h>
25#if 026#if 0
26#include <drizzled/message/transaction.pb.h>27#include <drizzled/message/transaction.pb.h>
27#include <google/protobuf/text_format.h>28#include <google/protobuf/text_format.h>
@@ -46,23 +47,6 @@
46const std::string &type(drizzled::message::Table::ForeignKeyConstraint::ForeignKeyMatchOption type);47const std::string &type(drizzled::message::Table::ForeignKeyConstraint::ForeignKeyMatchOption type);
47const std::string &type(drizzled::message::Table::TableType type);48const std::string &type(drizzled::message::Table::TableType type);
4849
49template<class T> bool is_replicated(const T& reference)
50{
51 if (reference.has_replication_options() and
52 reference.replication_options().has_is_replicated())
53 {
54 return reference.replication_options().is_replicated();
55 }
56
57 return true;
58}
59
60template<class T> void set_is_replicated(T& reference, bool arg)
61{
62 message::ReplicationOptions *options= reference.mutable_replication_options();
63 options->set_is_replicated(arg);
64}
65
66#if 050#if 0
67std::ostream& operator<<(std::ostream& output, const message::Transaction &message);51std::ostream& operator<<(std::ostream& output, const message::Transaction &message);
68std::ostream& operator<<(std::ostream& output, const message::Table &message);52std::ostream& operator<<(std::ostream& output, const message::Table &message);
6953
=== added file 'drizzled/message/replication_options.h'
--- drizzled/message/replication_options.h 1970-01-01 00:00:00 +0000
+++ drizzled/message/replication_options.h 2011-03-23 03:28:29 +0000
@@ -0,0 +1,47 @@
1/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3 *
4 * Copyright (C) 2011 Brian Aker
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#pragma once
22
23#include <drizzled/message/replication_options.pb.h>
24
25namespace drizzled {
26namespace message {
27
28template<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
39template<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} /* namespace message */
46} /* namespace drizzled */
47
048
=== modified file 'drizzled/message/table.proto'
--- drizzled/message/table.proto 2011-02-16 22:38:23 +0000
+++ drizzled/message/table.proto 2011-03-23 03:28:29 +0000
@@ -35,7 +35,7 @@
35 optional bool checksum = 17;35 optional bool checksum = 17;
36 optional bool page_checksum = 18;36 optional bool page_checksum = 18;
37 optional bool delay_key_write = 19;37 optional bool delay_key_write = 19;
38 optional bool dont_replicate = 20;38 optional bool unused = 20;
39 }39 }
4040
41 message ForeignKeyConstraint {41 message ForeignKeyConstraint {
4242
=== modified file 'drizzled/sql_yacc.yy'
--- drizzled/sql_yacc.yy 2011-03-11 19:18:45 +0000
+++ drizzled/sql_yacc.yy 2011-03-23 03:28:29 +0000
@@ -991,19 +991,19 @@
991 statement::CreateSchema *statement= (statement::CreateSchema *)Lex.statement;991 statement::CreateSchema *statement= (statement::CreateSchema *)Lex.statement;
992 statement->schema_message.mutable_engine()->add_options()->set_name($1.str);992 statement->schema_message.mutable_engine()->add_options()->set_name($1.str);
993 }993 }
994 | REPLICATE opt_equal TRUE_SYM994 | REPLICATE '=' TRUE_SYM
995 {995 {
996 parser::buildReplicationOption(&Lex, true);996 parser::buildReplicationOption(&Lex, true);
997 }997 }
998 | REPLICATE opt_equal FALSE_SYM998 | REPLICATE '=' FALSE_SYM
999 {999 {
1000 parser::buildReplicationOption(&Lex, false);1000 parser::buildReplicationOption(&Lex, false);
1001 }1001 }
1002 | ident_or_text equal ident_or_text1002 | ident_or_text '=' ident_or_text
1003 {1003 {
1004 parser::buildSchemaOption(&Lex, $1.str, $3);1004 parser::buildSchemaOption(&Lex, $1.str, $3);
1005 }1005 }
1006 | ident_or_text equal ulonglong_num1006 | ident_or_text '=' ulonglong_num
1007 {1007 {
1008 parser::buildSchemaOption(&Lex, $1.str, $3);1008 parser::buildSchemaOption(&Lex, $1.str, $3);
1009 }1009 }
@@ -1038,7 +1038,7 @@
1038 custom_engine_option;1038 custom_engine_option;
10391039
1040custom_engine_option:1040custom_engine_option:
1041 ENGINE_SYM equal ident_or_text1041 ENGINE_SYM '=' ident_or_text
1042 {1042 {
1043 Lex.table()->mutable_engine()->set_name($3.str);1043 Lex.table()->mutable_engine()->set_name($3.str);
1044 }1044 }
@@ -1050,27 +1050,27 @@
1050 {1050 {
1051 Lex.table()->mutable_options()->set_auto_increment_value($3);1051 Lex.table()->mutable_options()->set_auto_increment_value($3);
1052 }1052 }
1053 | REPLICATE opt_equal TRUE_SYM1053 | REPLICATE '=' TRUE_SYM
1054 {1054 {
1055 message::set_is_replicated(*Lex.table(), true);1055 message::set_is_replicated(*Lex.table(), true);
1056 }1056 }
1057 | REPLICATE opt_equal FALSE_SYM1057 | REPLICATE '=' FALSE_SYM
1058 {1058 {
1059 message::set_is_replicated(*Lex.table(), false);1059 message::set_is_replicated(*Lex.table(), false);
1060 }1060 }
1061 | ROW_FORMAT_SYM equal row_format_or_text1061 | ROW_FORMAT_SYM '=' row_format_or_text
1062 {1062 {
1063 parser::buildEngineOption(&Lex, "ROW_FORMAT", $3);1063 parser::buildEngineOption(&Lex, "ROW_FORMAT", $3);
1064 }1064 }
1065 | FILE_SYM equal TEXT_STRING_sys1065 | FILE_SYM '=' TEXT_STRING_sys
1066 {1066 {
1067 parser::buildEngineOption(&Lex, "FILE", $3);1067 parser::buildEngineOption(&Lex, "FILE", $3);
1068 }1068 }
1069 | ident_or_text equal engine_option_value1069 | ident_or_text '=' engine_option_value
1070 {1070 {
1071 parser::buildEngineOption(&Lex, $1.str, $3);1071 parser::buildEngineOption(&Lex, $1.str, $3);
1072 }1072 }
1073 | ident_or_text equal ulonglong_num1073 | ident_or_text '=' ulonglong_num
1074 {1074 {
1075 parser::buildEngineOption(&Lex, $1.str, $3);1075 parser::buildEngineOption(&Lex, $1.str, $3);
1076 }1076 }
@@ -4334,7 +4334,7 @@
43344334
4335opt_equal:4335opt_equal:
4336 /* empty */ {}4336 /* empty */ {}
4337 | equal {}4337 | '=' {}
4338 ;4338 ;
43394339
4340no_braces:4340no_braces:
43414341
=== modified file 'plugin/innobase/dict/create_replication.cc'
--- plugin/innobase/dict/create_replication.cc 2011-02-22 23:59:05 +0000
+++ plugin/innobase/dict/create_replication.cc 2011-03-23 03:28:29 +0000
@@ -128,7 +128,7 @@
128 drizzled::message::Table::TableOptions *options= table_message->mutable_options();128 drizzled::message::Table::TableOptions *options= table_message->mutable_options();
129 options->set_collation_id(drizzled::my_charset_bin.number);129 options->set_collation_id(drizzled::my_charset_bin.number);
130 options->set_collation(drizzled::my_charset_bin.name);130 options->set_collation(drizzled::my_charset_bin.name);
131 options->set_dont_replicate(true);131 drizzled::message::set_is_replicated(*table_message, false);
132132
133 drizzled::message::Table::Field *field= table_message->add_field();133 drizzled::message::Table::Field *field= table_message->add_field();
134 field->set_name("ID");134 field->set_name("ID");

Subscribers

People subscribed via source and target branches