Merge lp:~stewart/drizzle/bug707323 into lp:drizzle

Proposed by Stewart Smith
Status: Merged
Merged at revision: 2640
Proposed branch: lp:~stewart/drizzle/bug707323
Merge into: lp:drizzle
Diff against target: 207 lines (+26/-19)
7 files modified
client/drizzletest.cc (+1/-1)
drizzled/drizzled.cc (+1/-1)
drizzled/internal/my_static.cc (+3/-1)
drizzled/internal/my_sys.h (+2/-0)
drizzled/plugin/storage_engine.cc (+11/-6)
drizzled/plugin/storage_engine.h (+1/-1)
plugin/innobase/handler/ha_innodb.cc (+7/-9)
To merge this branch: bzr merge lp:~stewart/drizzle/bug707323
Reviewer Review Type Date Requested Status
Drizzle Trunk Pending
Review via email: mp+179116@code.launchpad.net

Description of the change

use API calls rather than exported variables

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 'client/drizzletest.cc'
--- client/drizzletest.cc 2013-02-14 11:36:21 +0000
+++ client/drizzletest.cc 2013-08-08 07:32:36 +0000
@@ -2355,7 +2355,7 @@
2355 mkdir_args, sizeof(mkdir_args)/sizeof(struct command_arg),2355 mkdir_args, sizeof(mkdir_args)/sizeof(struct command_arg),
2356 ' ');2356 ' ');
23572357
2358 int error= mkdir(ds_dirname.c_str(), (0777 & internal::my_umask_dir)) != 0;2358 int error= mkdir(ds_dirname.c_str(), (0777 & internal::get_my_umask_dir())) != 0;
2359 handle_command_error(command, error);2359 handle_command_error(command, error);
2360}2360}
23612361
23622362
=== modified file 'drizzled/drizzled.cc'
--- drizzled/drizzled.cc 2013-02-28 22:27:42 +0000
+++ drizzled/drizzled.cc 2013-08-08 07:32:36 +0000
@@ -1099,7 +1099,7 @@
10991099
1100bool init_variables_before_daemonizing(int argc, char **argv)1100bool init_variables_before_daemonizing(int argc, char **argv)
1101{1101{
1102 umask(((~internal::my_umask) & 0666));1102 umask(((~internal::get_my_umask()) & 0666));
1103 decimal_zero.set_zero(); // set decimal_zero constant;1103 decimal_zero.set_zero(); // set decimal_zero constant;
1104 tzset(); // Set tzname1104 tzset(); // Set tzname
11051105
11061106
=== modified file 'drizzled/internal/my_static.cc'
--- drizzled/internal/my_static.cc 2013-02-27 02:30:19 +0000
+++ drizzled/internal/my_static.cc 2013-08-08 07:32:36 +0000
@@ -37,8 +37,10 @@
37const char *my_progname=0;37const char *my_progname=0;
38char curr_dir[FN_REFLEN]= {0},38char curr_dir[FN_REFLEN]= {0},
39 home_dir_buff[FN_REFLEN]= {0};39 home_dir_buff[FN_REFLEN]= {0};
40DRIZZLED_API int my_umask=0664;40int my_umask=0664;
41int get_my_umask() { return my_umask; }
41int my_umask_dir=0777;42int my_umask_dir=0777;
43int get_my_umask_dir() { return my_umask_dir; }
4244
43 /* From mf_brkhant */45 /* From mf_brkhant */
44volatile int _my_signals=0;46volatile int _my_signals=0;
4547
=== modified file 'drizzled/internal/my_sys.h'
--- drizzled/internal/my_sys.h 2013-02-27 02:30:19 +0000
+++ drizzled/internal/my_sys.h 2013-08-08 07:32:36 +0000
@@ -206,6 +206,8 @@
206DRIZZLED_API void my_store_ptr(unsigned char *buff, size_t pack_length, my_off_t pos);206DRIZZLED_API void my_store_ptr(unsigned char *buff, size_t pack_length, my_off_t pos);
207DRIZZLED_API my_off_t my_get_ptr(unsigned char *ptr, size_t pack_length);207DRIZZLED_API my_off_t my_get_ptr(unsigned char *ptr, size_t pack_length);
208int create_temp_file(char *to, const char *dir, const char *pfx, myf MyFlags);208int create_temp_file(char *to, const char *dir, const char *pfx, myf MyFlags);
209int get_my_umask();
210int get_my_umask_dir();
209211
210} /* namespace internal */212} /* namespace internal */
211} /* namespace drizzled */213} /* namespace drizzled */
212214
=== modified file 'drizzled/plugin/storage_engine.cc'
--- drizzled/plugin/storage_engine.cc 2012-07-11 14:06:00 +0000
+++ drizzled/plugin/storage_engine.cc 2013-08-08 07:32:36 +0000
@@ -75,6 +75,11 @@
75 return g_schema_engines;75 return g_schema_engines;
76}76}
7777
78const std::string defaultTableDefinitionFileExt()
79{
80 return DEFAULT_DEFINITION_FILE_EXT;
81}
82
78StorageEngine::StorageEngine(const std::string &name_arg,83StorageEngine::StorageEngine(const std::string &name_arg,
79 const std::bitset<HTON_BIT_SIZE> &flags_arg) :84 const std::bitset<HTON_BIT_SIZE> &flags_arg) :
80 Plugin(name_arg, "StorageEngine"),85 Plugin(name_arg, "StorageEngine"),
@@ -150,7 +155,7 @@
150155
151 if (engine->getTableDefinitionFileExtension().length())156 if (engine->getTableDefinitionFileExtension().length())
152 {157 {
153 assert(engine->getTableDefinitionFileExtension().length() == DEFAULT_DEFINITION_FILE_EXT.length());158 assert(engine->getTableDefinitionFileExtension().length() == plugin::defaultTableDefinitionFileExt().length());
154 set_of_table_definition_ext.insert(engine->getTableDefinitionFileExtension());159 set_of_table_definition_ext.insert(engine->getTableDefinitionFileExtension());
155 }160 }
156161
@@ -539,7 +544,7 @@
539544
540 /* We remove the file extension. */545 /* We remove the file extension. */
541 length= entry->filename.length();546 length= entry->filename.length();
542 entry->filename.resize(length - DEFAULT_DEFINITION_FILE_EXT.length());547 entry->filename.resize(length - plugin::defaultTableDefinitionFileExt().length());
543548
544 path+= directory;549 path+= directory;
545 path+= FN_LIBCHAR;550 path+= FN_LIBCHAR;
@@ -842,7 +847,7 @@
842{847{
843 std::string path(identifier.getPath());848 std::string path(identifier.getPath());
844849
845 path.append(DEFAULT_DEFINITION_FILE_EXT);850 path.append(plugin::defaultTableDefinitionFileExt());
846851
847 return internal::my_delete(path.c_str(), MYF(0));852 return internal::my_delete(path.c_str(), MYF(0));
848}853}
@@ -853,8 +858,8 @@
853 std::string src_path(src.getPath());858 std::string src_path(src.getPath());
854 std::string dest_path(dest.getPath());859 std::string dest_path(dest.getPath());
855860
856 src_path.append(DEFAULT_DEFINITION_FILE_EXT);861 src_path.append(plugin::defaultTableDefinitionFileExt());
857 dest_path.append(DEFAULT_DEFINITION_FILE_EXT);862 dest_path.append(plugin::defaultTableDefinitionFileExt());
858863
859 bool was_read= StorageEngine::readTableFile(src_path.c_str(), table_message);864 bool was_read= StorageEngine::readTableFile(src_path.c_str(), table_message);
860865
@@ -881,7 +886,7 @@
881 char definition_file_tmp[FN_REFLEN];886 char definition_file_tmp[FN_REFLEN];
882 std::string file_name(identifier.getPath());887 std::string file_name(identifier.getPath());
883888
884 file_name.append(DEFAULT_DEFINITION_FILE_EXT);889 file_name.append(plugin::defaultTableDefinitionFileExt());
885890
886 snprintf(definition_file_tmp, sizeof(definition_file_tmp), "%sXXXXXX", file_name.c_str());891 snprintf(definition_file_tmp, sizeof(definition_file_tmp), "%sXXXXXX", file_name.c_str());
887892
888893
=== modified file 'drizzled/plugin/storage_engine.h'
--- drizzled/plugin/storage_engine.h 2013-03-03 01:46:08 +0000
+++ drizzled/plugin/storage_engine.h 2013-08-08 07:32:36 +0000
@@ -109,8 +109,8 @@
109typedef std::set<std::string> TableNameList;109typedef std::set<std::string> TableNameList;
110110
111extern const std::string UNKNOWN_STRING;111extern const std::string UNKNOWN_STRING;
112extern DRIZZLED_API const std::string DEFAULT_DEFINITION_FILE_EXT;
113112
113const std::string defaultTableDefinitionFileExt();
114114
115/*115/*
116 StorageEngine is a singleton structure - one instance per storage engine -116 StorageEngine is a singleton structure - one instance per storage engine -
117117
=== modified file 'plugin/innobase/handler/ha_innodb.cc'
--- plugin/innobase/handler/ha_innodb.cc 2013-03-03 02:44:39 +0000
+++ plugin/innobase/handler/ha_innodb.cc 2013-08-08 07:32:36 +0000
@@ -381,8 +381,6 @@
381 NULL381 NULL
382};382};
383383
384#define DEFAULT_FILE_EXTENSION ".dfe" // Deep Fried Elephant
385
386static INNOBASE_SHARE *get_share(const char *table_name);384static INNOBASE_SHARE *get_share(const char *table_name);
387static void free_share(INNOBASE_SHARE *share);385static void free_share(INNOBASE_SHARE *share);
388386
@@ -398,7 +396,7 @@
398 HTON_TABLE_SCAN_ON_INDEX |396 HTON_TABLE_SCAN_ON_INDEX |
399 HTON_HAS_FOREIGN_KEYS)397 HTON_HAS_FOREIGN_KEYS)
400 {398 {
401 table_definition_ext= plugin::DEFAULT_DEFINITION_FILE_EXT;399 table_definition_ext= plugin::defaultTableDefinitionFileExt();
402 addAlias("INNOBASE");400 addAlias("INNOBASE");
403 }401 }
404402
@@ -626,7 +624,7 @@
626624
627 const char *ext= strchr(filename->c_str(), '.');625 const char *ext= strchr(filename->c_str(), '.');
628626
629 if (ext == NULL || system_charset_info->strcasecmp(ext, DEFAULT_FILE_EXTENSION) ||627 if (ext == NULL || system_charset_info->strcasecmp(ext, plugin::defaultTableDefinitionFileExt().c_str()) ||
630 (filename->compare(0, strlen(TMP_FILE_PREFIX), TMP_FILE_PREFIX) == 0))628 (filename->compare(0, strlen(TMP_FILE_PREFIX), TMP_FILE_PREFIX) == 0))
631 { }629 { }
632 else630 else
@@ -653,7 +651,7 @@
653bool InnobaseEngine::doDoesTableExist(Session &session, const identifier::Table &identifier)651bool InnobaseEngine::doDoesTableExist(Session &session, const identifier::Table &identifier)
654{652{
655 string proto_path(identifier.getPath());653 string proto_path(identifier.getPath());
656 proto_path.append(DEFAULT_FILE_EXTENSION);654 proto_path.append(plugin::defaultTableDefinitionFileExt());
657655
658 if (session.getMessageCache().doesTableMessageExist(identifier))656 if (session.getMessageCache().doesTableMessageExist(identifier))
659 return true;657 return true;
@@ -677,7 +675,7 @@
677 message::Table &table_proto)675 message::Table &table_proto)
678{676{
679 string proto_path(identifier.getPath());677 string proto_path(identifier.getPath());
680 proto_path.append(DEFAULT_FILE_EXTENSION);678 proto_path.append(plugin::defaultTableDefinitionFileExt());
681679
682 // First we check the temporary tables.680 // First we check the temporary tables.
683 if (session.getMessageCache().getTableMessage(identifier, table_proto))681 if (session.getMessageCache().getTableMessage(identifier, table_proto))
@@ -2366,7 +2364,7 @@
2366 goto error;2364 goto error;
2367 }2365 }
23682366
2369 os_innodb_umask = (ulint)internal::my_umask;2367 os_innodb_umask = (ulint)internal::get_my_umask();
23702368
23712369
2372 /* Set InnoDB initialization parameters according to the values2370 /* Set InnoDB initialization parameters according to the values
@@ -6808,7 +6806,7 @@
6808 {6806 {
6809 string path(identifier.getPath());6807 string path(identifier.getPath());
68106808
6811 path.append(DEFAULT_FILE_EXTENSION);6809 path.append(plugin::defaultTableDefinitionFileExt());
68126810
6813 (void)internal::my_delete(path.c_str(), MYF(0));6811 (void)internal::my_delete(path.c_str(), MYF(0));
6814 }6812 }
@@ -6817,7 +6815,7 @@
6817 {6815 {
6818 string path(identifier.getPath());6816 string path(identifier.getPath());
68196817
6820 path.append(DEFAULT_FILE_EXTENSION);6818 path.append(plugin::defaultTableDefinitionFileExt());
68216819
6822 (void)internal::my_delete(path.c_str(), MYF(0));6820 (void)internal::my_delete(path.c_str(), MYF(0));
6823 }6821 }

Subscribers

People subscribed via source and target branches

to all changes: