Merge lp:~mordred/drizzle/drizzled-as-lib into lp:~drizzle-trunk/drizzle/development

Proposed by Monty Taylor
Status: Merged
Merged at revision: not available
Proposed branch: lp:~mordred/drizzle/drizzled-as-lib
Merge into: lp:~drizzle-trunk/drizzle/development
Prerequisite: lp:~mordred/drizzle/use-std-unordered
Diff against target: 3341 lines (+1195/-1142)
44 files modified
Makefile.am (+2/-1)
drizzled/cursor.cc (+24/-0)
drizzled/cursor.h (+9/-6)
drizzled/data_home.h (+5/-3)
drizzled/drizzled.cc (+45/-484)
drizzled/drizzled.h (+65/-0)
drizzled/function/str/load_file.cc (+1/-1)
drizzled/include.am (+353/-341)
drizzled/internal/include.am (+2/-1)
drizzled/internal/my_pthread.h (+0/-24)
drizzled/main.cc (+328/-0)
drizzled/message/include.am (+4/-3)
drizzled/optimizer/range.cc (+0/-181)
drizzled/pthread_globals.h (+1/-0)
drizzled/schema_identifier.cc (+1/-1)
drizzled/session.cc (+4/-5)
drizzled/session_list.cc (+1/-1)
drizzled/set_var.cc (+1/-1)
drizzled/signal_handler.cc (+212/-0)
drizzled/signal_handler.h (+55/-0)
drizzled/sql_base.cc (+1/-2)
drizzled/sql_load.cc (+3/-3)
drizzled/sql_table.cc (+1/-6)
drizzled/sql_table.h (+0/-4)
drizzled/stacktrace.cc (+11/-2)
drizzled/stacktrace.h (+0/-4)
drizzled/statement/alter_table.cc (+5/-5)
drizzled/statement/rename_table.cc (+1/-1)
drizzled/table.cc (+0/-26)
drizzled/table_identifier.cc (+3/-4)
extra/include.am (+1/-4)
plugin/archive/ha_archive.cc (+2/-11)
plugin/archive/ha_archive.h (+0/-4)
plugin/innobase/handler/ha_innodb.cc (+1/-1)
plugin/myisam/plugin.ini (+1/-1)
plugin/pbxt/src/ha_pbxt.h (+5/-5)
plugin/pbxt/src/myxt_xt.cc (+1/-1)
plugin/pbxt/src/table_xt.cc (+8/-0)
plugin/pbxt/src/xt_defs.h (+1/-1)
plugin/schema_engine/schema.cc (+2/-2)
plugin/signal_handler/signal_handler.cc (+2/-1)
support-files/drizzle.spec.in (+6/-0)
tests/test-run.pl (+3/-1)
tests/valgrind.supp (+24/-0)
To merge this branch: bzr merge lp:~mordred/drizzle/drizzled-as-lib
Reviewer Review Type Date Requested Status
Eric Day Pending
Brian Aker Pending
Review via email: mp+23590@code.launchpad.net

This proposal supersedes a proposal from 2010-04-01.

Description of the change

Changed the build to build most of the code as a shared lib and then link that into the drizzled binary. This does _NOT_ make it any sort of embedded server or make the lib particularly useful - except for pre-linking plugins against for link-time symbol resolution checking. It will also make it easier for us to start applying visibility structures to objects. YAY ABI!

To post a comment you must log in.
Revision history for this message
Eric Day (eday) wrote : Posted in a previous version of this proposal

Looks great! Excited to get the new main.cc whittled down even more.

review: Approve
Revision history for this message
Monty Taylor (mordred) wrote : Posted in a previous version of this proposal

Slight issue with the gdbinit file when starting from mtr I need to fix...

Revision history for this message
Monty Taylor (mordred) wrote : Posted in a previous version of this proposal

Got it.

Revision history for this message
Brian Aker (brianaker) wrote : Posted in a previous version of this proposal

Hi!

This has some of the DRIZZLE_DECLARE_PLUGIN patch in it. This needs to be submitted without it.

Cheers,
  -Brian

review: Needs Fixing
Revision history for this message
Monty Taylor (mordred) wrote : Posted in a previous version of this proposal

Merged up with latest in trunk and removed the drizzle-declare-plugin branch.

lp:~mordred/drizzle/drizzled-as-lib updated
1475. By Monty Taylor

Merged trunk.

1476. By Monty Taylor

Fixed a symbol oops.

Revision history for this message
Jay Pipes (jaypipes) wrote :

Note that this also has the latest pandora build merged in as well...

lp:~mordred/drizzle/drizzled-as-lib updated
1477. By Monty Taylor

Merged up with build.

1478. By Monty Taylor

We need to launch drizzled via libtool now.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile.am'
2--- Makefile.am 2010-04-16 00:08:16 +0000
3+++ Makefile.am 2010-04-19 20:33:26 +0000
4@@ -22,6 +22,7 @@
5 noinst_HEADERS =
6 nobase_nodist_include_HEADERS =
7 nobase_dist_include_HEADERS =
8+sbin_PROGRAMS =
9 lib_LTLIBRARIES =
10 noinst_LTLIBRARIES =
11 noinst_PROGRAMS =
12@@ -124,11 +125,11 @@
13
14 include config/lint-source.am
15
16+include drizzled/message/include.am
17 include drizzled/include.am
18 include drizzled/internal/include.am
19 include drizzled/algorithm/include.am
20 include drizzled/util/include.am
21-include drizzled/message/include.am
22 include client/include.am
23 include extra/include.am
24 include support-files/include.am
25
26=== modified file 'drizzled/cursor.cc'
27--- drizzled/cursor.cc 2010-04-08 16:25:53 +0000
28+++ drizzled/cursor.cc 2010-04-19 20:33:26 +0000
29@@ -90,6 +90,30 @@
30 return NULL;
31 }
32
33+/*
34+ DESCRIPTION
35+ given a buffer with a key value, and a map of keyparts
36+ that are present in this value, returns the length of the value
37+*/
38+uint32_t Cursor::calculate_key_len(uint32_t key_position, key_part_map keypart_map_arg)
39+{
40+ /* works only with key prefixes */
41+ assert(((keypart_map_arg + 1) & keypart_map_arg) == 0);
42+
43+ KEY *key_info_found= table->s->key_info + key_position;
44+ KEY_PART_INFO *key_part_found= key_info_found->key_part;
45+ KEY_PART_INFO *end_key_part_found= key_part_found + key_info_found->key_parts;
46+ uint32_t length= 0;
47+
48+ while (key_part_found < end_key_part_found && keypart_map_arg)
49+ {
50+ length+= key_part_found->store_length;
51+ keypart_map_arg >>= 1;
52+ key_part_found++;
53+ }
54+ return length;
55+}
56+
57 int Cursor::ha_index_init(uint32_t idx, bool sorted)
58 {
59 int result;
60
61=== modified file 'drizzled/cursor.h'
62--- drizzled/cursor.h 2010-04-09 11:55:54 +0000
63+++ drizzled/cursor.h 2010-04-19 20:33:26 +0000
64@@ -92,7 +92,6 @@
65 class CostVector;
66 }
67
68-uint32_t calculate_key_len(Table *, uint, const unsigned char *, key_part_map);
69 /*
70 bitmap with first N+1 bits set
71 (keypart_map for a key prefix of [0..N] keyparts)
72@@ -357,11 +356,11 @@
73 row if available. If the key value is null, begin at the first key of the
74 index.
75 */
76- virtual int index_read_map(unsigned char * buf, const unsigned char * key,
77+ virtual int index_read_map(unsigned char * buf, const unsigned char *key,
78 key_part_map keypart_map,
79 enum ha_rkey_function find_flag)
80 {
81- uint32_t key_len= calculate_key_len(table, active_index, key, keypart_map);
82+ uint32_t key_len= calculate_key_len(active_index, keypart_map);
83 return index_read(buf, key, key_len, find_flag);
84 }
85 /**
86@@ -383,6 +382,11 @@
87 virtual int index_last(unsigned char *)
88 { return HA_ERR_WRONG_COMMAND; }
89 virtual int index_next_same(unsigned char *, const unsigned char *, uint32_t);
90+
91+private:
92+ uint32_t calculate_key_len(uint32_t key_position, key_part_map keypart_map_arg);
93+public:
94+
95 /**
96 @brief
97 The following functions works like index_read, but it find the last
98@@ -391,7 +395,7 @@
99 virtual int index_read_last_map(unsigned char * buf, const unsigned char * key,
100 key_part_map keypart_map)
101 {
102- uint32_t key_len= calculate_key_len(table, active_index, key, keypart_map);
103+ uint32_t key_len= calculate_key_len(active_index, keypart_map);
104 return index_read_last(buf, key, key_len);
105 }
106 virtual int read_range_first(const key_range *start_key,
107@@ -733,8 +737,7 @@
108
109 bool mysql_rename_table(plugin::StorageEngine *base,
110 TableIdentifier &old_identifier,
111- TableIdentifier &new_identifier,
112- uint32_t flags);
113+ TableIdentifier &new_identifier);
114
115 bool mysql_prepare_update(Session *session, TableList *table_list,
116 Item **conds, uint32_t order_num, order_st *order);
117
118=== modified file 'drizzled/data_home.h'
119--- drizzled/data_home.h 2010-02-04 08:14:46 +0000
120+++ drizzled/data_home.h 2010-04-19 20:33:26 +0000
121@@ -23,9 +23,11 @@
122 namespace drizzled
123 {
124
125-extern uint32_t drizzle_data_home_len;
126-extern char *drizzle_data_home,
127- drizzle_real_data_home[], drizzle_unpacked_real_data_home[];
128+extern char *data_home;
129+extern uint32_t data_home_len;
130+extern char data_home_real[];
131+extern char data_home_real_unpacked[];
132+extern char data_home_buff[];
133
134 } /* namespace drizzled */
135
136
137=== modified file 'drizzled/drizzled.cc'
138--- drizzled/drizzled.cc 2010-04-07 15:56:28 +0000
139+++ drizzled/drizzled.cc 2010-04-19 20:33:26 +0000
140@@ -31,7 +31,6 @@
141 #include "drizzled/internal/my_sys.h"
142 #include "drizzled/internal/my_bit.h"
143 #include <drizzled/my_hash.h>
144-#include <drizzled/stacktrace.h>
145 #include <drizzled/error.h>
146 #include <drizzled/errmsg_print.h>
147 #include <drizzled/tztime.h>
148@@ -54,6 +53,7 @@
149 #include "drizzled/session_list.h"
150 #include "drizzled/charset.h"
151 #include "plugin/myisam/myisam.h"
152+#include "drizzled/drizzled.h"
153
154 #include <google/protobuf/stubs/common.h>
155
156@@ -73,8 +73,6 @@
157 #endif
158 #include <sys/socket.h>
159
160-#include <locale.h>
161-
162
163 #include <errno.h>
164 #include <sys/stat.h>
165@@ -85,8 +83,6 @@
166 #include <pwd.h> // For getpwent
167 #include <grp.h>
168
169-#include <sys/resource.h>
170-
171 #ifdef HAVE_SELECT_H
172 # include <select.h>
173 #endif
174@@ -191,8 +187,8 @@
175 /*
176 Used with --help for detailed option
177 */
178-static bool opt_help= false;
179-static bool opt_help_extended= false;
180+bool opt_help= false;
181+bool opt_help_extended= false;
182
183 arg_cmp_func Arg_comparator::comparator_matrix[5][2] =
184 {{&Arg_comparator::compare_string, &Arg_comparator::compare_e_string},
185@@ -203,12 +199,9 @@
186
187 /* static variables */
188
189-static bool volatile select_thread_in_use;
190-static bool volatile ready_to_exit;
191 static bool opt_debugging= 0;
192 static uint32_t wake_thread;
193-static uint32_t killed_threads;
194-static char *drizzled_user, *drizzled_chroot;
195+static char *drizzled_chroot;
196 static char *language_ptr;
197 static const char *default_character_set_name;
198 static const char *character_set_filesystem_name;
199@@ -219,6 +212,9 @@
200
201 /* Global variables */
202
203+bool volatile ready_to_exit;
204+char *drizzled_user;
205+bool volatile select_thread_in_use;
206 bool volatile abort_loop;
207 bool volatile shutdown_in_progress;
208 uint32_t max_used_connections;
209@@ -235,7 +231,7 @@
210
211 char* opt_secure_file_priv= 0;
212
213-static bool calling_initgroups= false; /**< Used in SIGSEGV handler. */
214+bool calling_initgroups= false; /**< Used in SIGSEGV handler. */
215
216 uint32_t drizzled_bind_timeout;
217 std::bitset<12> test_flags;
218@@ -294,15 +290,15 @@
219 char drizzle_home[FN_REFLEN], pidfile_name[FN_REFLEN], system_time_zone[30];
220 char *default_tz_name;
221 char glob_hostname[FN_REFLEN];
222-char drizzle_real_data_home[FN_REFLEN],
223+char data_home_real[FN_REFLEN],
224 language[FN_REFLEN],
225 *opt_tc_log_file;
226-char drizzle_unpacked_real_data_home[FN_REFLEN];
227+char data_home_real_unpacked[FN_REFLEN];
228 const key_map key_map_empty(0);
229 key_map key_map_full(0); // Will be initialized later
230
231-uint32_t drizzle_data_home_len;
232-char drizzle_data_home_buff[2], *drizzle_data_home=drizzle_real_data_home;
233+uint32_t data_home_len;
234+char data_home_buff[2], *data_home=data_home_real;
235 char *drizzle_tmpdir= NULL;
236 char *opt_drizzle_tmpdir= NULL;
237
238@@ -347,15 +343,12 @@
239
240 /* Static variables */
241
242-static bool segfaulted;
243 int cleanup_done;
244 static char *drizzle_home_ptr, *pidfile_name_ptr;
245 static int defaults_argc;
246 static char **defaults_argv;
247
248-struct passwd *user_info;
249-static pthread_t select_thread;
250-static uint32_t thr_kill_signal;
251+passwd *user_info;
252
253 /**
254 Number of currently active user connections. The variable is protected by
255@@ -379,10 +372,8 @@
256 static const char *get_relative_path(const char *path);
257 static void fix_paths(string &progname);
258 extern "C" pthread_handler_t handle_slave(void *arg);
259-static void clean_up(bool print_message);
260
261 static void usage(void);
262-static void clean_up_mutexes(void);
263 void close_connections(void);
264
265 /****************************************************************************
266@@ -467,20 +458,6 @@
267 }
268 }
269
270-extern "C" void print_signal_warning(int sig);
271-
272-extern "C" void print_signal_warning(int sig)
273-{
274- if (global_system_variables.log_warnings)
275- errmsg_printf(ERRMSG_LVL_WARN, _("Got signal %d from thread %"PRIu64),
276- sig, global_thread_id);
277-#ifndef HAVE_BSD_SIGNALS
278- my_sigset(sig,print_signal_warning); /* int. thread system calls */
279-#endif
280- if (sig == SIGALRM)
281- alarm(2); /* reschedule alarm */
282-}
283-
284 /**
285 cleanup all memory and end program nicely.
286
287@@ -517,7 +494,7 @@
288 }
289
290
291-static void clean_up(bool print_message)
292+void clean_up(bool print_message)
293 {
294 if (cleanup_done++)
295 return;
296@@ -559,7 +536,7 @@
297 } /* clean_up */
298
299
300-static void clean_up_mutexes()
301+void clean_up_mutexes()
302 {
303 (void) pthread_mutex_destroy(&LOCK_create_db);
304 (void) pthread_mutex_destroy(&LOCK_open);
305@@ -577,9 +554,9 @@
306
307 /* Change to run as another user if started with --user */
308
309-static struct passwd *check_user(const char *user)
310+passwd *check_user(const char *user)
311 {
312- struct passwd *tmp_user_info;
313+ passwd *tmp_user_info;
314 uid_t user_id= geteuid();
315
316 // Don't bother if we aren't superuser
317@@ -637,7 +614,7 @@
318
319 }
320
321-static void set_user(const char *user, struct passwd *user_info_arg)
322+void set_user(const char *user, passwd *user_info_arg)
323 {
324 assert(user_info_arg != 0);
325 /*
326@@ -662,6 +639,7 @@
327 }
328
329
330+
331 /** Change root user if started with @c --chroot . */
332 static void set_root(const char *path)
333 {
334@@ -672,21 +650,6 @@
335 }
336 }
337
338-extern "C" void end_thread_signal(int );
339-
340-/** Called when a thread is aborted. */
341-extern "C" void end_thread_signal(int )
342-{
343- Session *session=current_session;
344- if (session)
345- {
346- statistic_increment(killed_threads, &LOCK_status);
347- session->scheduler->killSessionNow(session);
348- DRIZZLE_CONNECTION_DONE(session->thread_id);
349- }
350- return;
351-}
352-
353
354 /*
355 Unlink session from global list of available connections and free session
356@@ -734,148 +697,6 @@
357 }
358 #endif
359
360-#if defined(BACKTRACE_DEMANGLE)
361-#include <cxxabi.h>
362-extern "C" char *my_demangle(const char *mangled_name, int *status)
363-{
364- return abi::__cxa_demangle(mangled_name, NULL, NULL, status);
365-}
366-#endif
367-
368-extern "C" void handle_segfault(int sig);
369-
370-extern "C" void handle_segfault(int sig)
371-{
372- time_t curr_time;
373- struct tm tm;
374-
375- /*
376- Strictly speaking, one needs a mutex here
377- but since we have got SIGSEGV already, things are a mess
378- so not having the mutex is not as bad as possibly using a buggy
379- mutex - so we keep things simple
380- */
381- if (segfaulted)
382- {
383- fprintf(stderr, _("Fatal signal %d while backtracing\n"), sig);
384- exit(1);
385- }
386-
387- segfaulted = 1;
388-
389- curr_time= time(NULL);
390- if(curr_time == (time_t)-1)
391- {
392- fprintf(stderr, "Fetal: time() call failed\n");
393- exit(1);
394- }
395-
396- localtime_r(&curr_time, &tm);
397-
398- fprintf(stderr,"%02d%02d%02d %2d:%02d:%02d - drizzled got signal %d;\n"
399- "This could be because you hit a bug. It is also possible that "
400- "this binary\n or one of the libraries it was linked against is "
401- "corrupt, improperly built,\n or misconfigured. This error can "
402- "also be caused by malfunctioning hardware.\n",
403- tm.tm_year % 100, tm.tm_mon+1, tm.tm_mday,
404- tm.tm_hour, tm.tm_min, tm.tm_sec,
405- sig);
406- fprintf(stderr, _("We will try our best to scrape up some info that "
407- "will hopefully help diagnose\n"
408- "the problem, but since we have already crashed, "
409- "something is definitely wrong\nand this may fail.\n\n"));
410- fprintf(stderr, "key_buffer_size=%u\n",
411- (uint32_t) dflt_key_cache->key_cache_mem_size);
412- fprintf(stderr, "read_buffer_size=%ld\n", (long) global_system_variables.read_buff_size);
413- fprintf(stderr, "max_used_connections=%u\n", max_used_connections);
414- fprintf(stderr, "connection_count=%u\n", uint32_t(connection_count));
415- fprintf(stderr, _("It is possible that drizzled could use up to \n"
416- "key_buffer_size + (read_buffer_size + "
417- "sort_buffer_size)*thread_count\n"
418- "bytes of memory\n"
419- "Hope that's ok; if not, decrease some variables in the "
420- "equation.\n\n"));
421-
422-#ifdef HAVE_STACKTRACE
423- Session *session= current_session;
424-
425- if (! (test_flags.test(TEST_NO_STACKTRACE)))
426- {
427- fprintf(stderr,"session: 0x%lx\n",(long) session);
428- fprintf(stderr,_("Attempting backtrace. You can use the following "
429- "information to find out\n"
430- "where drizzled died. If you see no messages after this, "
431- "something went\n"
432- "terribly wrong...\n"));
433- print_stacktrace(session ? (unsigned char*) session->thread_stack : (unsigned char*) 0,
434- my_thread_stack_size);
435- }
436- if (session)
437- {
438- const char *kreason= "UNKNOWN";
439- switch (session->killed) {
440- case Session::NOT_KILLED:
441- kreason= "NOT_KILLED";
442- break;
443- case Session::KILL_BAD_DATA:
444- kreason= "KILL_BAD_DATA";
445- break;
446- case Session::KILL_CONNECTION:
447- kreason= "KILL_CONNECTION";
448- break;
449- case Session::KILL_QUERY:
450- kreason= "KILL_QUERY";
451- break;
452- case Session::KILLED_NO_VALUE:
453- kreason= "KILLED_NO_VALUE";
454- break;
455- }
456- fprintf(stderr, _("Trying to get some variables.\n"
457- "Some pointers may be invalid and cause the "
458- "dump to abort...\n"));
459- safe_print_str("session->query", session->query.c_str(), 1024);
460- fprintf(stderr, "session->thread_id=%"PRIu32"\n", (uint32_t) session->thread_id);
461- fprintf(stderr, "session->killed=%s\n", kreason);
462- }
463- fflush(stderr);
464-#endif /* HAVE_STACKTRACE */
465-
466- if (calling_initgroups)
467- fprintf(stderr, _("\nThis crash occurred while the server was calling "
468- "initgroups(). This is\n"
469- "often due to the use of a drizzled that is statically "
470- "linked against glibc\n"
471- "and configured to use LDAP in /etc/nsswitch.conf. "
472- "You will need to either\n"
473- "upgrade to a version of glibc that does not have this "
474- "problem (2.3.4 or\n"
475- "later when used with nscd), disable LDAP in your "
476- "nsswitch.conf, or use a\n"
477- "drizzled that is not statically linked.\n"));
478-
479- if (internal::thd_lib_detected == THD_LIB_LT && !getenv("LD_ASSUME_KERNEL"))
480- fprintf(stderr,
481- _("\nYou are running a statically-linked LinuxThreads binary "
482- "on an NPTL system.\n"
483- "This can result in crashes on some distributions due "
484- "to LT/NPTL conflicts.\n"
485- "You should either build a dynamically-linked binary, or force "
486- "LinuxThreads\n"
487- "to be used with the LD_ASSUME_KERNEL environment variable. "
488- "Please consult\n"
489- "the documentation for your distribution on how to do that.\n"));
490-
491-#ifdef HAVE_WRITE_CORE
492- if (test_flags.test(TEST_CORE_ON_SIGNAL))
493- {
494- fprintf(stderr, _("Writing a core file\n"));
495- fflush(stderr);
496- write_core(sig);
497- }
498-#endif
499-
500- exit(1);
501-}
502
503 #ifndef SA_RESETHAND
504 #define SA_RESETHAND 0
505@@ -885,65 +706,12 @@
506 #endif
507
508
509-/**
510- All global error messages are sent here where the first one is stored
511- for the client.
512-*/
513-static void my_message_sql(uint32_t error, const char *str, myf MyFlags)
514+
515+
516+const char *load_default_groups[]=
517 {
518- Session *session;
519- /*
520- Put here following assertion when situation with EE_* error codes
521- will be fixed
522- */
523- if ((session= current_session))
524- {
525- if (MyFlags & ME_FATALERROR)
526- session->is_fatal_error= 1;
527-
528- /*
529- TODO: There are two exceptions mechanism (Session and sp_rcontext),
530- this could be improved by having a common stack of handlers.
531- */
532- if (session->handle_error(error, str,
533- DRIZZLE_ERROR::WARN_LEVEL_ERROR))
534- return;;
535-
536- /*
537- session->lex->current_select == 0 if lex structure is not inited
538- (not query command (COM_QUERY))
539- */
540- if (! (session->lex->current_select &&
541- session->lex->current_select->no_error && !session->is_fatal_error))
542- {
543- if (! session->main_da.is_error()) // Return only first message
544- {
545- if (error == 0)
546- error= ER_UNKNOWN_ERROR;
547- if (str == NULL)
548- str= ER(error);
549- session->main_da.set_error_status(error, str);
550- }
551- }
552-
553- if (!session->no_warnings_for_error && !session->is_fatal_error)
554- {
555- /*
556- Suppress infinite recursion if there a memory allocation error
557- inside push_warning.
558- */
559- session->no_warnings_for_error= true;
560- push_warning(session, DRIZZLE_ERROR::WARN_LEVEL_ERROR, error, str);
561- session->no_warnings_for_error= false;
562- }
563- }
564- if (!session || MyFlags & ME_NOREFRESH)
565- errmsg_printf(ERRMSG_LVL_ERROR, "%s: %s",internal::my_progname,str);
566-}
567-
568-
569-static const char *load_default_groups[]= {
570-DRIZZLE_CONFIG_NAME, "server", 0, 0};
571+ DRIZZLE_CONFIG_NAME, "server", 0, 0
572+};
573
574 static int show_starttime(drizzle_show_var *var, char *buff)
575 {
576@@ -1061,8 +829,8 @@
577 {NULL, NULL, SHOW_LONGLONG}
578 };
579
580-static int init_common_variables(const char *conf_file_name, int argc,
581- char **argv, const char **groups)
582+int init_common_variables(const char *conf_file_name, int argc,
583+ char **argv, const char **groups)
584 {
585 time_t curr_time;
586 umask(((~internal::my_umask) & 0666));
587@@ -1211,7 +979,7 @@
588 }
589
590
591-static int init_server_components(plugin::Registry &plugins)
592+int init_server_components(plugin::Registry &plugins)
593 {
594 /*
595 We need to call each of these following functions to ensure that
596@@ -1446,8 +1214,8 @@
597 NO_ARG, 0, 0, 0, 0, 0, 0},
598 {"datadir", 'h',
599 N_("Path to the database root."),
600- (char**) &drizzle_data_home,
601- (char**) &drizzle_data_home, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
602+ (char**) &data_home,
603+ (char**) &data_home, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
604 {"default-storage-engine", OPT_STORAGE_ENGINE,
605 N_("Set the default storage engine (table type) for tables."),
606 (char**)&default_storage_engine_str, (char**)&default_storage_engine_str,
607@@ -1793,7 +1561,6 @@
608 drizzle_home[0]= pidfile_name[0]= 0;
609 opt_tc_log_file= (char *)"tc.log"; // no hostname in tc_log file name !
610 opt_secure_file_priv= 0;
611- segfaulted= 0;
612 cleanup_done= 0;
613 defaults_argc= 0;
614 defaults_argv= 0;
615@@ -1818,7 +1585,7 @@
616 drizzle_home_ptr= drizzle_home;
617 pidfile_name_ptr= pidfile_name;
618 language_ptr= language;
619- drizzle_data_home= drizzle_real_data_home;
620+ data_home= data_home_real;
621 session_startup_options= (OPTION_AUTO_IS_NULL | OPTION_SQL_NOTES);
622 refresh_version= 1L; /* Increments on each reload */
623 global_thread_id= 1UL;
624@@ -1826,11 +1593,11 @@
625
626 /* Set directory paths */
627 strncpy(language, LANGUAGE, sizeof(language)-1);
628- strncpy(drizzle_real_data_home, get_relative_path(LOCALSTATEDIR),
629- sizeof(drizzle_real_data_home)-1);
630- drizzle_data_home_buff[0]=FN_CURLIB; // all paths are relative from here
631- drizzle_data_home_buff[1]=0;
632- drizzle_data_home_len= 2;
633+ strncpy(data_home_real, get_relative_path(LOCALSTATEDIR),
634+ sizeof(data_home_real)-1);
635+ data_home_buff[0]=FN_CURLIB; // all paths are relative from here
636+ data_home_buff[1]=0;
637+ data_home_len= 2;
638
639 /* Variables in libraries */
640 default_character_set_name= "utf8";
641@@ -1877,10 +1644,10 @@
642 default_collation_name= 0;
643 break;
644 case 'h':
645- strncpy(drizzle_real_data_home,argument, sizeof(drizzle_real_data_home)-1);
646+ strncpy(data_home_real,argument, sizeof(data_home_real)-1);
647 /* Correct pointer set by my_getopt (for embedded library) */
648- drizzle_data_home= drizzle_real_data_home;
649- drizzle_data_home_len= strlen(drizzle_data_home);
650+ data_home= data_home_real;
651+ data_home_len= strlen(data_home);
652 break;
653 case 'u':
654 if (!drizzled_user || !strcmp(drizzled_user, argument))
655@@ -2065,14 +1832,14 @@
656 pos[0]= FN_LIBCHAR;
657 pos[1]= 0;
658 }
659- internal::convert_dirname(drizzle_real_data_home,drizzle_real_data_home,NULL);
660- (void) internal::fn_format(buff, drizzle_real_data_home, "", "",
661+ internal::convert_dirname(data_home_real,data_home_real,NULL);
662+ (void) internal::fn_format(buff, data_home_real, "", "",
663 (MY_RETURN_REAL_PATH|MY_RESOLVE_SYMLINKS));
664- (void) internal::unpack_dirname(drizzle_unpacked_real_data_home, buff);
665+ (void) internal::unpack_dirname(data_home_real_unpacked, buff);
666 internal::convert_dirname(language,language,NULL);
667 (void) internal::my_load_path(drizzle_home, drizzle_home,""); // Resolve current dir
668- (void) internal::my_load_path(drizzle_real_data_home, drizzle_real_data_home,drizzle_home);
669- (void) internal::my_load_path(pidfile_name, pidfile_name,drizzle_real_data_home);
670+ (void) internal::my_load_path(data_home_real, data_home_real,drizzle_home);
671+ (void) internal::my_load_path(pidfile_name, pidfile_name,data_home_real);
672
673 if (opt_plugin_dir_ptr == NULL)
674 {
675@@ -2100,11 +1867,11 @@
676 progdir.assign(progdir.substr(0, progdir.rfind(".libs/")));
677 }
678 string testfile(progdir);
679- testfile.append("drizzled.o");
680+ testfile.append("drizzled.lo");
681 struct stat testfile_stat;
682 if (stat(testfile.c_str(), &testfile_stat))
683 {
684- /* drizzled.o doesn't exist - we are not in a source dir.
685+ /* drizzled.lo doesn't exist - we are not in a source dir.
686 * Go on as usual
687 */
688 (void) internal::my_load_path(opt_plugin_dir, get_relative_path(PKGPLUGINDIR),
689@@ -2173,209 +1940,3 @@
690
691 } /* namespace drizzled */
692
693-using namespace drizzled;
694-
695-
696-static void init_signals(void)
697-{
698- sigset_t set;
699- struct sigaction sa;
700-
701- if (!(test_flags.test(TEST_NO_STACKTRACE) ||
702- test_flags.test(TEST_CORE_ON_SIGNAL)))
703- {
704- sa.sa_flags = SA_RESETHAND | SA_NODEFER;
705- sigemptyset(&sa.sa_mask);
706- sigprocmask(SIG_SETMASK,&sa.sa_mask,NULL);
707-
708- init_stacktrace();
709- sa.sa_handler=handle_segfault;
710- sigaction(SIGSEGV, &sa, NULL);
711- sigaction(SIGABRT, &sa, NULL);
712-#ifdef SIGBUS
713- sigaction(SIGBUS, &sa, NULL);
714-#endif
715- sigaction(SIGILL, &sa, NULL);
716- sigaction(SIGFPE, &sa, NULL);
717- }
718-
719- if (test_flags.test(TEST_CORE_ON_SIGNAL))
720- {
721- /* Change limits so that we will get a core file */
722- struct rlimit rl;
723- rl.rlim_cur = rl.rlim_max = RLIM_INFINITY;
724- if (setrlimit(RLIMIT_CORE, &rl) && global_system_variables.log_warnings)
725- errmsg_printf(ERRMSG_LVL_WARN,
726- _("setrlimit could not change the size of core files "
727- "to 'infinity'; We may not be able to generate a "
728- "core file on signals"));
729- }
730- (void) sigemptyset(&set);
731- my_sigset(SIGPIPE,SIG_IGN);
732- sigaddset(&set,SIGPIPE);
733-#ifndef IGNORE_SIGHUP_SIGQUIT
734- sigaddset(&set,SIGQUIT);
735- sigaddset(&set,SIGHUP);
736-#endif
737- sigaddset(&set,SIGTERM);
738-
739- /* Fix signals if blocked by parents (can happen on Mac OS X) */
740- sigemptyset(&sa.sa_mask);
741- sa.sa_flags = 0;
742- sa.sa_handler = print_signal_warning;
743- sigaction(SIGTERM, &sa, (struct sigaction*) 0);
744- sa.sa_flags = 0;
745- sa.sa_handler = print_signal_warning;
746- sigaction(SIGHUP, &sa, (struct sigaction*) 0);
747-#ifdef SIGTSTP
748- sigaddset(&set,SIGTSTP);
749-#endif
750- if (test_flags.test(TEST_SIGINT))
751- {
752- my_sigset(thr_kill_signal, end_thread_signal);
753- // May be SIGINT
754- sigdelset(&set, thr_kill_signal);
755- }
756- else
757- sigaddset(&set,SIGINT);
758- sigprocmask(SIG_SETMASK,&set,NULL);
759- pthread_sigmask(SIG_SETMASK,&set,NULL);
760- return;;
761-}
762-
763-int main(int argc, char **argv)
764-{
765-#if defined(ENABLE_NLS)
766-# if defined(HAVE_LOCALE_H)
767- setlocale(LC_ALL, "");
768-# endif
769- bindtextdomain("drizzle", LOCALEDIR);
770- textdomain("drizzle");
771-#endif
772-
773- plugin::Registry &plugins= plugin::Registry::singleton();
774- plugin::Client *client;
775- Session *session;
776-
777- MY_INIT(argv[0]); // init my_sys library & pthreads
778- /* nothing should come before this line ^^^ */
779-
780- /* Set signal used to kill Drizzle */
781-#if defined(SIGUSR2)
782- thr_kill_signal= internal::thd_lib_detected == THD_LIB_LT ? SIGINT : SIGUSR2;
783-#else
784- thr_kill_signal= SIGINT;
785-#endif
786-
787- if (init_common_variables(DRIZZLE_CONFIG_NAME,
788- argc, argv, load_default_groups))
789- unireg_abort(1); // Will do exit
790-
791- init_signals();
792-
793-
794- select_thread=pthread_self();
795- select_thread_in_use=1;
796-
797- if (chdir(drizzle_real_data_home) && !opt_help)
798- {
799- errmsg_printf(ERRMSG_LVL_ERROR, _("Data directory %s does not exist\n"), drizzle_real_data_home);
800- unireg_abort(1);
801- }
802- drizzle_data_home= drizzle_data_home_buff;
803- drizzle_data_home[0]=FN_CURLIB; // all paths are relative from here
804- drizzle_data_home[1]=0;
805- drizzle_data_home_len= 2;
806-
807- if ((user_info= check_user(drizzled_user)))
808- {
809- set_user(drizzled_user, user_info);
810- }
811-
812- if (server_id == 0)
813- {
814- server_id= 1;
815- }
816-
817- if (init_server_components(plugins))
818- unireg_abort(1);
819-
820- /**
821- * This check must be done after init_server_components for now
822- * because we don't yet have plugin dependency tracking...
823- *
824- * ReplicationServices::evaluateRegisteredPlugins() will print error messages to stderr
825- * via errmsg_printf().
826- *
827- * @todo
828- *
829- * not checking return since unireg_abort() hangs
830- */
831- ReplicationServices &replication_services= ReplicationServices::singleton();
832- (void) replication_services.evaluateRegisteredPlugins();
833-
834- if (plugin::Listen::setup())
835- unireg_abort(1);
836-
837- /*
838- init signals & alarm
839- After this we can't quit by a simple unireg_abort
840- */
841- error_handler_hook= my_message_sql;
842-
843- assert(plugin::num_trx_monitored_objects > 0);
844- if (drizzle_rm_tmp_tables() ||
845- my_tz_init((Session *)0, default_tz_name))
846- {
847- abort_loop= true;
848- select_thread_in_use=0;
849- (void) pthread_kill(signal_thread, SIGTERM);
850-
851- (void) unlink(pidfile_name); // Not needed anymore
852-
853- exit(1);
854- }
855-
856- init_status_vars();
857-
858- errmsg_printf(ERRMSG_LVL_INFO, _(ER(ER_STARTUP)), internal::my_progname,
859- PANDORA_RELEASE_VERSION, COMPILATION_COMMENT);
860-
861-
862- /* Listen for new connections and start new session for each connection
863- accepted. The listen.getClient() method will return NULL when the server
864- should be shutdown. */
865- while ((client= plugin::Listen::getClient()) != NULL)
866- {
867- if (!(session= new Session(client)))
868- {
869- delete client;
870- continue;
871- }
872-
873- /* If we error on creation we drop the connection and delete the session. */
874- if (session->schedule())
875- Session::unlink(session);
876- }
877-
878- /* (void) pthread_attr_destroy(&connection_attrib); */
879-
880-
881- (void) pthread_mutex_lock(&LOCK_thread_count);
882- select_thread_in_use=0; // For close_connections
883- (void) pthread_mutex_unlock(&LOCK_thread_count);
884- (void) pthread_cond_broadcast(&COND_thread_count);
885-
886- /* Wait until cleanup is done */
887- (void) pthread_mutex_lock(&LOCK_thread_count);
888- while (!ready_to_exit)
889- pthread_cond_wait(&COND_server_end,&LOCK_thread_count);
890- (void) pthread_mutex_unlock(&LOCK_thread_count);
891-
892- clean_up(1);
893- plugin::Registry::shutdown();
894- clean_up_mutexes();
895- internal::my_end();
896- return 0;
897-}
898-
899
900=== added file 'drizzled/drizzled.h'
901--- drizzled/drizzled.h 1970-01-01 00:00:00 +0000
902+++ drizzled/drizzled.h 2010-04-19 20:33:26 +0000
903@@ -0,0 +1,65 @@
904+/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
905+ * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
906+ *
907+ * Copyright (C) 2008 Sun Microsystems
908+ * Copyright (C) 2010 Monty Taylor
909+ *
910+ * This program is free software; you can redistribute it and/or modify
911+ * it under the terms of the GNU General Public License as published by
912+ * the Free Software Foundation; version 2 of the License.
913+ *
914+ * This program is distributed in the hope that it will be useful,
915+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
916+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
917+ * GNU General Public License for more details.
918+ *
919+ * You should have received a copy of the GNU General Public License
920+ * along with this program; if not, write to the Free Software
921+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
922+ */
923+
924+#ifndef DRIZZLED_DRIZZLED_H
925+#define DRIZZLED_DRIZZLED_H
926+
927+#include <bitset>
928+
929+#include "drizzled/atomics.h"
930+
931+struct passwd;
932+
933+namespace drizzled
934+{
935+
936+namespace plugin
937+{
938+class Registry;
939+}
940+
941+extern std::bitset<12> test_flags;
942+extern uint32_t max_used_connections;
943+extern atomic<uint32_t> connection_count;
944+extern bool calling_initgroups;
945+extern const char *load_default_groups[];
946+extern bool volatile select_thread_in_use;
947+extern bool volatile abort_loop;
948+extern bool volatile ready_to_exit;
949+extern bool opt_help;
950+extern bool opt_help_extended;
951+extern passwd *user_info;
952+extern char *drizzled_user;
953+
954+extern const char * const DRIZZLE_CONFIG_NAME;
955+
956+int init_server_components(plugin::Registry &plugins);
957+int init_common_variables(const char *conf_file_name, int argc,
958+ char **argv, const char **groups);
959+
960+passwd *check_user(const char *user);
961+void set_user(const char *user, passwd *user_info_arg);
962+void clean_up(bool print_message);
963+void clean_up_mutexes(void);
964+bool drizzle_rm_tmp_tables();
965+
966+} /* namespace drizzled */
967+
968+#endif /* DRIZZLED_DRIZZLED_H */
969
970=== modified file 'drizzled/function/str/load_file.cc'
971--- drizzled/function/str/load_file.cc 2010-02-04 08:14:46 +0000
972+++ drizzled/function/str/load_file.cc 2010-04-19 20:33:26 +0000
973@@ -42,7 +42,7 @@
974 if (!(file_name= args[0]->val_str(str)))
975 goto err;
976
977- (void) internal::fn_format(path, file_name->c_ptr(), drizzle_real_data_home, "",
978+ (void) internal::fn_format(path, file_name->c_ptr(), data_home_real, "",
979 MY_RELATIVE_PATH | MY_UNPACK_FILENAME);
980
981 /* Read only allowed from within dir specified by secure_file_priv */
982
983=== modified file 'drizzled/include.am'
984--- drizzled/include.am 2010-04-14 21:40:03 +0000
985+++ drizzled/include.am 2010-04-19 20:33:26 +0000
986@@ -18,8 +18,6 @@
987 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
988
989
990-sbin_PROGRAMS= drizzled/drizzled
991-
992 DTRACEFILES= \
993 drizzled/cursor.o \
994 drizzled/drizzled.o \
995@@ -54,12 +52,15 @@
996 drizzled/comp_creator.h \
997 drizzled/create_field.h \
998 drizzled/current_session.h \
999+ drizzled/cursor.h \
1000 drizzled/data_home.h \
1001 drizzled/db.h \
1002 drizzled/decimal.h \
1003 drizzled/definitions.h \
1004 drizzled/diagnostics_area.h \
1005 drizzled/discrete_interval.h \
1006+ drizzled/drizzle_time.h \
1007+ drizzled/drizzled.h \
1008 drizzled/dtcollation.h \
1009 drizzled/dynamic_array.h \
1010 drizzled/enum.h \
1011@@ -184,14 +185,12 @@
1012 drizzled/function/time/unix_timestamp.h \
1013 drizzled/function/time/weekday.h \
1014 drizzled/function/time/year.h \
1015- drizzled/typelib.h \
1016 drizzled/function/units.h \
1017 drizzled/function/user_var_as_out_param.h \
1018 drizzled/function_hash.h \
1019 drizzled/gettext.h \
1020 drizzled/global_charset_info.h \
1021 drizzled/ha_statistics.h \
1022- drizzled/cursor.h \
1023 drizzled/handler_structs.h \
1024 drizzled/hybrid_type.h \
1025 drizzled/hybrid_type_traits.h \
1026@@ -200,7 +199,6 @@
1027 drizzled/index_hint.h \
1028 drizzled/internal_error_handler.h \
1029 drizzled/item.h \
1030- drizzled/item_result.h \
1031 drizzled/item/basic_constant.h \
1032 drizzled/item/bin_string.h \
1033 drizzled/item/blob.h \
1034@@ -238,6 +236,7 @@
1035 drizzled/item/sum.h \
1036 drizzled/item/type_holder.h \
1037 drizzled/item/uint.h \
1038+ drizzled/item_result.h \
1039 drizzled/join.h \
1040 drizzled/join_cache.h \
1041 drizzled/join_table.h \
1042@@ -251,24 +250,20 @@
1043 drizzled/lex_symbol.h \
1044 drizzled/lock.h \
1045 drizzled/lookup_symbol.h \
1046- drizzled/memory/sql_alloc.h \
1047 drizzled/memory/multi_malloc.h \
1048 drizzled/memory/root.h \
1049- drizzled/option.h \
1050+ drizzled/memory/sql_alloc.h \
1051 drizzled/my_hash.h \
1052- drizzled/drizzle_time.h \
1053- drizzled/tree.h \
1054- drizzled/var.h \
1055 drizzled/name_resolution_context.h \
1056 drizzled/name_resolution_context_state.h \
1057 drizzled/named_savepoint.h \
1058 drizzled/natural_join_column.h \
1059 drizzled/nested_join.h \
1060 drizzled/open_tables_state.h \
1061- drizzled/optimizer/cost_vector.h \
1062+ drizzled/optimizer/cost_vector.h \
1063+ drizzled/optimizer/explain_plan.h \
1064 drizzled/optimizer/key_field.h \
1065 drizzled/optimizer/key_use.h \
1066- drizzled/optimizer/explain_plan.h \
1067 drizzled/optimizer/position.h \
1068 drizzled/optimizer/quick_group_min_max_select.h \
1069 drizzled/optimizer/quick_index_merge_select.h \
1070@@ -284,6 +279,7 @@
1071 drizzled/optimizer/sel_tree.h \
1072 drizzled/optimizer/sum.h \
1073 drizzled/optimizer/table_read_plan.h \
1074+ drizzled/option.h \
1075 drizzled/order.h \
1076 drizzled/parser.h \
1077 drizzled/plugin.h \
1078@@ -304,9 +300,9 @@
1079 drizzled/plugin/null_client.h \
1080 drizzled/plugin/plugin.h \
1081 drizzled/plugin/query_cache.h \
1082- drizzled/plugin/query_rewrite.h \
1083+ drizzled/plugin/query_rewrite.h \
1084+ drizzled/plugin/replication.h \
1085 drizzled/plugin/registry.h \
1086- drizzled/plugin/replication.h \
1087 drizzled/plugin/scheduler.h \
1088 drizzled/plugin/storage_engine.h \
1089 drizzled/plugin/table_function.h \
1090@@ -314,11 +310,11 @@
1091 drizzled/plugin/transaction_reader.h \
1092 drizzled/plugin/transaction_replicator.h \
1093 drizzled/plugin/transactional_storage_engine.h \
1094+ drizzled/plugin/version.h \
1095+ drizzled/plugin/xa_resource_manager.h \
1096 drizzled/plugin/xa_storage_engine.h \
1097- drizzled/plugin/xa_resource_manager.h \
1098- drizzled/plugin/version.h \
1099+ drizzled/probes.h \
1100 drizzled/pthread_globals.h \
1101- drizzled/probes.h \
1102 drizzled/qsort_cmp.h \
1103 drizzled/query_id.h \
1104 drizzled/records.h \
1105@@ -344,6 +340,7 @@
1106 drizzled/session_list.h \
1107 drizzled/set_var.h \
1108 drizzled/show.h \
1109+ drizzled/signal_handler.h \
1110 drizzled/sql_base.h \
1111 drizzled/sql_bitmap.h \
1112 drizzled/sql_error.h \
1113@@ -414,8 +411,10 @@
1114 drizzled/thr_lock.h \
1115 drizzled/time_functions.h \
1116 drizzled/tmp_table_param.h \
1117+ drizzled/transaction_context.h \
1118 drizzled/transaction_services.h \
1119- drizzled/transaction_context.h \
1120+ drizzled/tree.h \
1121+ drizzled/typelib.h \
1122 drizzled/tzfile.h \
1123 drizzled/tztime.h \
1124 drizzled/unique.h \
1125@@ -427,337 +426,350 @@
1126 drizzled/utf8/checked.h \
1127 drizzled/utf8/core.h \
1128 drizzled/utf8/unchecked.h \
1129+ drizzled/var.h \
1130 drizzled/version.h \
1131 drizzled/visibility.h \
1132 drizzled/xid.h
1133
1134-DRIZZLED_LDADD= \
1135- drizzled/internal/libinternal.la \
1136- $(LIBZ) \
1137- $(LIBINTL) \
1138- ${LIBC_P}
1139-
1140+lib_LTLIBRARIES+= drizzled/libdrizzled.la
1141+drizzled_libdrizzled_la_LIBADD= \
1142+ drizzled/algorithm/libhash.la \
1143+ drizzled/util/libutil.la \
1144+ drizzled/internal/libinternal.la \
1145+ drizzled/message/libdrizzledmessage.la \
1146+ gnulib/libgnu.la \
1147+ $(LIBZ) \
1148+ $(LIBINTL) \
1149+ ${LIBC_P} \
1150+ $(pandora_plugin_libs) \
1151+ $(LDADD) \
1152+ $(LIBUUID) \
1153+ $(LIBDL_LIBS) \
1154+ $(LIBPROTOBUF) \
1155+ $(LIBPCRE) \
1156+ $(LIBTBB) \
1157+ $(GCOV_LIBS)
1158+
1159+drizzled_libdrizzled_la_DEPENDENCIES= \
1160+ drizzled/message/libdrizzledmessage.la \
1161+ ${noinst_LTLIBRARIES} \
1162+ $(pandora_plugin_libs)
1163+
1164+drizzled_libdrizzled_la_SOURCES= \
1165+ drizzled/alter_info.cc \
1166+ drizzled/cached_item.cc \
1167+ drizzled/calendar.cc \
1168+ drizzled/check_stack_overrun.cc \
1169+ drizzled/comp_creator.cc \
1170+ drizzled/create_field.cc \
1171+ drizzled/current_session.cc \
1172+ drizzled/cursor.cc \
1173+ drizzled/decimal.cc \
1174+ drizzled/diagnostics_area.cc \
1175+ drizzled/drizzle_time.cc \
1176+ drizzled/drizzled.cc \
1177+ drizzled/dtcollation.cc \
1178+ drizzled/errmsg_print.cc \
1179+ drizzled/field.cc \
1180+ drizzled/field/blob.cc \
1181+ drizzled/field/date.cc \
1182+ drizzled/field/datetime.cc \
1183+ drizzled/field/decimal.cc \
1184+ drizzled/field/double.cc \
1185+ drizzled/field/enum.cc \
1186+ drizzled/field/int64_t.cc \
1187+ drizzled/field/long.cc \
1188+ drizzled/field/null.cc \
1189+ drizzled/field/num.cc \
1190+ drizzled/field/real.cc \
1191+ drizzled/field/str.cc \
1192+ drizzled/field/timestamp.cc \
1193+ drizzled/field/varstring.cc \
1194+ drizzled/field_conv.cc \
1195+ drizzled/field_iterator.cc \
1196+ drizzled/file_exchange.cc \
1197+ drizzled/filesort.cc \
1198+ drizzled/foreign_key.cc \
1199+ drizzled/function/additive_op.cc \
1200+ drizzled/function/coercibility.cc \
1201+ drizzled/function/field.cc \
1202+ drizzled/function/find_in_set.cc \
1203+ drizzled/function/found_rows.cc \
1204+ drizzled/function/func.cc \
1205+ drizzled/function/get_system_var.cc \
1206+ drizzled/function/get_user_var.cc \
1207+ drizzled/function/last_insert.cc \
1208+ drizzled/function/locate.cc \
1209+ drizzled/function/math/abs.cc \
1210+ drizzled/function/math/acos.cc \
1211+ drizzled/function/math/asin.cc \
1212+ drizzled/function/math/atan.cc \
1213+ drizzled/function/math/ceiling.cc \
1214+ drizzled/function/math/cos.cc \
1215+ drizzled/function/math/decimal_typecast.cc \
1216+ drizzled/function/math/divide.cc \
1217+ drizzled/function/math/exp.cc \
1218+ drizzled/function/math/floor.cc \
1219+ drizzled/function/math/int.cc \
1220+ drizzled/function/math/int_divide.cc \
1221+ drizzled/function/math/int_val.cc \
1222+ drizzled/function/math/integer.cc \
1223+ drizzled/function/math/ln.cc \
1224+ drizzled/function/math/log.cc \
1225+ drizzled/function/math/minus.cc \
1226+ drizzled/function/math/mod.cc \
1227+ drizzled/function/math/multiply.cc \
1228+ drizzled/function/math/neg.cc \
1229+ drizzled/function/math/ord.cc \
1230+ drizzled/function/math/plus.cc \
1231+ drizzled/function/math/pow.cc \
1232+ drizzled/function/math/rand.cc \
1233+ drizzled/function/math/real.cc \
1234+ drizzled/function/math/round.cc \
1235+ drizzled/function/math/sin.cc \
1236+ drizzled/function/math/sqrt.cc \
1237+ drizzled/function/math/tan.cc \
1238+ drizzled/function/min_max.cc \
1239+ drizzled/function/num1.cc \
1240+ drizzled/function/num_op.cc \
1241+ drizzled/function/numhybrid.cc \
1242+ drizzled/function/row_count.cc \
1243+ drizzled/function/set_user_var.cc \
1244+ drizzled/function/sign.cc \
1245+ drizzled/function/str/alloc_buffer.cc \
1246+ drizzled/function/str/binary.cc \
1247+ drizzled/function/str/char.cc \
1248+ drizzled/function/str/collation.cc \
1249+ drizzled/function/str/concat.cc \
1250+ drizzled/function/str/conv.cc \
1251+ drizzled/function/str/conv_charset.cc \
1252+ drizzled/function/str/elt.cc \
1253+ drizzled/function/str/export_set.cc \
1254+ drizzled/function/str/format.cc \
1255+ drizzled/function/str/insert.cc \
1256+ drizzled/function/str/left.cc \
1257+ drizzled/function/str/load_file.cc \
1258+ drizzled/function/str/make_set.cc \
1259+ drizzled/function/str/pad.cc \
1260+ drizzled/function/str/quote.cc \
1261+ drizzled/function/str/repeat.cc \
1262+ drizzled/function/str/replace.cc \
1263+ drizzled/function/str/right.cc \
1264+ drizzled/function/str/set_collation.cc \
1265+ drizzled/function/str/str_conv.cc \
1266+ drizzled/function/str/strfunc.cc \
1267+ drizzled/function/str/trim.cc \
1268+ drizzled/function/time/curdate.cc \
1269+ drizzled/function/time/date.cc \
1270+ drizzled/function/time/date_add_interval.cc \
1271+ drizzled/function/time/date_format.cc \
1272+ drizzled/function/time/dayname.cc \
1273+ drizzled/function/time/dayofmonth.cc \
1274+ drizzled/function/time/dayofyear.cc \
1275+ drizzled/function/time/extract.cc \
1276+ drizzled/function/time/from_days.cc \
1277+ drizzled/function/time/from_unixtime.cc \
1278+ drizzled/function/time/hour.cc \
1279+ drizzled/function/time/last_day.cc \
1280+ drizzled/function/time/makedate.cc \
1281+ drizzled/function/time/microsecond.cc \
1282+ drizzled/function/time/minute.cc \
1283+ drizzled/function/time/month.cc \
1284+ drizzled/function/time/now.cc \
1285+ drizzled/function/time/period_add.cc \
1286+ drizzled/function/time/period_diff.cc \
1287+ drizzled/function/time/quarter.cc \
1288+ drizzled/function/time/second.cc \
1289+ drizzled/function/time/sysdate_local.cc \
1290+ drizzled/function/time/timestamp_diff.cc \
1291+ drizzled/function/time/to_days.cc \
1292+ drizzled/function/time/typecast.cc \
1293+ drizzled/function/time/unix_timestamp.cc \
1294+ drizzled/function/time/weekday.cc \
1295+ drizzled/function/time/year.cc \
1296+ drizzled/function/units.cc \
1297+ drizzled/function/user_var_as_out_param.cc \
1298+ drizzled/ha_commands.cc \
1299+ drizzled/hybrid_type_traits.cc \
1300+ drizzled/hybrid_type_traits_decimal.cc \
1301+ drizzled/hybrid_type_traits_integer.cc \
1302+ drizzled/index_hint.cc \
1303+ drizzled/item.cc \
1304+ drizzled/item/bin_string.cc \
1305+ drizzled/item/cache.cc \
1306+ drizzled/item/cache_decimal.cc \
1307+ drizzled/item/cache_int.cc \
1308+ drizzled/item/cache_real.cc \
1309+ drizzled/item/cache_row.cc \
1310+ drizzled/item/cache_str.cc \
1311+ drizzled/item/cmpfunc.cc \
1312+ drizzled/item/copy_string.cc \
1313+ drizzled/item/create.cc \
1314+ drizzled/item/decimal.cc \
1315+ drizzled/item/default_value.cc \
1316+ drizzled/item/direct_ref.cc \
1317+ drizzled/item/empty_string.cc \
1318+ drizzled/item/field.cc \
1319+ drizzled/item/float.cc \
1320+ drizzled/item/hex_string.cc \
1321+ drizzled/item/ident.cc \
1322+ drizzled/item/insert_value.cc \
1323+ drizzled/item/int.cc \
1324+ drizzled/item/int_with_ref.cc \
1325+ drizzled/item/null.cc \
1326+ drizzled/item/num.cc \
1327+ drizzled/item/outer_ref.cc \
1328+ drizzled/item/ref.cc \
1329+ drizzled/item/ref_null_helper.cc \
1330+ drizzled/item/row.cc \
1331+ drizzled/item/string.cc \
1332+ drizzled/item/subselect.cc \
1333+ drizzled/item/sum.cc \
1334+ drizzled/item/type_holder.cc \
1335+ drizzled/item/uint.cc \
1336+ drizzled/join.cc \
1337+ drizzled/join_cache.cc \
1338+ drizzled/join_table.cc \
1339+ drizzled/key.cc \
1340+ drizzled/key_map.cc \
1341+ drizzled/lock.cc \
1342+ drizzled/lookup_symbol.cc \
1343+ drizzled/my_getsystime.cc \
1344+ drizzled/my_hash.cc \
1345+ drizzled/name_resolution_context_state.cc \
1346+ drizzled/natural_join_column.cc \
1347+ drizzled/optimizer/explain_plan.cc \
1348+ drizzled/optimizer/key_field.cc \
1349+ drizzled/optimizer/quick_group_min_max_select.cc \
1350+ drizzled/optimizer/quick_index_merge_select.cc \
1351+ drizzled/optimizer/quick_range.cc \
1352+ drizzled/optimizer/quick_range_select.cc \
1353+ drizzled/optimizer/quick_ror_intersect_select.cc \
1354+ drizzled/optimizer/quick_ror_union_select.cc \
1355+ drizzled/optimizer/range.cc \
1356+ drizzled/optimizer/sel_arg.cc \
1357+ drizzled/optimizer/sel_imerge.cc \
1358+ drizzled/optimizer/sel_tree.cc \
1359+ drizzled/optimizer/sum.cc \
1360+ drizzled/plugin/authentication.cc \
1361+ drizzled/plugin/authorization.cc \
1362+ drizzled/plugin/client.cc \
1363+ drizzled/plugin/error_message.cc \
1364+ drizzled/plugin/function.cc \
1365+ drizzled/plugin/library.cc \
1366+ drizzled/plugin/listen.cc \
1367+ drizzled/plugin/listen_tcp.cc \
1368+ drizzled/plugin/loader.cc \
1369+ drizzled/plugin/logging.cc \
1370+ drizzled/plugin/monitored_in_transaction.cc \
1371+ drizzled/plugin/plugin.cc \
1372+ drizzled/plugin/query_cache.cc \
1373+ drizzled/plugin/query_rewrite.cc \
1374+ drizzled/plugin/registry.cc \
1375+ drizzled/plugin/scheduler.cc \
1376+ drizzled/plugin/schema_engine.cc \
1377+ drizzled/plugin/storage_engine.cc \
1378+ drizzled/plugin/table_function.cc \
1379+ drizzled/plugin/transaction_applier.cc \
1380+ drizzled/plugin/transaction_replicator.cc \
1381+ drizzled/plugin/transactional_storage_engine.cc \
1382+ drizzled/plugin/xa_resource_manager.cc \
1383+ drizzled/plugin/xa_storage_engine.cc \
1384+ drizzled/query_id.cc \
1385+ drizzled/records.cc \
1386+ drizzled/replication_services.cc \
1387+ drizzled/resource_context.cc \
1388+ drizzled/schema_identifier.cc \
1389+ drizzled/session.cc \
1390+ drizzled/session_list.cc \
1391+ drizzled/set_var.cc \
1392+ drizzled/show.cc \
1393+ drizzled/signal_handler.cc \
1394+ drizzled/sql_base.cc \
1395+ drizzled/sql_bitmap.cc \
1396+ drizzled/sql_delete.cc \
1397+ drizzled/sql_derived.cc \
1398+ drizzled/sql_error.cc \
1399+ drizzled/sql_insert.cc \
1400+ drizzled/sql_lex.cc \
1401+ drizzled/sql_list.cc \
1402+ drizzled/sql_load.cc \
1403+ drizzled/sql_locale.cc \
1404+ drizzled/sql_parse.cc \
1405+ drizzled/sql_select.cc \
1406+ drizzled/sql_state.cc \
1407+ drizzled/sql_string.cc \
1408+ drizzled/sql_table.cc \
1409+ drizzled/sql_union.cc \
1410+ drizzled/sql_update.cc \
1411+ drizzled/sql_yacc.yy \
1412+ drizzled/stacktrace.cc \
1413+ drizzled/statement/alter_schema.cc \
1414+ drizzled/statement/alter_table.cc \
1415+ drizzled/statement/analyze.cc \
1416+ drizzled/statement/change_schema.cc \
1417+ drizzled/statement/check.cc \
1418+ drizzled/statement/commit.cc \
1419+ drizzled/statement/create_index.cc \
1420+ drizzled/statement/create_schema.cc \
1421+ drizzled/statement/create_table.cc \
1422+ drizzled/statement/delete.cc \
1423+ drizzled/statement/drop_index.cc \
1424+ drizzled/statement/drop_schema.cc \
1425+ drizzled/statement/drop_table.cc \
1426+ drizzled/statement/empty_query.cc \
1427+ drizzled/statement/flush.cc \
1428+ drizzled/statement/insert.cc \
1429+ drizzled/statement/insert_select.cc \
1430+ drizzled/statement/kill.cc \
1431+ drizzled/statement/load.cc \
1432+ drizzled/statement/release_savepoint.cc \
1433+ drizzled/statement/rename_table.cc \
1434+ drizzled/statement/replace.cc \
1435+ drizzled/statement/replace_select.cc \
1436+ drizzled/statement/rollback.cc \
1437+ drizzled/statement/rollback_to_savepoint.cc \
1438+ drizzled/statement/savepoint.cc \
1439+ drizzled/statement/select.cc \
1440+ drizzled/statement/set_option.cc \
1441+ drizzled/statement/show_create.cc \
1442+ drizzled/statement/show_create_schema.cc \
1443+ drizzled/statement/show_errors.cc \
1444+ drizzled/statement/show_warnings.cc \
1445+ drizzled/statement/start_transaction.cc \
1446+ drizzled/statement/truncate.cc \
1447+ drizzled/statement/unlock_tables.cc \
1448+ drizzled/statement/update.cc \
1449+ drizzled/strfunc.cc \
1450+ drizzled/table.cc \
1451+ drizzled/table_function_container.cc \
1452+ drizzled/table_identifier.cc \
1453+ drizzled/table_list.cc \
1454+ drizzled/table_share.cc \
1455+ drizzled/temporal.cc \
1456+ drizzled/temporal_format.cc \
1457+ drizzled/temporal_interval.cc \
1458+ drizzled/thr_lock.cc \
1459+ drizzled/time_functions.cc \
1460+ drizzled/transaction_services.cc \
1461+ drizzled/tree.cc \
1462+ drizzled/tztime.cc \
1463+ drizzled/uniques.cc \
1464+ drizzled/user_var_entry.cc \
1465+ drizzled/version.cc \
1466+ drizzled/xid.cc
1467+
1468+sbin_PROGRAMS+= drizzled/drizzled
1469+
1470+drizzled_drizzled_SOURCES= \
1471+ drizzled/main.cc
1472 drizzled_drizzled_LDADD= \
1473- ${DRIZZLED_LDADD} \
1474- ${noinst_LTLIBRARIES} \
1475- drizzled/algorithm/libhash.la \
1476- drizzled/util/libutil.la \
1477- drizzled/message/libdrizzledmessage.la \
1478- drizzled/libcached_directory.la \
1479- drizzled/liberror.la \
1480- drizzled/libmemory.la \
1481- $(pandora_plugin_libs) \
1482- $(LDADD) $(LIBUUID) gnulib/libgnu.la \
1483- $(LIBDL_LIBS) $(LIBPROTOBUF) $(LIBPCRE) $(LIBTBB) \
1484- $(PANDORA_PLUGIN_DEP_LIBS) $(GCOV_LIBS)
1485-
1486-drizzled_drizzled_DEPENDENCIES= ${noinst_LTLIBRARIES} $(pandora_plugin_libs)
1487+ $(LIBPCRE) \
1488+ $(LIBINTL) \
1489+ drizzled/libdrizzled.la
1490
1491 drizzled_drizzled_LDFLAGS= -export-dynamic
1492
1493-drizzled_drizzled_SOURCES= \
1494- drizzled/alter_info.cc \
1495- drizzled/cached_item.cc \
1496- drizzled/calendar.cc \
1497- drizzled/check_stack_overrun.cc \
1498- drizzled/comp_creator.cc \
1499- drizzled/create_field.cc \
1500- drizzled/current_session.cc \
1501- drizzled/cursor.cc \
1502- drizzled/decimal.cc \
1503- drizzled/diagnostics_area.cc \
1504- drizzled/drizzled.cc \
1505- drizzled/dtcollation.cc \
1506- drizzled/errmsg_print.cc \
1507- drizzled/field.cc \
1508- drizzled/field/blob.cc \
1509- drizzled/field/date.cc \
1510- drizzled/field/datetime.cc \
1511- drizzled/field/decimal.cc \
1512- drizzled/field/double.cc \
1513- drizzled/field/enum.cc \
1514- drizzled/field/int64_t.cc \
1515- drizzled/field/long.cc \
1516- drizzled/field/null.cc \
1517- drizzled/field/num.cc \
1518- drizzled/field/real.cc \
1519- drizzled/field/str.cc \
1520- drizzled/field/timestamp.cc \
1521- drizzled/field/varstring.cc \
1522- drizzled/field_conv.cc \
1523- drizzled/field_iterator.cc \
1524- drizzled/file_exchange.cc \
1525- drizzled/filesort.cc \
1526- drizzled/foreign_key.cc \
1527- drizzled/function/additive_op.cc \
1528- drizzled/function/coercibility.cc \
1529- drizzled/function/field.cc \
1530- drizzled/function/find_in_set.cc \
1531- drizzled/function/found_rows.cc \
1532- drizzled/function/func.cc \
1533- drizzled/function/get_system_var.cc \
1534- drizzled/function/get_user_var.cc \
1535- drizzled/function/last_insert.cc \
1536- drizzled/function/locate.cc \
1537- drizzled/function/math/abs.cc \
1538- drizzled/function/math/acos.cc \
1539- drizzled/function/math/asin.cc \
1540- drizzled/function/math/atan.cc \
1541- drizzled/function/math/ceiling.cc \
1542- drizzled/function/math/cos.cc \
1543- drizzled/function/math/decimal_typecast.cc \
1544- drizzled/function/math/divide.cc \
1545- drizzled/function/math/exp.cc \
1546- drizzled/function/math/floor.cc \
1547- drizzled/function/math/int.cc \
1548- drizzled/function/math/int_divide.cc \
1549- drizzled/function/math/int_val.cc \
1550- drizzled/function/math/integer.cc \
1551- drizzled/function/math/ln.cc \
1552- drizzled/function/math/log.cc \
1553- drizzled/function/math/minus.cc \
1554- drizzled/function/math/mod.cc \
1555- drizzled/function/math/multiply.cc \
1556- drizzled/function/math/neg.cc \
1557- drizzled/function/math/ord.cc \
1558- drizzled/function/math/plus.cc \
1559- drizzled/function/math/pow.cc \
1560- drizzled/function/math/rand.cc \
1561- drizzled/function/math/real.cc \
1562- drizzled/function/math/round.cc \
1563- drizzled/function/math/sin.cc \
1564- drizzled/function/math/sqrt.cc \
1565- drizzled/function/math/tan.cc \
1566- drizzled/function/min_max.cc \
1567- drizzled/function/num1.cc \
1568- drizzled/function/num_op.cc \
1569- drizzled/function/numhybrid.cc \
1570- drizzled/function/row_count.cc \
1571- drizzled/function/set_user_var.cc \
1572- drizzled/function/sign.cc \
1573- drizzled/function/str/alloc_buffer.cc \
1574- drizzled/function/str/binary.cc \
1575- drizzled/function/str/char.cc \
1576- drizzled/function/str/collation.cc \
1577- drizzled/function/str/concat.cc \
1578- drizzled/function/str/conv.cc \
1579- drizzled/function/str/conv_charset.cc \
1580- drizzled/function/str/elt.cc \
1581- drizzled/function/str/export_set.cc \
1582- drizzled/function/str/format.cc \
1583- drizzled/function/str/insert.cc \
1584- drizzled/function/str/left.cc \
1585- drizzled/function/str/load_file.cc \
1586- drizzled/function/str/make_set.cc \
1587- drizzled/function/str/pad.cc \
1588- drizzled/function/str/quote.cc \
1589- drizzled/function/str/repeat.cc \
1590- drizzled/function/str/replace.cc \
1591- drizzled/function/str/right.cc \
1592- drizzled/function/str/set_collation.cc \
1593- drizzled/function/str/str_conv.cc \
1594- drizzled/function/str/strfunc.cc \
1595- drizzled/function/str/trim.cc \
1596- drizzled/function/time/curdate.cc \
1597- drizzled/function/time/date.cc \
1598- drizzled/function/time/date_add_interval.cc \
1599- drizzled/function/time/date_format.cc \
1600- drizzled/function/time/dayname.cc \
1601- drizzled/function/time/dayofmonth.cc \
1602- drizzled/function/time/dayofyear.cc \
1603- drizzled/function/time/extract.cc \
1604- drizzled/function/time/from_days.cc \
1605- drizzled/function/time/from_unixtime.cc \
1606- drizzled/function/time/hour.cc \
1607- drizzled/function/time/last_day.cc \
1608- drizzled/function/time/makedate.cc \
1609- drizzled/function/time/microsecond.cc \
1610- drizzled/function/time/minute.cc \
1611- drizzled/function/time/month.cc \
1612- drizzled/function/time/now.cc \
1613- drizzled/function/time/period_add.cc \
1614- drizzled/function/time/period_diff.cc \
1615- drizzled/function/time/quarter.cc \
1616- drizzled/function/time/second.cc \
1617- drizzled/function/time/sysdate_local.cc \
1618- drizzled/function/time/timestamp_diff.cc \
1619- drizzled/function/time/to_days.cc \
1620- drizzled/function/time/typecast.cc \
1621- drizzled/function/time/unix_timestamp.cc \
1622- drizzled/function/time/weekday.cc \
1623- drizzled/function/time/year.cc \
1624- drizzled/function/units.cc \
1625- drizzled/function/user_var_as_out_param.cc \
1626- drizzled/ha_commands.cc \
1627- drizzled/hybrid_type_traits.cc \
1628- drizzled/hybrid_type_traits_decimal.cc \
1629- drizzled/hybrid_type_traits_integer.cc \
1630- drizzled/index_hint.cc \
1631- drizzled/item.cc \
1632- drizzled/item/bin_string.cc \
1633- drizzled/item/cache.cc \
1634- drizzled/item/cache_decimal.cc \
1635- drizzled/item/cache_int.cc \
1636- drizzled/item/cache_real.cc \
1637- drizzled/item/cache_row.cc \
1638- drizzled/item/cache_str.cc \
1639- drizzled/item/cmpfunc.cc \
1640- drizzled/item/copy_string.cc \
1641- drizzled/item/create.cc \
1642- drizzled/item/decimal.cc \
1643- drizzled/item/default_value.cc \
1644- drizzled/item/direct_ref.cc \
1645- drizzled/item/empty_string.cc \
1646- drizzled/item/field.cc \
1647- drizzled/item/float.cc \
1648- drizzled/item/hex_string.cc \
1649- drizzled/item/ident.cc \
1650- drizzled/item/insert_value.cc \
1651- drizzled/item/int.cc \
1652- drizzled/item/int_with_ref.cc \
1653- drizzled/item/null.cc \
1654- drizzled/item/num.cc \
1655- drizzled/item/outer_ref.cc \
1656- drizzled/item/ref.cc \
1657- drizzled/item/ref_null_helper.cc \
1658- drizzled/item/row.cc \
1659- drizzled/item/string.cc \
1660- drizzled/item/subselect.cc \
1661- drizzled/item/sum.cc \
1662- drizzled/item/type_holder.cc \
1663- drizzled/item/uint.cc \
1664- drizzled/join.cc \
1665- drizzled/join_cache.cc \
1666- drizzled/join_table.cc \
1667- drizzled/key.cc \
1668- drizzled/key_map.cc \
1669- drizzled/lock.cc \
1670- drizzled/lookup_symbol.cc \
1671- drizzled/my_getsystime.cc \
1672- drizzled/my_hash.cc \
1673- drizzled/drizzle_time.cc \
1674- drizzled/tree.cc \
1675- drizzled/name_resolution_context_state.cc \
1676- drizzled/natural_join_column.cc \
1677- drizzled/optimizer/explain_plan.cc \
1678- drizzled/optimizer/key_field.cc \
1679- drizzled/optimizer/quick_group_min_max_select.cc \
1680- drizzled/optimizer/quick_index_merge_select.cc \
1681- drizzled/optimizer/quick_range.cc \
1682- drizzled/optimizer/quick_range_select.cc \
1683- drizzled/optimizer/quick_ror_intersect_select.cc \
1684- drizzled/optimizer/quick_ror_union_select.cc \
1685- drizzled/optimizer/range.cc \
1686- drizzled/optimizer/sel_arg.cc \
1687- drizzled/optimizer/sel_imerge.cc \
1688- drizzled/optimizer/sel_tree.cc \
1689- drizzled/optimizer/sum.cc \
1690- drizzled/plugin/authentication.cc \
1691- drizzled/plugin/authorization.cc \
1692- drizzled/plugin/client.cc \
1693- drizzled/plugin/error_message.cc \
1694- drizzled/plugin/function.cc \
1695- drizzled/plugin/library.cc \
1696- drizzled/plugin/listen.cc \
1697- drizzled/plugin/listen_tcp.cc \
1698- drizzled/plugin/loader.cc \
1699- drizzled/plugin/logging.cc \
1700- drizzled/plugin/monitored_in_transaction.cc \
1701- drizzled/plugin/plugin.cc \
1702- drizzled/plugin/query_cache.cc \
1703- drizzled/plugin/query_rewrite.cc \
1704- drizzled/plugin/registry.cc \
1705- drizzled/plugin/scheduler.cc \
1706- drizzled/plugin/schema_engine.cc \
1707- drizzled/plugin/storage_engine.cc \
1708- drizzled/plugin/table_function.cc \
1709- drizzled/plugin/transaction_applier.cc \
1710- drizzled/plugin/transaction_replicator.cc \
1711- drizzled/plugin/transactional_storage_engine.cc \
1712- drizzled/plugin/xa_resource_manager.cc \
1713- drizzled/plugin/xa_storage_engine.cc \
1714- drizzled/query_id.cc \
1715- drizzled/records.cc \
1716- drizzled/replication_services.cc \
1717- drizzled/resource_context.cc \
1718- drizzled/schema_identifier.cc \
1719- drizzled/session.cc \
1720- drizzled/session_list.cc \
1721- drizzled/set_var.cc \
1722- drizzled/show.cc \
1723- drizzled/sql_base.cc \
1724- drizzled/sql_bitmap.cc \
1725- drizzled/sql_delete.cc \
1726- drizzled/sql_derived.cc \
1727- drizzled/sql_error.cc \
1728- drizzled/sql_insert.cc \
1729- drizzled/sql_lex.cc \
1730- drizzled/sql_list.cc \
1731- drizzled/sql_load.cc \
1732- drizzled/sql_locale.cc \
1733- drizzled/sql_parse.cc \
1734- drizzled/sql_select.cc \
1735- drizzled/sql_state.cc \
1736- drizzled/sql_string.cc \
1737- drizzled/sql_table.cc \
1738- drizzled/sql_union.cc \
1739- drizzled/sql_update.cc \
1740- drizzled/sql_yacc.yy \
1741- drizzled/stacktrace.cc \
1742- drizzled/statement/alter_schema.cc \
1743- drizzled/statement/alter_table.cc \
1744- drizzled/statement/analyze.cc \
1745- drizzled/statement/change_schema.cc \
1746- drizzled/statement/check.cc \
1747- drizzled/statement/commit.cc \
1748- drizzled/statement/create_index.cc \
1749- drizzled/statement/create_schema.cc \
1750- drizzled/statement/create_table.cc \
1751- drizzled/statement/delete.cc \
1752- drizzled/statement/drop_index.cc \
1753- drizzled/statement/drop_schema.cc \
1754- drizzled/statement/drop_table.cc \
1755- drizzled/statement/empty_query.cc \
1756- drizzled/statement/flush.cc \
1757- drizzled/statement/insert.cc \
1758- drizzled/statement/insert_select.cc \
1759- drizzled/statement/kill.cc \
1760- drizzled/statement/load.cc \
1761- drizzled/statement/release_savepoint.cc \
1762- drizzled/statement/rename_table.cc \
1763- drizzled/statement/replace.cc \
1764- drizzled/statement/replace_select.cc \
1765- drizzled/statement/rollback.cc \
1766- drizzled/statement/rollback_to_savepoint.cc \
1767- drizzled/statement/savepoint.cc \
1768- drizzled/statement/select.cc \
1769- drizzled/statement/set_option.cc \
1770- drizzled/statement/show_create.cc \
1771- drizzled/statement/show_create_schema.cc \
1772- drizzled/statement/show_errors.cc \
1773- drizzled/statement/show_warnings.cc \
1774- drizzled/statement/start_transaction.cc \
1775- drizzled/statement/truncate.cc \
1776- drizzled/statement/unlock_tables.cc \
1777- drizzled/statement/update.cc \
1778- drizzled/strfunc.cc \
1779- drizzled/table.cc \
1780- drizzled/table_function_container.cc \
1781- drizzled/table_identifier.cc \
1782- drizzled/table_list.cc \
1783- drizzled/table_share.cc \
1784- drizzled/temporal.cc \
1785- drizzled/temporal_format.cc \
1786- drizzled/temporal_interval.cc \
1787- drizzled/thr_lock.cc \
1788- drizzled/time_functions.cc \
1789- drizzled/transaction_services.cc \
1790- drizzled/tztime.cc \
1791- drizzled/uniques.cc \
1792- drizzled/user_var_entry.cc \
1793- drizzled/version.cc \
1794- drizzled/xid.cc
1795-
1796 noinst_LTLIBRARIES+= \
1797 drizzled/libcached_directory.la \
1798 drizzled/libcharset.la \
1799
1800=== modified file 'drizzled/internal/include.am'
1801--- drizzled/internal/include.am 2010-02-04 08:14:46 +0000
1802+++ drizzled/internal/include.am 2010-04-19 20:33:26 +0000
1803@@ -34,7 +34,8 @@
1804 drizzled/liberror.la \
1805 drizzled/libgetopt.la \
1806 drizzled/libmemory.la \
1807- drizzled/libtypelib.la
1808+ drizzled/libtypelib.la \
1809+ drizzled/libserialutil.la
1810
1811 drizzled_internal_libinternal_la_SOURCES= \
1812 drizzled/internal/bmove_upp.cc \
1813
1814=== modified file 'drizzled/internal/my_pthread.h'
1815--- drizzled/internal/my_pthread.h 2010-02-04 08:14:46 +0000
1816+++ drizzled/internal/my_pthread.h 2010-04-19 20:33:26 +0000
1817@@ -19,7 +19,6 @@
1818 #define DRIZZLED_INTERNAL_MY_PTHREAD_H
1819
1820 #include <unistd.h>
1821-#include <signal.h>
1822
1823 #ifndef ETIME
1824 #define ETIME ETIMEDOUT /* For FreeBSD */
1825@@ -45,29 +44,6 @@
1826 #define pthread_handler_t void *
1827 typedef void *(* pthread_handler)(void *);
1828
1829-
1830-/*
1831- We define my_sigset() and use that instead of the system sigset() so that
1832- we can favor an implementation based on sigaction(). On some systems, such
1833- as Mac OS X, sigset() results in flags such as SA_RESTART being set, and
1834- we want to make sure that no such flags are set.
1835-*/
1836-#if !defined(my_sigset)
1837-#define my_sigset(A,B) do { struct sigaction l_s; sigset_t l_set; int l_rc; \
1838- assert((A) != 0); \
1839- sigemptyset(&l_set); \
1840- l_s.sa_handler = (B); \
1841- l_s.sa_mask = l_set; \
1842- l_s.sa_flags = 0; \
1843- l_rc= sigaction((A), &l_s, (struct sigaction *) NULL);\
1844- assert(l_rc == 0); \
1845- } while (0)
1846-#elif defined(HAVE_SIGSET) && !defined(my_sigset)
1847-#define my_sigset(A,B) sigset((A),(B))
1848-#elif !defined(my_sigset)
1849-#define my_sigset(A,B) signal((A),(B))
1850-#endif
1851-
1852 #ifndef my_pthread_attr_setprio
1853 #ifdef HAVE_PTHREAD_ATTR_SETPRIO
1854 #define my_pthread_attr_setprio(A,B) pthread_attr_setprio((A),(B))
1855
1856=== added file 'drizzled/main.cc'
1857--- drizzled/main.cc 1970-01-01 00:00:00 +0000
1858+++ drizzled/main.cc 2010-04-19 20:33:26 +0000
1859@@ -0,0 +1,328 @@
1860+/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
1861+ * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
1862+ *
1863+ * Copyright (C) 2008 Sun Microsystems
1864+ *
1865+ * This program is free software; you can redistribute it and/or modify
1866+ * it under the terms of the GNU General Public License as published by
1867+ * the Free Software Foundation; version 2 of the License.
1868+ *
1869+ * This program is distributed in the hope that it will be useful,
1870+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1871+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1872+ * GNU General Public License for more details.
1873+ *
1874+ * You should have received a copy of the GNU General Public License
1875+ * along with this program; if not, write to the Free Software
1876+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1877+ */
1878+
1879+#include "config.h"
1880+
1881+#include <pthread.h>
1882+#include <signal.h>
1883+#include <sys/resource.h>
1884+#include <unistd.h>
1885+
1886+#if TIME_WITH_SYS_TIME
1887+# include <sys/time.h>
1888+# include <time.h>
1889+#else
1890+# if HAVE_SYS_TIME_H
1891+# include <sys/time.h>
1892+# else
1893+# include <time.h>
1894+# endif
1895+#endif
1896+
1897+#if defined(HAVE_LOCALE_H)
1898+# include <locale.h>
1899+#endif
1900+
1901+
1902+#include "drizzled/plugin.h"
1903+#include "drizzled/gettext.h"
1904+#include "drizzled/configmake.h"
1905+#include "drizzled/session.h"
1906+#include "drizzled/internal/my_sys.h"
1907+#include "drizzled/unireg.h"
1908+#include "drizzled/stacktrace.h"
1909+#include "drizzled/drizzled.h"
1910+#include "drizzled/errmsg_print.h"
1911+#include "drizzled/data_home.h"
1912+#include "drizzled/plugin/listen.h"
1913+#include "drizzled/plugin/client.h"
1914+#include "drizzled/pthread_globals.h"
1915+#include "drizzled/tztime.h"
1916+#include "drizzled/signal_handler.h"
1917+#include "drizzled/replication_services.h"
1918+
1919+using namespace drizzled;
1920+using namespace std;
1921+
1922+static pthread_t select_thread;
1923+static uint32_t thr_kill_signal;
1924+
1925+/**
1926+ All global error messages are sent here where the first one is stored
1927+ for the client.
1928+*/
1929+static void my_message_sql(uint32_t error, const char *str, myf MyFlags)
1930+{
1931+ Session *session;
1932+ /*
1933+ Put here following assertion when situation with EE_* error codes
1934+ will be fixed
1935+ */
1936+ if ((session= current_session))
1937+ {
1938+ if (MyFlags & ME_FATALERROR)
1939+ session->is_fatal_error= 1;
1940+
1941+ /*
1942+ TODO: There are two exceptions mechanism (Session and sp_rcontext),
1943+ this could be improved by having a common stack of handlers.
1944+ */
1945+ if (session->handle_error(error, str,
1946+ DRIZZLE_ERROR::WARN_LEVEL_ERROR))
1947+ return;;
1948+
1949+ /*
1950+ session->lex->current_select == 0 if lex structure is not inited
1951+ (not query command (COM_QUERY))
1952+ */
1953+ if (! (session->lex->current_select &&
1954+ session->lex->current_select->no_error && !session->is_fatal_error))
1955+ {
1956+ if (! session->main_da.is_error()) // Return only first message
1957+ {
1958+ if (error == 0)
1959+ error= ER_UNKNOWN_ERROR;
1960+ if (str == NULL)
1961+ str= ER(error);
1962+ session->main_da.set_error_status(error, str);
1963+ }
1964+ }
1965+
1966+ if (!session->no_warnings_for_error && !session->is_fatal_error)
1967+ {
1968+ /*
1969+ Suppress infinite recursion if there a memory allocation error
1970+ inside push_warning.
1971+ */
1972+ session->no_warnings_for_error= true;
1973+ push_warning(session, DRIZZLE_ERROR::WARN_LEVEL_ERROR, error, str);
1974+ session->no_warnings_for_error= false;
1975+ }
1976+ }
1977+ if (!session || MyFlags & ME_NOREFRESH)
1978+ errmsg_printf(ERRMSG_LVL_ERROR, "%s: %s",internal::my_progname,str);
1979+}
1980+
1981+static void init_signals(void)
1982+{
1983+ sigset_t set;
1984+ struct sigaction sa;
1985+
1986+ if (!(test_flags.test(TEST_NO_STACKTRACE) ||
1987+ test_flags.test(TEST_CORE_ON_SIGNAL)))
1988+ {
1989+ sa.sa_flags = SA_RESETHAND | SA_NODEFER;
1990+ sigemptyset(&sa.sa_mask);
1991+ sigprocmask(SIG_SETMASK,&sa.sa_mask,NULL);
1992+
1993+ init_stacktrace();
1994+ sa.sa_handler= drizzled_handle_segfault;
1995+ sigaction(SIGSEGV, &sa, NULL);
1996+ sigaction(SIGABRT, &sa, NULL);
1997+#ifdef SIGBUS
1998+ sigaction(SIGBUS, &sa, NULL);
1999+#endif
2000+ sigaction(SIGILL, &sa, NULL);
2001+ sigaction(SIGFPE, &sa, NULL);
2002+ }
2003+
2004+ if (test_flags.test(TEST_CORE_ON_SIGNAL))
2005+ {
2006+ /* Change limits so that we will get a core file */
2007+ struct rlimit rl;
2008+ rl.rlim_cur = rl.rlim_max = RLIM_INFINITY;
2009+ if (setrlimit(RLIMIT_CORE, &rl) && global_system_variables.log_warnings)
2010+ errmsg_printf(ERRMSG_LVL_WARN,
2011+ _("setrlimit could not change the size of core files "
2012+ "to 'infinity'; We may not be able to generate a "
2013+ "core file on signals"));
2014+ }
2015+ (void) sigemptyset(&set);
2016+ ignore_signal(SIGPIPE);
2017+ sigaddset(&set,SIGPIPE);
2018+#ifndef IGNORE_SIGHUP_SIGQUIT
2019+ sigaddset(&set,SIGQUIT);
2020+ sigaddset(&set,SIGHUP);
2021+#endif
2022+ sigaddset(&set,SIGTERM);
2023+
2024+ /* Fix signals if blocked by parents (can happen on Mac OS X) */
2025+ sigemptyset(&sa.sa_mask);
2026+ sa.sa_flags = 0;
2027+ sa.sa_handler = drizzled_print_signal_warning;
2028+ sigaction(SIGTERM, &sa, NULL);
2029+ sa.sa_flags = 0;
2030+ sa.sa_handler = drizzled_print_signal_warning;
2031+ sigaction(SIGHUP, &sa, NULL);
2032+#ifdef SIGTSTP
2033+ sigaddset(&set,SIGTSTP);
2034+#endif
2035+ if (test_flags.test(TEST_SIGINT))
2036+ {
2037+ sa.sa_flags= 0;
2038+ sa.sa_handler= drizzled_end_thread_signal;
2039+ sigaction(thr_kill_signal, &sa, NULL);
2040+
2041+ // May be SIGINT
2042+ sigdelset(&set, thr_kill_signal);
2043+ }
2044+ else
2045+ sigaddset(&set,SIGINT);
2046+ sigprocmask(SIG_SETMASK,&set,NULL);
2047+ pthread_sigmask(SIG_SETMASK,&set,NULL);
2048+ return;
2049+}
2050+
2051+
2052+int main(int argc, char **argv)
2053+{
2054+#if defined(ENABLE_NLS)
2055+# if defined(HAVE_LOCALE_H)
2056+ setlocale(LC_ALL, "");
2057+# endif
2058+ bindtextdomain("drizzle", LOCALEDIR);
2059+ textdomain("drizzle");
2060+#endif
2061+
2062+ plugin::Registry &plugins= plugin::Registry::singleton();
2063+ plugin::Client *client;
2064+ Session *session;
2065+
2066+ MY_INIT(argv[0]); // init my_sys library & pthreads
2067+ /* nothing should come before this line ^^^ */
2068+
2069+ /* Set signal used to kill Drizzle */
2070+#if defined(SIGUSR2)
2071+ thr_kill_signal= internal::thd_lib_detected == THD_LIB_LT ? SIGINT : SIGUSR2;
2072+#else
2073+ thr_kill_signal= SIGINT;
2074+#endif
2075+
2076+ if (init_common_variables(DRIZZLE_CONFIG_NAME,
2077+ argc, argv, load_default_groups))
2078+ unireg_abort(1); // Will do exit
2079+
2080+ init_signals();
2081+
2082+
2083+ select_thread=pthread_self();
2084+ select_thread_in_use=1;
2085+
2086+ if (chdir(data_home_real) && !opt_help)
2087+ {
2088+ errmsg_printf(ERRMSG_LVL_ERROR, _("Data directory %s does not exist\n"), data_home_real);
2089+ unireg_abort(1);
2090+ }
2091+ data_home= data_home_buff;
2092+ data_home[0]=FN_CURLIB; // all paths are relative from here
2093+ data_home[1]=0;
2094+ data_home_len= 2;
2095+
2096+ if ((user_info= check_user(drizzled_user)))
2097+ {
2098+ set_user(drizzled_user, user_info);
2099+ }
2100+
2101+ if (server_id == 0)
2102+ {
2103+ server_id= 1;
2104+ }
2105+
2106+ if (init_server_components(plugins))
2107+ unireg_abort(1);
2108+
2109+ /**
2110+ * This check must be done after init_server_components for now
2111+ * because we don't yet have plugin dependency tracking...
2112+ *
2113+ * ReplicationServices::evaluateRegisteredPlugins() will print error messages to stderr
2114+ * via errmsg_printf().
2115+ *
2116+ * @todo
2117+ *
2118+ * not checking return since unireg_abort() hangs
2119+ */
2120+ ReplicationServices &replication_services= ReplicationServices::singleton();
2121+ (void) replication_services.evaluateRegisteredPlugins();
2122+
2123+ if (plugin::Listen::setup())
2124+ unireg_abort(1);
2125+
2126+ /*
2127+ init signals & alarm
2128+ After this we can't quit by a simple unireg_abort
2129+ */
2130+ error_handler_hook= my_message_sql;
2131+
2132+ assert(plugin::num_trx_monitored_objects > 0);
2133+ if (drizzle_rm_tmp_tables() ||
2134+ my_tz_init((Session *)0, default_tz_name))
2135+ {
2136+ abort_loop= true;
2137+ select_thread_in_use=0;
2138+ (void) pthread_kill(signal_thread, SIGTERM);
2139+
2140+ (void) unlink(pidfile_name); // Not needed anymore
2141+
2142+ exit(1);
2143+ }
2144+
2145+ init_status_vars();
2146+
2147+ errmsg_printf(ERRMSG_LVL_INFO, _(ER(ER_STARTUP)), internal::my_progname,
2148+ PANDORA_RELEASE_VERSION, COMPILATION_COMMENT);
2149+
2150+
2151+ /* Listen for new connections and start new session for each connection
2152+ accepted. The listen.getClient() method will return NULL when the server
2153+ should be shutdown. */
2154+ while ((client= plugin::Listen::getClient()) != NULL)
2155+ {
2156+ if (!(session= new Session(client)))
2157+ {
2158+ delete client;
2159+ continue;
2160+ }
2161+
2162+ /* If we error on creation we drop the connection and delete the session. */
2163+ if (session->schedule())
2164+ Session::unlink(session);
2165+ }
2166+
2167+ /* (void) pthread_attr_destroy(&connection_attrib); */
2168+
2169+
2170+ (void) pthread_mutex_lock(&LOCK_thread_count);
2171+ select_thread_in_use=0; // For close_connections
2172+ (void) pthread_mutex_unlock(&LOCK_thread_count);
2173+ (void) pthread_cond_broadcast(&COND_thread_count);
2174+
2175+ /* Wait until cleanup is done */
2176+ (void) pthread_mutex_lock(&LOCK_thread_count);
2177+ while (!ready_to_exit)
2178+ pthread_cond_wait(&COND_server_end,&LOCK_thread_count);
2179+ (void) pthread_mutex_unlock(&LOCK_thread_count);
2180+
2181+ clean_up(1);
2182+ plugin::Registry::shutdown();
2183+ clean_up_mutexes();
2184+ internal::my_end();
2185+ return 0;
2186+}
2187+
2188
2189=== modified file 'drizzled/message/include.am'
2190--- drizzled/message/include.am 2010-02-24 00:03:28 +0000
2191+++ drizzled/message/include.am 2010-04-19 20:33:26 +0000
2192@@ -35,11 +35,12 @@
2193 drizzled/message/transaction_reader \
2194 drizzled/message/transaction_writer
2195
2196-noinst_LTLIBRARIES += drizzled/message/libdrizzledmessage.la
2197+lib_LTLIBRARIES += drizzled/message/libdrizzledmessage.la
2198
2199 drizzled_message_libdrizzledmessage_la_CXXFLAGS = ${MESSAGE_AM_CXXFLAGS} ${NO_WERROR}
2200
2201 drizzled_message_libdrizzledmessage_la_SOURCES = drizzled/message/statement_transform.cc
2202+drizzled_message_libdrizzledmessage_la_LIBADD= ${LTLIBPROTOBUF}
2203
2204 nobase_dist_include_HEADERS+= drizzled/message/statement_transform.h
2205
2206@@ -88,11 +89,11 @@
2207 drizzled_message_master_list_reader_LDADD = ${MESSAGE_LDADD}
2208 drizzled_message_master_list_reader_CXXFLAGS = ${MESSAGE_AM_CXXFLAGS}
2209
2210-drizzled_message_transaction_writer_SOURCES = drizzled/message/transaction_writer.cc drizzled/message/transaction.pb.cc
2211+drizzled_message_transaction_writer_SOURCES = drizzled/message/transaction_writer.cc
2212 drizzled_message_transaction_writer_LDADD = ${MESSAGE_LDADD} ${top_builddir}/drizzled/algorithm/libhash.la
2213 drizzled_message_transaction_writer_CXXFLAGS = ${MESSAGE_AM_CXXFLAGS} ${NO_WERROR}
2214
2215-drizzled_message_transaction_reader_SOURCES = drizzled/message/transaction_reader.cc drizzled/message/transaction.pb.cc
2216+drizzled_message_transaction_reader_SOURCES = drizzled/message/transaction_reader.cc
2217 drizzled_message_transaction_reader_LDADD = ${MESSAGE_LDADD} ${top_builddir}/drizzled/algorithm/libhash.la ${top_builddir}/drizzled/util/libutil.la
2218 drizzled_message_transaction_reader_CXXFLAGS = ${MESSAGE_AM_CXXFLAGS} ${NO_WERROR}
2219
2220
2221=== modified file 'drizzled/optimizer/range.cc'
2222--- drizzled/optimizer/range.cc 2010-03-22 05:47:41 +0000
2223+++ drizzled/optimizer/range.cc 2010-04-19 20:33:26 +0000
2224@@ -272,11 +272,6 @@
2225 bool *are_all_covering);
2226
2227 static
2228-optimizer::RorIntersectReadPlan *get_best_covering_ror_intersect(optimizer::Parameter *param,
2229- optimizer::SEL_TREE *tree,
2230- double read_time);
2231-
2232-static
2233 optimizer::TableReadPlan *get_best_disjunct_quick(optimizer::Parameter *param,
2234 optimizer::SEL_IMERGE *imerge,
2235 double read_time);
2236@@ -816,14 +811,6 @@
2237 {
2238 best_trp= rori_trp;
2239 best_read_time= best_trp->read_cost;
2240- /*
2241- Try constructing covering ROR-intersect only if it looks possible
2242- and worth doing.
2243- */
2244- if (rori_trp->isRowRetrievalNecessary() && can_build_covering &&
2245- (rori_trp= get_best_covering_ror_intersect(&param, tree,
2246- best_read_time)))
2247- best_trp= rori_trp;
2248 }
2249 }
2250 }
2251@@ -1276,40 +1263,6 @@
2252 return (val1 < val2)? -1: (val1 == val2)? 0 : 1;
2253 }
2254
2255-/*
2256- Compare two ROR_SCAN_INFO** by
2257- (#covered fields in F desc,
2258- #components asc,
2259- number of first not covered component asc)
2260-
2261- SYNOPSIS
2262- cmp_ror_scan_info_covering()
2263- a ptr to first compared value
2264- b ptr to second compared value
2265-
2266- RETURN
2267- -1 a < b
2268- 0 a = b
2269- 1 a > b
2270-*/
2271-
2272-static int cmp_ror_scan_info_covering(ROR_SCAN_INFO** a, ROR_SCAN_INFO** b)
2273-{
2274- if ((*a)->used_fields_covered > (*b)->used_fields_covered)
2275- return -1;
2276- if ((*a)->used_fields_covered < (*b)->used_fields_covered)
2277- return 1;
2278- if ((*a)->key_components < (*b)->key_components)
2279- return -1;
2280- if ((*a)->key_components > (*b)->key_components)
2281- return 1;
2282- if ((*a)->first_uncovered_field < (*b)->first_uncovered_field)
2283- return -1;
2284- if ((*a)->first_uncovered_field > (*b)->first_uncovered_field)
2285- return 1;
2286- return 0;
2287-}
2288-
2289
2290 /* Auxiliary structure for incremental ROR-intersection creation */
2291 typedef struct
2292@@ -1830,140 +1783,6 @@
2293
2294
2295 /*
2296- Get best covering ROR-intersection.
2297- SYNOPSIS
2298- get_best_covering_ror_intersect()
2299- param Parameter from test_quick_select function.
2300- tree optimizer::SEL_TREE with sets of intervals for different keys.
2301- read_time Don't return table read plans with cost > read_time.
2302-
2303- RETURN
2304- Best covering ROR-intersection plan
2305- NULL if no plan found.
2306-
2307- NOTES
2308- get_best_ror_intersect must be called for a tree before calling this
2309- function for it.
2310- This function invalidates tree->ror_scans member values.
2311-
2312- The following approximate algorithm is used:
2313- I=set of all covering indexes
2314- F=set of all fields to cover
2315- S={}
2316-
2317- do
2318- {
2319- Order I by (#covered fields in F desc,
2320- #components asc,
2321- number of first not covered component asc);
2322- F=F-covered by first(I);
2323- S=S+first(I);
2324- I=I-first(I);
2325- } while F is not empty.
2326-*/
2327-
2328-static
2329-optimizer::RorIntersectReadPlan *get_best_covering_ror_intersect(optimizer::Parameter *param,
2330- optimizer::SEL_TREE *tree,
2331- double read_time)
2332-{
2333- ROR_SCAN_INFO **ror_scan_mark;
2334- ROR_SCAN_INFO **ror_scans_end= tree->ror_scans_end;
2335-
2336- for (ROR_SCAN_INFO **scan= tree->ror_scans; scan != ror_scans_end; ++scan)
2337- (*scan)->key_components=
2338- param->table->key_info[(*scan)->keynr].key_parts;
2339-
2340- /*
2341- Run covering-ROR-search algorithm.
2342- Assume set I is [ror_scan .. ror_scans_end)
2343- */
2344-
2345- /*I=set of all covering indexes */
2346- ror_scan_mark= tree->ror_scans;
2347-
2348- MyBitmap *covered_fields= &param->tmp_covered_fields;
2349- if (! covered_fields->getBitmap())
2350- {
2351- my_bitmap_map *tmp_bitmap= (my_bitmap_map*)alloc_root(param->mem_root,
2352- param->fields_bitmap_size);
2353- covered_fields->setBitmap(tmp_bitmap);
2354- }
2355- if (! covered_fields->getBitmap() ||
2356- covered_fields->init(covered_fields->getBitmap(),
2357- param->table->s->fields))
2358- return 0;
2359- covered_fields->clearAll();
2360-
2361- double total_cost= 0.0f;
2362- ha_rows records=0;
2363- bool all_covered;
2364-
2365- do
2366- {
2367- /*
2368- Update changed sorting info:
2369- #covered fields,
2370- number of first not covered component
2371- Calculate and save these values for each of remaining scans.
2372- */
2373- for (ROR_SCAN_INFO **scan= ror_scan_mark; scan != ror_scans_end; ++scan)
2374- {
2375- bitmap_subtract(&(*scan)->covered_fields, covered_fields);
2376- (*scan)->used_fields_covered=
2377- (*scan)->covered_fields.getBitsSet();
2378- (*scan)->first_uncovered_field=
2379- (*scan)->covered_fields.getFirst();
2380- }
2381-
2382- internal::my_qsort(ror_scan_mark, ror_scans_end-ror_scan_mark,
2383- sizeof(ROR_SCAN_INFO*),
2384- (qsort_cmp)cmp_ror_scan_info_covering);
2385-
2386- /* I=I-first(I) */
2387- total_cost += (*ror_scan_mark)->index_read_cost;
2388- records += (*ror_scan_mark)->records;
2389- if (total_cost > read_time)
2390- return NULL;
2391- /* F=F-covered by first(I) */
2392- bitmap_union(covered_fields, &(*ror_scan_mark)->covered_fields);
2393- all_covered= bitmap_is_subset(&param->needed_fields, covered_fields);
2394- } while ((++ror_scan_mark < ror_scans_end) && !all_covered);
2395-
2396- if (!all_covered || (ror_scan_mark - tree->ror_scans) == 1)
2397- return NULL;
2398-
2399- /*
2400- Ok, [tree->ror_scans .. ror_scan) holds covering index_intersection with
2401- cost total_cost.
2402- */
2403- /* Add priority queue use cost. */
2404- total_cost += rows2double(records)*
2405- log((double)(ror_scan_mark - tree->ror_scans)) /
2406- (TIME_FOR_COMPARE_ROWID * M_LN2);
2407-
2408- if (total_cost > read_time)
2409- return NULL;
2410-
2411- optimizer::RorIntersectReadPlan *trp= NULL;
2412- if (! (trp= new (param->mem_root) optimizer::RorIntersectReadPlan))
2413- {
2414- return trp;
2415- }
2416-
2417- uint32_t best_num= (ror_scan_mark - tree->ror_scans);
2418- trp->ror_range_scans.assign(tree->ror_scans, tree->ror_scans + best_num);
2419- trp->setRowRetrievalNecessary(true);
2420- trp->read_cost= total_cost;
2421- trp->records= records;
2422- trp->cpk_scan= NULL;
2423- set_if_smaller(param->table->quick_condition_rows, records);
2424-
2425- return(trp);
2426-}
2427-
2428-
2429-/*
2430 Get best "range" table read plan for given optimizer::SEL_TREE, also update some info
2431
2432 SYNOPSIS
2433
2434=== modified file 'drizzled/pthread_globals.h'
2435--- drizzled/pthread_globals.h 2010-02-04 08:14:46 +0000
2436+++ drizzled/pthread_globals.h 2010-04-19 20:33:26 +0000
2437@@ -36,6 +36,7 @@
2438 extern pthread_cond_t COND_refresh;
2439 extern pthread_cond_t COND_thread_count;
2440 extern pthread_cond_t COND_global_read_lock;
2441+extern pthread_cond_t COND_server_end;
2442 extern pthread_attr_t connection_attrib;
2443 extern pthread_t signal_thread;
2444
2445
2446=== modified file 'drizzled/schema_identifier.cc'
2447--- drizzled/schema_identifier.cc 2010-04-14 18:21:22 +0000
2448+++ drizzled/schema_identifier.cc 2010-04-19 20:33:26 +0000
2449@@ -61,7 +61,7 @@
2450
2451
2452 int rootdir_len= strlen(FN_ROOTDIR);
2453- path.append(drizzle_data_home);
2454+ path.append(data_home);
2455 ssize_t without_rootdir= path.length() - rootdir_len;
2456
2457 /* Don't add FN_ROOTDIR if dirzzle_data_home already includes it */
2458
2459=== modified file 'drizzled/session.cc'
2460--- drizzled/session.cc 2010-04-08 16:25:53 +0000
2461+++ drizzled/session.cc 2010-04-19 20:33:26 +0000
2462@@ -46,6 +46,7 @@
2463 #include "drizzled/db.h"
2464 #include "drizzled/pthread_globals.h"
2465 #include "drizzled/transaction_services.h"
2466+#include "drizzled/drizzled.h"
2467
2468 #include "plugin/myisam/myisam.h"
2469 #include "drizzled/internal/iocache.h"
2470@@ -74,8 +75,6 @@
2471 const char * const Session::DEFAULT_WHERE= "field list";
2472 extern pthread_key_t THR_Session;
2473 extern pthread_key_t THR_Mem_root;
2474-extern uint32_t max_used_connections;
2475-extern atomic<uint32_t> connection_count;
2476
2477
2478 /****************************************************************************
2479@@ -1048,13 +1047,13 @@
2480
2481 if (!internal::dirname_length(exchange->file_name))
2482 {
2483- strcpy(path, drizzle_real_data_home);
2484+ strcpy(path, data_home_real);
2485 if (! session->db.empty())
2486- strncat(path, session->db.c_str(), FN_REFLEN-strlen(drizzle_real_data_home)-1);
2487+ strncat(path, session->db.c_str(), FN_REFLEN-strlen(data_home_real)-1);
2488 (void) internal::fn_format(path, exchange->file_name, path, "", option);
2489 }
2490 else
2491- (void) internal::fn_format(path, exchange->file_name, drizzle_real_data_home, "", option);
2492+ (void) internal::fn_format(path, exchange->file_name, data_home_real, "", option);
2493
2494 if (opt_secure_file_priv &&
2495 strncmp(opt_secure_file_priv, path, strlen(opt_secure_file_priv)))
2496
2497=== modified file 'drizzled/session_list.cc'
2498--- drizzled/session_list.cc 2010-03-04 16:54:08 +0000
2499+++ drizzled/session_list.cc 2010-04-19 20:33:26 +0000
2500@@ -35,7 +35,7 @@
2501
2502 SessionList session_list;
2503
2504-vector<Session*> &getSessionList()
2505+SessionList &getSessionList()
2506 {
2507 return session_list;
2508 }
2509
2510=== modified file 'drizzled/set_var.cc'
2511--- drizzled/set_var.cc 2010-04-07 15:56:28 +0000
2512+++ drizzled/set_var.cc 2010-04-19 20:33:26 +0000
2513@@ -143,7 +143,7 @@
2514 fix_completion_type);
2515 static sys_var_collation_sv
2516 sys_collation_server(&vars, "collation_server", &system_variables::collation_server, &default_charset_info);
2517-static sys_var_const_str sys_datadir(&vars, "datadir", drizzle_real_data_home);
2518+static sys_var_const_str sys_datadir(&vars, "datadir", data_home_real);
2519
2520 static sys_var_session_uint64_t sys_join_buffer_size(&vars, "join_buffer_size",
2521 &system_variables::join_buff_size);
2522
2523=== added file 'drizzled/signal_handler.cc'
2524--- drizzled/signal_handler.cc 1970-01-01 00:00:00 +0000
2525+++ drizzled/signal_handler.cc 2010-04-19 20:33:26 +0000
2526@@ -0,0 +1,212 @@
2527+/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2528+ * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
2529+ *
2530+ * Copyright (C) 2008 Sun Microsystems
2531+ *
2532+ * This program is free software; you can redistribute it and/or modify
2533+ * it under the terms of the GNU General Public License as published by
2534+ * the Free Software Foundation; version 2 of the License.
2535+ *
2536+ * This program is distributed in the hope that it will be useful,
2537+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2538+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2539+ * GNU General Public License for more details.
2540+ *
2541+ * You should have received a copy of the GNU General Public License
2542+ * along with this program; if not, write to the Free Software
2543+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2544+ */
2545+
2546+#include "config.h"
2547+
2548+#include <signal.h>
2549+
2550+#include "drizzled/signal_handler.h"
2551+#include "drizzled/drizzled.h"
2552+#include "drizzled/session.h"
2553+#include "drizzled/internal/my_sys.h"
2554+#include "drizzled/probes.h"
2555+#include "drizzled/plugin.h"
2556+#include "drizzled/plugin/scheduler.h"
2557+#include "plugin/myisam/keycache.h"
2558+
2559+using namespace drizzled;
2560+
2561+static uint32_t killed_threads;
2562+static bool segfaulted= false;
2563+
2564+/*
2565+ * We declare these extern "C" because they are passed to system callback functions
2566+ * and Sun Studio does not like it when those don't have C linkage. We prefix them
2567+ * because extern "C"-ing something effectively removes the namespace from the
2568+ * linker symbols, meaning they would be exporting symbols like "print_signal_warning
2569+ */
2570+extern "C"
2571+{
2572+
2573+void drizzled_print_signal_warning(int sig)
2574+{
2575+ if (global_system_variables.log_warnings)
2576+ errmsg_printf(ERRMSG_LVL_WARN, _("Got signal %d from thread %"PRIu64),
2577+ sig, global_thread_id);
2578+#ifndef HAVE_BSD_SIGNALS
2579+ sigset_t set;
2580+ sigemptyset(&set);
2581+
2582+ struct sigaction sa;
2583+ sa.sa_handler= drizzled_print_signal_warning;
2584+ sa.sa_mask= set;
2585+ sa.sa_flags= 0;
2586+ sigaction(sig, &sa, NULL); /* int. thread system calls */
2587+#endif
2588+ if (sig == SIGALRM)
2589+ alarm(2); /* reschedule alarm */
2590+}
2591+
2592+/** Called when a thread is aborted. */
2593+void drizzled_end_thread_signal(int )
2594+{
2595+ Session *session=current_session;
2596+ if (session)
2597+ {
2598+ statistic_increment(killed_threads, &LOCK_status);
2599+ session->scheduler->killSessionNow(session);
2600+ DRIZZLE_CONNECTION_DONE(session->thread_id);
2601+ }
2602+ return;
2603+}
2604+
2605+void drizzled_handle_segfault(int sig)
2606+{
2607+ time_t curr_time;
2608+ struct tm tm;
2609+
2610+ /*
2611+ Strictly speaking, one needs a mutex here
2612+ but since we have got SIGSEGV already, things are a mess
2613+ so not having the mutex is not as bad as possibly using a buggy
2614+ mutex - so we keep things simple
2615+ */
2616+ if (segfaulted)
2617+ {
2618+ fprintf(stderr, _("Fatal signal %d while backtracing\n"), sig);
2619+ exit(1);
2620+ }
2621+
2622+ segfaulted= true;
2623+
2624+ curr_time= time(NULL);
2625+ if(curr_time == (time_t)-1)
2626+ {
2627+ fprintf(stderr, _("Fatal: time() call failed\n"));
2628+ exit(1);
2629+ }
2630+
2631+ localtime_r(&curr_time, &tm);
2632+
2633+ fprintf(stderr,_("%02d%02d%02d %2d:%02d:%02d - drizzled got signal %d;\n"
2634+ "This could be because you hit a bug. It is also possible that "
2635+ "this binary\n or one of the libraries it was linked against is "
2636+ "corrupt, improperly built,\n or misconfigured. This error can "
2637+ "also be caused by malfunctioning hardware.\n"),
2638+ tm.tm_year % 100, tm.tm_mon+1, tm.tm_mday,
2639+ tm.tm_hour, tm.tm_min, tm.tm_sec,
2640+ sig);
2641+ fprintf(stderr, _("We will try our best to scrape up some info that "
2642+ "will hopefully help diagnose\n"
2643+ "the problem, but since we have already crashed, "
2644+ "something is definitely wrong\nand this may fail.\n\n"));
2645+ fprintf(stderr, "key_buffer_size=%u\n",
2646+ (uint32_t) dflt_key_cache->key_cache_mem_size);
2647+ fprintf(stderr, "read_buffer_size=%ld\n", (long) global_system_variables.read_buff_size);
2648+ fprintf(stderr, "max_used_connections=%u\n", max_used_connections);
2649+ fprintf(stderr, "connection_count=%u\n", uint32_t(connection_count));
2650+ fprintf(stderr, _("It is possible that drizzled could use up to \n"
2651+ "key_buffer_size + (read_buffer_size + "
2652+ "sort_buffer_size)*thread_count\n"
2653+ "bytes of memory\n"
2654+ "Hope that's ok; if not, decrease some variables in the "
2655+ "equation.\n\n"));
2656+
2657+#ifdef HAVE_STACKTRACE
2658+ Session *session= current_session;
2659+
2660+ if (! (test_flags.test(TEST_NO_STACKTRACE)))
2661+ {
2662+ fprintf(stderr,"session: 0x%lx\n",(long) session);
2663+ fprintf(stderr,_("Attempting backtrace. You can use the following "
2664+ "information to find out\n"
2665+ "where drizzled died. If you see no messages after this, "
2666+ "something went\n"
2667+ "terribly wrong...\n"));
2668+ print_stacktrace(session ? (unsigned char*) session->thread_stack : (unsigned char*) 0,
2669+ my_thread_stack_size);
2670+ }
2671+ if (session)
2672+ {
2673+ const char *kreason= "UNKNOWN";
2674+ switch (session->killed) {
2675+ case Session::NOT_KILLED:
2676+ kreason= "NOT_KILLED";
2677+ break;
2678+ case Session::KILL_BAD_DATA:
2679+ kreason= "KILL_BAD_DATA";
2680+ break;
2681+ case Session::KILL_CONNECTION:
2682+ kreason= "KILL_CONNECTION";
2683+ break;
2684+ case Session::KILL_QUERY:
2685+ kreason= "KILL_QUERY";
2686+ break;
2687+ case Session::KILLED_NO_VALUE:
2688+ kreason= "KILLED_NO_VALUE";
2689+ break;
2690+ }
2691+ fprintf(stderr, _("Trying to get some variables.\n"
2692+ "Some pointers may be invalid and cause the "
2693+ "dump to abort...\n"));
2694+ safe_print_str("session->query", session->query, 1024);
2695+ fprintf(stderr, "session->thread_id=%"PRIu32"\n", (uint32_t) session->thread_id);
2696+ fprintf(stderr, "session->killed=%s\n", kreason);
2697+ }
2698+ fflush(stderr);
2699+#endif /* HAVE_STACKTRACE */
2700+
2701+ if (calling_initgroups)
2702+ fprintf(stderr, _("\nThis crash occurred while the server was calling "
2703+ "initgroups(). This is\n"
2704+ "often due to the use of a drizzled that is statically "
2705+ "linked against glibc\n"
2706+ "and configured to use LDAP in /etc/nsswitch.conf. "
2707+ "You will need to either\n"
2708+ "upgrade to a version of glibc that does not have this "
2709+ "problem (2.3.4 or\n"
2710+ "later when used with nscd), disable LDAP in your "
2711+ "nsswitch.conf, or use a\n"
2712+ "drizzled that is not statically linked.\n"));
2713+
2714+ if (internal::thd_lib_detected == THD_LIB_LT && !getenv("LD_ASSUME_KERNEL"))
2715+ fprintf(stderr,
2716+ _("\nYou are running a statically-linked LinuxThreads binary "
2717+ "on an NPTL system.\n"
2718+ "This can result in crashes on some distributions due "
2719+ "to LT/NPTL conflicts.\n"
2720+ "You should either build a dynamically-linked binary, or force "
2721+ "LinuxThreads\n"
2722+ "to be used with the LD_ASSUME_KERNEL environment variable. "
2723+ "Please consult\n"
2724+ "the documentation for your distribution on how to do that.\n"));
2725+
2726+#ifdef HAVE_WRITE_CORE
2727+ if (test_flags.test(TEST_CORE_ON_SIGNAL))
2728+ {
2729+ fprintf(stderr, _("Writing a core file\n"));
2730+ fflush(stderr);
2731+ write_core(sig);
2732+ }
2733+#endif
2734+
2735+ exit(1);
2736+}
2737+
2738+} /* extern "C" */
2739
2740=== added file 'drizzled/signal_handler.h'
2741--- drizzled/signal_handler.h 1970-01-01 00:00:00 +0000
2742+++ drizzled/signal_handler.h 2010-04-19 20:33:26 +0000
2743@@ -0,0 +1,55 @@
2744+/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2745+ * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
2746+ *
2747+ * Copyright (C) 2008 Sun Microsystems
2748+ * Copyright (C) 2010 Monty Taylor
2749+ *
2750+ * This program is free software; you can redistribute it and/or modify
2751+ * it under the terms of the GNU General Public License as published by
2752+ * the Free Software Foundation; version 2 of the License.
2753+ *
2754+ * This program is distributed in the hope that it will be useful,
2755+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2756+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2757+ * GNU General Public License for more details.
2758+ *
2759+ * You should have received a copy of the GNU General Public License
2760+ * along with this program; if not, write to the Free Software
2761+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2762+ */
2763+
2764+#ifndef DRIZZLED_SIGNAL_HANDLER_H
2765+#define DRIZZLED_SIGNAL_HANDLER_H
2766+
2767+#include <signal.h>
2768+
2769+#include <cstdlib>
2770+#include <cassert>
2771+
2772+extern "C" void drizzled_print_signal_warning(int sig);
2773+extern "C" void drizzled_handle_segfault(int sig);
2774+extern "C" void drizzled_end_thread_signal(int sig);
2775+
2776+/*
2777+ posix sigaction() based signal handler implementation
2778+ On some systems, such as Mac OS X, sigset() results in flags
2779+ such as SA_RESTART being set, and we want to make sure that no such
2780+ flags are set.
2781+*/
2782+static inline void ignore_signal(int sig)
2783+{
2784+ /* Wow. There is a function sigaction which takes a pointer to a
2785+ struct sigaction. */
2786+ struct sigaction l_s;
2787+ sigset_t l_set;
2788+ sigemptyset(&l_set);
2789+
2790+ assert(sig != 0);
2791+ l_s.sa_handler= SIG_IGN;
2792+ l_s.sa_mask= l_set;
2793+ l_s.sa_flags= 0;
2794+ int l_rc= sigaction(sig, &l_s, NULL);
2795+ assert(l_rc == 0);
2796+}
2797+
2798+#endif /* DRIZZLED_SIGNAL_HANDLER_H */
2799
2800=== modified file 'drizzled/sql_base.cc'
2801--- drizzled/sql_base.cc 2010-04-15 19:22:50 +0000
2802+++ drizzled/sql_base.cc 2010-04-19 20:33:26 +0000
2803@@ -51,6 +51,7 @@
2804 #include "drizzled/global_charset_info.h"
2805 #include "drizzled/pthread_globals.h"
2806 #include "drizzled/internal/iocache.h"
2807+#include "drizzled/drizzled.h"
2808 #include "drizzled/plugin/authorization.h"
2809
2810 using namespace std;
2811@@ -60,8 +61,6 @@
2812
2813 extern bool volatile shutdown_in_progress;
2814
2815-bool drizzle_rm_tmp_tables();
2816-
2817 /**
2818 @defgroup Data_Dictionary Data Dictionary
2819 @{
2820
2821=== modified file 'drizzled/sql_load.cc'
2822--- drizzled/sql_load.cc 2010-03-31 21:15:40 +0000
2823+++ drizzled/sql_load.cc 2010-04-19 20:33:26 +0000
2824@@ -258,14 +258,14 @@
2825 #endif
2826 if (!internal::dirname_length(ex->file_name))
2827 {
2828- strcpy(name, drizzle_real_data_home);
2829- strncat(name, tdb, FN_REFLEN-strlen(drizzle_real_data_home)-1);
2830+ strcpy(name, data_home_real);
2831+ strncat(name, tdb, FN_REFLEN-strlen(data_home_real)-1);
2832 (void) internal::fn_format(name, ex->file_name, name, "",
2833 MY_RELATIVE_PATH | MY_UNPACK_FILENAME);
2834 }
2835 else
2836 {
2837- (void) internal::fn_format(name, ex->file_name, drizzle_real_data_home, "",
2838+ (void) internal::fn_format(name, ex->file_name, data_home_real, "",
2839 MY_RELATIVE_PATH | MY_UNPACK_FILENAME);
2840
2841 if (opt_secure_file_priv &&
2842
2843=== modified file 'drizzled/sql_table.cc'
2844--- drizzled/sql_table.cc 2010-04-11 17:19:47 +0000
2845+++ drizzled/sql_table.cc 2010-04-19 20:33:26 +0000
2846@@ -54,7 +54,6 @@
2847 namespace drizzled
2848 {
2849
2850-extern plugin::StorageEngine *myisam_engine;
2851 extern pid_t current_pid;
2852
2853 bool is_primary_key(KEY *key_info)
2854@@ -1618,9 +1617,6 @@
2855 old_name The old table name.
2856 new_db The new database name.
2857 new_name The new table name.
2858- flags flags for build_table_filename().
2859- FN_FROM_IS_TMP old_name is temporary.
2860- FN_TO_IS_TMP new_name is temporary.
2861
2862 RETURN
2863 false OK
2864@@ -1630,8 +1626,7 @@
2865 bool
2866 mysql_rename_table(plugin::StorageEngine *base,
2867 TableIdentifier &from,
2868- TableIdentifier &to,
2869- uint32_t )
2870+ TableIdentifier &to)
2871 {
2872 Session *session= current_session;
2873 int error= 0;
2874
2875=== modified file 'drizzled/sql_table.h'
2876--- drizzled/sql_table.h 2010-04-11 17:04:06 +0000
2877+++ drizzled/sql_table.h 2010-04-19 20:33:26 +0000
2878@@ -40,10 +40,6 @@
2879 class AlterInfo;
2880 class Cursor;
2881
2882-/* Flags for conversion functions. */
2883-static const uint32_t FN_FROM_IS_TMP(1 << 0);
2884-static const uint32_t FN_TO_IS_TMP(1 << 0);
2885-
2886 namespace message { class Table; }
2887 class TableIdentifier;
2888
2889
2890=== modified file 'drizzled/stacktrace.cc'
2891--- drizzled/stacktrace.cc 2010-02-04 08:14:46 +0000
2892+++ drizzled/stacktrace.cc 2010-04-19 20:33:26 +0000
2893@@ -36,6 +36,10 @@
2894 #include <cstdio>
2895 #include <algorithm>
2896
2897+#if defined(BACKTRACE_DEMANGLE)
2898+# include <cxxabi.h>
2899+#endif
2900+
2901 #include "drizzled/definitions.h"
2902
2903 using namespace std;
2904@@ -74,8 +78,13 @@
2905 #define SIGRETURN_FRAME_OFFSET 23
2906 #endif
2907
2908-
2909-#if BACKTRACE_DEMANGLE
2910+#if defined(BACKTRACE_DEMANGLE)
2911+
2912+static inline char *my_demangle(const char *mangled_name, int *status)
2913+{
2914+ return abi::__cxa_demangle(mangled_name, NULL, NULL, status);
2915+}
2916+
2917 static void my_demangle_symbols(char **addrs, int n)
2918 {
2919 int status, i;
2920
2921=== modified file 'drizzled/stacktrace.h'
2922--- drizzled/stacktrace.h 2010-02-04 08:14:46 +0000
2923+++ drizzled/stacktrace.h 2010-04-19 20:33:26 +0000
2924@@ -35,10 +35,6 @@
2925 #define BACKTRACE_DEMANGLE 1
2926 #endif
2927
2928-#if defined(BACKTRACE_DEMANGLE)
2929-extern "C" char *my_demangle(const char *mangled_name, int *status);
2930-#endif
2931-
2932 #ifdef TARGET_OS_LINUX
2933 #if defined(HAVE_STACKTRACE) || (defined (__x86_64__) || defined (__i386__) )
2934 #undef HAVE_STACKTRACE
2935
2936=== modified file 'drizzled/statement/alter_table.cc'
2937--- drizzled/statement/alter_table.cc 2010-04-08 16:25:53 +0000
2938+++ drizzled/statement/alter_table.cc 2010-04-19 20:33:26 +0000
2939@@ -931,7 +931,7 @@
2940 }
2941 else
2942 {
2943- if (mysql_rename_table(original_engine, original_table_identifier, new_table_identifier, 0))
2944+ if (mysql_rename_table(original_engine, original_table_identifier, new_table_identifier))
2945 {
2946 error= -1;
2947 }
2948@@ -1125,7 +1125,7 @@
2949
2950 new_table_identifier.setPath(new_table_as_temporary.getPath());
2951
2952- if (mysql_rename_table(new_engine, new_table_as_temporary, new_table_identifier, FN_FROM_IS_TMP) != 0)
2953+ if (mysql_rename_table(new_engine, new_table_as_temporary, new_table_identifier) != 0)
2954 {
2955 return true;
2956 }
2957@@ -1184,14 +1184,14 @@
2958 TableIdentifier original_table_to_drop(original_table_identifier.getSchemaName(),
2959 old_name, message::Table::TEMPORARY);
2960
2961- if (mysql_rename_table(original_engine, original_table_identifier, original_table_to_drop, FN_TO_IS_TMP))
2962+ if (mysql_rename_table(original_engine, original_table_identifier, original_table_to_drop))
2963 {
2964 error= 1;
2965 quick_rm_table(*session, new_table_as_temporary);
2966 }
2967 else
2968 {
2969- if (mysql_rename_table(new_engine, new_table_as_temporary, new_table_identifier, FN_FROM_IS_TMP) != 0)
2970+ if (mysql_rename_table(new_engine, new_table_as_temporary, new_table_identifier) != 0)
2971 {
2972 /* Try to get everything back. */
2973 error= 1;
2974@@ -1200,7 +1200,7 @@
2975
2976 quick_rm_table(*session, new_table_as_temporary);
2977
2978- mysql_rename_table(original_engine, original_table_to_drop, original_table_identifier, FN_FROM_IS_TMP);
2979+ mysql_rename_table(original_engine, original_table_to_drop, original_table_identifier);
2980 }
2981 else
2982 {
2983
2984=== modified file 'drizzled/statement/rename_table.cc'
2985--- drizzled/statement/rename_table.cc 2010-03-25 19:25:04 +0000
2986+++ drizzled/statement/rename_table.cc 2010-04-19 20:33:26 +0000
2987@@ -171,7 +171,7 @@
2988 return 1; // This can't be skipped
2989 }
2990
2991- rc= mysql_rename_table(engine, old_identifier, new_identifier, 0);
2992+ rc= mysql_rename_table(engine, old_identifier, new_identifier);
2993 if (rc && ! skip_error)
2994 return true;
2995
2996
2997=== modified file 'drizzled/table.cc'
2998--- drizzled/table.cc 2010-04-01 12:38:11 +0000
2999+++ drizzled/table.cc 2010-04-19 20:33:26 +0000
3000@@ -1885,32 +1885,6 @@
3001 }
3002
3003 /*
3004- DESCRIPTION
3005- given a buffer with a key value, and a map of keyparts
3006- that are present in this value, returns the length of the value
3007-*/
3008-uint32_t calculate_key_len(Table *table, uint32_t key,
3009- const unsigned char *,
3010- key_part_map keypart_map)
3011-{
3012- /* works only with key prefixes */
3013- assert(((keypart_map + 1) & keypart_map) == 0);
3014-
3015- KEY *key_info= table->s->key_info+key;
3016- KEY_PART_INFO *key_part= key_info->key_part;
3017- KEY_PART_INFO *end_key_part= key_part + key_info->key_parts;
3018- uint32_t length= 0;
3019-
3020- while (key_part < end_key_part && keypart_map)
3021- {
3022- length+= key_part->store_length;
3023- keypart_map >>= 1;
3024- key_part++;
3025- }
3026- return length;
3027-}
3028-
3029-/*
3030 Check if database name is valid
3031
3032 SYNPOSIS
3033
3034=== modified file 'drizzled/table_identifier.cc'
3035--- drizzled/table_identifier.cc 2010-03-31 06:34:03 +0000
3036+++ drizzled/table_identifier.cc 2010-04-19 20:33:26 +0000
3037@@ -145,8 +145,7 @@
3038 db Database name
3039 table_name Table name
3040 ext File extension.
3041- flags FN_FROM_IS_TMP or FN_TO_IS_TMP
3042- table_name is temporary, do not change.
3043+ flags table_name is temporary, do not change.
3044
3045 NOTES
3046
3047@@ -174,7 +173,7 @@
3048 bool conversion_error= false;
3049
3050 memset(tbbuff, 0, sizeof(tbbuff));
3051- if (is_tmp) // FN_FROM_IS_TMP | FN_TO_IS_TMP
3052+ if (is_tmp) // It a conversion tmp
3053 {
3054 strncpy(tbbuff, table_name, sizeof(tbbuff));
3055 }
3056@@ -201,7 +200,7 @@
3057
3058
3059 int rootdir_len= strlen(FN_ROOTDIR);
3060- path.append(drizzle_data_home);
3061+ path.append(data_home);
3062 ssize_t without_rootdir= path.length() - rootdir_len;
3063
3064 /* Don't add FN_ROOTDIR if dirzzle_data_home already includes it */
3065
3066=== modified file 'extra/include.am'
3067--- extra/include.am 2010-01-11 23:50:15 +0000
3068+++ extra/include.am 2010-04-19 20:33:26 +0000
3069@@ -4,7 +4,4 @@
3070
3071
3072 extra_my_print_defaults_SOURCES= extra/my_print_defaults.cc
3073-extra_my_print_defaults_LDADD= \
3074- drizzled/internal/libinternal.la \
3075- gnulib/libgnu.la \
3076- $(LIBINTL)
3077+extra_my_print_defaults_LDADD= $(CLIENT_LDADD)
3078
3079=== modified file 'plugin/archive/ha_archive.cc'
3080--- plugin/archive/ha_archive.cc 2010-04-01 15:54:57 +0000
3081+++ plugin/archive/ha_archive.cc 2010-04-19 20:33:26 +0000
3082@@ -769,20 +769,11 @@
3083 the optimizer that we have unique indexes, we scan
3084 */
3085 int ha_archive::index_read(unsigned char *buf, const unsigned char *key,
3086- uint32_t key_len, enum ha_rkey_function find_flag)
3087-{
3088- int rc;
3089- rc= index_read_idx(buf, active_index, key, key_len, find_flag);
3090- return(rc);
3091-}
3092-
3093-
3094-int ha_archive::index_read_idx(unsigned char *buf, uint32_t index, const unsigned char *key,
3095- uint32_t key_len, enum ha_rkey_function)
3096+ uint32_t key_len, enum ha_rkey_function)
3097 {
3098 int rc;
3099 bool found= 0;
3100- KEY *mkey= &table->s->key_info[index];
3101+ KEY *mkey= &table->s->key_info[0];
3102 current_k_offset= mkey->key_part->offset;
3103 current_key= key;
3104 current_key_len= key_len;
3105
3106=== modified file 'plugin/archive/ha_archive.h'
3107--- plugin/archive/ha_archive.h 2010-02-12 21:18:37 +0000
3108+++ plugin/archive/ha_archive.h 2010-04-19 20:33:26 +0000
3109@@ -96,10 +96,6 @@
3110 virtual int index_read(unsigned char * buf, const unsigned char * key,
3111 uint32_t key_len,
3112 drizzled::ha_rkey_function find_flag);
3113- virtual int index_read_idx(unsigned char * buf, uint32_t index,
3114- const unsigned char * key,
3115- uint32_t key_len,
3116- drizzled::ha_rkey_function find_flag);
3117 int index_next(unsigned char * buf);
3118 int open(const char *name, int mode, uint32_t test_if_locked);
3119 int close(void);
3120
3121=== modified file 'plugin/innobase/handler/ha_innodb.cc'
3122--- plugin/innobase/handler/ha_innodb.cc 2010-04-15 16:00:18 +0000
3123+++ plugin/innobase/handler/ha_innodb.cc 2010-04-19 20:33:26 +0000
3124@@ -6469,7 +6469,7 @@
3125 }
3126
3127 snprintf(path, sizeof(path), "%s/%s%s",
3128- drizzle_data_home, ib_table->name, ".dfe");
3129+ data_home, ib_table->name, ".dfe");
3130
3131 internal::unpack_filename(path,path);
3132
3133
3134=== modified file 'plugin/myisam/plugin.ini'
3135--- plugin/myisam/plugin.ini 2010-02-04 08:14:46 +0000
3136+++ plugin/myisam/plugin.ini 2010-04-19 20:33:26 +0000
3137@@ -18,6 +18,6 @@
3138 description=Legacy non-transactional MySQL tables
3139 load_by_default=yes
3140 sources=ha_myisam.cc
3141-libs=plugin/myisam/libmyisam.la drizzled/internal/libinternal.la
3142+libs=plugin/myisam/libmyisam.la
3143 ldflags=$(LIBZ) $(LIBINTL)
3144 static=yes
3145
3146=== modified file 'plugin/pbxt/src/ha_pbxt.h'
3147--- plugin/pbxt/src/ha_pbxt.h 2010-04-14 16:29:40 +0000
3148+++ plugin/pbxt/src/ha_pbxt.h 2010-04-19 20:33:26 +0000
3149@@ -256,11 +256,11 @@
3150 int index_end();
3151 int index_read(byte * buf, const byte * key,
3152 uint key_len, enum ha_rkey_function find_flag);
3153- int index_read_idx(byte * buf, uint idx, const byte * key,
3154- uint key_len, enum ha_rkey_function find_flag);
3155- int index_read_xt(byte * buf, uint idx, const byte * key,
3156- uint key_len, enum ha_rkey_function find_flag);
3157- int index_next(byte * buf);
3158+ int index_read_idx(byte * buf, uint idx, const byte * key,
3159+ uint key_len, enum ha_rkey_function find_flag);
3160+ int index_read_xt(byte * buf, uint idx, const byte * key,
3161+ uint key_len, enum ha_rkey_function find_flag);
3162+ int index_next(byte * buf);
3163 int index_next_same(byte * buf, const byte *key, uint length);
3164 int index_prev(byte * buf);
3165 int index_first(byte * buf);
3166
3167=== modified file 'plugin/pbxt/src/myxt_xt.cc'
3168--- plugin/pbxt/src/myxt_xt.cc 2010-04-14 16:29:40 +0000
3169+++ plugin/pbxt/src/myxt_xt.cc 2010-04-19 20:33:26 +0000
3170@@ -2082,7 +2082,7 @@
3171 message::Table::STANDARD);
3172 } else {
3173 std::string n;
3174- n.append(drizzle_data_home);
3175+ n.append(data_home);
3176 n.append("/");
3177 n.append(db_name);
3178 n.append("/");
3179
3180=== modified file 'plugin/pbxt/src/table_xt.cc'
3181--- plugin/pbxt/src/table_xt.cc 2010-04-08 17:52:00 +0000
3182+++ plugin/pbxt/src/table_xt.cc 2010-04-19 20:33:26 +0000
3183@@ -683,17 +683,25 @@
3184 * Previously we only caclulated statistics when a handler was opened
3185 * and the underlying table was also opened.
3186 */
3187+ /* This (hack) fixes: warning: variable 'edx' might be clobbered by 'longjmp' or 'vfork' */
3188+ u_int save_edx;
3189+
3190 xt_enum_tables_init(&edx);
3191 while ((te_ptr = xt_enum_tables_next(self, db, &edx))) {
3192+ save_edx = edx;
3193+
3194 xt_strcpy(PATH_MAX, pbuf, te_ptr->te_tab_path->tp_path);
3195 xt_add_dir_char(PATH_MAX, pbuf);
3196 xt_strcat(PATH_MAX, pbuf, te_ptr->te_tab_name);
3197 try_(a) {
3198+ edx = 0;
3199 xt_heap_release(self, xt_use_table_no_lock(self, db, (XTPathStrPtr)pbuf, FALSE, FALSE, NULL));
3200 } catch_(a) {
3201+ edx = 0;
3202 /* ignore errors */
3203 xt_log_and_clear_warning(self);
3204 } cont_(a);
3205+ edx = save_edx;
3206 }
3207
3208 popr_(); // Discard xt_tab_exit_db(db)
3209
3210=== modified file 'plugin/pbxt/src/xt_defs.h'
3211--- plugin/pbxt/src/xt_defs.h 2010-04-08 16:11:29 +0000
3212+++ plugin/pbxt/src/xt_defs.h 2010-04-19 20:33:26 +0000
3213@@ -903,7 +903,7 @@
3214
3215 #define my_pthread_setspecific_ptr(T, V) pthread_setspecific(T, (void*) (V))
3216
3217-#define mysql_real_data_home drizzle_real_data_home
3218+#define mysql_real_data_home ::drizzled::data_home
3219
3220 #define mi_int4store(T,A) { uint32_t def_temp= (uint32_t) (A);\
3221 ((unsigned char*) (T))[3]= (unsigned char) (def_temp);\
3222
3223=== modified file 'plugin/schema_engine/schema.cc'
3224--- plugin/schema_engine/schema.cc 2010-04-01 15:54:57 +0000
3225+++ plugin/schema_engine/schema.cc 2010-04-19 20:33:26 +0000
3226@@ -69,7 +69,7 @@
3227
3228 void Schema::prime()
3229 {
3230- CachedDirectory directory(drizzle_data_home, CachedDirectory::DIRECTORY);
3231+ CachedDirectory directory(data_home, CachedDirectory::DIRECTORY);
3232 CachedDirectory::Entries files= directory.getEntries();
3233
3234 pthread_rwlock_wrlock(&schema_lock);
3235@@ -113,7 +113,7 @@
3236
3237 // If for some reason getting a lock should fail, we resort to disk
3238
3239- CachedDirectory directory(drizzle_data_home, CachedDirectory::DIRECTORY);
3240+ CachedDirectory directory(data_home, CachedDirectory::DIRECTORY);
3241
3242 CachedDirectory::Entries files= directory.getEntries();
3243
3244
3245=== modified file 'plugin/signal_handler/signal_handler.cc'
3246--- plugin/signal_handler/signal_handler.cc 2010-03-26 21:36:11 +0000
3247+++ plugin/signal_handler/signal_handler.cc 2010-04-19 20:33:26 +0000
3248@@ -23,6 +23,7 @@
3249 #include "drizzled/internal/my_pthread.h"
3250 #include "drizzled/internal/my_sys.h"
3251 #include "drizzled/plugin/daemon.h"
3252+#include "drizzled/signal_handler.h"
3253
3254 #include <sys/stat.h>
3255 #include <fcntl.h>
3256@@ -67,7 +68,7 @@
3257 kill_in_progress=true;
3258 abort_loop=1; // This should be set
3259 if (sig != 0) // 0 is not a valid signal number
3260- my_sigset(sig, SIG_IGN); /* purify inspected */
3261+ ignore_signal(sig); /* purify inspected */
3262 if (sig == SIGTERM || sig == 0)
3263 errmsg_printf(ERRMSG_LVL_INFO, _(ER(ER_NORMAL_SHUTDOWN)),internal::my_progname);
3264 else
3265
3266=== modified file 'support-files/drizzle.spec.in'
3267--- support-files/drizzle.spec.in 2010-03-30 09:29:02 +0000
3268+++ support-files/drizzle.spec.in 2010-04-19 20:33:26 +0000
3269@@ -479,6 +479,12 @@
3270 %{_includedir}/drizzled/version.h
3271 %{_includedir}/drizzled/visibility.h
3272 %{_includedir}/drizzled/xid.h
3273+%{_libdir}/libdrizzled.la
3274+%{_libdir}/libdrizzled.so
3275+%{_libdir}/libdrizzled.so.*
3276+%{_libdir}/libdrizzledmessage.la
3277+%{_libdir}/libdrizzledmessage.so
3278+%{_libdir}/libdrizzledmessage.so.*
3279 %{_libdir}/drizzle/libarchive_plugin.la
3280 %{_libdir}/drizzle/libarchive_plugin.so
3281 %{_libdir}/drizzle/libascii_plugin.la
3282
3283=== modified file 'tests/test-run.pl'
3284--- tests/test-run.pl 2010-03-31 18:10:36 +0000
3285+++ tests/test-run.pl 2010-04-19 20:33:26 +0000
3286@@ -3337,17 +3337,19 @@
3287 # write init file for mysqld
3288 mtr_tofile($gdb_init_file,
3289 "set args $str\n" .
3290+ "set breakpoint pending on\n" .
3291 "break drizzled::mysql_parse\n" .
3292 "commands 1\n" .
3293 "disable 1\n" .
3294 "end\n" .
3295+ "set breakpoint pending off\n" .
3296 "run");
3297 }
3298
3299 if ( $opt_manual_gdb )
3300 {
3301 print "\nTo start gdb for $type, type in another window:\n";
3302- print "gdb -cd $glob_mysql_test_dir -x $gdb_init_file $$exe\n";
3303+ print "$glob_mysql_test_dir/../libtool --mode=execute gdb -cd $glob_mysql_test_dir -x $gdb_init_file $$exe\n";
3304
3305 # Indicate the exe should not be started
3306 $$exe= undef;
3307
3308=== modified file 'tests/valgrind.supp'
3309--- tests/valgrind.supp 2010-04-12 23:31:44 +0000
3310+++ tests/valgrind.supp 2010-04-19 20:33:26 +0000
3311@@ -964,6 +964,30 @@
3312 }
3313
3314 {
3315+ thr_local_hash static initialization
3316+ Memcheck:Leak
3317+ fun:malloc
3318+ fun:mem_heap_create_block
3319+ ...
3320+ fun:_ZL13innobase_initR14PluginRegistry
3321+ fun:_Z11plugin_initPiPPci
3322+ fun:_ZL22init_server_componentsv
3323+ fun:main
3324+}
3325+
3326+{
3327+ thr_local_hash static initialization
3328+ Memcheck:Leak
3329+ fun:malloc
3330+ fun:ut_malloc_low
3331+ ...
3332+ fun:_ZL13innobase_initR14PluginRegistry
3333+ fun:_Z11plugin_initPiPPci
3334+ fun:_ZL22init_server_componentsv
3335+ fun:main
3336+}
3337+
3338+{
3339 InnoDB Garbage
3340 Memcheck:Value8
3341 ...