Merge lp:~mordred/drizzle/bug544303 into lp:~drizzle-trunk/drizzle/development

Proposed by Monty Taylor
Status: Merged
Merged at revision: not available
Proposed branch: lp:~mordred/drizzle/bug544303
Merge into: lp:~drizzle-trunk/drizzle/development
Diff against target: 98 lines (+8/-13)
6 files modified
drizzled/plugin/storage_engine.cc (+1/-1)
drizzled/sql_base.cc (+2/-2)
drizzled/sql_table.cc (+1/-1)
drizzled/table_identifier.h (+2/-7)
plugin/schema_engine/schema.cc (+1/-1)
tests/test-run.pl (+1/-1)
To merge this branch: bzr merge lp:~mordred/drizzle/bug544303
Reviewer Review Type Date Requested Status
Brian Aker Approve
Stewart Smith (community) Approve
Review via email: mp+22524@code.launchpad.net

Description of the change

TableIdentifier was returning an object by value rather than by reference. I'm assuming that the GCC copy-on-write implementation inside of their std::string was allowing it to magically work on linux.

To post a comment you must log in.
Revision history for this message
Stewart Smith (stewart) wrote :

just scary. we assume the previous stuff i was looking at was dbx being ass, or really corrupted and confused.

review: Approve
Revision history for this message
Brian Aker (brianaker) wrote :

Awesome! Thanks for catching the typo :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'drizzled/plugin/storage_engine.cc'
2--- drizzled/plugin/storage_engine.cc 2010-03-27 04:01:18 +0000
3+++ drizzled/plugin/storage_engine.cc 2010-03-31 09:39:32 +0000
4@@ -518,7 +518,7 @@
5 {
6 int error= 1;
7 Table table;
8- TableShare share(identifier.getDBName().c_str(), 0, identifier.getTableName().c_str(), identifier.getPath().c_str());
9+ TableShare share(identifier.getSchemaName().c_str(), 0, identifier.getTableName().c_str(), identifier.getPath().c_str());
10 message::Table tmp_proto;
11
12 if (parse_table_proto(session, table_message, &share) || open_table_from_share(&session, &share, "", 0, 0, &table))
13
14=== modified file 'drizzled/sql_base.cc'
15--- drizzled/sql_base.cc 2010-03-25 19:25:04 +0000
16+++ drizzled/sql_base.cc 2010-03-31 09:39:32 +0000
17@@ -2299,8 +2299,8 @@
18 uint32_t key_length, path_length;
19 TableList table_list;
20
21- table_list.db= (char*) identifier.getDBName().c_str();
22- table_list.table_name= (char*) identifier.getTableName().c_str();
23+ table_list.db= const_cast<char*>(identifier.getSchemaName().c_str());
24+ table_list.table_name= const_cast<char*>(identifier.getTableName().c_str());
25 /* Create the cache_key for temporary tables */
26 key_length= table_list.create_table_def_key(cache_key);
27 path_length= identifier.getPath().length();
28
29=== modified file 'drizzled/sql_table.cc'
30--- drizzled/sql_table.cc 2010-03-26 20:07:44 +0000
31+++ drizzled/sql_table.cc 2010-03-31 09:39:32 +0000
32@@ -1438,7 +1438,7 @@
33 if (create_info->row_type == ROW_TYPE_DYNAMIC)
34 db_options|=HA_OPTION_PACK_RECORD;
35
36- set_table_default_charset(create_info, identifier.getDBName().c_str());
37+ set_table_default_charset(create_info, identifier.getSchemaName().c_str());
38
39 /* Build a Table object to pass down to the engine, and the do the actual create. */
40 if (not mysql_prepare_create_table(session, create_info, table_proto, alter_info,
41
42=== modified file 'drizzled/table_identifier.h'
43--- drizzled/table_identifier.h 2010-03-26 19:56:34 +0000
44+++ drizzled/table_identifier.h 2010-03-31 09:39:32 +0000
45@@ -106,17 +106,12 @@
46 path= new_path;
47 }
48
49- const std::string &getDBName() const
50- {
51- return db;
52- }
53-
54 const std::string &getSchemaName() const
55 {
56 return db;
57 }
58
59- const std::string getTableName() const
60+ const std::string &getTableName() const
61 {
62 return table_name;
63 }
64@@ -128,7 +123,7 @@
65 const char *type_str;
66
67 output << "TableIdentifier:(";
68- output << identifier.getDBName();
69+ output << identifier.getSchemaName();
70 output << ", ";
71 output << identifier.getTableName();
72 output << ", ";
73
74=== modified file 'plugin/schema_engine/schema.cc'
75--- plugin/schema_engine/schema.cc 2010-03-27 04:01:18 +0000
76+++ plugin/schema_engine/schema.cc 2010-03-31 09:39:32 +0000
77@@ -81,7 +81,7 @@
78 if (readTableFile(proto_path, table_proto))
79 return EEXIST;
80
81- return -1;
82+ return ENOENT;
83 }
84
85 void Schema::doGetTableNames(CachedDirectory &directory, string&, set<string>& set_of_names)
86
87=== modified file 'tests/test-run.pl'
88--- tests/test-run.pl 2010-03-23 23:50:56 +0000
89+++ tests/test-run.pl 2010-03-31 09:39:32 +0000
90@@ -3281,7 +3281,7 @@
91 {
92 # write init file for drizzled
93 mtr_tofile($dbx_init_file,
94- "stop in drizzled::mysql_parse\n" .
95+ "stop in __1cIdrizzledLmysql_parse6Fpn0AHSession_pkcI_v_\n" .
96 "runargs $str\n" .
97 "run\n" .
98 "\n");