Merge lp:~stewart/drizzle/remove-more-unireg into lp:drizzle
- remove-more-unireg
- Merge into 7.2
Proposed by
Stewart Smith
Status: | Merged |
---|---|
Merged at revision: | 2629 |
Proposed branch: | lp:~stewart/drizzle/remove-more-unireg |
Merge into: | lp:drizzle |
Diff against target: |
789 lines (+94/-95) 5 files modified
drizzled/drizzled.cc (+68/-68) drizzled/drizzled_abort.h (+10/-11) drizzled/include.am (+1/-1) drizzled/main.cc (+11/-11) drizzled/module/registry.h (+4/-4) |
To merge this branch: | bzr merge lp:~stewart/drizzle/remove-more-unireg |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Stewart Smith (community) | Approve | ||
Drizzle Trunk | Pending | ||
Review via email: mp+150857@code.launchpad.net |
Commit message
Description of the change
unireg.h now has nothing to do with UNIREG. Let's stop confusing people.
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/drizzled.cc' | |||
2 | --- drizzled/drizzled.cc 2012-12-13 18:45:19 +0000 | |||
3 | +++ drizzled/drizzled.cc 2013-02-27 17:19:19 +0000 | |||
4 | @@ -77,7 +77,7 @@ | |||
5 | 77 | #include <drizzled/statistics_variables.h> | 77 | #include <drizzled/statistics_variables.h> |
6 | 78 | #include <drizzled/table/cache.h> | 78 | #include <drizzled/table/cache.h> |
7 | 79 | #include <drizzled/temporal_format.h> /* For init_temporal_formats() */ | 79 | #include <drizzled/temporal_format.h> /* For init_temporal_formats() */ |
9 | 80 | #include <drizzled/unireg.h> | 80 | #include <drizzled/drizzled_abort.h> |
10 | 81 | #include <plugin/myisam/myisam.h> | 81 | #include <plugin/myisam/myisam.h> |
11 | 82 | #include <drizzled/typelib.h> | 82 | #include <drizzled/typelib.h> |
12 | 83 | #include <drizzled/visibility.h> | 83 | #include <drizzled/visibility.h> |
13 | @@ -437,7 +437,7 @@ | |||
14 | 437 | (void)close(file); /* We can ignore the error, since we are going to error anyway at this point */ | 437 | (void)close(file); /* We can ignore the error, since we are going to error anyway at this point */ |
15 | 438 | } | 438 | } |
16 | 439 | 439 | ||
18 | 440 | unireg_abort << "Can't start server, was unable to create PID file: " << pid_file.string(); | 440 | drizzled_abort << "Can't start server, was unable to create PID file: " << pid_file.string(); |
19 | 441 | } | 441 | } |
20 | 442 | 442 | ||
21 | 443 | #ifdef DEFINED_O_CLOEXEC | 443 | #ifdef DEFINED_O_CLOEXEC |
22 | @@ -524,20 +524,20 @@ | |||
23 | 524 | } | 524 | } |
24 | 525 | } | 525 | } |
25 | 526 | 526 | ||
28 | 527 | static bool unireg_startup_completed= false; | 527 | static bool drizzled_startup_completed= false; |
29 | 528 | void unireg_startup_finished() | 528 | void drizzled_startup_finished() |
30 | 529 | { | 529 | { |
32 | 530 | unireg_startup_completed= true; | 530 | drizzled_startup_completed= true; |
33 | 531 | } | 531 | } |
34 | 532 | 532 | ||
36 | 533 | void unireg_exit() | 533 | void drizzled_exit() |
37 | 534 | { | 534 | { |
38 | 535 | internal::my_end(); | 535 | internal::my_end(); |
40 | 536 | assert(unireg_startup_completed == false); | 536 | assert(drizzled_startup_completed == false); |
41 | 537 | exit(EXIT_SUCCESS); | 537 | exit(EXIT_SUCCESS); |
42 | 538 | } | 538 | } |
43 | 539 | 539 | ||
45 | 540 | void unireg_actual_abort(const char *file, int line, const char *func, const std::string& message) | 540 | void drizzled_actual_abort(const char *file, int line, const char *func, const std::string& message) |
46 | 541 | { | 541 | { |
47 | 542 | std::stringstream temp; | 542 | std::stringstream temp; |
48 | 543 | temp << _("Aborting:") << "\"" << message << "\"" << ". Abort was called from " << file << ":" << line << " in " << func << "()"; | 543 | temp << _("Aborting:") << "\"" << message << "\"" << ". Abort was called from " << file << ":" << line << " in " << func << "()"; |
49 | @@ -546,7 +546,7 @@ | |||
50 | 546 | clean_up(vm.count("help") == 0); | 546 | clean_up(vm.count("help") == 0); |
51 | 547 | internal::my_end(); | 547 | internal::my_end(); |
52 | 548 | 548 | ||
54 | 549 | assert(unireg_startup_completed == false); | 549 | assert(drizzled_startup_completed == false); |
55 | 550 | exit(EXIT_FAILURE); | 550 | exit(EXIT_FAILURE); |
56 | 551 | } | 551 | } |
57 | 552 | 552 | ||
58 | @@ -607,7 +607,7 @@ | |||
59 | 607 | } | 607 | } |
60 | 608 | if (not user) | 608 | if (not user) |
61 | 609 | { | 609 | { |
63 | 610 | unireg_abort << _("drizzled cannot be run as root, use --user to start drizzled up as another user"); | 610 | drizzled_abort << _("drizzled cannot be run as root, use --user to start drizzled up as another user"); |
64 | 611 | } | 611 | } |
65 | 612 | 612 | ||
66 | 613 | if (strcmp(user, "root") == 0) | 613 | if (strcmp(user, "root") == 0) |
67 | @@ -635,7 +635,7 @@ | |||
68 | 635 | 635 | ||
69 | 636 | if (failed) | 636 | if (failed) |
70 | 637 | { | 637 | { |
72 | 638 | unireg_abort << "Fatal error: Can't change to run as user '" << user << "' ; Please check that the user exists!"; | 638 | drizzled_abort << "Fatal error: Can't change to run as user '" << user << "' ; Please check that the user exists!"; |
73 | 639 | 639 | ||
74 | 640 | #ifdef PR_SET_DUMPABLE | 640 | #ifdef PR_SET_DUMPABLE |
75 | 641 | if (getDebug().test(debug::CORE_ON_SIGNAL)) | 641 | if (getDebug().test(debug::CORE_ON_SIGNAL)) |
76 | @@ -657,11 +657,11 @@ | |||
77 | 657 | initgroups(user, user_info_arg->pw_gid); | 657 | initgroups(user, user_info_arg->pw_gid); |
78 | 658 | if (setgid(user_info_arg->pw_gid) == -1) | 658 | if (setgid(user_info_arg->pw_gid) == -1) |
79 | 659 | { | 659 | { |
81 | 660 | unireg_abort << _("Set process group ID failed ") << strerror(errno); | 660 | drizzled_abort << _("Set process group ID failed ") << strerror(errno); |
82 | 661 | } | 661 | } |
83 | 662 | if (setuid(user_info_arg->pw_uid) == -1) | 662 | if (setuid(user_info_arg->pw_uid) == -1) |
84 | 663 | { | 663 | { |
86 | 664 | unireg_abort << _("Set process user ID failed") << strerror(errno); | 664 | drizzled_abort << _("Set process user ID failed") << strerror(errno); |
87 | 665 | } | 665 | } |
88 | 666 | } | 666 | } |
89 | 667 | 667 | ||
90 | @@ -672,7 +672,7 @@ | |||
91 | 672 | { | 672 | { |
92 | 673 | if ((chroot(path) == -1) or chdir("/") == 0) | 673 | if ((chroot(path) == -1) or chdir("/") == 0) |
93 | 674 | { | 674 | { |
95 | 675 | unireg_abort << _("Process chroot failed"); | 675 | drizzled_abort << _("Process chroot failed"); |
96 | 676 | } | 676 | } |
97 | 677 | } | 677 | } |
98 | 678 | 678 | ||
99 | @@ -771,7 +771,7 @@ | |||
100 | 771 | global_system_variables.auto_increment_increment= 1; | 771 | global_system_variables.auto_increment_increment= 1; |
101 | 772 | if (in_auto_increment_increment < 1 || in_auto_increment_increment > UINT64_MAX) | 772 | if (in_auto_increment_increment < 1 || in_auto_increment_increment > UINT64_MAX) |
102 | 773 | { | 773 | { |
104 | 774 | unireg_abort << _("Invalid Value for auto_increment_increment"); | 774 | drizzled_abort << _("Invalid Value for auto_increment_increment"); |
105 | 775 | } | 775 | } |
106 | 776 | global_system_variables.auto_increment_increment= in_auto_increment_increment; | 776 | global_system_variables.auto_increment_increment= in_auto_increment_increment; |
107 | 777 | } | 777 | } |
108 | @@ -781,7 +781,7 @@ | |||
109 | 781 | global_system_variables.auto_increment_offset= 1; | 781 | global_system_variables.auto_increment_offset= 1; |
110 | 782 | if (in_auto_increment_offset < 1 || in_auto_increment_offset > UINT64_MAX) | 782 | if (in_auto_increment_offset < 1 || in_auto_increment_offset > UINT64_MAX) |
111 | 783 | { | 783 | { |
113 | 784 | unireg_abort << _("Invalid Value for auto_increment_offset"); | 784 | drizzled_abort << _("Invalid Value for auto_increment_offset"); |
114 | 785 | } | 785 | } |
115 | 786 | global_system_variables.auto_increment_offset= in_auto_increment_offset; | 786 | global_system_variables.auto_increment_offset= in_auto_increment_offset; |
116 | 787 | } | 787 | } |
117 | @@ -791,7 +791,7 @@ | |||
118 | 791 | global_system_variables.completion_type= 0; | 791 | global_system_variables.completion_type= 0; |
119 | 792 | if (in_completion_type > 2) | 792 | if (in_completion_type > 2) |
120 | 793 | { | 793 | { |
122 | 794 | unireg_abort << _("Invalid Value for completion_type"); | 794 | drizzled_abort << _("Invalid Value for completion_type"); |
123 | 795 | } | 795 | } |
124 | 796 | global_system_variables.completion_type= in_completion_type; | 796 | global_system_variables.completion_type= in_completion_type; |
125 | 797 | } | 797 | } |
126 | @@ -802,7 +802,7 @@ | |||
127 | 802 | global_system_variables.div_precincrement= 4; | 802 | global_system_variables.div_precincrement= 4; |
128 | 803 | if (in_div_precincrement > DECIMAL_MAX_SCALE) | 803 | if (in_div_precincrement > DECIMAL_MAX_SCALE) |
129 | 804 | { | 804 | { |
131 | 805 | unireg_abort << _("Invalid Value for div-precision-increment"); | 805 | drizzled_abort << _("Invalid Value for div-precision-increment"); |
132 | 806 | } | 806 | } |
133 | 807 | global_system_variables.div_precincrement= in_div_precincrement; | 807 | global_system_variables.div_precincrement= in_div_precincrement; |
134 | 808 | } | 808 | } |
135 | @@ -812,7 +812,7 @@ | |||
136 | 812 | global_system_variables.group_concat_max_len= 1024; | 812 | global_system_variables.group_concat_max_len= 1024; |
137 | 813 | if (in_group_concat_max_len > ULONG_MAX || in_group_concat_max_len < 4) | 813 | if (in_group_concat_max_len > ULONG_MAX || in_group_concat_max_len < 4) |
138 | 814 | { | 814 | { |
140 | 815 | unireg_abort << _("Invalid Value for group_concat_max_len"); | 815 | drizzled_abort << _("Invalid Value for group_concat_max_len"); |
141 | 816 | } | 816 | } |
142 | 817 | global_system_variables.group_concat_max_len= in_group_concat_max_len; | 817 | global_system_variables.group_concat_max_len= in_group_concat_max_len; |
143 | 818 | } | 818 | } |
144 | @@ -822,7 +822,7 @@ | |||
145 | 822 | global_system_variables.join_buff_size= (128*1024L); | 822 | global_system_variables.join_buff_size= (128*1024L); |
146 | 823 | if (in_join_buffer_size < IO_SIZE*2 || in_join_buffer_size > ULONG_MAX) | 823 | if (in_join_buffer_size < IO_SIZE*2 || in_join_buffer_size > ULONG_MAX) |
147 | 824 | { | 824 | { |
149 | 825 | unireg_abort << _("Invalid Value for join_buffer_size"); | 825 | drizzled_abort << _("Invalid Value for join_buffer_size"); |
150 | 826 | } | 826 | } |
151 | 827 | in_join_buffer_size-= in_join_buffer_size % IO_SIZE; | 827 | in_join_buffer_size-= in_join_buffer_size % IO_SIZE; |
152 | 828 | global_system_variables.join_buff_size= in_join_buffer_size; | 828 | global_system_variables.join_buff_size= in_join_buffer_size; |
153 | @@ -833,7 +833,7 @@ | |||
154 | 833 | global_system_variables.max_allowed_packet= (64*1024*1024L); | 833 | global_system_variables.max_allowed_packet= (64*1024*1024L); |
155 | 834 | if (in_max_allowed_packet < 1024 || in_max_allowed_packet > 1024*1024L*1024L) | 834 | if (in_max_allowed_packet < 1024 || in_max_allowed_packet > 1024*1024L*1024L) |
156 | 835 | { | 835 | { |
158 | 836 | unireg_abort << _("Invalid Value for max_allowed_packet"); | 836 | drizzled_abort << _("Invalid Value for max_allowed_packet"); |
159 | 837 | } | 837 | } |
160 | 838 | in_max_allowed_packet-= in_max_allowed_packet % 1024; | 838 | in_max_allowed_packet-= in_max_allowed_packet % 1024; |
161 | 839 | global_system_variables.max_allowed_packet= in_max_allowed_packet; | 839 | global_system_variables.max_allowed_packet= in_max_allowed_packet; |
162 | @@ -844,7 +844,7 @@ | |||
163 | 844 | global_system_variables.max_error_count= DEFAULT_ERROR_COUNT; | 844 | global_system_variables.max_error_count= DEFAULT_ERROR_COUNT; |
164 | 845 | if (in_max_error_count > 65535) | 845 | if (in_max_error_count > 65535) |
165 | 846 | { | 846 | { |
167 | 847 | unireg_abort << _("Invalid Value for max_error_count"); | 847 | drizzled_abort << _("Invalid Value for max_error_count"); |
168 | 848 | } | 848 | } |
169 | 849 | global_system_variables.max_error_count= in_max_error_count; | 849 | global_system_variables.max_error_count= in_max_error_count; |
170 | 850 | } | 850 | } |
171 | @@ -854,7 +854,7 @@ | |||
172 | 854 | global_system_variables.max_heap_table_size= (16*1024*1024L); | 854 | global_system_variables.max_heap_table_size= (16*1024*1024L); |
173 | 855 | if (in_max_heap_table_size < 16384 || in_max_heap_table_size > MAX_MEM_TABLE_SIZE) | 855 | if (in_max_heap_table_size < 16384 || in_max_heap_table_size > MAX_MEM_TABLE_SIZE) |
174 | 856 | { | 856 | { |
176 | 857 | unireg_abort << _("Invalid Value for max_heap_table_size"); | 857 | drizzled_abort << _("Invalid Value for max_heap_table_size"); |
177 | 858 | } | 858 | } |
178 | 859 | in_max_heap_table_size-= in_max_heap_table_size % 1024; | 859 | in_max_heap_table_size-= in_max_heap_table_size % 1024; |
179 | 860 | global_system_variables.max_heap_table_size= in_max_heap_table_size; | 860 | global_system_variables.max_heap_table_size= in_max_heap_table_size; |
180 | @@ -865,7 +865,7 @@ | |||
181 | 865 | global_system_variables.min_examined_row_limit= 0; | 865 | global_system_variables.min_examined_row_limit= 0; |
182 | 866 | if (in_min_examined_row_limit > ULONG_MAX) | 866 | if (in_min_examined_row_limit > ULONG_MAX) |
183 | 867 | { | 867 | { |
185 | 868 | unireg_abort << _("Invalid Value for min_examined_row_limit"); | 868 | drizzled_abort << _("Invalid Value for min_examined_row_limit"); |
186 | 869 | } | 869 | } |
187 | 870 | global_system_variables.min_examined_row_limit= in_min_examined_row_limit; | 870 | global_system_variables.min_examined_row_limit= in_min_examined_row_limit; |
188 | 871 | } | 871 | } |
189 | @@ -875,7 +875,7 @@ | |||
190 | 875 | global_system_variables.max_join_size= INT32_MAX; | 875 | global_system_variables.max_join_size= INT32_MAX; |
191 | 876 | if ((uint64_t)in_max_join_size < 1 || (uint64_t)in_max_join_size > INT32_MAX) | 876 | if ((uint64_t)in_max_join_size < 1 || (uint64_t)in_max_join_size > INT32_MAX) |
192 | 877 | { | 877 | { |
194 | 878 | unireg_abort << _("Invalid Value for max_join_size"); | 878 | drizzled_abort << _("Invalid Value for max_join_size"); |
195 | 879 | } | 879 | } |
196 | 880 | global_system_variables.max_join_size= in_max_join_size; | 880 | global_system_variables.max_join_size= in_max_join_size; |
197 | 881 | } | 881 | } |
198 | @@ -885,7 +885,7 @@ | |||
199 | 885 | global_system_variables.max_length_for_sort_data= 1024; | 885 | global_system_variables.max_length_for_sort_data= 1024; |
200 | 886 | if (in_max_length_for_sort_data < 4 || in_max_length_for_sort_data > 8192*1024L) | 886 | if (in_max_length_for_sort_data < 4 || in_max_length_for_sort_data > 8192*1024L) |
201 | 887 | { | 887 | { |
203 | 888 | unireg_abort << _("Invalid Value for max_length_for_sort_data"); | 888 | drizzled_abort << _("Invalid Value for max_length_for_sort_data"); |
204 | 889 | } | 889 | } |
205 | 890 | global_system_variables.max_length_for_sort_data= in_max_length_for_sort_data; | 890 | global_system_variables.max_length_for_sort_data= in_max_length_for_sort_data; |
206 | 891 | } | 891 | } |
207 | @@ -895,7 +895,7 @@ | |||
208 | 895 | global_system_variables.max_seeks_for_key= ULONG_MAX; | 895 | global_system_variables.max_seeks_for_key= ULONG_MAX; |
209 | 896 | if (in_max_seeks_for_key < 1 || in_max_seeks_for_key > ULONG_MAX) | 896 | if (in_max_seeks_for_key < 1 || in_max_seeks_for_key > ULONG_MAX) |
210 | 897 | { | 897 | { |
212 | 898 | unireg_abort << _("Invalid Value for max_seeks_for_key"); | 898 | drizzled_abort << _("Invalid Value for max_seeks_for_key"); |
213 | 899 | } | 899 | } |
214 | 900 | global_system_variables.max_seeks_for_key= in_max_seeks_for_key; | 900 | global_system_variables.max_seeks_for_key= in_max_seeks_for_key; |
215 | 901 | } | 901 | } |
216 | @@ -905,7 +905,7 @@ | |||
217 | 905 | global_system_variables.max_sort_length= 1024; | 905 | global_system_variables.max_sort_length= 1024; |
218 | 906 | if ((int64_t)in_max_sort_length < 4 || (int64_t)in_max_sort_length > 8192*1024L) | 906 | if ((int64_t)in_max_sort_length < 4 || (int64_t)in_max_sort_length > 8192*1024L) |
219 | 907 | { | 907 | { |
221 | 908 | unireg_abort << _("Invalid Value for max_sort_length"); | 908 | drizzled_abort << _("Invalid Value for max_sort_length"); |
222 | 909 | } | 909 | } |
223 | 910 | global_system_variables.max_sort_length= in_max_sort_length; | 910 | global_system_variables.max_sort_length= in_max_sort_length; |
224 | 911 | } | 911 | } |
225 | @@ -915,7 +915,7 @@ | |||
226 | 915 | global_system_variables.optimizer_search_depth= 0; | 915 | global_system_variables.optimizer_search_depth= 0; |
227 | 916 | if (in_optimizer_search_depth > MAX_TABLES + 2) | 916 | if (in_optimizer_search_depth > MAX_TABLES + 2) |
228 | 917 | { | 917 | { |
230 | 918 | unireg_abort << _("Invalid Value for optimizer_search_depth"); | 918 | drizzled_abort << _("Invalid Value for optimizer_search_depth"); |
231 | 919 | } | 919 | } |
232 | 920 | global_system_variables.optimizer_search_depth= in_optimizer_search_depth; | 920 | global_system_variables.optimizer_search_depth= in_optimizer_search_depth; |
233 | 921 | } | 921 | } |
234 | @@ -925,7 +925,7 @@ | |||
235 | 925 | global_system_variables.preload_buff_size= (32*1024L); | 925 | global_system_variables.preload_buff_size= (32*1024L); |
236 | 926 | if (in_preload_buff_size < 1024 || in_preload_buff_size > 1024*1024*1024L) | 926 | if (in_preload_buff_size < 1024 || in_preload_buff_size > 1024*1024*1024L) |
237 | 927 | { | 927 | { |
239 | 928 | unireg_abort << _("Invalid Value for preload_buff_size"); | 928 | drizzled_abort << _("Invalid Value for preload_buff_size"); |
240 | 929 | } | 929 | } |
241 | 930 | global_system_variables.preload_buff_size= in_preload_buff_size; | 930 | global_system_variables.preload_buff_size= in_preload_buff_size; |
242 | 931 | } | 931 | } |
243 | @@ -935,7 +935,7 @@ | |||
244 | 935 | global_system_variables.query_alloc_block_size= QUERY_ALLOC_BLOCK_SIZE; | 935 | global_system_variables.query_alloc_block_size= QUERY_ALLOC_BLOCK_SIZE; |
245 | 936 | if (in_query_alloc_block_size < 1024) | 936 | if (in_query_alloc_block_size < 1024) |
246 | 937 | { | 937 | { |
248 | 938 | unireg_abort << _("Invalid Value for query_alloc_block_size"); | 938 | drizzled_abort << _("Invalid Value for query_alloc_block_size"); |
249 | 939 | } | 939 | } |
250 | 940 | in_query_alloc_block_size-= in_query_alloc_block_size % 1024; | 940 | in_query_alloc_block_size-= in_query_alloc_block_size % 1024; |
251 | 941 | global_system_variables.query_alloc_block_size= in_query_alloc_block_size; | 941 | global_system_variables.query_alloc_block_size= in_query_alloc_block_size; |
252 | @@ -946,7 +946,7 @@ | |||
253 | 946 | global_system_variables.query_prealloc_size= QUERY_ALLOC_PREALLOC_SIZE; | 946 | global_system_variables.query_prealloc_size= QUERY_ALLOC_PREALLOC_SIZE; |
254 | 947 | if (in_query_prealloc_size < QUERY_ALLOC_PREALLOC_SIZE) | 947 | if (in_query_prealloc_size < QUERY_ALLOC_PREALLOC_SIZE) |
255 | 948 | { | 948 | { |
257 | 949 | unireg_abort << _("Invalid Value for query_prealloc_size"); | 949 | drizzled_abort << _("Invalid Value for query_prealloc_size"); |
258 | 950 | } | 950 | } |
259 | 951 | in_query_prealloc_size-= in_query_prealloc_size % 1024; | 951 | in_query_prealloc_size-= in_query_prealloc_size % 1024; |
260 | 952 | global_system_variables.query_prealloc_size= in_query_prealloc_size; | 952 | global_system_variables.query_prealloc_size= in_query_prealloc_size; |
261 | @@ -957,7 +957,7 @@ | |||
262 | 957 | global_system_variables.range_alloc_block_size= RANGE_ALLOC_BLOCK_SIZE; | 957 | global_system_variables.range_alloc_block_size= RANGE_ALLOC_BLOCK_SIZE; |
263 | 958 | if (in_range_alloc_block_size < RANGE_ALLOC_BLOCK_SIZE) | 958 | if (in_range_alloc_block_size < RANGE_ALLOC_BLOCK_SIZE) |
264 | 959 | { | 959 | { |
266 | 960 | unireg_abort << _("Invalid Value for range_alloc_block_size"); | 960 | drizzled_abort << _("Invalid Value for range_alloc_block_size"); |
267 | 961 | } | 961 | } |
268 | 962 | in_range_alloc_block_size-= in_range_alloc_block_size % 1024; | 962 | in_range_alloc_block_size-= in_range_alloc_block_size % 1024; |
269 | 963 | global_system_variables.range_alloc_block_size= in_range_alloc_block_size; | 963 | global_system_variables.range_alloc_block_size= in_range_alloc_block_size; |
270 | @@ -968,7 +968,7 @@ | |||
271 | 968 | global_system_variables.read_buff_size= (128*1024L); | 968 | global_system_variables.read_buff_size= (128*1024L); |
272 | 969 | if (in_read_buff_size < IO_SIZE*2 || in_read_buff_size > INT32_MAX) | 969 | if (in_read_buff_size < IO_SIZE*2 || in_read_buff_size > INT32_MAX) |
273 | 970 | { | 970 | { |
275 | 971 | unireg_abort << _("Invalid Value for read_buff_size"); | 971 | drizzled_abort << _("Invalid Value for read_buff_size"); |
276 | 972 | } | 972 | } |
277 | 973 | in_read_buff_size-= in_read_buff_size % IO_SIZE; | 973 | in_read_buff_size-= in_read_buff_size % IO_SIZE; |
278 | 974 | global_system_variables.read_buff_size= in_read_buff_size; | 974 | global_system_variables.read_buff_size= in_read_buff_size; |
279 | @@ -979,7 +979,7 @@ | |||
280 | 979 | global_system_variables.read_rnd_buff_size= (256*1024L); | 979 | global_system_variables.read_rnd_buff_size= (256*1024L); |
281 | 980 | if (in_read_rnd_buff_size < 64 || in_read_rnd_buff_size > UINT32_MAX) | 980 | if (in_read_rnd_buff_size < 64 || in_read_rnd_buff_size > UINT32_MAX) |
282 | 981 | { | 981 | { |
284 | 982 | unireg_abort << _("Invalid Value for read_rnd_buff_size"); | 982 | drizzled_abort << _("Invalid Value for read_rnd_buff_size"); |
285 | 983 | } | 983 | } |
286 | 984 | global_system_variables.read_rnd_buff_size= in_read_rnd_buff_size; | 984 | global_system_variables.read_rnd_buff_size= in_read_rnd_buff_size; |
287 | 985 | } | 985 | } |
288 | @@ -989,7 +989,7 @@ | |||
289 | 989 | global_system_variables.sortbuff_size= MAX_SORT_MEMORY; | 989 | global_system_variables.sortbuff_size= MAX_SORT_MEMORY; |
290 | 990 | if ((uint32_t)in_sortbuff_size < MIN_SORT_MEMORY) | 990 | if ((uint32_t)in_sortbuff_size < MIN_SORT_MEMORY) |
291 | 991 | { | 991 | { |
293 | 992 | unireg_abort << _("Invalid Value for sort_buff_size"); | 992 | drizzled_abort << _("Invalid Value for sort_buff_size"); |
294 | 993 | } | 993 | } |
295 | 994 | global_system_variables.sortbuff_size= in_sortbuff_size; | 994 | global_system_variables.sortbuff_size= in_sortbuff_size; |
296 | 995 | } | 995 | } |
297 | @@ -999,7 +999,7 @@ | |||
298 | 999 | table_def_size= 128; | 999 | table_def_size= 128; |
299 | 1000 | if (in_table_def_size < 1 || in_table_def_size > 512*1024L) | 1000 | if (in_table_def_size < 1 || in_table_def_size > 512*1024L) |
300 | 1001 | { | 1001 | { |
302 | 1002 | unireg_abort << _("Invalid Value for table_def_size"); | 1002 | drizzled_abort << _("Invalid Value for table_def_size"); |
303 | 1003 | } | 1003 | } |
304 | 1004 | table_def_size= in_table_def_size; | 1004 | table_def_size= in_table_def_size; |
305 | 1005 | } | 1005 | } |
306 | @@ -1009,7 +1009,7 @@ | |||
307 | 1009 | table_cache_size= TABLE_OPEN_CACHE_DEFAULT; | 1009 | table_cache_size= TABLE_OPEN_CACHE_DEFAULT; |
308 | 1010 | if (in_table_cache_size < TABLE_OPEN_CACHE_MIN || in_table_cache_size > 512*1024L) | 1010 | if (in_table_cache_size < TABLE_OPEN_CACHE_MIN || in_table_cache_size > 512*1024L) |
309 | 1011 | { | 1011 | { |
311 | 1012 | unireg_abort << _("Invalid Value for table_cache_size"); | 1012 | drizzled_abort << _("Invalid Value for table_cache_size"); |
312 | 1013 | } | 1013 | } |
313 | 1014 | table_cache_size= in_table_cache_size; | 1014 | table_cache_size= in_table_cache_size; |
314 | 1015 | } | 1015 | } |
315 | @@ -1019,7 +1019,7 @@ | |||
316 | 1019 | table_lock_wait_timeout= 50; | 1019 | table_lock_wait_timeout= 50; |
317 | 1020 | if (in_table_lock_wait_timeout < 1 || in_table_lock_wait_timeout > 1024*1024*1024) | 1020 | if (in_table_lock_wait_timeout < 1 || in_table_lock_wait_timeout > 1024*1024*1024) |
318 | 1021 | { | 1021 | { |
320 | 1022 | unireg_abort << _("Invalid Value for table_lock_wait_timeout"); | 1022 | drizzled_abort << _("Invalid Value for table_lock_wait_timeout"); |
321 | 1023 | } | 1023 | } |
322 | 1024 | table_lock_wait_timeout= in_table_lock_wait_timeout; | 1024 | table_lock_wait_timeout= in_table_lock_wait_timeout; |
323 | 1025 | } | 1025 | } |
324 | @@ -1034,7 +1034,7 @@ | |||
325 | 1034 | global_system_variables.tmp_table_size= 16*1024*1024L; | 1034 | global_system_variables.tmp_table_size= 16*1024*1024L; |
326 | 1035 | if (in_tmp_table_size < 1024 || in_tmp_table_size > MAX_MEM_TABLE_SIZE) | 1035 | if (in_tmp_table_size < 1024 || in_tmp_table_size > MAX_MEM_TABLE_SIZE) |
327 | 1036 | { | 1036 | { |
329 | 1037 | unireg_abort << _("Invalid Value for table_lock_wait_timeout"); | 1037 | drizzled_abort << _("Invalid Value for table_lock_wait_timeout"); |
330 | 1038 | } | 1038 | } |
331 | 1039 | global_system_variables.tmp_table_size= in_tmp_table_size; | 1039 | global_system_variables.tmp_table_size= in_tmp_table_size; |
332 | 1040 | } | 1040 | } |
333 | @@ -1044,7 +1044,7 @@ | |||
334 | 1044 | transaction_message_threshold= 1024*1024; | 1044 | transaction_message_threshold= 1024*1024; |
335 | 1045 | if ((int64_t) in_transaction_message_threshold < 128*1024 || (int64_t)in_transaction_message_threshold > 1024*1024) | 1045 | if ((int64_t) in_transaction_message_threshold < 128*1024 || (int64_t)in_transaction_message_threshold > 1024*1024) |
336 | 1046 | { | 1046 | { |
338 | 1047 | unireg_abort << _("Invalid Value for transaction_message_threshold valid values are between 131072 - 1048576 bytes"); | 1047 | drizzled_abort << _("Invalid Value for transaction_message_threshold valid values are between 131072 - 1048576 bytes"); |
339 | 1048 | } | 1048 | } |
340 | 1049 | transaction_message_threshold= in_transaction_message_threshold; | 1049 | transaction_message_threshold= in_transaction_message_threshold; |
341 | 1050 | } | 1050 | } |
342 | @@ -1092,7 +1092,7 @@ | |||
343 | 1092 | } | 1092 | } |
344 | 1093 | else | 1093 | else |
345 | 1094 | { | 1094 | { |
347 | 1095 | unireg_abort << "Defaults file '" << it << "' not found"; | 1095 | drizzled_abort << "Defaults file '" << it << "' not found"; |
348 | 1096 | } | 1096 | } |
349 | 1097 | } | 1097 | } |
350 | 1098 | } | 1098 | } |
351 | @@ -1347,7 +1347,7 @@ | |||
352 | 1347 | } | 1347 | } |
353 | 1348 | catch (std::exception&) | 1348 | catch (std::exception&) |
354 | 1349 | { | 1349 | { |
356 | 1350 | unireg_abort << _("Duplicate entry for command line option"); | 1350 | drizzled_abort << _("Duplicate entry for command line option"); |
357 | 1351 | } | 1351 | } |
358 | 1352 | 1352 | ||
359 | 1353 | /* TODO: here is where we should add a process_env_vars */ | 1353 | /* TODO: here is where we should add a process_env_vars */ |
360 | @@ -1359,13 +1359,13 @@ | |||
361 | 1359 | } | 1359 | } |
362 | 1360 | catch (po::validation_error &err) | 1360 | catch (po::validation_error &err) |
363 | 1361 | { | 1361 | { |
365 | 1362 | unireg_abort << err.what() << ". " << "Use --help to get a list of available options. "; | 1362 | drizzled_abort << err.what() << ". " << "Use --help to get a list of available options. "; |
366 | 1363 | } | 1363 | } |
367 | 1364 | 1364 | ||
368 | 1365 | if (vm.count("version")) | 1365 | if (vm.count("version")) |
369 | 1366 | { | 1366 | { |
370 | 1367 | print_version(); | 1367 | print_version(); |
372 | 1368 | unireg_exit(); | 1368 | drizzled_exit(); |
373 | 1369 | } | 1369 | } |
374 | 1370 | 1370 | ||
375 | 1371 | if (!vm["no-defaults"].as<bool>()) | 1371 | if (!vm["no-defaults"].as<bool>()) |
376 | @@ -1400,13 +1400,13 @@ | |||
377 | 1400 | } | 1400 | } |
378 | 1401 | catch (po::validation_error &err) | 1401 | catch (po::validation_error &err) |
379 | 1402 | { | 1402 | { |
381 | 1403 | unireg_abort << err.what() << ". " << "Use --help to get a list of available options. "; | 1403 | drizzled_abort << err.what() << ". " << "Use --help to get a list of available options. "; |
382 | 1404 | } | 1404 | } |
383 | 1405 | 1405 | ||
384 | 1406 | return true; | 1406 | return true; |
385 | 1407 | } | 1407 | } |
386 | 1408 | 1408 | ||
388 | 1409 | // Return failure if we can't pass this, unireg_abort() will then be called | 1409 | // Return failure if we can't pass this, drizzled_abort() will then be called |
389 | 1410 | // by the caller. | 1410 | // by the caller. |
390 | 1411 | bool init_variables_after_daemonizing(module::Registry &plugins) | 1411 | bool init_variables_after_daemonizing(module::Registry &plugins) |
391 | 1412 | { | 1412 | { |
392 | @@ -1420,7 +1420,7 @@ | |||
393 | 1420 | 1420 | ||
394 | 1421 | if (plugin_init(plugins, plugin_options)) | 1421 | if (plugin_init(plugins, plugin_options)) |
395 | 1422 | { | 1422 | { |
397 | 1423 | unireg_abort << _("Failed to initialize plugins"); | 1423 | drizzled_abort << _("Failed to initialize plugins"); |
398 | 1424 | } | 1424 | } |
399 | 1425 | 1425 | ||
400 | 1426 | full_options.add(plugin_options); | 1426 | full_options.add(plugin_options); |
401 | @@ -1446,15 +1446,15 @@ | |||
402 | 1446 | } | 1446 | } |
403 | 1447 | catch (po::validation_error &err) | 1447 | catch (po::validation_error &err) |
404 | 1448 | { | 1448 | { |
406 | 1449 | unireg_abort << err.what() << ". " << "Use --help to get a list of available options. "; | 1449 | drizzled_abort << err.what() << ". " << "Use --help to get a list of available options. "; |
407 | 1450 | } | 1450 | } |
408 | 1451 | catch (po::invalid_command_line_syntax &err) | 1451 | catch (po::invalid_command_line_syntax &err) |
409 | 1452 | { | 1452 | { |
411 | 1453 | unireg_abort << err.what() << ". " << "Use --help to get a list of available options. "; | 1453 | drizzled_abort << err.what() << ". " << "Use --help to get a list of available options. "; |
412 | 1454 | } | 1454 | } |
413 | 1455 | catch (po::unknown_option &err) | 1455 | catch (po::unknown_option &err) |
414 | 1456 | { | 1456 | { |
416 | 1457 | unireg_abort << err.what() << ". " << "Use --help to get a list of available options. "; | 1457 | drizzled_abort << err.what() << ". " << "Use --help to get a list of available options. "; |
417 | 1458 | } | 1458 | } |
418 | 1459 | 1459 | ||
419 | 1460 | try | 1460 | try |
420 | @@ -1463,7 +1463,7 @@ | |||
421 | 1463 | } | 1463 | } |
422 | 1464 | catch (po::validation_error &err) | 1464 | catch (po::validation_error &err) |
423 | 1465 | { | 1465 | { |
425 | 1466 | unireg_abort << err.what() << ". " << "Use --help to get a list of available options. "; | 1466 | drizzled_abort << err.what() << ". " << "Use --help to get a list of available options. "; |
426 | 1467 | } | 1467 | } |
427 | 1468 | 1468 | ||
428 | 1469 | get_options(); | 1469 | get_options(); |
429 | @@ -1546,7 +1546,7 @@ | |||
430 | 1546 | 1546 | ||
431 | 1547 | /* | 1547 | /* |
432 | 1548 | We need to call each of these following functions to ensure that | 1548 | We need to call each of these following functions to ensure that |
434 | 1549 | all things are initialized so that unireg_abort() doesn't fail | 1549 | all things are initialized so that drizzled_abort() doesn't fail |
435 | 1550 | */ | 1550 | */ |
436 | 1551 | 1551 | ||
437 | 1552 | // Resize the definition Cache at startup | 1552 | // Resize the definition Cache at startup |
438 | @@ -1561,12 +1561,12 @@ | |||
439 | 1561 | 1561 | ||
440 | 1562 | if (plugin_finalize(plugins)) | 1562 | if (plugin_finalize(plugins)) |
441 | 1563 | { | 1563 | { |
443 | 1564 | unireg_abort << "plugin_finalize() failed"; | 1564 | drizzled_abort << "plugin_finalize() failed"; |
444 | 1565 | } | 1565 | } |
445 | 1566 | 1566 | ||
446 | 1567 | if (plugin::Scheduler::setPlugin(opt_scheduler)) | 1567 | if (plugin::Scheduler::setPlugin(opt_scheduler)) |
447 | 1568 | { | 1568 | { |
449 | 1569 | unireg_abort << _("No scheduler found"); | 1569 | drizzled_abort << _("No scheduler found"); |
450 | 1570 | } | 1570 | } |
451 | 1571 | 1571 | ||
452 | 1572 | /* | 1572 | /* |
453 | @@ -1584,7 +1584,7 @@ | |||
454 | 1584 | plugin::StorageEngine *engine= plugin::StorageEngine::findByName(default_storage_engine_str); | 1584 | plugin::StorageEngine *engine= plugin::StorageEngine::findByName(default_storage_engine_str); |
455 | 1585 | if (engine == NULL) | 1585 | if (engine == NULL) |
456 | 1586 | { | 1586 | { |
458 | 1587 | unireg_abort << _("Unknown/unsupported storage engine: ") << default_storage_engine_str; | 1587 | drizzled_abort << _("Unknown/unsupported storage engine: ") << default_storage_engine_str; |
459 | 1588 | } | 1588 | } |
460 | 1589 | global_system_variables.storage_engine= engine; | 1589 | global_system_variables.storage_engine= engine; |
461 | 1590 | } | 1590 | } |
462 | @@ -1592,7 +1592,7 @@ | |||
463 | 1592 | if (plugin::XaResourceManager::recoverAllXids()) | 1592 | if (plugin::XaResourceManager::recoverAllXids()) |
464 | 1593 | { | 1593 | { |
465 | 1594 | /* This function alredy generates error messages */ | 1594 | /* This function alredy generates error messages */ |
467 | 1595 | unireg_abort << "plugin::XaResourceManager::recoverAllXids() failed"; | 1595 | drizzled_abort << "plugin::XaResourceManager::recoverAllXids() failed"; |
468 | 1596 | } | 1596 | } |
469 | 1597 | 1597 | ||
470 | 1598 | init_update_queries(); | 1598 | init_update_queries(); |
471 | @@ -1949,7 +1949,7 @@ | |||
472 | 1949 | { | 1949 | { |
473 | 1950 | if ((default_charset_info= get_charset_by_csname(default_character_set_name, MY_CS_PRIMARY)) == NULL) | 1950 | if ((default_charset_info= get_charset_by_csname(default_character_set_name, MY_CS_PRIMARY)) == NULL) |
474 | 1951 | { | 1951 | { |
476 | 1952 | unireg_abort << "Failed to load default_charset_info:" << default_character_set_name; | 1952 | drizzled_abort << "Failed to load default_charset_info:" << default_character_set_name; |
477 | 1953 | } | 1953 | } |
478 | 1954 | 1954 | ||
479 | 1955 | if (default_collation_name == NULL) | 1955 | if (default_collation_name == NULL) |
480 | @@ -1975,7 +1975,7 @@ | |||
481 | 1975 | all_options.add(plugin_options); | 1975 | all_options.add(plugin_options); |
482 | 1976 | cout << all_options << endl; | 1976 | cout << all_options << endl; |
483 | 1977 | 1977 | ||
485 | 1978 | unireg_exit(); | 1978 | drizzled_exit(); |
486 | 1979 | } | 1979 | } |
487 | 1980 | 1980 | ||
488 | 1981 | /** | 1981 | /** |
489 | @@ -2087,7 +2087,7 @@ | |||
490 | 2087 | if ((vm["sort-heap-threshold"].as<uint64_t>() > 0) and | 2087 | if ((vm["sort-heap-threshold"].as<uint64_t>() > 0) and |
491 | 2088 | (vm["sort-heap-threshold"].as<uint64_t>() < global_system_variables.sortbuff_size)) | 2088 | (vm["sort-heap-threshold"].as<uint64_t>() < global_system_variables.sortbuff_size)) |
492 | 2089 | { | 2089 | { |
494 | 2090 | unireg_abort << _("sort-heap-threshold cannot be less than sort-buffer-size"); | 2090 | drizzled_abort << _("sort-heap-threshold cannot be less than sort-buffer-size"); |
495 | 2091 | } | 2091 | } |
496 | 2092 | 2092 | ||
497 | 2093 | global_sort_buffer.setMaxSize(vm["sort-heap-threshold"].as<uint64_t>()); | 2093 | global_sort_buffer.setMaxSize(vm["sort-heap-threshold"].as<uint64_t>()); |
498 | @@ -2098,7 +2098,7 @@ | |||
499 | 2098 | if ((vm["join-heap-threshold"].as<uint64_t>() > 0) and | 2098 | if ((vm["join-heap-threshold"].as<uint64_t>() > 0) and |
500 | 2099 | (vm["join-heap-threshold"].as<uint64_t>() < global_system_variables.join_buff_size)) | 2099 | (vm["join-heap-threshold"].as<uint64_t>() < global_system_variables.join_buff_size)) |
501 | 2100 | { | 2100 | { |
503 | 2101 | unireg_abort << _("join-heap-threshold cannot be less than join-buffer-size"); | 2101 | drizzled_abort << _("join-heap-threshold cannot be less than join-buffer-size"); |
504 | 2102 | } | 2102 | } |
505 | 2103 | 2103 | ||
506 | 2104 | global_join_buffer.setMaxSize(vm["join-heap-threshold"].as<uint64_t>()); | 2104 | global_join_buffer.setMaxSize(vm["join-heap-threshold"].as<uint64_t>()); |
507 | @@ -2109,7 +2109,7 @@ | |||
508 | 2109 | if ((vm["read-rnd-threshold"].as<uint64_t>() > 0) and | 2109 | if ((vm["read-rnd-threshold"].as<uint64_t>() > 0) and |
509 | 2110 | (vm["read-rnd-threshold"].as<uint64_t>() < global_system_variables.read_rnd_buff_size)) | 2110 | (vm["read-rnd-threshold"].as<uint64_t>() < global_system_variables.read_rnd_buff_size)) |
510 | 2111 | { | 2111 | { |
512 | 2112 | unireg_abort << _("read-rnd-threshold cannot be less than read-rnd-buffer-size"); | 2112 | drizzled_abort << _("read-rnd-threshold cannot be less than read-rnd-buffer-size"); |
513 | 2113 | } | 2113 | } |
514 | 2114 | 2114 | ||
515 | 2115 | global_read_rnd_buffer.setMaxSize(vm["read-rnd-threshold"].as<uint64_t>()); | 2115 | global_read_rnd_buffer.setMaxSize(vm["read-rnd-threshold"].as<uint64_t>()); |
516 | @@ -2120,7 +2120,7 @@ | |||
517 | 2120 | if ((vm["read-buffer-threshold"].as<uint64_t>() > 0) and | 2120 | if ((vm["read-buffer-threshold"].as<uint64_t>() > 0) and |
518 | 2121 | (vm["read-buffer-threshold"].as<uint64_t>() < global_system_variables.read_buff_size)) | 2121 | (vm["read-buffer-threshold"].as<uint64_t>() < global_system_variables.read_buff_size)) |
519 | 2122 | { | 2122 | { |
521 | 2123 | unireg_abort << _("read-buffer-threshold cannot be less than read-buffer-size"); | 2123 | drizzled_abort << _("read-buffer-threshold cannot be less than read-buffer-size"); |
522 | 2124 | } | 2124 | } |
523 | 2125 | 2125 | ||
524 | 2126 | global_read_buffer.setMaxSize(vm["read-buffer-threshold"].as<uint64_t>()); | 2126 | global_read_buffer.setMaxSize(vm["read-buffer-threshold"].as<uint64_t>()); |
525 | @@ -2154,12 +2154,12 @@ | |||
526 | 2154 | const charset_info_st * const default_collation= get_charset_by_name(vm["collation-server"].as<string>().c_str()); | 2154 | const charset_info_st * const default_collation= get_charset_by_name(vm["collation-server"].as<string>().c_str()); |
527 | 2155 | if (not default_collation) | 2155 | if (not default_collation) |
528 | 2156 | { | 2156 | { |
530 | 2157 | unireg_abort << "Unknown collation: " << default_collation_name; | 2157 | drizzled_abort << "Unknown collation: " << default_collation_name; |
531 | 2158 | } | 2158 | } |
532 | 2159 | 2159 | ||
533 | 2160 | if (not my_charset_same(default_charset_info, default_collation)) | 2160 | if (not my_charset_same(default_charset_info, default_collation)) |
534 | 2161 | { | 2161 | { |
536 | 2162 | unireg_abort << "COLLATION '" << default_collation_name << "' is not valid for CHARACTER SET '" << default_charset_info->csname << "'"; | 2162 | drizzled_abort << "COLLATION '" << default_collation_name << "' is not valid for CHARACTER SET '" << default_charset_info->csname << "'"; |
537 | 2163 | } | 2163 | } |
538 | 2164 | default_charset_info= default_collation; | 2164 | default_charset_info= default_collation; |
539 | 2165 | } | 2165 | } |
540 | @@ -2252,14 +2252,14 @@ | |||
541 | 2252 | assert(getuid() != 0 and geteuid() != 0); | 2252 | assert(getuid() != 0 and geteuid() != 0); |
542 | 2253 | if (getuid() == 0 or geteuid() == 0) | 2253 | if (getuid() == 0 or geteuid() == 0) |
543 | 2254 | { | 2254 | { |
545 | 2255 | unireg_abort << "Drizzle cannot be run as root, please see the Security piece of the manual for more information."; | 2255 | drizzled_abort << "Drizzle cannot be run as root, please see the Security piece of the manual for more information."; |
546 | 2256 | } | 2256 | } |
547 | 2257 | 2257 | ||
548 | 2258 | if (mkdir(drizzle_tmpdir.c_str(), 0777) == -1) | 2258 | if (mkdir(drizzle_tmpdir.c_str(), 0777) == -1) |
549 | 2259 | { | 2259 | { |
550 | 2260 | if (errno != EEXIST) | 2260 | if (errno != EEXIST) |
551 | 2261 | { | 2261 | { |
553 | 2262 | unireg_abort << "There was an error creating the '" | 2262 | drizzled_abort << "There was an error creating the '" |
554 | 2263 | << fs::path(drizzle_tmpdir).leaf() | 2263 | << fs::path(drizzle_tmpdir).leaf() |
555 | 2264 | << "' part of the path '" | 2264 | << "' part of the path '" |
556 | 2265 | << drizzle_tmpdir | 2265 | << drizzle_tmpdir |
557 | @@ -2269,7 +2269,7 @@ | |||
558 | 2269 | 2269 | ||
559 | 2270 | if (stat(drizzle_tmpdir.c_str(), &buf) || not S_ISDIR(buf.st_mode)) | 2270 | if (stat(drizzle_tmpdir.c_str(), &buf) || not S_ISDIR(buf.st_mode)) |
560 | 2271 | { | 2271 | { |
562 | 2272 | unireg_abort << "There was an error opening the path '" << drizzle_tmpdir << "', please check the path exists and is writable."; | 2272 | drizzled_abort << "There was an error opening the path '" << drizzle_tmpdir << "', please check the path exists and is writable."; |
563 | 2273 | } | 2273 | } |
564 | 2274 | } | 2274 | } |
565 | 2275 | 2275 | ||
566 | 2276 | 2276 | ||
567 | === renamed file 'drizzled/unireg.h' => 'drizzled/drizzled_abort.h' | |||
568 | --- drizzled/unireg.h 2011-07-19 02:02:52 +0000 | |||
569 | +++ drizzled/drizzled_abort.h 2013-02-27 17:19:19 +0000 | |||
570 | @@ -2,6 +2,8 @@ | |||
571 | 2 | * vim:expandtab:shiftwidth=2:tabstop=2:smarttab: | 2 | * vim:expandtab:shiftwidth=2:tabstop=2:smarttab: |
572 | 3 | * | 3 | * |
573 | 4 | * Copyright (C) 2008 Sun Microsystems, Inc. | 4 | * Copyright (C) 2008 Sun Microsystems, Inc. |
574 | 5 | * Copyright (C) 2011 Brian Aker | ||
575 | 6 | * Copyright (C) 2013 Stewart Smith | ||
576 | 5 | * | 7 | * |
577 | 6 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
578 | 7 | * it under the terms of the GNU General Public License as published by | 9 | * it under the terms of the GNU General Public License as published by |
579 | @@ -17,9 +19,6 @@ | |||
580 | 17 | * along with this program; if not, write to the Free Software | 19 | * along with this program; if not, write to the Free Software |
581 | 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
582 | 19 | */ | 21 | */ |
583 | 20 | |||
584 | 21 | /* Extra functions used by unireg library */ | ||
585 | 22 | |||
586 | 23 | #pragma once | 22 | #pragma once |
587 | 24 | 23 | ||
588 | 25 | #include <drizzled/visibility.h> | 24 | #include <drizzled/visibility.h> |
589 | @@ -28,16 +27,16 @@ | |||
590 | 28 | namespace drizzled | 27 | namespace drizzled |
591 | 29 | { | 28 | { |
592 | 30 | 29 | ||
596 | 31 | void unireg_exit() __attribute__((noreturn)); | 30 | void drizzled_exit() __attribute__((noreturn)); |
597 | 32 | DRIZZLED_API void unireg_actual_abort(const char *file, int line, const char *func, const std::string& message) __attribute__((noreturn)); | 31 | DRIZZLED_API void drizzled_actual_abort(const char *file, int line, const char *func, const std::string& message) __attribute__((noreturn)); |
598 | 33 | void unireg_startup_finished(); | 32 | void drizzled_startup_finished(); |
599 | 34 | 33 | ||
600 | 35 | namespace stream { | 34 | namespace stream { |
601 | 36 | 35 | ||
602 | 37 | namespace detail { | 36 | namespace detail { |
603 | 38 | 37 | ||
604 | 39 | template<class Ch, class Tr, class A> | 38 | template<class Ch, class Tr, class A> |
606 | 40 | class _unireg { | 39 | class _drizzled_abort_log { |
607 | 41 | private: | 40 | private: |
608 | 42 | 41 | ||
609 | 43 | public: | 42 | public: |
610 | @@ -46,7 +45,7 @@ | |||
611 | 46 | public: | 45 | public: |
612 | 47 | void operator()(const stream_buffer &s, const char *filename, int line, const char *func) | 46 | void operator()(const stream_buffer &s, const char *filename, int line, const char *func) |
613 | 48 | { | 47 | { |
615 | 49 | unireg_actual_abort(filename, line, func, s.str()); | 48 | drizzled_actual_abort(filename, line, func, s.str()); |
616 | 50 | } | 49 | } |
617 | 51 | }; | 50 | }; |
618 | 52 | 51 | ||
619 | @@ -90,9 +89,9 @@ | |||
620 | 90 | }; | 89 | }; |
621 | 91 | } // namespace detail | 90 | } // namespace detail |
622 | 92 | 91 | ||
624 | 93 | class _unireg : public detail::log<detail::_unireg> { | 92 | class _drizzled_abort_log : public detail::log<detail::_drizzled_abort_log> { |
625 | 94 | public: | 93 | public: |
627 | 95 | _unireg(const char *filename, int line_number, const char *func) | 94 | _drizzled_abort_log(const char *filename, int line_number, const char *func) |
628 | 96 | { | 95 | { |
629 | 97 | set_filename(filename, line_number, func); | 96 | set_filename(filename, line_number, func); |
630 | 98 | } | 97 | } |
631 | @@ -100,6 +99,6 @@ | |||
632 | 100 | 99 | ||
633 | 101 | } // namespace stream | 100 | } // namespace stream |
634 | 102 | 101 | ||
636 | 103 | #define unireg_abort stream::_unireg(__FILE__, __LINE__, __func__) | 102 | #define drizzled_abort stream::_drizzled_abort_log(__FILE__, __LINE__, __func__) |
637 | 104 | 103 | ||
638 | 105 | } /* namespace drizzled */ | 104 | } /* namespace drizzled */ |
639 | 106 | 105 | ||
640 | === modified file 'drizzled/include.am' | |||
641 | --- drizzled/include.am 2013-01-20 11:22:10 +0000 | |||
642 | +++ drizzled/include.am 2013-02-27 17:19:19 +0000 | |||
643 | @@ -83,6 +83,7 @@ | |||
644 | 83 | drizzled/discrete_interval.h \ | 83 | drizzled/discrete_interval.h \ |
645 | 84 | drizzled/display.h \ | 84 | drizzled/display.h \ |
646 | 85 | drizzled/drizzled.h \ | 85 | drizzled/drizzled.h \ |
647 | 86 | drizzled/drizzled_abort.h \ | ||
648 | 86 | drizzled/dtcollation.h \ | 87 | drizzled/dtcollation.h \ |
649 | 87 | drizzled/dynamic_array.h \ | 88 | drizzled/dynamic_array.h \ |
650 | 88 | drizzled/enum.h \ | 89 | drizzled/enum.h \ |
651 | @@ -512,7 +513,6 @@ | |||
652 | 512 | drizzled/type/ipv6.h \ | 513 | drizzled/type/ipv6.h \ |
653 | 513 | drizzled/typelib.h \ | 514 | drizzled/typelib.h \ |
654 | 514 | drizzled/unique.h \ | 515 | drizzled/unique.h \ |
655 | 515 | drizzled/unireg.h \ | ||
656 | 516 | drizzled/user_var_entry.h \ | 516 | drizzled/user_var_entry.h \ |
657 | 517 | drizzled/utf8/checked.h \ | 517 | drizzled/utf8/checked.h \ |
658 | 518 | drizzled/utf8/core.h \ | 518 | drizzled/utf8/core.h \ |
659 | 519 | 519 | ||
660 | === modified file 'drizzled/main.cc' | |||
661 | --- drizzled/main.cc 2012-10-20 23:08:23 +0000 | |||
662 | +++ drizzled/main.cc 2013-02-27 17:19:19 +0000 | |||
663 | @@ -63,7 +63,7 @@ | |||
664 | 63 | #include <drizzled/session/cache.h> | 63 | #include <drizzled/session/cache.h> |
665 | 64 | #include <drizzled/signal_handler.h> | 64 | #include <drizzled/signal_handler.h> |
666 | 65 | #include <drizzled/transaction_services.h> | 65 | #include <drizzled/transaction_services.h> |
668 | 66 | #include <drizzled/unireg.h> | 66 | #include <drizzled/drizzled_abort.h> |
669 | 67 | #include <drizzled/util/backtrace.h> | 67 | #include <drizzled/util/backtrace.h> |
670 | 68 | #include <drizzled/current_session.h> | 68 | #include <drizzled/current_session.h> |
671 | 69 | #include <drizzled/daemon.h> | 69 | #include <drizzled/daemon.h> |
672 | @@ -272,7 +272,7 @@ | |||
673 | 272 | /* init_common_variables must get basic settings such as data_home_dir and plugin_load_list. */ | 272 | /* init_common_variables must get basic settings such as data_home_dir and plugin_load_list. */ |
674 | 273 | if (init_variables_before_daemonizing(argc, argv) == false) | 273 | if (init_variables_before_daemonizing(argc, argv) == false) |
675 | 274 | { | 274 | { |
677 | 275 | unireg_abort << "init_variables_before_daemonizing() failed"; // Will do exit | 275 | drizzled_abort << "init_variables_before_daemonizing() failed"; // Will do exit |
678 | 276 | } | 276 | } |
679 | 277 | 277 | ||
680 | 278 | if (opt_daemon and was_help_requested() == false) | 278 | if (opt_daemon and was_help_requested() == false) |
681 | @@ -284,18 +284,18 @@ | |||
682 | 284 | 284 | ||
683 | 285 | if (daemonize()) | 285 | if (daemonize()) |
684 | 286 | { | 286 | { |
686 | 287 | unireg_abort << "--daemon failed"; | 287 | drizzled_abort << "--daemon failed"; |
687 | 288 | } | 288 | } |
688 | 289 | } | 289 | } |
689 | 290 | 290 | ||
690 | 291 | if (init_variables_after_daemonizing(modules) == false) | 291 | if (init_variables_after_daemonizing(modules) == false) |
691 | 292 | { | 292 | { |
693 | 293 | unireg_abort << "init_variables_after_daemonizing() failed"; // Will do exit | 293 | drizzled_abort << "init_variables_after_daemonizing() failed"; // Will do exit |
694 | 294 | } | 294 | } |
695 | 295 | 295 | ||
696 | 296 | /* | 296 | /* |
697 | 297 | init signals & alarm | 297 | init signals & alarm |
699 | 298 | After this we can't quit by a simple unireg_abort | 298 | After this we can't quit by a simple drizzled_abort |
700 | 299 | */ | 299 | */ |
701 | 300 | 300 | ||
702 | 301 | init_signals(); | 301 | init_signals(); |
703 | @@ -307,7 +307,7 @@ | |||
704 | 307 | { | 307 | { |
705 | 308 | if (chdir(getDataHome().string().c_str())) | 308 | if (chdir(getDataHome().string().c_str())) |
706 | 309 | { | 309 | { |
708 | 310 | unireg_abort << "Data directory " << getDataHome().string() << " does not exist"; | 310 | drizzled_abort << "Data directory " << getDataHome().string() << " does not exist"; |
709 | 311 | } | 311 | } |
710 | 312 | 312 | ||
711 | 313 | ifstream old_uuid_file ("server.uuid"); | 313 | ifstream old_uuid_file ("server.uuid"); |
712 | @@ -338,13 +338,13 @@ | |||
713 | 338 | case EACCES: | 338 | case EACCES: |
714 | 339 | { | 339 | { |
715 | 340 | char cwd[1024]; | 340 | char cwd[1024]; |
717 | 341 | unireg_abort << "Could not create local catalog, permission denied in directory:" << getcwd(cwd, sizeof(cwd)); | 341 | drizzled_abort << "Could not create local catalog, permission denied in directory:" << getcwd(cwd, sizeof(cwd)); |
718 | 342 | } | 342 | } |
719 | 343 | 343 | ||
720 | 344 | default: | 344 | default: |
721 | 345 | { | 345 | { |
722 | 346 | char cwd[1024]; | 346 | char cwd[1024]; |
724 | 347 | unireg_abort << "Could not create local catalog, in directory:" << getcwd(cwd, sizeof(cwd)) << " system error was:" << strerror(errno); | 347 | drizzled_abort << "Could not create local catalog, in directory:" << getcwd(cwd, sizeof(cwd)) << " system error was:" << strerror(errno); |
725 | 348 | } | 348 | } |
726 | 349 | } | 349 | } |
727 | 350 | } | 350 | } |
728 | @@ -370,7 +370,7 @@ | |||
729 | 370 | cout << _("In File: ") << *::boost::get_error_info<boost::throw_file>(ex) << endl; | 370 | cout << _("In File: ") << *::boost::get_error_info<boost::throw_file>(ex) << endl; |
730 | 371 | cout << _("On Line: ") << *::boost::get_error_info<boost::throw_line>(ex) << endl; | 371 | cout << _("On Line: ") << *::boost::get_error_info<boost::throw_line>(ex) << endl; |
731 | 372 | #endif | 372 | #endif |
733 | 373 | unireg_abort << "init_server_components() failed"; | 373 | drizzled_abort << "init_server_components() failed"; |
734 | 374 | } | 374 | } |
735 | 375 | 375 | ||
736 | 376 | 376 | ||
737 | @@ -383,13 +383,13 @@ | |||
738 | 383 | * | 383 | * |
739 | 384 | * @todo | 384 | * @todo |
740 | 385 | * | 385 | * |
742 | 386 | * not checking return since unireg_abort() hangs | 386 | * not checking return since drizzled_abort() hangs |
743 | 387 | */ | 387 | */ |
744 | 388 | (void) ReplicationServices::evaluateRegisteredPlugins(); | 388 | (void) ReplicationServices::evaluateRegisteredPlugins(); |
745 | 389 | 389 | ||
746 | 390 | if (plugin::Listen::setup()) | 390 | if (plugin::Listen::setup()) |
747 | 391 | { | 391 | { |
749 | 392 | unireg_abort << "Failed plugin::Listen::setup()"; | 392 | drizzled_abort << "Failed plugin::Listen::setup()"; |
750 | 393 | } | 393 | } |
751 | 394 | 394 | ||
752 | 395 | assert(plugin::num_trx_monitored_objects > 0); | 395 | assert(plugin::num_trx_monitored_objects > 0); |
753 | 396 | 396 | ||
754 | === modified file 'drizzled/module/registry.h' | |||
755 | --- drizzled/module/registry.h 2011-08-16 01:07:54 +0000 | |||
756 | +++ drizzled/module/registry.h 2013-02-27 17:19:19 +0000 | |||
757 | @@ -29,7 +29,7 @@ | |||
758 | 29 | #include <boost/scoped_ptr.hpp> | 29 | #include <boost/scoped_ptr.hpp> |
759 | 30 | 30 | ||
760 | 31 | #include <drizzled/gettext.h> | 31 | #include <drizzled/gettext.h> |
762 | 32 | #include <drizzled/unireg.h> | 32 | #include <drizzled/drizzled_abort.h> |
763 | 33 | #include <drizzled/errmsg_print.h> | 33 | #include <drizzled/errmsg_print.h> |
764 | 34 | #include <drizzled/plugin/plugin.h> | 34 | #include <drizzled/plugin/plugin.h> |
765 | 35 | #include <drizzled/util/find_ptr.h> | 35 | #include <drizzled/util/find_ptr.h> |
766 | @@ -102,7 +102,7 @@ | |||
767 | 102 | error_message+= plugin->getTypeName(); | 102 | error_message+= plugin->getTypeName(); |
768 | 103 | error_message+= ":"; | 103 | error_message+= ":"; |
769 | 104 | error_message+= plugin->getName(); | 104 | error_message+= plugin->getName(); |
771 | 105 | unireg_actual_abort(__FILE__, __LINE__, __func__, error_message); | 105 | drizzled_actual_abort(__FILE__, __LINE__, __func__, error_message); |
772 | 106 | } | 106 | } |
773 | 107 | 107 | ||
774 | 108 | if (T::addPlugin(plugin)) | 108 | if (T::addPlugin(plugin)) |
775 | @@ -112,12 +112,12 @@ | |||
776 | 112 | error_message+= plugin->getTypeName(); | 112 | error_message+= plugin->getTypeName(); |
777 | 113 | error_message+= ":"; | 113 | error_message+= ":"; |
778 | 114 | error_message+= plugin->getName(); | 114 | error_message+= plugin->getName(); |
780 | 115 | unireg_actual_abort(__FILE__, __LINE__, __func__, error_message); | 115 | drizzled_actual_abort(__FILE__, __LINE__, __func__, error_message); |
781 | 116 | } | 116 | } |
782 | 117 | 117 | ||
783 | 118 | if (failed) | 118 | if (failed) |
784 | 119 | { | 119 | { |
786 | 120 | unireg_abort << _("Fatal error: Failed initializing: ") << plugin->getTypeName() << ":" << plugin->getName(); | 120 | drizzled_abort << _("Fatal error: Failed initializing: ") << plugin->getTypeName() << ":" << plugin->getName(); |
787 | 121 | } | 121 | } |
788 | 122 | plugin_registry.insert(std::make_pair(std::make_pair(plugin_type, plugin_name), plugin)); | 122 | plugin_registry.insert(std::make_pair(std::make_pair(plugin_type, plugin_name), plugin)); |
789 | 123 | } | 123 | } |
discussed (and approved) with Brian over email