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
=== modified file 'Makefile.am'
--- Makefile.am 2010-04-16 00:08:16 +0000
+++ Makefile.am 2010-04-19 20:33:26 +0000
@@ -22,6 +22,7 @@
22noinst_HEADERS =22noinst_HEADERS =
23nobase_nodist_include_HEADERS =23nobase_nodist_include_HEADERS =
24nobase_dist_include_HEADERS =24nobase_dist_include_HEADERS =
25sbin_PROGRAMS =
25lib_LTLIBRARIES = 26lib_LTLIBRARIES =
26noinst_LTLIBRARIES =27noinst_LTLIBRARIES =
27noinst_PROGRAMS =28noinst_PROGRAMS =
@@ -124,11 +125,11 @@
124125
125include config/lint-source.am126include config/lint-source.am
126127
128include drizzled/message/include.am
127include drizzled/include.am129include drizzled/include.am
128include drizzled/internal/include.am130include drizzled/internal/include.am
129include drizzled/algorithm/include.am131include drizzled/algorithm/include.am
130include drizzled/util/include.am132include drizzled/util/include.am
131include drizzled/message/include.am
132include client/include.am133include client/include.am
133include extra/include.am134include extra/include.am
134include support-files/include.am135include support-files/include.am
135136
=== modified file 'drizzled/cursor.cc'
--- drizzled/cursor.cc 2010-04-08 16:25:53 +0000
+++ drizzled/cursor.cc 2010-04-19 20:33:26 +0000
@@ -90,6 +90,30 @@
90 return NULL;90 return NULL;
91}91}
9292
93/*
94 DESCRIPTION
95 given a buffer with a key value, and a map of keyparts
96 that are present in this value, returns the length of the value
97*/
98uint32_t Cursor::calculate_key_len(uint32_t key_position, key_part_map keypart_map_arg)
99{
100 /* works only with key prefixes */
101 assert(((keypart_map_arg + 1) & keypart_map_arg) == 0);
102
103 KEY *key_info_found= table->s->key_info + key_position;
104 KEY_PART_INFO *key_part_found= key_info_found->key_part;
105 KEY_PART_INFO *end_key_part_found= key_part_found + key_info_found->key_parts;
106 uint32_t length= 0;
107
108 while (key_part_found < end_key_part_found && keypart_map_arg)
109 {
110 length+= key_part_found->store_length;
111 keypart_map_arg >>= 1;
112 key_part_found++;
113 }
114 return length;
115}
116
93int Cursor::ha_index_init(uint32_t idx, bool sorted)117int Cursor::ha_index_init(uint32_t idx, bool sorted)
94{118{
95 int result;119 int result;
96120
=== modified file 'drizzled/cursor.h'
--- drizzled/cursor.h 2010-04-09 11:55:54 +0000
+++ drizzled/cursor.h 2010-04-19 20:33:26 +0000
@@ -92,7 +92,6 @@
92 class CostVector;92 class CostVector;
93}93}
9494
95uint32_t calculate_key_len(Table *, uint, const unsigned char *, key_part_map);
96/*95/*
97 bitmap with first N+1 bits set96 bitmap with first N+1 bits set
98 (keypart_map for a key prefix of [0..N] keyparts)97 (keypart_map for a key prefix of [0..N] keyparts)
@@ -357,11 +356,11 @@
357 row if available. If the key value is null, begin at the first key of the356 row if available. If the key value is null, begin at the first key of the
358 index.357 index.
359 */358 */
360 virtual int index_read_map(unsigned char * buf, const unsigned char * key,359 virtual int index_read_map(unsigned char * buf, const unsigned char *key,
361 key_part_map keypart_map,360 key_part_map keypart_map,
362 enum ha_rkey_function find_flag)361 enum ha_rkey_function find_flag)
363 {362 {
364 uint32_t key_len= calculate_key_len(table, active_index, key, keypart_map);363 uint32_t key_len= calculate_key_len(active_index, keypart_map);
365 return index_read(buf, key, key_len, find_flag);364 return index_read(buf, key, key_len, find_flag);
366 }365 }
367 /**366 /**
@@ -383,6 +382,11 @@
383 virtual int index_last(unsigned char *)382 virtual int index_last(unsigned char *)
384 { return HA_ERR_WRONG_COMMAND; }383 { return HA_ERR_WRONG_COMMAND; }
385 virtual int index_next_same(unsigned char *, const unsigned char *, uint32_t);384 virtual int index_next_same(unsigned char *, const unsigned char *, uint32_t);
385
386private:
387 uint32_t calculate_key_len(uint32_t key_position, key_part_map keypart_map_arg);
388public:
389
386 /**390 /**
387 @brief391 @brief
388 The following functions works like index_read, but it find the last392 The following functions works like index_read, but it find the last
@@ -391,7 +395,7 @@
391 virtual int index_read_last_map(unsigned char * buf, const unsigned char * key,395 virtual int index_read_last_map(unsigned char * buf, const unsigned char * key,
392 key_part_map keypart_map)396 key_part_map keypart_map)
393 {397 {
394 uint32_t key_len= calculate_key_len(table, active_index, key, keypart_map);398 uint32_t key_len= calculate_key_len(active_index, keypart_map);
395 return index_read_last(buf, key, key_len);399 return index_read_last(buf, key, key_len);
396 }400 }
397 virtual int read_range_first(const key_range *start_key,401 virtual int read_range_first(const key_range *start_key,
@@ -733,8 +737,7 @@
733737
734bool mysql_rename_table(plugin::StorageEngine *base,738bool mysql_rename_table(plugin::StorageEngine *base,
735 TableIdentifier &old_identifier,739 TableIdentifier &old_identifier,
736 TableIdentifier &new_identifier,740 TableIdentifier &new_identifier);
737 uint32_t flags);
738741
739bool mysql_prepare_update(Session *session, TableList *table_list,742bool mysql_prepare_update(Session *session, TableList *table_list,
740 Item **conds, uint32_t order_num, order_st *order);743 Item **conds, uint32_t order_num, order_st *order);
741744
=== modified file 'drizzled/data_home.h'
--- drizzled/data_home.h 2010-02-04 08:14:46 +0000
+++ drizzled/data_home.h 2010-04-19 20:33:26 +0000
@@ -23,9 +23,11 @@
23namespace drizzled23namespace drizzled
24{24{
2525
26extern uint32_t drizzle_data_home_len;26extern char *data_home;
27extern char *drizzle_data_home,27extern uint32_t data_home_len;
28 drizzle_real_data_home[], drizzle_unpacked_real_data_home[];28extern char data_home_real[];
29extern char data_home_real_unpacked[];
30extern char data_home_buff[];
2931
30} /* namespace drizzled */32} /* namespace drizzled */
3133
3234
=== modified file 'drizzled/drizzled.cc'
--- drizzled/drizzled.cc 2010-04-07 15:56:28 +0000
+++ drizzled/drizzled.cc 2010-04-19 20:33:26 +0000
@@ -31,7 +31,6 @@
31#include "drizzled/internal/my_sys.h"31#include "drizzled/internal/my_sys.h"
32#include "drizzled/internal/my_bit.h"32#include "drizzled/internal/my_bit.h"
33#include <drizzled/my_hash.h>33#include <drizzled/my_hash.h>
34#include <drizzled/stacktrace.h>
35#include <drizzled/error.h>34#include <drizzled/error.h>
36#include <drizzled/errmsg_print.h>35#include <drizzled/errmsg_print.h>
37#include <drizzled/tztime.h>36#include <drizzled/tztime.h>
@@ -54,6 +53,7 @@
54#include "drizzled/session_list.h"53#include "drizzled/session_list.h"
55#include "drizzled/charset.h"54#include "drizzled/charset.h"
56#include "plugin/myisam/myisam.h"55#include "plugin/myisam/myisam.h"
56#include "drizzled/drizzled.h"
5757
58#include <google/protobuf/stubs/common.h>58#include <google/protobuf/stubs/common.h>
5959
@@ -73,8 +73,6 @@
73#endif73#endif
74#include <sys/socket.h>74#include <sys/socket.h>
7575
76#include <locale.h>
77
7876
79#include <errno.h>77#include <errno.h>
80#include <sys/stat.h>78#include <sys/stat.h>
@@ -85,8 +83,6 @@
85#include <pwd.h> // For getpwent83#include <pwd.h> // For getpwent
86#include <grp.h>84#include <grp.h>
8785
88#include <sys/resource.h>
89
90#ifdef HAVE_SELECT_H86#ifdef HAVE_SELECT_H
91# include <select.h>87# include <select.h>
92#endif88#endif
@@ -191,8 +187,8 @@
191/*187/*
192 Used with --help for detailed option188 Used with --help for detailed option
193*/189*/
194static bool opt_help= false;190bool opt_help= false;
195static bool opt_help_extended= false;191bool opt_help_extended= false;
196192
197arg_cmp_func Arg_comparator::comparator_matrix[5][2] =193arg_cmp_func Arg_comparator::comparator_matrix[5][2] =
198{{&Arg_comparator::compare_string, &Arg_comparator::compare_e_string},194{{&Arg_comparator::compare_string, &Arg_comparator::compare_e_string},
@@ -203,12 +199,9 @@
203199
204/* static variables */200/* static variables */
205201
206static bool volatile select_thread_in_use;
207static bool volatile ready_to_exit;
208static bool opt_debugging= 0;202static bool opt_debugging= 0;
209static uint32_t wake_thread;203static uint32_t wake_thread;
210static uint32_t killed_threads;204static char *drizzled_chroot;
211static char *drizzled_user, *drizzled_chroot;
212static char *language_ptr;205static char *language_ptr;
213static const char *default_character_set_name;206static const char *default_character_set_name;
214static const char *character_set_filesystem_name;207static const char *character_set_filesystem_name;
@@ -219,6 +212,9 @@
219212
220/* Global variables */213/* Global variables */
221214
215bool volatile ready_to_exit;
216char *drizzled_user;
217bool volatile select_thread_in_use;
222bool volatile abort_loop;218bool volatile abort_loop;
223bool volatile shutdown_in_progress;219bool volatile shutdown_in_progress;
224uint32_t max_used_connections;220uint32_t max_used_connections;
@@ -235,7 +231,7 @@
235231
236char* opt_secure_file_priv= 0;232char* opt_secure_file_priv= 0;
237233
238static bool calling_initgroups= false; /**< Used in SIGSEGV handler. */234bool calling_initgroups= false; /**< Used in SIGSEGV handler. */
239235
240uint32_t drizzled_bind_timeout;236uint32_t drizzled_bind_timeout;
241std::bitset<12> test_flags;237std::bitset<12> test_flags;
@@ -294,15 +290,15 @@
294char drizzle_home[FN_REFLEN], pidfile_name[FN_REFLEN], system_time_zone[30];290char drizzle_home[FN_REFLEN], pidfile_name[FN_REFLEN], system_time_zone[30];
295char *default_tz_name;291char *default_tz_name;
296char glob_hostname[FN_REFLEN];292char glob_hostname[FN_REFLEN];
297char drizzle_real_data_home[FN_REFLEN],293char data_home_real[FN_REFLEN],
298 language[FN_REFLEN], 294 language[FN_REFLEN],
299 *opt_tc_log_file;295 *opt_tc_log_file;
300char drizzle_unpacked_real_data_home[FN_REFLEN];296char data_home_real_unpacked[FN_REFLEN];
301const key_map key_map_empty(0);297const key_map key_map_empty(0);
302key_map key_map_full(0); // Will be initialized later298key_map key_map_full(0); // Will be initialized later
303299
304uint32_t drizzle_data_home_len;300uint32_t data_home_len;
305char drizzle_data_home_buff[2], *drizzle_data_home=drizzle_real_data_home;301char data_home_buff[2], *data_home=data_home_real;
306char *drizzle_tmpdir= NULL;302char *drizzle_tmpdir= NULL;
307char *opt_drizzle_tmpdir= NULL;303char *opt_drizzle_tmpdir= NULL;
308304
@@ -347,15 +343,12 @@
347343
348/* Static variables */344/* Static variables */
349345
350static bool segfaulted;
351int cleanup_done;346int cleanup_done;
352static char *drizzle_home_ptr, *pidfile_name_ptr;347static char *drizzle_home_ptr, *pidfile_name_ptr;
353static int defaults_argc;348static int defaults_argc;
354static char **defaults_argv;349static char **defaults_argv;
355350
356struct passwd *user_info;351passwd *user_info;
357static pthread_t select_thread;
358static uint32_t thr_kill_signal;
359352
360/**353/**
361 Number of currently active user connections. The variable is protected by354 Number of currently active user connections. The variable is protected by
@@ -379,10 +372,8 @@
379static const char *get_relative_path(const char *path);372static const char *get_relative_path(const char *path);
380static void fix_paths(string &progname);373static void fix_paths(string &progname);
381extern "C" pthread_handler_t handle_slave(void *arg);374extern "C" pthread_handler_t handle_slave(void *arg);
382static void clean_up(bool print_message);
383375
384static void usage(void);376static void usage(void);
385static void clean_up_mutexes(void);
386void close_connections(void);377void close_connections(void);
387 378
388/****************************************************************************379/****************************************************************************
@@ -467,20 +458,6 @@
467 }458 }
468}459}
469460
470extern "C" void print_signal_warning(int sig);
471
472extern "C" void print_signal_warning(int sig)
473{
474 if (global_system_variables.log_warnings)
475 errmsg_printf(ERRMSG_LVL_WARN, _("Got signal %d from thread %"PRIu64),
476 sig, global_thread_id);
477#ifndef HAVE_BSD_SIGNALS
478 my_sigset(sig,print_signal_warning); /* int. thread system calls */
479#endif
480 if (sig == SIGALRM)
481 alarm(2); /* reschedule alarm */
482}
483
484/**461/**
485 cleanup all memory and end program nicely.462 cleanup all memory and end program nicely.
486463
@@ -517,7 +494,7 @@
517}494}
518495
519496
520static void clean_up(bool print_message)497void clean_up(bool print_message)
521{498{
522 if (cleanup_done++)499 if (cleanup_done++)
523 return;500 return;
@@ -559,7 +536,7 @@
559} /* clean_up */536} /* clean_up */
560537
561538
562static void clean_up_mutexes()539void clean_up_mutexes()
563{540{
564 (void) pthread_mutex_destroy(&LOCK_create_db);541 (void) pthread_mutex_destroy(&LOCK_create_db);
565 (void) pthread_mutex_destroy(&LOCK_open);542 (void) pthread_mutex_destroy(&LOCK_open);
@@ -577,9 +554,9 @@
577554
578/* Change to run as another user if started with --user */555/* Change to run as another user if started with --user */
579556
580static struct passwd *check_user(const char *user)557passwd *check_user(const char *user)
581{558{
582 struct passwd *tmp_user_info;559 passwd *tmp_user_info;
583 uid_t user_id= geteuid();560 uid_t user_id= geteuid();
584561
585 // Don't bother if we aren't superuser562 // Don't bother if we aren't superuser
@@ -637,7 +614,7 @@
637614
638}615}
639616
640static void set_user(const char *user, struct passwd *user_info_arg)617void set_user(const char *user, passwd *user_info_arg)
641{618{
642 assert(user_info_arg != 0);619 assert(user_info_arg != 0);
643 /*620 /*
@@ -662,6 +639,7 @@
662}639}
663640
664641
642
665/** Change root user if started with @c --chroot . */643/** Change root user if started with @c --chroot . */
666static void set_root(const char *path)644static void set_root(const char *path)
667{645{
@@ -672,21 +650,6 @@
672 }650 }
673}651}
674652
675extern "C" void end_thread_signal(int );
676
677/** Called when a thread is aborted. */
678extern "C" void end_thread_signal(int )
679{
680 Session *session=current_session;
681 if (session)
682 {
683 statistic_increment(killed_threads, &LOCK_status);
684 session->scheduler->killSessionNow(session);
685 DRIZZLE_CONNECTION_DONE(session->thread_id);
686 }
687 return;
688}
689
690653
691/*654/*
692 Unlink session from global list of available connections and free session655 Unlink session from global list of available connections and free session
@@ -734,148 +697,6 @@
734}697}
735#endif698#endif
736699
737#if defined(BACKTRACE_DEMANGLE)
738#include <cxxabi.h>
739extern "C" char *my_demangle(const char *mangled_name, int *status)
740{
741 return abi::__cxa_demangle(mangled_name, NULL, NULL, status);
742}
743#endif
744
745extern "C" void handle_segfault(int sig);
746
747extern "C" void handle_segfault(int sig)
748{
749 time_t curr_time;
750 struct tm tm;
751
752 /*
753 Strictly speaking, one needs a mutex here
754 but since we have got SIGSEGV already, things are a mess
755 so not having the mutex is not as bad as possibly using a buggy
756 mutex - so we keep things simple
757 */
758 if (segfaulted)
759 {
760 fprintf(stderr, _("Fatal signal %d while backtracing\n"), sig);
761 exit(1);
762 }
763
764 segfaulted = 1;
765
766 curr_time= time(NULL);
767 if(curr_time == (time_t)-1)
768 {
769 fprintf(stderr, "Fetal: time() call failed\n");
770 exit(1);
771 }
772
773 localtime_r(&curr_time, &tm);
774
775 fprintf(stderr,"%02d%02d%02d %2d:%02d:%02d - drizzled got signal %d;\n"
776 "This could be because you hit a bug. It is also possible that "
777 "this binary\n or one of the libraries it was linked against is "
778 "corrupt, improperly built,\n or misconfigured. This error can "
779 "also be caused by malfunctioning hardware.\n",
780 tm.tm_year % 100, tm.tm_mon+1, tm.tm_mday,
781 tm.tm_hour, tm.tm_min, tm.tm_sec,
782 sig);
783 fprintf(stderr, _("We will try our best to scrape up some info that "
784 "will hopefully help diagnose\n"
785 "the problem, but since we have already crashed, "
786 "something is definitely wrong\nand this may fail.\n\n"));
787 fprintf(stderr, "key_buffer_size=%u\n",
788 (uint32_t) dflt_key_cache->key_cache_mem_size);
789 fprintf(stderr, "read_buffer_size=%ld\n", (long) global_system_variables.read_buff_size);
790 fprintf(stderr, "max_used_connections=%u\n", max_used_connections);
791 fprintf(stderr, "connection_count=%u\n", uint32_t(connection_count));
792 fprintf(stderr, _("It is possible that drizzled could use up to \n"
793 "key_buffer_size + (read_buffer_size + "
794 "sort_buffer_size)*thread_count\n"
795 "bytes of memory\n"
796 "Hope that's ok; if not, decrease some variables in the "
797 "equation.\n\n"));
798
799#ifdef HAVE_STACKTRACE
800 Session *session= current_session;
801
802 if (! (test_flags.test(TEST_NO_STACKTRACE)))
803 {
804 fprintf(stderr,"session: 0x%lx\n",(long) session);
805 fprintf(stderr,_("Attempting backtrace. You can use the following "
806 "information to find out\n"
807 "where drizzled died. If you see no messages after this, "
808 "something went\n"
809 "terribly wrong...\n"));
810 print_stacktrace(session ? (unsigned char*) session->thread_stack : (unsigned char*) 0,
811 my_thread_stack_size);
812 }
813 if (session)
814 {
815 const char *kreason= "UNKNOWN";
816 switch (session->killed) {
817 case Session::NOT_KILLED:
818 kreason= "NOT_KILLED";
819 break;
820 case Session::KILL_BAD_DATA:
821 kreason= "KILL_BAD_DATA";
822 break;
823 case Session::KILL_CONNECTION:
824 kreason= "KILL_CONNECTION";
825 break;
826 case Session::KILL_QUERY:
827 kreason= "KILL_QUERY";
828 break;
829 case Session::KILLED_NO_VALUE:
830 kreason= "KILLED_NO_VALUE";
831 break;
832 }
833 fprintf(stderr, _("Trying to get some variables.\n"
834 "Some pointers may be invalid and cause the "
835 "dump to abort...\n"));
836 safe_print_str("session->query", session->query.c_str(), 1024);
837 fprintf(stderr, "session->thread_id=%"PRIu32"\n", (uint32_t) session->thread_id);
838 fprintf(stderr, "session->killed=%s\n", kreason);
839 }
840 fflush(stderr);
841#endif /* HAVE_STACKTRACE */
842
843 if (calling_initgroups)
844 fprintf(stderr, _("\nThis crash occurred while the server was calling "
845 "initgroups(). This is\n"
846 "often due to the use of a drizzled that is statically "
847 "linked against glibc\n"
848 "and configured to use LDAP in /etc/nsswitch.conf. "
849 "You will need to either\n"
850 "upgrade to a version of glibc that does not have this "
851 "problem (2.3.4 or\n"
852 "later when used with nscd), disable LDAP in your "
853 "nsswitch.conf, or use a\n"
854 "drizzled that is not statically linked.\n"));
855
856 if (internal::thd_lib_detected == THD_LIB_LT && !getenv("LD_ASSUME_KERNEL"))
857 fprintf(stderr,
858 _("\nYou are running a statically-linked LinuxThreads binary "
859 "on an NPTL system.\n"
860 "This can result in crashes on some distributions due "
861 "to LT/NPTL conflicts.\n"
862 "You should either build a dynamically-linked binary, or force "
863 "LinuxThreads\n"
864 "to be used with the LD_ASSUME_KERNEL environment variable. "
865 "Please consult\n"
866 "the documentation for your distribution on how to do that.\n"));
867
868#ifdef HAVE_WRITE_CORE
869 if (test_flags.test(TEST_CORE_ON_SIGNAL))
870 {
871 fprintf(stderr, _("Writing a core file\n"));
872 fflush(stderr);
873 write_core(sig);
874 }
875#endif
876
877 exit(1);
878}
879700
880#ifndef SA_RESETHAND701#ifndef SA_RESETHAND
881#define SA_RESETHAND 0702#define SA_RESETHAND 0
@@ -885,65 +706,12 @@
885#endif706#endif
886707
887708
888/**709
889 All global error messages are sent here where the first one is stored710
890 for the client.711const char *load_default_groups[]=
891*/
892static void my_message_sql(uint32_t error, const char *str, myf MyFlags)
893{712{
894 Session *session;713 DRIZZLE_CONFIG_NAME, "server", 0, 0
895 /*714};
896 Put here following assertion when situation with EE_* error codes
897 will be fixed
898 */
899 if ((session= current_session))
900 {
901 if (MyFlags & ME_FATALERROR)
902 session->is_fatal_error= 1;
903
904 /*
905 TODO: There are two exceptions mechanism (Session and sp_rcontext),
906 this could be improved by having a common stack of handlers.
907 */
908 if (session->handle_error(error, str,
909 DRIZZLE_ERROR::WARN_LEVEL_ERROR))
910 return;;
911
912 /*
913 session->lex->current_select == 0 if lex structure is not inited
914 (not query command (COM_QUERY))
915 */
916 if (! (session->lex->current_select &&
917 session->lex->current_select->no_error && !session->is_fatal_error))
918 {
919 if (! session->main_da.is_error()) // Return only first message
920 {
921 if (error == 0)
922 error= ER_UNKNOWN_ERROR;
923 if (str == NULL)
924 str= ER(error);
925 session->main_da.set_error_status(error, str);
926 }
927 }
928
929 if (!session->no_warnings_for_error && !session->is_fatal_error)
930 {
931 /*
932 Suppress infinite recursion if there a memory allocation error
933 inside push_warning.
934 */
935 session->no_warnings_for_error= true;
936 push_warning(session, DRIZZLE_ERROR::WARN_LEVEL_ERROR, error, str);
937 session->no_warnings_for_error= false;
938 }
939 }
940 if (!session || MyFlags & ME_NOREFRESH)
941 errmsg_printf(ERRMSG_LVL_ERROR, "%s: %s",internal::my_progname,str);
942}
943
944
945static const char *load_default_groups[]= {
946DRIZZLE_CONFIG_NAME, "server", 0, 0};
947715
948static int show_starttime(drizzle_show_var *var, char *buff)716static int show_starttime(drizzle_show_var *var, char *buff)
949{717{
@@ -1061,8 +829,8 @@
1061 {NULL, NULL, SHOW_LONGLONG}829 {NULL, NULL, SHOW_LONGLONG}
1062};830};
1063831
1064static int init_common_variables(const char *conf_file_name, int argc,832int init_common_variables(const char *conf_file_name, int argc,
1065 char **argv, const char **groups)833 char **argv, const char **groups)
1066{834{
1067 time_t curr_time;835 time_t curr_time;
1068 umask(((~internal::my_umask) & 0666));836 umask(((~internal::my_umask) & 0666));
@@ -1211,7 +979,7 @@
1211}979}
1212980
1213981
1214static int init_server_components(plugin::Registry &plugins)982int init_server_components(plugin::Registry &plugins)
1215{983{
1216 /*984 /*
1217 We need to call each of these following functions to ensure that985 We need to call each of these following functions to ensure that
@@ -1446,8 +1214,8 @@
1446 NO_ARG, 0, 0, 0, 0, 0, 0},1214 NO_ARG, 0, 0, 0, 0, 0, 0},
1447 {"datadir", 'h',1215 {"datadir", 'h',
1448 N_("Path to the database root."),1216 N_("Path to the database root."),
1449 (char**) &drizzle_data_home,1217 (char**) &data_home,
1450 (char**) &drizzle_data_home, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},1218 (char**) &data_home, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1451 {"default-storage-engine", OPT_STORAGE_ENGINE,1219 {"default-storage-engine", OPT_STORAGE_ENGINE,
1452 N_("Set the default storage engine (table type) for tables."),1220 N_("Set the default storage engine (table type) for tables."),
1453 (char**)&default_storage_engine_str, (char**)&default_storage_engine_str,1221 (char**)&default_storage_engine_str, (char**)&default_storage_engine_str,
@@ -1793,7 +1561,6 @@
1793 drizzle_home[0]= pidfile_name[0]= 0;1561 drizzle_home[0]= pidfile_name[0]= 0;
1794 opt_tc_log_file= (char *)"tc.log"; // no hostname in tc_log file name !1562 opt_tc_log_file= (char *)"tc.log"; // no hostname in tc_log file name !
1795 opt_secure_file_priv= 0;1563 opt_secure_file_priv= 0;
1796 segfaulted= 0;
1797 cleanup_done= 0;1564 cleanup_done= 0;
1798 defaults_argc= 0;1565 defaults_argc= 0;
1799 defaults_argv= 0;1566 defaults_argv= 0;
@@ -1818,7 +1585,7 @@
1818 drizzle_home_ptr= drizzle_home;1585 drizzle_home_ptr= drizzle_home;
1819 pidfile_name_ptr= pidfile_name;1586 pidfile_name_ptr= pidfile_name;
1820 language_ptr= language;1587 language_ptr= language;
1821 drizzle_data_home= drizzle_real_data_home;1588 data_home= data_home_real;
1822 session_startup_options= (OPTION_AUTO_IS_NULL | OPTION_SQL_NOTES);1589 session_startup_options= (OPTION_AUTO_IS_NULL | OPTION_SQL_NOTES);
1823 refresh_version= 1L; /* Increments on each reload */1590 refresh_version= 1L; /* Increments on each reload */
1824 global_thread_id= 1UL;1591 global_thread_id= 1UL;
@@ -1826,11 +1593,11 @@
18261593
1827 /* Set directory paths */1594 /* Set directory paths */
1828 strncpy(language, LANGUAGE, sizeof(language)-1);1595 strncpy(language, LANGUAGE, sizeof(language)-1);
1829 strncpy(drizzle_real_data_home, get_relative_path(LOCALSTATEDIR),1596 strncpy(data_home_real, get_relative_path(LOCALSTATEDIR),
1830 sizeof(drizzle_real_data_home)-1);1597 sizeof(data_home_real)-1);
1831 drizzle_data_home_buff[0]=FN_CURLIB; // all paths are relative from here1598 data_home_buff[0]=FN_CURLIB; // all paths are relative from here
1832 drizzle_data_home_buff[1]=0;1599 data_home_buff[1]=0;
1833 drizzle_data_home_len= 2;1600 data_home_len= 2;
18341601
1835 /* Variables in libraries */1602 /* Variables in libraries */
1836 default_character_set_name= "utf8";1603 default_character_set_name= "utf8";
@@ -1877,10 +1644,10 @@
1877 default_collation_name= 0;1644 default_collation_name= 0;
1878 break;1645 break;
1879 case 'h':1646 case 'h':
1880 strncpy(drizzle_real_data_home,argument, sizeof(drizzle_real_data_home)-1);1647 strncpy(data_home_real,argument, sizeof(data_home_real)-1);
1881 /* Correct pointer set by my_getopt (for embedded library) */1648 /* Correct pointer set by my_getopt (for embedded library) */
1882 drizzle_data_home= drizzle_real_data_home;1649 data_home= data_home_real;
1883 drizzle_data_home_len= strlen(drizzle_data_home);1650 data_home_len= strlen(data_home);
1884 break;1651 break;
1885 case 'u':1652 case 'u':
1886 if (!drizzled_user || !strcmp(drizzled_user, argument))1653 if (!drizzled_user || !strcmp(drizzled_user, argument))
@@ -2065,14 +1832,14 @@
2065 pos[0]= FN_LIBCHAR;1832 pos[0]= FN_LIBCHAR;
2066 pos[1]= 0;1833 pos[1]= 0;
2067 }1834 }
2068 internal::convert_dirname(drizzle_real_data_home,drizzle_real_data_home,NULL);1835 internal::convert_dirname(data_home_real,data_home_real,NULL);
2069 (void) internal::fn_format(buff, drizzle_real_data_home, "", "",1836 (void) internal::fn_format(buff, data_home_real, "", "",
2070 (MY_RETURN_REAL_PATH|MY_RESOLVE_SYMLINKS));1837 (MY_RETURN_REAL_PATH|MY_RESOLVE_SYMLINKS));
2071 (void) internal::unpack_dirname(drizzle_unpacked_real_data_home, buff);1838 (void) internal::unpack_dirname(data_home_real_unpacked, buff);
2072 internal::convert_dirname(language,language,NULL);1839 internal::convert_dirname(language,language,NULL);
2073 (void) internal::my_load_path(drizzle_home, drizzle_home,""); // Resolve current dir1840 (void) internal::my_load_path(drizzle_home, drizzle_home,""); // Resolve current dir
2074 (void) internal::my_load_path(drizzle_real_data_home, drizzle_real_data_home,drizzle_home);1841 (void) internal::my_load_path(data_home_real, data_home_real,drizzle_home);
2075 (void) internal::my_load_path(pidfile_name, pidfile_name,drizzle_real_data_home);1842 (void) internal::my_load_path(pidfile_name, pidfile_name,data_home_real);
20761843
2077 if (opt_plugin_dir_ptr == NULL)1844 if (opt_plugin_dir_ptr == NULL)
2078 {1845 {
@@ -2100,11 +1867,11 @@
2100 progdir.assign(progdir.substr(0, progdir.rfind(".libs/")));1867 progdir.assign(progdir.substr(0, progdir.rfind(".libs/")));
2101 }1868 }
2102 string testfile(progdir);1869 string testfile(progdir);
2103 testfile.append("drizzled.o");1870 testfile.append("drizzled.lo");
2104 struct stat testfile_stat;1871 struct stat testfile_stat;
2105 if (stat(testfile.c_str(), &testfile_stat))1872 if (stat(testfile.c_str(), &testfile_stat))
2106 {1873 {
2107 /* drizzled.o doesn't exist - we are not in a source dir.1874 /* drizzled.lo doesn't exist - we are not in a source dir.
2108 * Go on as usual1875 * Go on as usual
2109 */1876 */
2110 (void) internal::my_load_path(opt_plugin_dir, get_relative_path(PKGPLUGINDIR),1877 (void) internal::my_load_path(opt_plugin_dir, get_relative_path(PKGPLUGINDIR),
@@ -2173,209 +1940,3 @@
21731940
2174} /* namespace drizzled */1941} /* namespace drizzled */
21751942
2176using namespace drizzled;
2177
2178
2179static void init_signals(void)
2180{
2181 sigset_t set;
2182 struct sigaction sa;
2183
2184 if (!(test_flags.test(TEST_NO_STACKTRACE) ||
2185 test_flags.test(TEST_CORE_ON_SIGNAL)))
2186 {
2187 sa.sa_flags = SA_RESETHAND | SA_NODEFER;
2188 sigemptyset(&sa.sa_mask);
2189 sigprocmask(SIG_SETMASK,&sa.sa_mask,NULL);
2190
2191 init_stacktrace();
2192 sa.sa_handler=handle_segfault;
2193 sigaction(SIGSEGV, &sa, NULL);
2194 sigaction(SIGABRT, &sa, NULL);
2195#ifdef SIGBUS
2196 sigaction(SIGBUS, &sa, NULL);
2197#endif
2198 sigaction(SIGILL, &sa, NULL);
2199 sigaction(SIGFPE, &sa, NULL);
2200 }
2201
2202 if (test_flags.test(TEST_CORE_ON_SIGNAL))
2203 {
2204 /* Change limits so that we will get a core file */
2205 struct rlimit rl;
2206 rl.rlim_cur = rl.rlim_max = RLIM_INFINITY;
2207 if (setrlimit(RLIMIT_CORE, &rl) && global_system_variables.log_warnings)
2208 errmsg_printf(ERRMSG_LVL_WARN,
2209 _("setrlimit could not change the size of core files "
2210 "to 'infinity'; We may not be able to generate a "
2211 "core file on signals"));
2212 }
2213 (void) sigemptyset(&set);
2214 my_sigset(SIGPIPE,SIG_IGN);
2215 sigaddset(&set,SIGPIPE);
2216#ifndef IGNORE_SIGHUP_SIGQUIT
2217 sigaddset(&set,SIGQUIT);
2218 sigaddset(&set,SIGHUP);
2219#endif
2220 sigaddset(&set,SIGTERM);
2221
2222 /* Fix signals if blocked by parents (can happen on Mac OS X) */
2223 sigemptyset(&sa.sa_mask);
2224 sa.sa_flags = 0;
2225 sa.sa_handler = print_signal_warning;
2226 sigaction(SIGTERM, &sa, (struct sigaction*) 0);
2227 sa.sa_flags = 0;
2228 sa.sa_handler = print_signal_warning;
2229 sigaction(SIGHUP, &sa, (struct sigaction*) 0);
2230#ifdef SIGTSTP
2231 sigaddset(&set,SIGTSTP);
2232#endif
2233 if (test_flags.test(TEST_SIGINT))
2234 {
2235 my_sigset(thr_kill_signal, end_thread_signal);
2236 // May be SIGINT
2237 sigdelset(&set, thr_kill_signal);
2238 }
2239 else
2240 sigaddset(&set,SIGINT);
2241 sigprocmask(SIG_SETMASK,&set,NULL);
2242 pthread_sigmask(SIG_SETMASK,&set,NULL);
2243 return;;
2244}
2245
2246int main(int argc, char **argv)
2247{
2248#if defined(ENABLE_NLS)
2249# if defined(HAVE_LOCALE_H)
2250 setlocale(LC_ALL, "");
2251# endif
2252 bindtextdomain("drizzle", LOCALEDIR);
2253 textdomain("drizzle");
2254#endif
2255
2256 plugin::Registry &plugins= plugin::Registry::singleton();
2257 plugin::Client *client;
2258 Session *session;
2259
2260 MY_INIT(argv[0]); // init my_sys library & pthreads
2261 /* nothing should come before this line ^^^ */
2262
2263 /* Set signal used to kill Drizzle */
2264#if defined(SIGUSR2)
2265 thr_kill_signal= internal::thd_lib_detected == THD_LIB_LT ? SIGINT : SIGUSR2;
2266#else
2267 thr_kill_signal= SIGINT;
2268#endif
2269
2270 if (init_common_variables(DRIZZLE_CONFIG_NAME,
2271 argc, argv, load_default_groups))
2272 unireg_abort(1); // Will do exit
2273
2274 init_signals();
2275
2276
2277 select_thread=pthread_self();
2278 select_thread_in_use=1;
2279
2280 if (chdir(drizzle_real_data_home) && !opt_help)
2281 {
2282 errmsg_printf(ERRMSG_LVL_ERROR, _("Data directory %s does not exist\n"), drizzle_real_data_home);
2283 unireg_abort(1);
2284 }
2285 drizzle_data_home= drizzle_data_home_buff;
2286 drizzle_data_home[0]=FN_CURLIB; // all paths are relative from here
2287 drizzle_data_home[1]=0;
2288 drizzle_data_home_len= 2;
2289
2290 if ((user_info= check_user(drizzled_user)))
2291 {
2292 set_user(drizzled_user, user_info);
2293 }
2294
2295 if (server_id == 0)
2296 {
2297 server_id= 1;
2298 }
2299
2300 if (init_server_components(plugins))
2301 unireg_abort(1);
2302
2303 /**
2304 * This check must be done after init_server_components for now
2305 * because we don't yet have plugin dependency tracking...
2306 *
2307 * ReplicationServices::evaluateRegisteredPlugins() will print error messages to stderr
2308 * via errmsg_printf().
2309 *
2310 * @todo
2311 *
2312 * not checking return since unireg_abort() hangs
2313 */
2314 ReplicationServices &replication_services= ReplicationServices::singleton();
2315 (void) replication_services.evaluateRegisteredPlugins();
2316
2317 if (plugin::Listen::setup())
2318 unireg_abort(1);
2319
2320 /*
2321 init signals & alarm
2322 After this we can't quit by a simple unireg_abort
2323 */
2324 error_handler_hook= my_message_sql;
2325
2326 assert(plugin::num_trx_monitored_objects > 0);
2327 if (drizzle_rm_tmp_tables() ||
2328 my_tz_init((Session *)0, default_tz_name))
2329 {
2330 abort_loop= true;
2331 select_thread_in_use=0;
2332 (void) pthread_kill(signal_thread, SIGTERM);
2333
2334 (void) unlink(pidfile_name); // Not needed anymore
2335
2336 exit(1);
2337 }
2338
2339 init_status_vars();
2340
2341 errmsg_printf(ERRMSG_LVL_INFO, _(ER(ER_STARTUP)), internal::my_progname,
2342 PANDORA_RELEASE_VERSION, COMPILATION_COMMENT);
2343
2344
2345 /* Listen for new connections and start new session for each connection
2346 accepted. The listen.getClient() method will return NULL when the server
2347 should be shutdown. */
2348 while ((client= plugin::Listen::getClient()) != NULL)
2349 {
2350 if (!(session= new Session(client)))
2351 {
2352 delete client;
2353 continue;
2354 }
2355
2356 /* If we error on creation we drop the connection and delete the session. */
2357 if (session->schedule())
2358 Session::unlink(session);
2359 }
2360
2361 /* (void) pthread_attr_destroy(&connection_attrib); */
2362
2363
2364 (void) pthread_mutex_lock(&LOCK_thread_count);
2365 select_thread_in_use=0; // For close_connections
2366 (void) pthread_mutex_unlock(&LOCK_thread_count);
2367 (void) pthread_cond_broadcast(&COND_thread_count);
2368
2369 /* Wait until cleanup is done */
2370 (void) pthread_mutex_lock(&LOCK_thread_count);
2371 while (!ready_to_exit)
2372 pthread_cond_wait(&COND_server_end,&LOCK_thread_count);
2373 (void) pthread_mutex_unlock(&LOCK_thread_count);
2374
2375 clean_up(1);
2376 plugin::Registry::shutdown();
2377 clean_up_mutexes();
2378 internal::my_end();
2379 return 0;
2380}
2381
23821943
=== added file 'drizzled/drizzled.h'
--- drizzled/drizzled.h 1970-01-01 00:00:00 +0000
+++ drizzled/drizzled.h 2010-04-19 20:33:26 +0000
@@ -0,0 +1,65 @@
1/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3 *
4 * Copyright (C) 2008 Sun Microsystems
5 * Copyright (C) 2010 Monty Taylor
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#ifndef DRIZZLED_DRIZZLED_H
22#define DRIZZLED_DRIZZLED_H
23
24#include <bitset>
25
26#include "drizzled/atomics.h"
27
28struct passwd;
29
30namespace drizzled
31{
32
33namespace plugin
34{
35class Registry;
36}
37
38extern std::bitset<12> test_flags;
39extern uint32_t max_used_connections;
40extern atomic<uint32_t> connection_count;
41extern bool calling_initgroups;
42extern const char *load_default_groups[];
43extern bool volatile select_thread_in_use;
44extern bool volatile abort_loop;
45extern bool volatile ready_to_exit;
46extern bool opt_help;
47extern bool opt_help_extended;
48extern passwd *user_info;
49extern char *drizzled_user;
50
51extern const char * const DRIZZLE_CONFIG_NAME;
52
53int init_server_components(plugin::Registry &plugins);
54int init_common_variables(const char *conf_file_name, int argc,
55 char **argv, const char **groups);
56
57passwd *check_user(const char *user);
58void set_user(const char *user, passwd *user_info_arg);
59void clean_up(bool print_message);
60void clean_up_mutexes(void);
61bool drizzle_rm_tmp_tables();
62
63} /* namespace drizzled */
64
65#endif /* DRIZZLED_DRIZZLED_H */
066
=== modified file 'drizzled/function/str/load_file.cc'
--- drizzled/function/str/load_file.cc 2010-02-04 08:14:46 +0000
+++ drizzled/function/str/load_file.cc 2010-04-19 20:33:26 +0000
@@ -42,7 +42,7 @@
42 if (!(file_name= args[0]->val_str(str)))42 if (!(file_name= args[0]->val_str(str)))
43 goto err;43 goto err;
4444
45 (void) internal::fn_format(path, file_name->c_ptr(), drizzle_real_data_home, "",45 (void) internal::fn_format(path, file_name->c_ptr(), data_home_real, "",
46 MY_RELATIVE_PATH | MY_UNPACK_FILENAME);46 MY_RELATIVE_PATH | MY_UNPACK_FILENAME);
4747
48 /* Read only allowed from within dir specified by secure_file_priv */48 /* Read only allowed from within dir specified by secure_file_priv */
4949
=== modified file 'drizzled/include.am'
--- drizzled/include.am 2010-04-14 21:40:03 +0000
+++ drizzled/include.am 2010-04-19 20:33:26 +0000
@@ -18,8 +18,6 @@
18# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA18# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1919
2020
21sbin_PROGRAMS= drizzled/drizzled
22
23DTRACEFILES= \21DTRACEFILES= \
24 drizzled/cursor.o \22 drizzled/cursor.o \
25 drizzled/drizzled.o \23 drizzled/drizzled.o \
@@ -54,12 +52,15 @@
54 drizzled/comp_creator.h \52 drizzled/comp_creator.h \
55 drizzled/create_field.h \53 drizzled/create_field.h \
56 drizzled/current_session.h \54 drizzled/current_session.h \
55 drizzled/cursor.h \
57 drizzled/data_home.h \56 drizzled/data_home.h \
58 drizzled/db.h \57 drizzled/db.h \
59 drizzled/decimal.h \58 drizzled/decimal.h \
60 drizzled/definitions.h \59 drizzled/definitions.h \
61 drizzled/diagnostics_area.h \60 drizzled/diagnostics_area.h \
62 drizzled/discrete_interval.h \61 drizzled/discrete_interval.h \
62 drizzled/drizzle_time.h \
63 drizzled/drizzled.h \
63 drizzled/dtcollation.h \64 drizzled/dtcollation.h \
64 drizzled/dynamic_array.h \65 drizzled/dynamic_array.h \
65 drizzled/enum.h \66 drizzled/enum.h \
@@ -184,14 +185,12 @@
184 drizzled/function/time/unix_timestamp.h \185 drizzled/function/time/unix_timestamp.h \
185 drizzled/function/time/weekday.h \186 drizzled/function/time/weekday.h \
186 drizzled/function/time/year.h \187 drizzled/function/time/year.h \
187 drizzled/typelib.h \
188 drizzled/function/units.h \188 drizzled/function/units.h \
189 drizzled/function/user_var_as_out_param.h \189 drizzled/function/user_var_as_out_param.h \
190 drizzled/function_hash.h \190 drizzled/function_hash.h \
191 drizzled/gettext.h \191 drizzled/gettext.h \
192 drizzled/global_charset_info.h \192 drizzled/global_charset_info.h \
193 drizzled/ha_statistics.h \193 drizzled/ha_statistics.h \
194 drizzled/cursor.h \
195 drizzled/handler_structs.h \194 drizzled/handler_structs.h \
196 drizzled/hybrid_type.h \195 drizzled/hybrid_type.h \
197 drizzled/hybrid_type_traits.h \196 drizzled/hybrid_type_traits.h \
@@ -200,7 +199,6 @@
200 drizzled/index_hint.h \199 drizzled/index_hint.h \
201 drizzled/internal_error_handler.h \200 drizzled/internal_error_handler.h \
202 drizzled/item.h \201 drizzled/item.h \
203 drizzled/item_result.h \
204 drizzled/item/basic_constant.h \202 drizzled/item/basic_constant.h \
205 drizzled/item/bin_string.h \203 drizzled/item/bin_string.h \
206 drizzled/item/blob.h \204 drizzled/item/blob.h \
@@ -238,6 +236,7 @@
238 drizzled/item/sum.h \236 drizzled/item/sum.h \
239 drizzled/item/type_holder.h \237 drizzled/item/type_holder.h \
240 drizzled/item/uint.h \238 drizzled/item/uint.h \
239 drizzled/item_result.h \
241 drizzled/join.h \240 drizzled/join.h \
242 drizzled/join_cache.h \241 drizzled/join_cache.h \
243 drizzled/join_table.h \242 drizzled/join_table.h \
@@ -251,24 +250,20 @@
251 drizzled/lex_symbol.h \250 drizzled/lex_symbol.h \
252 drizzled/lock.h \251 drizzled/lock.h \
253 drizzled/lookup_symbol.h \252 drizzled/lookup_symbol.h \
254 drizzled/memory/sql_alloc.h \
255 drizzled/memory/multi_malloc.h \253 drizzled/memory/multi_malloc.h \
256 drizzled/memory/root.h \254 drizzled/memory/root.h \
257 drizzled/option.h \255 drizzled/memory/sql_alloc.h \
258 drizzled/my_hash.h \256 drizzled/my_hash.h \
259 drizzled/drizzle_time.h \
260 drizzled/tree.h \
261 drizzled/var.h \
262 drizzled/name_resolution_context.h \257 drizzled/name_resolution_context.h \
263 drizzled/name_resolution_context_state.h \258 drizzled/name_resolution_context_state.h \
264 drizzled/named_savepoint.h \259 drizzled/named_savepoint.h \
265 drizzled/natural_join_column.h \260 drizzled/natural_join_column.h \
266 drizzled/nested_join.h \261 drizzled/nested_join.h \
267 drizzled/open_tables_state.h \262 drizzled/open_tables_state.h \
268 drizzled/optimizer/cost_vector.h \263 drizzled/optimizer/cost_vector.h \
264 drizzled/optimizer/explain_plan.h \
269 drizzled/optimizer/key_field.h \265 drizzled/optimizer/key_field.h \
270 drizzled/optimizer/key_use.h \266 drizzled/optimizer/key_use.h \
271 drizzled/optimizer/explain_plan.h \
272 drizzled/optimizer/position.h \267 drizzled/optimizer/position.h \
273 drizzled/optimizer/quick_group_min_max_select.h \268 drizzled/optimizer/quick_group_min_max_select.h \
274 drizzled/optimizer/quick_index_merge_select.h \269 drizzled/optimizer/quick_index_merge_select.h \
@@ -284,6 +279,7 @@
284 drizzled/optimizer/sel_tree.h \279 drizzled/optimizer/sel_tree.h \
285 drizzled/optimizer/sum.h \280 drizzled/optimizer/sum.h \
286 drizzled/optimizer/table_read_plan.h \281 drizzled/optimizer/table_read_plan.h \
282 drizzled/option.h \
287 drizzled/order.h \283 drizzled/order.h \
288 drizzled/parser.h \284 drizzled/parser.h \
289 drizzled/plugin.h \285 drizzled/plugin.h \
@@ -304,9 +300,9 @@
304 drizzled/plugin/null_client.h \300 drizzled/plugin/null_client.h \
305 drizzled/plugin/plugin.h \301 drizzled/plugin/plugin.h \
306 drizzled/plugin/query_cache.h \302 drizzled/plugin/query_cache.h \
307 drizzled/plugin/query_rewrite.h \303 drizzled/plugin/query_rewrite.h \
304 drizzled/plugin/replication.h \
308 drizzled/plugin/registry.h \305 drizzled/plugin/registry.h \
309 drizzled/plugin/replication.h \
310 drizzled/plugin/scheduler.h \306 drizzled/plugin/scheduler.h \
311 drizzled/plugin/storage_engine.h \307 drizzled/plugin/storage_engine.h \
312 drizzled/plugin/table_function.h \308 drizzled/plugin/table_function.h \
@@ -314,11 +310,11 @@
314 drizzled/plugin/transaction_reader.h \310 drizzled/plugin/transaction_reader.h \
315 drizzled/plugin/transaction_replicator.h \311 drizzled/plugin/transaction_replicator.h \
316 drizzled/plugin/transactional_storage_engine.h \312 drizzled/plugin/transactional_storage_engine.h \
313 drizzled/plugin/version.h \
314 drizzled/plugin/xa_resource_manager.h \
317 drizzled/plugin/xa_storage_engine.h \315 drizzled/plugin/xa_storage_engine.h \
318 drizzled/plugin/xa_resource_manager.h \316 drizzled/probes.h \
319 drizzled/plugin/version.h \
320 drizzled/pthread_globals.h \317 drizzled/pthread_globals.h \
321 drizzled/probes.h \
322 drizzled/qsort_cmp.h \318 drizzled/qsort_cmp.h \
323 drizzled/query_id.h \319 drizzled/query_id.h \
324 drizzled/records.h \320 drizzled/records.h \
@@ -344,6 +340,7 @@
344 drizzled/session_list.h \340 drizzled/session_list.h \
345 drizzled/set_var.h \341 drizzled/set_var.h \
346 drizzled/show.h \342 drizzled/show.h \
343 drizzled/signal_handler.h \
347 drizzled/sql_base.h \344 drizzled/sql_base.h \
348 drizzled/sql_bitmap.h \345 drizzled/sql_bitmap.h \
349 drizzled/sql_error.h \346 drizzled/sql_error.h \
@@ -414,8 +411,10 @@
414 drizzled/thr_lock.h \411 drizzled/thr_lock.h \
415 drizzled/time_functions.h \412 drizzled/time_functions.h \
416 drizzled/tmp_table_param.h \413 drizzled/tmp_table_param.h \
414 drizzled/transaction_context.h \
417 drizzled/transaction_services.h \415 drizzled/transaction_services.h \
418 drizzled/transaction_context.h \416 drizzled/tree.h \
417 drizzled/typelib.h \
419 drizzled/tzfile.h \418 drizzled/tzfile.h \
420 drizzled/tztime.h \419 drizzled/tztime.h \
421 drizzled/unique.h \420 drizzled/unique.h \
@@ -427,337 +426,350 @@
427 drizzled/utf8/checked.h \426 drizzled/utf8/checked.h \
428 drizzled/utf8/core.h \427 drizzled/utf8/core.h \
429 drizzled/utf8/unchecked.h \428 drizzled/utf8/unchecked.h \
429 drizzled/var.h \
430 drizzled/version.h \430 drizzled/version.h \
431 drizzled/visibility.h \431 drizzled/visibility.h \
432 drizzled/xid.h432 drizzled/xid.h
433433
434DRIZZLED_LDADD= \434lib_LTLIBRARIES+= drizzled/libdrizzled.la
435 drizzled/internal/libinternal.la \435drizzled_libdrizzled_la_LIBADD= \
436 $(LIBZ) \436 drizzled/algorithm/libhash.la \
437 $(LIBINTL) \437 drizzled/util/libutil.la \
438 ${LIBC_P}438 drizzled/internal/libinternal.la \
439439 drizzled/message/libdrizzledmessage.la \
440 gnulib/libgnu.la \
441 $(LIBZ) \
442 $(LIBINTL) \
443 ${LIBC_P} \
444 $(pandora_plugin_libs) \
445 $(LDADD) \
446 $(LIBUUID) \
447 $(LIBDL_LIBS) \
448 $(LIBPROTOBUF) \
449 $(LIBPCRE) \
450 $(LIBTBB) \
451 $(GCOV_LIBS)
452
453drizzled_libdrizzled_la_DEPENDENCIES= \
454 drizzled/message/libdrizzledmessage.la \
455 ${noinst_LTLIBRARIES} \
456 $(pandora_plugin_libs)
457
458drizzled_libdrizzled_la_SOURCES= \
459 drizzled/alter_info.cc \
460 drizzled/cached_item.cc \
461 drizzled/calendar.cc \
462 drizzled/check_stack_overrun.cc \
463 drizzled/comp_creator.cc \
464 drizzled/create_field.cc \
465 drizzled/current_session.cc \
466 drizzled/cursor.cc \
467 drizzled/decimal.cc \
468 drizzled/diagnostics_area.cc \
469 drizzled/drizzle_time.cc \
470 drizzled/drizzled.cc \
471 drizzled/dtcollation.cc \
472 drizzled/errmsg_print.cc \
473 drizzled/field.cc \
474 drizzled/field/blob.cc \
475 drizzled/field/date.cc \
476 drizzled/field/datetime.cc \
477 drizzled/field/decimal.cc \
478 drizzled/field/double.cc \
479 drizzled/field/enum.cc \
480 drizzled/field/int64_t.cc \
481 drizzled/field/long.cc \
482 drizzled/field/null.cc \
483 drizzled/field/num.cc \
484 drizzled/field/real.cc \
485 drizzled/field/str.cc \
486 drizzled/field/timestamp.cc \
487 drizzled/field/varstring.cc \
488 drizzled/field_conv.cc \
489 drizzled/field_iterator.cc \
490 drizzled/file_exchange.cc \
491 drizzled/filesort.cc \
492 drizzled/foreign_key.cc \
493 drizzled/function/additive_op.cc \
494 drizzled/function/coercibility.cc \
495 drizzled/function/field.cc \
496 drizzled/function/find_in_set.cc \
497 drizzled/function/found_rows.cc \
498 drizzled/function/func.cc \
499 drizzled/function/get_system_var.cc \
500 drizzled/function/get_user_var.cc \
501 drizzled/function/last_insert.cc \
502 drizzled/function/locate.cc \
503 drizzled/function/math/abs.cc \
504 drizzled/function/math/acos.cc \
505 drizzled/function/math/asin.cc \
506 drizzled/function/math/atan.cc \
507 drizzled/function/math/ceiling.cc \
508 drizzled/function/math/cos.cc \
509 drizzled/function/math/decimal_typecast.cc \
510 drizzled/function/math/divide.cc \
511 drizzled/function/math/exp.cc \
512 drizzled/function/math/floor.cc \
513 drizzled/function/math/int.cc \
514 drizzled/function/math/int_divide.cc \
515 drizzled/function/math/int_val.cc \
516 drizzled/function/math/integer.cc \
517 drizzled/function/math/ln.cc \
518 drizzled/function/math/log.cc \
519 drizzled/function/math/minus.cc \
520 drizzled/function/math/mod.cc \
521 drizzled/function/math/multiply.cc \
522 drizzled/function/math/neg.cc \
523 drizzled/function/math/ord.cc \
524 drizzled/function/math/plus.cc \
525 drizzled/function/math/pow.cc \
526 drizzled/function/math/rand.cc \
527 drizzled/function/math/real.cc \
528 drizzled/function/math/round.cc \
529 drizzled/function/math/sin.cc \
530 drizzled/function/math/sqrt.cc \
531 drizzled/function/math/tan.cc \
532 drizzled/function/min_max.cc \
533 drizzled/function/num1.cc \
534 drizzled/function/num_op.cc \
535 drizzled/function/numhybrid.cc \
536 drizzled/function/row_count.cc \
537 drizzled/function/set_user_var.cc \
538 drizzled/function/sign.cc \
539 drizzled/function/str/alloc_buffer.cc \
540 drizzled/function/str/binary.cc \
541 drizzled/function/str/char.cc \
542 drizzled/function/str/collation.cc \
543 drizzled/function/str/concat.cc \
544 drizzled/function/str/conv.cc \
545 drizzled/function/str/conv_charset.cc \
546 drizzled/function/str/elt.cc \
547 drizzled/function/str/export_set.cc \
548 drizzled/function/str/format.cc \
549 drizzled/function/str/insert.cc \
550 drizzled/function/str/left.cc \
551 drizzled/function/str/load_file.cc \
552 drizzled/function/str/make_set.cc \
553 drizzled/function/str/pad.cc \
554 drizzled/function/str/quote.cc \
555 drizzled/function/str/repeat.cc \
556 drizzled/function/str/replace.cc \
557 drizzled/function/str/right.cc \
558 drizzled/function/str/set_collation.cc \
559 drizzled/function/str/str_conv.cc \
560 drizzled/function/str/strfunc.cc \
561 drizzled/function/str/trim.cc \
562 drizzled/function/time/curdate.cc \
563 drizzled/function/time/date.cc \
564 drizzled/function/time/date_add_interval.cc \
565 drizzled/function/time/date_format.cc \
566 drizzled/function/time/dayname.cc \
567 drizzled/function/time/dayofmonth.cc \
568 drizzled/function/time/dayofyear.cc \
569 drizzled/function/time/extract.cc \
570 drizzled/function/time/from_days.cc \
571 drizzled/function/time/from_unixtime.cc \
572 drizzled/function/time/hour.cc \
573 drizzled/function/time/last_day.cc \
574 drizzled/function/time/makedate.cc \
575 drizzled/function/time/microsecond.cc \
576 drizzled/function/time/minute.cc \
577 drizzled/function/time/month.cc \
578 drizzled/function/time/now.cc \
579 drizzled/function/time/period_add.cc \
580 drizzled/function/time/period_diff.cc \
581 drizzled/function/time/quarter.cc \
582 drizzled/function/time/second.cc \
583 drizzled/function/time/sysdate_local.cc \
584 drizzled/function/time/timestamp_diff.cc \
585 drizzled/function/time/to_days.cc \
586 drizzled/function/time/typecast.cc \
587 drizzled/function/time/unix_timestamp.cc \
588 drizzled/function/time/weekday.cc \
589 drizzled/function/time/year.cc \
590 drizzled/function/units.cc \
591 drizzled/function/user_var_as_out_param.cc \
592 drizzled/ha_commands.cc \
593 drizzled/hybrid_type_traits.cc \
594 drizzled/hybrid_type_traits_decimal.cc \
595 drizzled/hybrid_type_traits_integer.cc \
596 drizzled/index_hint.cc \
597 drizzled/item.cc \
598 drizzled/item/bin_string.cc \
599 drizzled/item/cache.cc \
600 drizzled/item/cache_decimal.cc \
601 drizzled/item/cache_int.cc \
602 drizzled/item/cache_real.cc \
603 drizzled/item/cache_row.cc \
604 drizzled/item/cache_str.cc \
605 drizzled/item/cmpfunc.cc \
606 drizzled/item/copy_string.cc \
607 drizzled/item/create.cc \
608 drizzled/item/decimal.cc \
609 drizzled/item/default_value.cc \
610 drizzled/item/direct_ref.cc \
611 drizzled/item/empty_string.cc \
612 drizzled/item/field.cc \
613 drizzled/item/float.cc \
614 drizzled/item/hex_string.cc \
615 drizzled/item/ident.cc \
616 drizzled/item/insert_value.cc \
617 drizzled/item/int.cc \
618 drizzled/item/int_with_ref.cc \
619 drizzled/item/null.cc \
620 drizzled/item/num.cc \
621 drizzled/item/outer_ref.cc \
622 drizzled/item/ref.cc \
623 drizzled/item/ref_null_helper.cc \
624 drizzled/item/row.cc \
625 drizzled/item/string.cc \
626 drizzled/item/subselect.cc \
627 drizzled/item/sum.cc \
628 drizzled/item/type_holder.cc \
629 drizzled/item/uint.cc \
630 drizzled/join.cc \
631 drizzled/join_cache.cc \
632 drizzled/join_table.cc \
633 drizzled/key.cc \
634 drizzled/key_map.cc \
635 drizzled/lock.cc \
636 drizzled/lookup_symbol.cc \
637 drizzled/my_getsystime.cc \
638 drizzled/my_hash.cc \
639 drizzled/name_resolution_context_state.cc \
640 drizzled/natural_join_column.cc \
641 drizzled/optimizer/explain_plan.cc \
642 drizzled/optimizer/key_field.cc \
643 drizzled/optimizer/quick_group_min_max_select.cc \
644 drizzled/optimizer/quick_index_merge_select.cc \
645 drizzled/optimizer/quick_range.cc \
646 drizzled/optimizer/quick_range_select.cc \
647 drizzled/optimizer/quick_ror_intersect_select.cc \
648 drizzled/optimizer/quick_ror_union_select.cc \
649 drizzled/optimizer/range.cc \
650 drizzled/optimizer/sel_arg.cc \
651 drizzled/optimizer/sel_imerge.cc \
652 drizzled/optimizer/sel_tree.cc \
653 drizzled/optimizer/sum.cc \
654 drizzled/plugin/authentication.cc \
655 drizzled/plugin/authorization.cc \
656 drizzled/plugin/client.cc \
657 drizzled/plugin/error_message.cc \
658 drizzled/plugin/function.cc \
659 drizzled/plugin/library.cc \
660 drizzled/plugin/listen.cc \
661 drizzled/plugin/listen_tcp.cc \
662 drizzled/plugin/loader.cc \
663 drizzled/plugin/logging.cc \
664 drizzled/plugin/monitored_in_transaction.cc \
665 drizzled/plugin/plugin.cc \
666 drizzled/plugin/query_cache.cc \
667 drizzled/plugin/query_rewrite.cc \
668 drizzled/plugin/registry.cc \
669 drizzled/plugin/scheduler.cc \
670 drizzled/plugin/schema_engine.cc \
671 drizzled/plugin/storage_engine.cc \
672 drizzled/plugin/table_function.cc \
673 drizzled/plugin/transaction_applier.cc \
674 drizzled/plugin/transaction_replicator.cc \
675 drizzled/plugin/transactional_storage_engine.cc \
676 drizzled/plugin/xa_resource_manager.cc \
677 drizzled/plugin/xa_storage_engine.cc \
678 drizzled/query_id.cc \
679 drizzled/records.cc \
680 drizzled/replication_services.cc \
681 drizzled/resource_context.cc \
682 drizzled/schema_identifier.cc \
683 drizzled/session.cc \
684 drizzled/session_list.cc \
685 drizzled/set_var.cc \
686 drizzled/show.cc \
687 drizzled/signal_handler.cc \
688 drizzled/sql_base.cc \
689 drizzled/sql_bitmap.cc \
690 drizzled/sql_delete.cc \
691 drizzled/sql_derived.cc \
692 drizzled/sql_error.cc \
693 drizzled/sql_insert.cc \
694 drizzled/sql_lex.cc \
695 drizzled/sql_list.cc \
696 drizzled/sql_load.cc \
697 drizzled/sql_locale.cc \
698 drizzled/sql_parse.cc \
699 drizzled/sql_select.cc \
700 drizzled/sql_state.cc \
701 drizzled/sql_string.cc \
702 drizzled/sql_table.cc \
703 drizzled/sql_union.cc \
704 drizzled/sql_update.cc \
705 drizzled/sql_yacc.yy \
706 drizzled/stacktrace.cc \
707 drizzled/statement/alter_schema.cc \
708 drizzled/statement/alter_table.cc \
709 drizzled/statement/analyze.cc \
710 drizzled/statement/change_schema.cc \
711 drizzled/statement/check.cc \
712 drizzled/statement/commit.cc \
713 drizzled/statement/create_index.cc \
714 drizzled/statement/create_schema.cc \
715 drizzled/statement/create_table.cc \
716 drizzled/statement/delete.cc \
717 drizzled/statement/drop_index.cc \
718 drizzled/statement/drop_schema.cc \
719 drizzled/statement/drop_table.cc \
720 drizzled/statement/empty_query.cc \
721 drizzled/statement/flush.cc \
722 drizzled/statement/insert.cc \
723 drizzled/statement/insert_select.cc \
724 drizzled/statement/kill.cc \
725 drizzled/statement/load.cc \
726 drizzled/statement/release_savepoint.cc \
727 drizzled/statement/rename_table.cc \
728 drizzled/statement/replace.cc \
729 drizzled/statement/replace_select.cc \
730 drizzled/statement/rollback.cc \
731 drizzled/statement/rollback_to_savepoint.cc \
732 drizzled/statement/savepoint.cc \
733 drizzled/statement/select.cc \
734 drizzled/statement/set_option.cc \
735 drizzled/statement/show_create.cc \
736 drizzled/statement/show_create_schema.cc \
737 drizzled/statement/show_errors.cc \
738 drizzled/statement/show_warnings.cc \
739 drizzled/statement/start_transaction.cc \
740 drizzled/statement/truncate.cc \
741 drizzled/statement/unlock_tables.cc \
742 drizzled/statement/update.cc \
743 drizzled/strfunc.cc \
744 drizzled/table.cc \
745 drizzled/table_function_container.cc \
746 drizzled/table_identifier.cc \
747 drizzled/table_list.cc \
748 drizzled/table_share.cc \
749 drizzled/temporal.cc \
750 drizzled/temporal_format.cc \
751 drizzled/temporal_interval.cc \
752 drizzled/thr_lock.cc \
753 drizzled/time_functions.cc \
754 drizzled/transaction_services.cc \
755 drizzled/tree.cc \
756 drizzled/tztime.cc \
757 drizzled/uniques.cc \
758 drizzled/user_var_entry.cc \
759 drizzled/version.cc \
760 drizzled/xid.cc
761
762sbin_PROGRAMS+= drizzled/drizzled
763
764drizzled_drizzled_SOURCES= \
765 drizzled/main.cc
440drizzled_drizzled_LDADD= \766drizzled_drizzled_LDADD= \
441 ${DRIZZLED_LDADD} \767 $(LIBPCRE) \
442 ${noinst_LTLIBRARIES} \768 $(LIBINTL) \
443 drizzled/algorithm/libhash.la \769 drizzled/libdrizzled.la
444 drizzled/util/libutil.la \
445 drizzled/message/libdrizzledmessage.la \
446 drizzled/libcached_directory.la \
447 drizzled/liberror.la \
448 drizzled/libmemory.la \
449 $(pandora_plugin_libs) \
450 $(LDADD) $(LIBUUID) gnulib/libgnu.la \
451 $(LIBDL_LIBS) $(LIBPROTOBUF) $(LIBPCRE) $(LIBTBB) \
452 $(PANDORA_PLUGIN_DEP_LIBS) $(GCOV_LIBS)
453
454drizzled_drizzled_DEPENDENCIES= ${noinst_LTLIBRARIES} $(pandora_plugin_libs)
455770
456drizzled_drizzled_LDFLAGS= -export-dynamic771drizzled_drizzled_LDFLAGS= -export-dynamic
457772
458drizzled_drizzled_SOURCES= \
459 drizzled/alter_info.cc \
460 drizzled/cached_item.cc \
461 drizzled/calendar.cc \
462 drizzled/check_stack_overrun.cc \
463 drizzled/comp_creator.cc \
464 drizzled/create_field.cc \
465 drizzled/current_session.cc \
466 drizzled/cursor.cc \
467 drizzled/decimal.cc \
468 drizzled/diagnostics_area.cc \
469 drizzled/drizzled.cc \
470 drizzled/dtcollation.cc \
471 drizzled/errmsg_print.cc \
472 drizzled/field.cc \
473 drizzled/field/blob.cc \
474 drizzled/field/date.cc \
475 drizzled/field/datetime.cc \
476 drizzled/field/decimal.cc \
477 drizzled/field/double.cc \
478 drizzled/field/enum.cc \
479 drizzled/field/int64_t.cc \
480 drizzled/field/long.cc \
481 drizzled/field/null.cc \
482 drizzled/field/num.cc \
483 drizzled/field/real.cc \
484 drizzled/field/str.cc \
485 drizzled/field/timestamp.cc \
486 drizzled/field/varstring.cc \
487 drizzled/field_conv.cc \
488 drizzled/field_iterator.cc \
489 drizzled/file_exchange.cc \
490 drizzled/filesort.cc \
491 drizzled/foreign_key.cc \
492 drizzled/function/additive_op.cc \
493 drizzled/function/coercibility.cc \
494 drizzled/function/field.cc \
495 drizzled/function/find_in_set.cc \
496 drizzled/function/found_rows.cc \
497 drizzled/function/func.cc \
498 drizzled/function/get_system_var.cc \
499 drizzled/function/get_user_var.cc \
500 drizzled/function/last_insert.cc \
501 drizzled/function/locate.cc \
502 drizzled/function/math/abs.cc \
503 drizzled/function/math/acos.cc \
504 drizzled/function/math/asin.cc \
505 drizzled/function/math/atan.cc \
506 drizzled/function/math/ceiling.cc \
507 drizzled/function/math/cos.cc \
508 drizzled/function/math/decimal_typecast.cc \
509 drizzled/function/math/divide.cc \
510 drizzled/function/math/exp.cc \
511 drizzled/function/math/floor.cc \
512 drizzled/function/math/int.cc \
513 drizzled/function/math/int_divide.cc \
514 drizzled/function/math/int_val.cc \
515 drizzled/function/math/integer.cc \
516 drizzled/function/math/ln.cc \
517 drizzled/function/math/log.cc \
518 drizzled/function/math/minus.cc \
519 drizzled/function/math/mod.cc \
520 drizzled/function/math/multiply.cc \
521 drizzled/function/math/neg.cc \
522 drizzled/function/math/ord.cc \
523 drizzled/function/math/plus.cc \
524 drizzled/function/math/pow.cc \
525 drizzled/function/math/rand.cc \
526 drizzled/function/math/real.cc \
527 drizzled/function/math/round.cc \
528 drizzled/function/math/sin.cc \
529 drizzled/function/math/sqrt.cc \
530 drizzled/function/math/tan.cc \
531 drizzled/function/min_max.cc \
532 drizzled/function/num1.cc \
533 drizzled/function/num_op.cc \
534 drizzled/function/numhybrid.cc \
535 drizzled/function/row_count.cc \
536 drizzled/function/set_user_var.cc \
537 drizzled/function/sign.cc \
538 drizzled/function/str/alloc_buffer.cc \
539 drizzled/function/str/binary.cc \
540 drizzled/function/str/char.cc \
541 drizzled/function/str/collation.cc \
542 drizzled/function/str/concat.cc \
543 drizzled/function/str/conv.cc \
544 drizzled/function/str/conv_charset.cc \
545 drizzled/function/str/elt.cc \
546 drizzled/function/str/export_set.cc \
547 drizzled/function/str/format.cc \
548 drizzled/function/str/insert.cc \
549 drizzled/function/str/left.cc \
550 drizzled/function/str/load_file.cc \
551 drizzled/function/str/make_set.cc \
552 drizzled/function/str/pad.cc \
553 drizzled/function/str/quote.cc \
554 drizzled/function/str/repeat.cc \
555 drizzled/function/str/replace.cc \
556 drizzled/function/str/right.cc \
557 drizzled/function/str/set_collation.cc \
558 drizzled/function/str/str_conv.cc \
559 drizzled/function/str/strfunc.cc \
560 drizzled/function/str/trim.cc \
561 drizzled/function/time/curdate.cc \
562 drizzled/function/time/date.cc \
563 drizzled/function/time/date_add_interval.cc \
564 drizzled/function/time/date_format.cc \
565 drizzled/function/time/dayname.cc \
566 drizzled/function/time/dayofmonth.cc \
567 drizzled/function/time/dayofyear.cc \
568 drizzled/function/time/extract.cc \
569 drizzled/function/time/from_days.cc \
570 drizzled/function/time/from_unixtime.cc \
571 drizzled/function/time/hour.cc \
572 drizzled/function/time/last_day.cc \
573 drizzled/function/time/makedate.cc \
574 drizzled/function/time/microsecond.cc \
575 drizzled/function/time/minute.cc \
576 drizzled/function/time/month.cc \
577 drizzled/function/time/now.cc \
578 drizzled/function/time/period_add.cc \
579 drizzled/function/time/period_diff.cc \
580 drizzled/function/time/quarter.cc \
581 drizzled/function/time/second.cc \
582 drizzled/function/time/sysdate_local.cc \
583 drizzled/function/time/timestamp_diff.cc \
584 drizzled/function/time/to_days.cc \
585 drizzled/function/time/typecast.cc \
586 drizzled/function/time/unix_timestamp.cc \
587 drizzled/function/time/weekday.cc \
588 drizzled/function/time/year.cc \
589 drizzled/function/units.cc \
590 drizzled/function/user_var_as_out_param.cc \
591 drizzled/ha_commands.cc \
592 drizzled/hybrid_type_traits.cc \
593 drizzled/hybrid_type_traits_decimal.cc \
594 drizzled/hybrid_type_traits_integer.cc \
595 drizzled/index_hint.cc \
596 drizzled/item.cc \
597 drizzled/item/bin_string.cc \
598 drizzled/item/cache.cc \
599 drizzled/item/cache_decimal.cc \
600 drizzled/item/cache_int.cc \
601 drizzled/item/cache_real.cc \
602 drizzled/item/cache_row.cc \
603 drizzled/item/cache_str.cc \
604 drizzled/item/cmpfunc.cc \
605 drizzled/item/copy_string.cc \
606 drizzled/item/create.cc \
607 drizzled/item/decimal.cc \
608 drizzled/item/default_value.cc \
609 drizzled/item/direct_ref.cc \
610 drizzled/item/empty_string.cc \
611 drizzled/item/field.cc \
612 drizzled/item/float.cc \
613 drizzled/item/hex_string.cc \
614 drizzled/item/ident.cc \
615 drizzled/item/insert_value.cc \
616 drizzled/item/int.cc \
617 drizzled/item/int_with_ref.cc \
618 drizzled/item/null.cc \
619 drizzled/item/num.cc \
620 drizzled/item/outer_ref.cc \
621 drizzled/item/ref.cc \
622 drizzled/item/ref_null_helper.cc \
623 drizzled/item/row.cc \
624 drizzled/item/string.cc \
625 drizzled/item/subselect.cc \
626 drizzled/item/sum.cc \
627 drizzled/item/type_holder.cc \
628 drizzled/item/uint.cc \
629 drizzled/join.cc \
630 drizzled/join_cache.cc \
631 drizzled/join_table.cc \
632 drizzled/key.cc \
633 drizzled/key_map.cc \
634 drizzled/lock.cc \
635 drizzled/lookup_symbol.cc \
636 drizzled/my_getsystime.cc \
637 drizzled/my_hash.cc \
638 drizzled/drizzle_time.cc \
639 drizzled/tree.cc \
640 drizzled/name_resolution_context_state.cc \
641 drizzled/natural_join_column.cc \
642 drizzled/optimizer/explain_plan.cc \
643 drizzled/optimizer/key_field.cc \
644 drizzled/optimizer/quick_group_min_max_select.cc \
645 drizzled/optimizer/quick_index_merge_select.cc \
646 drizzled/optimizer/quick_range.cc \
647 drizzled/optimizer/quick_range_select.cc \
648 drizzled/optimizer/quick_ror_intersect_select.cc \
649 drizzled/optimizer/quick_ror_union_select.cc \
650 drizzled/optimizer/range.cc \
651 drizzled/optimizer/sel_arg.cc \
652 drizzled/optimizer/sel_imerge.cc \
653 drizzled/optimizer/sel_tree.cc \
654 drizzled/optimizer/sum.cc \
655 drizzled/plugin/authentication.cc \
656 drizzled/plugin/authorization.cc \
657 drizzled/plugin/client.cc \
658 drizzled/plugin/error_message.cc \
659 drizzled/plugin/function.cc \
660 drizzled/plugin/library.cc \
661 drizzled/plugin/listen.cc \
662 drizzled/plugin/listen_tcp.cc \
663 drizzled/plugin/loader.cc \
664 drizzled/plugin/logging.cc \
665 drizzled/plugin/monitored_in_transaction.cc \
666 drizzled/plugin/plugin.cc \
667 drizzled/plugin/query_cache.cc \
668 drizzled/plugin/query_rewrite.cc \
669 drizzled/plugin/registry.cc \
670 drizzled/plugin/scheduler.cc \
671 drizzled/plugin/schema_engine.cc \
672 drizzled/plugin/storage_engine.cc \
673 drizzled/plugin/table_function.cc \
674 drizzled/plugin/transaction_applier.cc \
675 drizzled/plugin/transaction_replicator.cc \
676 drizzled/plugin/transactional_storage_engine.cc \
677 drizzled/plugin/xa_resource_manager.cc \
678 drizzled/plugin/xa_storage_engine.cc \
679 drizzled/query_id.cc \
680 drizzled/records.cc \
681 drizzled/replication_services.cc \
682 drizzled/resource_context.cc \
683 drizzled/schema_identifier.cc \
684 drizzled/session.cc \
685 drizzled/session_list.cc \
686 drizzled/set_var.cc \
687 drizzled/show.cc \
688 drizzled/sql_base.cc \
689 drizzled/sql_bitmap.cc \
690 drizzled/sql_delete.cc \
691 drizzled/sql_derived.cc \
692 drizzled/sql_error.cc \
693 drizzled/sql_insert.cc \
694 drizzled/sql_lex.cc \
695 drizzled/sql_list.cc \
696 drizzled/sql_load.cc \
697 drizzled/sql_locale.cc \
698 drizzled/sql_parse.cc \
699 drizzled/sql_select.cc \
700 drizzled/sql_state.cc \
701 drizzled/sql_string.cc \
702 drizzled/sql_table.cc \
703 drizzled/sql_union.cc \
704 drizzled/sql_update.cc \
705 drizzled/sql_yacc.yy \
706 drizzled/stacktrace.cc \
707 drizzled/statement/alter_schema.cc \
708 drizzled/statement/alter_table.cc \
709 drizzled/statement/analyze.cc \
710 drizzled/statement/change_schema.cc \
711 drizzled/statement/check.cc \
712 drizzled/statement/commit.cc \
713 drizzled/statement/create_index.cc \
714 drizzled/statement/create_schema.cc \
715 drizzled/statement/create_table.cc \
716 drizzled/statement/delete.cc \
717 drizzled/statement/drop_index.cc \
718 drizzled/statement/drop_schema.cc \
719 drizzled/statement/drop_table.cc \
720 drizzled/statement/empty_query.cc \
721 drizzled/statement/flush.cc \
722 drizzled/statement/insert.cc \
723 drizzled/statement/insert_select.cc \
724 drizzled/statement/kill.cc \
725 drizzled/statement/load.cc \
726 drizzled/statement/release_savepoint.cc \
727 drizzled/statement/rename_table.cc \
728 drizzled/statement/replace.cc \
729 drizzled/statement/replace_select.cc \
730 drizzled/statement/rollback.cc \
731 drizzled/statement/rollback_to_savepoint.cc \
732 drizzled/statement/savepoint.cc \
733 drizzled/statement/select.cc \
734 drizzled/statement/set_option.cc \
735 drizzled/statement/show_create.cc \
736 drizzled/statement/show_create_schema.cc \
737 drizzled/statement/show_errors.cc \
738 drizzled/statement/show_warnings.cc \
739 drizzled/statement/start_transaction.cc \
740 drizzled/statement/truncate.cc \
741 drizzled/statement/unlock_tables.cc \
742 drizzled/statement/update.cc \
743 drizzled/strfunc.cc \
744 drizzled/table.cc \
745 drizzled/table_function_container.cc \
746 drizzled/table_identifier.cc \
747 drizzled/table_list.cc \
748 drizzled/table_share.cc \
749 drizzled/temporal.cc \
750 drizzled/temporal_format.cc \
751 drizzled/temporal_interval.cc \
752 drizzled/thr_lock.cc \
753 drizzled/time_functions.cc \
754 drizzled/transaction_services.cc \
755 drizzled/tztime.cc \
756 drizzled/uniques.cc \
757 drizzled/user_var_entry.cc \
758 drizzled/version.cc \
759 drizzled/xid.cc
760
761noinst_LTLIBRARIES+= \773noinst_LTLIBRARIES+= \
762 drizzled/libcached_directory.la \774 drizzled/libcached_directory.la \
763 drizzled/libcharset.la \775 drizzled/libcharset.la \
764776
=== modified file 'drizzled/internal/include.am'
--- drizzled/internal/include.am 2010-02-04 08:14:46 +0000
+++ drizzled/internal/include.am 2010-04-19 20:33:26 +0000
@@ -34,7 +34,8 @@
34 drizzled/liberror.la \34 drizzled/liberror.la \
35 drizzled/libgetopt.la \35 drizzled/libgetopt.la \
36 drizzled/libmemory.la \36 drizzled/libmemory.la \
37 drizzled/libtypelib.la37 drizzled/libtypelib.la \
38 drizzled/libserialutil.la
3839
39drizzled_internal_libinternal_la_SOURCES= \40drizzled_internal_libinternal_la_SOURCES= \
40 drizzled/internal/bmove_upp.cc \41 drizzled/internal/bmove_upp.cc \
4142
=== modified file 'drizzled/internal/my_pthread.h'
--- drizzled/internal/my_pthread.h 2010-02-04 08:14:46 +0000
+++ drizzled/internal/my_pthread.h 2010-04-19 20:33:26 +0000
@@ -19,7 +19,6 @@
19#define DRIZZLED_INTERNAL_MY_PTHREAD_H19#define DRIZZLED_INTERNAL_MY_PTHREAD_H
2020
21#include <unistd.h>21#include <unistd.h>
22#include <signal.h>
2322
24#ifndef ETIME23#ifndef ETIME
25#define ETIME ETIMEDOUT /* For FreeBSD */24#define ETIME ETIMEDOUT /* For FreeBSD */
@@ -45,29 +44,6 @@
45#define pthread_handler_t void *44#define pthread_handler_t void *
46typedef void *(* pthread_handler)(void *);45typedef void *(* pthread_handler)(void *);
4746
48
49/*
50 We define my_sigset() and use that instead of the system sigset() so that
51 we can favor an implementation based on sigaction(). On some systems, such
52 as Mac OS X, sigset() results in flags such as SA_RESTART being set, and
53 we want to make sure that no such flags are set.
54*/
55#if !defined(my_sigset)
56#define my_sigset(A,B) do { struct sigaction l_s; sigset_t l_set; int l_rc; \
57 assert((A) != 0); \
58 sigemptyset(&l_set); \
59 l_s.sa_handler = (B); \
60 l_s.sa_mask = l_set; \
61 l_s.sa_flags = 0; \
62 l_rc= sigaction((A), &l_s, (struct sigaction *) NULL);\
63 assert(l_rc == 0); \
64 } while (0)
65#elif defined(HAVE_SIGSET) && !defined(my_sigset)
66#define my_sigset(A,B) sigset((A),(B))
67#elif !defined(my_sigset)
68#define my_sigset(A,B) signal((A),(B))
69#endif
70
71#ifndef my_pthread_attr_setprio47#ifndef my_pthread_attr_setprio
72#ifdef HAVE_PTHREAD_ATTR_SETPRIO48#ifdef HAVE_PTHREAD_ATTR_SETPRIO
73#define my_pthread_attr_setprio(A,B) pthread_attr_setprio((A),(B))49#define my_pthread_attr_setprio(A,B) pthread_attr_setprio((A),(B))
7450
=== added file 'drizzled/main.cc'
--- drizzled/main.cc 1970-01-01 00:00:00 +0000
+++ drizzled/main.cc 2010-04-19 20:33:26 +0000
@@ -0,0 +1,328 @@
1/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3 *
4 * Copyright (C) 2008 Sun Microsystems
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#include "config.h"
21
22#include <pthread.h>
23#include <signal.h>
24#include <sys/resource.h>
25#include <unistd.h>
26
27#if TIME_WITH_SYS_TIME
28# include <sys/time.h>
29# include <time.h>
30#else
31# if HAVE_SYS_TIME_H
32# include <sys/time.h>
33# else
34# include <time.h>
35# endif
36#endif
37
38#if defined(HAVE_LOCALE_H)
39# include <locale.h>
40#endif
41
42
43#include "drizzled/plugin.h"
44#include "drizzled/gettext.h"
45#include "drizzled/configmake.h"
46#include "drizzled/session.h"
47#include "drizzled/internal/my_sys.h"
48#include "drizzled/unireg.h"
49#include "drizzled/stacktrace.h"
50#include "drizzled/drizzled.h"
51#include "drizzled/errmsg_print.h"
52#include "drizzled/data_home.h"
53#include "drizzled/plugin/listen.h"
54#include "drizzled/plugin/client.h"
55#include "drizzled/pthread_globals.h"
56#include "drizzled/tztime.h"
57#include "drizzled/signal_handler.h"
58#include "drizzled/replication_services.h"
59
60using namespace drizzled;
61using namespace std;
62
63static pthread_t select_thread;
64static uint32_t thr_kill_signal;
65
66/**
67 All global error messages are sent here where the first one is stored
68 for the client.
69*/
70static void my_message_sql(uint32_t error, const char *str, myf MyFlags)
71{
72 Session *session;
73 /*
74 Put here following assertion when situation with EE_* error codes
75 will be fixed
76 */
77 if ((session= current_session))
78 {
79 if (MyFlags & ME_FATALERROR)
80 session->is_fatal_error= 1;
81
82 /*
83 TODO: There are two exceptions mechanism (Session and sp_rcontext),
84 this could be improved by having a common stack of handlers.
85 */
86 if (session->handle_error(error, str,
87 DRIZZLE_ERROR::WARN_LEVEL_ERROR))
88 return;;
89
90 /*
91 session->lex->current_select == 0 if lex structure is not inited
92 (not query command (COM_QUERY))
93 */
94 if (! (session->lex->current_select &&
95 session->lex->current_select->no_error && !session->is_fatal_error))
96 {
97 if (! session->main_da.is_error()) // Return only first message
98 {
99 if (error == 0)
100 error= ER_UNKNOWN_ERROR;
101 if (str == NULL)
102 str= ER(error);
103 session->main_da.set_error_status(error, str);
104 }
105 }
106
107 if (!session->no_warnings_for_error && !session->is_fatal_error)
108 {
109 /*
110 Suppress infinite recursion if there a memory allocation error
111 inside push_warning.
112 */
113 session->no_warnings_for_error= true;
114 push_warning(session, DRIZZLE_ERROR::WARN_LEVEL_ERROR, error, str);
115 session->no_warnings_for_error= false;
116 }
117 }
118 if (!session || MyFlags & ME_NOREFRESH)
119 errmsg_printf(ERRMSG_LVL_ERROR, "%s: %s",internal::my_progname,str);
120}
121
122static void init_signals(void)
123{
124 sigset_t set;
125 struct sigaction sa;
126
127 if (!(test_flags.test(TEST_NO_STACKTRACE) ||
128 test_flags.test(TEST_CORE_ON_SIGNAL)))
129 {
130 sa.sa_flags = SA_RESETHAND | SA_NODEFER;
131 sigemptyset(&sa.sa_mask);
132 sigprocmask(SIG_SETMASK,&sa.sa_mask,NULL);
133
134 init_stacktrace();
135 sa.sa_handler= drizzled_handle_segfault;
136 sigaction(SIGSEGV, &sa, NULL);
137 sigaction(SIGABRT, &sa, NULL);
138#ifdef SIGBUS
139 sigaction(SIGBUS, &sa, NULL);
140#endif
141 sigaction(SIGILL, &sa, NULL);
142 sigaction(SIGFPE, &sa, NULL);
143 }
144
145 if (test_flags.test(TEST_CORE_ON_SIGNAL))
146 {
147 /* Change limits so that we will get a core file */
148 struct rlimit rl;
149 rl.rlim_cur = rl.rlim_max = RLIM_INFINITY;
150 if (setrlimit(RLIMIT_CORE, &rl) && global_system_variables.log_warnings)
151 errmsg_printf(ERRMSG_LVL_WARN,
152 _("setrlimit could not change the size of core files "
153 "to 'infinity'; We may not be able to generate a "
154 "core file on signals"));
155 }
156 (void) sigemptyset(&set);
157 ignore_signal(SIGPIPE);
158 sigaddset(&set,SIGPIPE);
159#ifndef IGNORE_SIGHUP_SIGQUIT
160 sigaddset(&set,SIGQUIT);
161 sigaddset(&set,SIGHUP);
162#endif
163 sigaddset(&set,SIGTERM);
164
165 /* Fix signals if blocked by parents (can happen on Mac OS X) */
166 sigemptyset(&sa.sa_mask);
167 sa.sa_flags = 0;
168 sa.sa_handler = drizzled_print_signal_warning;
169 sigaction(SIGTERM, &sa, NULL);
170 sa.sa_flags = 0;
171 sa.sa_handler = drizzled_print_signal_warning;
172 sigaction(SIGHUP, &sa, NULL);
173#ifdef SIGTSTP
174 sigaddset(&set,SIGTSTP);
175#endif
176 if (test_flags.test(TEST_SIGINT))
177 {
178 sa.sa_flags= 0;
179 sa.sa_handler= drizzled_end_thread_signal;
180 sigaction(thr_kill_signal, &sa, NULL);
181
182 // May be SIGINT
183 sigdelset(&set, thr_kill_signal);
184 }
185 else
186 sigaddset(&set,SIGINT);
187 sigprocmask(SIG_SETMASK,&set,NULL);
188 pthread_sigmask(SIG_SETMASK,&set,NULL);
189 return;
190}
191
192
193int main(int argc, char **argv)
194{
195#if defined(ENABLE_NLS)
196# if defined(HAVE_LOCALE_H)
197 setlocale(LC_ALL, "");
198# endif
199 bindtextdomain("drizzle", LOCALEDIR);
200 textdomain("drizzle");
201#endif
202
203 plugin::Registry &plugins= plugin::Registry::singleton();
204 plugin::Client *client;
205 Session *session;
206
207 MY_INIT(argv[0]); // init my_sys library & pthreads
208 /* nothing should come before this line ^^^ */
209
210 /* Set signal used to kill Drizzle */
211#if defined(SIGUSR2)
212 thr_kill_signal= internal::thd_lib_detected == THD_LIB_LT ? SIGINT : SIGUSR2;
213#else
214 thr_kill_signal= SIGINT;
215#endif
216
217 if (init_common_variables(DRIZZLE_CONFIG_NAME,
218 argc, argv, load_default_groups))
219 unireg_abort(1); // Will do exit
220
221 init_signals();
222
223
224 select_thread=pthread_self();
225 select_thread_in_use=1;
226
227 if (chdir(data_home_real) && !opt_help)
228 {
229 errmsg_printf(ERRMSG_LVL_ERROR, _("Data directory %s does not exist\n"), data_home_real);
230 unireg_abort(1);
231 }
232 data_home= data_home_buff;
233 data_home[0]=FN_CURLIB; // all paths are relative from here
234 data_home[1]=0;
235 data_home_len= 2;
236
237 if ((user_info= check_user(drizzled_user)))
238 {
239 set_user(drizzled_user, user_info);
240 }
241
242 if (server_id == 0)
243 {
244 server_id= 1;
245 }
246
247 if (init_server_components(plugins))
248 unireg_abort(1);
249
250 /**
251 * This check must be done after init_server_components for now
252 * because we don't yet have plugin dependency tracking...
253 *
254 * ReplicationServices::evaluateRegisteredPlugins() will print error messages to stderr
255 * via errmsg_printf().
256 *
257 * @todo
258 *
259 * not checking return since unireg_abort() hangs
260 */
261 ReplicationServices &replication_services= ReplicationServices::singleton();
262 (void) replication_services.evaluateRegisteredPlugins();
263
264 if (plugin::Listen::setup())
265 unireg_abort(1);
266
267 /*
268 init signals & alarm
269 After this we can't quit by a simple unireg_abort
270 */
271 error_handler_hook= my_message_sql;
272
273 assert(plugin::num_trx_monitored_objects > 0);
274 if (drizzle_rm_tmp_tables() ||
275 my_tz_init((Session *)0, default_tz_name))
276 {
277 abort_loop= true;
278 select_thread_in_use=0;
279 (void) pthread_kill(signal_thread, SIGTERM);
280
281 (void) unlink(pidfile_name); // Not needed anymore
282
283 exit(1);
284 }
285
286 init_status_vars();
287
288 errmsg_printf(ERRMSG_LVL_INFO, _(ER(ER_STARTUP)), internal::my_progname,
289 PANDORA_RELEASE_VERSION, COMPILATION_COMMENT);
290
291
292 /* Listen for new connections and start new session for each connection
293 accepted. The listen.getClient() method will return NULL when the server
294 should be shutdown. */
295 while ((client= plugin::Listen::getClient()) != NULL)
296 {
297 if (!(session= new Session(client)))
298 {
299 delete client;
300 continue;
301 }
302
303 /* If we error on creation we drop the connection and delete the session. */
304 if (session->schedule())
305 Session::unlink(session);
306 }
307
308 /* (void) pthread_attr_destroy(&connection_attrib); */
309
310
311 (void) pthread_mutex_lock(&LOCK_thread_count);
312 select_thread_in_use=0; // For close_connections
313 (void) pthread_mutex_unlock(&LOCK_thread_count);
314 (void) pthread_cond_broadcast(&COND_thread_count);
315
316 /* Wait until cleanup is done */
317 (void) pthread_mutex_lock(&LOCK_thread_count);
318 while (!ready_to_exit)
319 pthread_cond_wait(&COND_server_end,&LOCK_thread_count);
320 (void) pthread_mutex_unlock(&LOCK_thread_count);
321
322 clean_up(1);
323 plugin::Registry::shutdown();
324 clean_up_mutexes();
325 internal::my_end();
326 return 0;
327}
328
0329
=== modified file 'drizzled/message/include.am'
--- drizzled/message/include.am 2010-02-24 00:03:28 +0000
+++ drizzled/message/include.am 2010-04-19 20:33:26 +0000
@@ -35,11 +35,12 @@
35 drizzled/message/transaction_reader \35 drizzled/message/transaction_reader \
36 drizzled/message/transaction_writer36 drizzled/message/transaction_writer
3737
38noinst_LTLIBRARIES += drizzled/message/libdrizzledmessage.la38lib_LTLIBRARIES += drizzled/message/libdrizzledmessage.la
3939
40drizzled_message_libdrizzledmessage_la_CXXFLAGS = ${MESSAGE_AM_CXXFLAGS} ${NO_WERROR}40drizzled_message_libdrizzledmessage_la_CXXFLAGS = ${MESSAGE_AM_CXXFLAGS} ${NO_WERROR}
4141
42drizzled_message_libdrizzledmessage_la_SOURCES = drizzled/message/statement_transform.cc42drizzled_message_libdrizzledmessage_la_SOURCES = drizzled/message/statement_transform.cc
43drizzled_message_libdrizzledmessage_la_LIBADD= ${LTLIBPROTOBUF}
4344
44nobase_dist_include_HEADERS+= drizzled/message/statement_transform.h45nobase_dist_include_HEADERS+= drizzled/message/statement_transform.h
4546
@@ -88,11 +89,11 @@
88drizzled_message_master_list_reader_LDADD = ${MESSAGE_LDADD}89drizzled_message_master_list_reader_LDADD = ${MESSAGE_LDADD}
89drizzled_message_master_list_reader_CXXFLAGS = ${MESSAGE_AM_CXXFLAGS}90drizzled_message_master_list_reader_CXXFLAGS = ${MESSAGE_AM_CXXFLAGS}
9091
91drizzled_message_transaction_writer_SOURCES = drizzled/message/transaction_writer.cc drizzled/message/transaction.pb.cc92drizzled_message_transaction_writer_SOURCES = drizzled/message/transaction_writer.cc
92drizzled_message_transaction_writer_LDADD = ${MESSAGE_LDADD} ${top_builddir}/drizzled/algorithm/libhash.la93drizzled_message_transaction_writer_LDADD = ${MESSAGE_LDADD} ${top_builddir}/drizzled/algorithm/libhash.la
93drizzled_message_transaction_writer_CXXFLAGS = ${MESSAGE_AM_CXXFLAGS} ${NO_WERROR}94drizzled_message_transaction_writer_CXXFLAGS = ${MESSAGE_AM_CXXFLAGS} ${NO_WERROR}
9495
95drizzled_message_transaction_reader_SOURCES = drizzled/message/transaction_reader.cc drizzled/message/transaction.pb.cc96drizzled_message_transaction_reader_SOURCES = drizzled/message/transaction_reader.cc
96drizzled_message_transaction_reader_LDADD = ${MESSAGE_LDADD} ${top_builddir}/drizzled/algorithm/libhash.la ${top_builddir}/drizzled/util/libutil.la97drizzled_message_transaction_reader_LDADD = ${MESSAGE_LDADD} ${top_builddir}/drizzled/algorithm/libhash.la ${top_builddir}/drizzled/util/libutil.la
97drizzled_message_transaction_reader_CXXFLAGS = ${MESSAGE_AM_CXXFLAGS} ${NO_WERROR}98drizzled_message_transaction_reader_CXXFLAGS = ${MESSAGE_AM_CXXFLAGS} ${NO_WERROR}
9899
99100
=== modified file 'drizzled/optimizer/range.cc'
--- drizzled/optimizer/range.cc 2010-03-22 05:47:41 +0000
+++ drizzled/optimizer/range.cc 2010-04-19 20:33:26 +0000
@@ -272,11 +272,6 @@
272 bool *are_all_covering);272 bool *are_all_covering);
273273
274static274static
275optimizer::RorIntersectReadPlan *get_best_covering_ror_intersect(optimizer::Parameter *param,
276 optimizer::SEL_TREE *tree,
277 double read_time);
278
279static
280optimizer::TableReadPlan *get_best_disjunct_quick(optimizer::Parameter *param,275optimizer::TableReadPlan *get_best_disjunct_quick(optimizer::Parameter *param,
281 optimizer::SEL_IMERGE *imerge,276 optimizer::SEL_IMERGE *imerge,
282 double read_time);277 double read_time);
@@ -816,14 +811,6 @@
816 {811 {
817 best_trp= rori_trp;812 best_trp= rori_trp;
818 best_read_time= best_trp->read_cost;813 best_read_time= best_trp->read_cost;
819 /*
820 Try constructing covering ROR-intersect only if it looks possible
821 and worth doing.
822 */
823 if (rori_trp->isRowRetrievalNecessary() && can_build_covering &&
824 (rori_trp= get_best_covering_ror_intersect(&param, tree,
825 best_read_time)))
826 best_trp= rori_trp;
827 }814 }
828 }815 }
829 }816 }
@@ -1276,40 +1263,6 @@
1276 return (val1 < val2)? -1: (val1 == val2)? 0 : 1;1263 return (val1 < val2)? -1: (val1 == val2)? 0 : 1;
1277}1264}
12781265
1279/*
1280 Compare two ROR_SCAN_INFO** by
1281 (#covered fields in F desc,
1282 #components asc,
1283 number of first not covered component asc)
1284
1285 SYNOPSIS
1286 cmp_ror_scan_info_covering()
1287 a ptr to first compared value
1288 b ptr to second compared value
1289
1290 RETURN
1291 -1 a < b
1292 0 a = b
1293 1 a > b
1294*/
1295
1296static int cmp_ror_scan_info_covering(ROR_SCAN_INFO** a, ROR_SCAN_INFO** b)
1297{
1298 if ((*a)->used_fields_covered > (*b)->used_fields_covered)
1299 return -1;
1300 if ((*a)->used_fields_covered < (*b)->used_fields_covered)
1301 return 1;
1302 if ((*a)->key_components < (*b)->key_components)
1303 return -1;
1304 if ((*a)->key_components > (*b)->key_components)
1305 return 1;
1306 if ((*a)->first_uncovered_field < (*b)->first_uncovered_field)
1307 return -1;
1308 if ((*a)->first_uncovered_field > (*b)->first_uncovered_field)
1309 return 1;
1310 return 0;
1311}
1312
13131266
1314/* Auxiliary structure for incremental ROR-intersection creation */1267/* Auxiliary structure for incremental ROR-intersection creation */
1315typedef struct1268typedef struct
@@ -1830,140 +1783,6 @@
18301783
18311784
1832/*1785/*
1833 Get best covering ROR-intersection.
1834 SYNOPSIS
1835 get_best_covering_ror_intersect()
1836 param Parameter from test_quick_select function.
1837 tree optimizer::SEL_TREE with sets of intervals for different keys.
1838 read_time Don't return table read plans with cost > read_time.
1839
1840 RETURN
1841 Best covering ROR-intersection plan
1842 NULL if no plan found.
1843
1844 NOTES
1845 get_best_ror_intersect must be called for a tree before calling this
1846 function for it.
1847 This function invalidates tree->ror_scans member values.
1848
1849 The following approximate algorithm is used:
1850 I=set of all covering indexes
1851 F=set of all fields to cover
1852 S={}
1853
1854 do
1855 {
1856 Order I by (#covered fields in F desc,
1857 #components asc,
1858 number of first not covered component asc);
1859 F=F-covered by first(I);
1860 S=S+first(I);
1861 I=I-first(I);
1862 } while F is not empty.
1863*/
1864
1865static
1866optimizer::RorIntersectReadPlan *get_best_covering_ror_intersect(optimizer::Parameter *param,
1867 optimizer::SEL_TREE *tree,
1868 double read_time)
1869{
1870 ROR_SCAN_INFO **ror_scan_mark;
1871 ROR_SCAN_INFO **ror_scans_end= tree->ror_scans_end;
1872
1873 for (ROR_SCAN_INFO **scan= tree->ror_scans; scan != ror_scans_end; ++scan)
1874 (*scan)->key_components=
1875 param->table->key_info[(*scan)->keynr].key_parts;
1876
1877 /*
1878 Run covering-ROR-search algorithm.
1879 Assume set I is [ror_scan .. ror_scans_end)
1880 */
1881
1882 /*I=set of all covering indexes */
1883 ror_scan_mark= tree->ror_scans;
1884
1885 MyBitmap *covered_fields= &param->tmp_covered_fields;
1886 if (! covered_fields->getBitmap())
1887 {
1888 my_bitmap_map *tmp_bitmap= (my_bitmap_map*)alloc_root(param->mem_root,
1889 param->fields_bitmap_size);
1890 covered_fields->setBitmap(tmp_bitmap);
1891 }
1892 if (! covered_fields->getBitmap() ||
1893 covered_fields->init(covered_fields->getBitmap(),
1894 param->table->s->fields))
1895 return 0;
1896 covered_fields->clearAll();
1897
1898 double total_cost= 0.0f;
1899 ha_rows records=0;
1900 bool all_covered;
1901
1902 do
1903 {
1904 /*
1905 Update changed sorting info:
1906 #covered fields,
1907 number of first not covered component
1908 Calculate and save these values for each of remaining scans.
1909 */
1910 for (ROR_SCAN_INFO **scan= ror_scan_mark; scan != ror_scans_end; ++scan)
1911 {
1912 bitmap_subtract(&(*scan)->covered_fields, covered_fields);
1913 (*scan)->used_fields_covered=
1914 (*scan)->covered_fields.getBitsSet();
1915 (*scan)->first_uncovered_field=
1916 (*scan)->covered_fields.getFirst();
1917 }
1918
1919 internal::my_qsort(ror_scan_mark, ror_scans_end-ror_scan_mark,
1920 sizeof(ROR_SCAN_INFO*),
1921 (qsort_cmp)cmp_ror_scan_info_covering);
1922
1923 /* I=I-first(I) */
1924 total_cost += (*ror_scan_mark)->index_read_cost;
1925 records += (*ror_scan_mark)->records;
1926 if (total_cost > read_time)
1927 return NULL;
1928 /* F=F-covered by first(I) */
1929 bitmap_union(covered_fields, &(*ror_scan_mark)->covered_fields);
1930 all_covered= bitmap_is_subset(&param->needed_fields, covered_fields);
1931 } while ((++ror_scan_mark < ror_scans_end) && !all_covered);
1932
1933 if (!all_covered || (ror_scan_mark - tree->ror_scans) == 1)
1934 return NULL;
1935
1936 /*
1937 Ok, [tree->ror_scans .. ror_scan) holds covering index_intersection with
1938 cost total_cost.
1939 */
1940 /* Add priority queue use cost. */
1941 total_cost += rows2double(records)*
1942 log((double)(ror_scan_mark - tree->ror_scans)) /
1943 (TIME_FOR_COMPARE_ROWID * M_LN2);
1944
1945 if (total_cost > read_time)
1946 return NULL;
1947
1948 optimizer::RorIntersectReadPlan *trp= NULL;
1949 if (! (trp= new (param->mem_root) optimizer::RorIntersectReadPlan))
1950 {
1951 return trp;
1952 }
1953
1954 uint32_t best_num= (ror_scan_mark - tree->ror_scans);
1955 trp->ror_range_scans.assign(tree->ror_scans, tree->ror_scans + best_num);
1956 trp->setRowRetrievalNecessary(true);
1957 trp->read_cost= total_cost;
1958 trp->records= records;
1959 trp->cpk_scan= NULL;
1960 set_if_smaller(param->table->quick_condition_rows, records);
1961
1962 return(trp);
1963}
1964
1965
1966/*
1967 Get best "range" table read plan for given optimizer::SEL_TREE, also update some info1786 Get best "range" table read plan for given optimizer::SEL_TREE, also update some info
19681787
1969 SYNOPSIS1788 SYNOPSIS
19701789
=== modified file 'drizzled/pthread_globals.h'
--- drizzled/pthread_globals.h 2010-02-04 08:14:46 +0000
+++ drizzled/pthread_globals.h 2010-04-19 20:33:26 +0000
@@ -36,6 +36,7 @@
36extern pthread_cond_t COND_refresh;36extern pthread_cond_t COND_refresh;
37extern pthread_cond_t COND_thread_count;37extern pthread_cond_t COND_thread_count;
38extern pthread_cond_t COND_global_read_lock;38extern pthread_cond_t COND_global_read_lock;
39extern pthread_cond_t COND_server_end;
39extern pthread_attr_t connection_attrib;40extern pthread_attr_t connection_attrib;
40extern pthread_t signal_thread;41extern pthread_t signal_thread;
4142
4243
=== modified file 'drizzled/schema_identifier.cc'
--- drizzled/schema_identifier.cc 2010-04-14 18:21:22 +0000
+++ drizzled/schema_identifier.cc 2010-04-19 20:33:26 +0000
@@ -61,7 +61,7 @@
61 61
6262
63 int rootdir_len= strlen(FN_ROOTDIR);63 int rootdir_len= strlen(FN_ROOTDIR);
64 path.append(drizzle_data_home);64 path.append(data_home);
65 ssize_t without_rootdir= path.length() - rootdir_len;65 ssize_t without_rootdir= path.length() - rootdir_len;
6666
67 /* Don't add FN_ROOTDIR if dirzzle_data_home already includes it */67 /* Don't add FN_ROOTDIR if dirzzle_data_home already includes it */
6868
=== modified file 'drizzled/session.cc'
--- drizzled/session.cc 2010-04-08 16:25:53 +0000
+++ drizzled/session.cc 2010-04-19 20:33:26 +0000
@@ -46,6 +46,7 @@
46#include "drizzled/db.h"46#include "drizzled/db.h"
47#include "drizzled/pthread_globals.h"47#include "drizzled/pthread_globals.h"
48#include "drizzled/transaction_services.h"48#include "drizzled/transaction_services.h"
49#include "drizzled/drizzled.h"
4950
50#include "plugin/myisam/myisam.h"51#include "plugin/myisam/myisam.h"
51#include "drizzled/internal/iocache.h"52#include "drizzled/internal/iocache.h"
@@ -74,8 +75,6 @@
74const char * const Session::DEFAULT_WHERE= "field list";75const char * const Session::DEFAULT_WHERE= "field list";
75extern pthread_key_t THR_Session;76extern pthread_key_t THR_Session;
76extern pthread_key_t THR_Mem_root;77extern pthread_key_t THR_Mem_root;
77extern uint32_t max_used_connections;
78extern atomic<uint32_t> connection_count;
7978
8079
81/****************************************************************************80/****************************************************************************
@@ -1048,13 +1047,13 @@
10481047
1049 if (!internal::dirname_length(exchange->file_name))1048 if (!internal::dirname_length(exchange->file_name))
1050 {1049 {
1051 strcpy(path, drizzle_real_data_home);1050 strcpy(path, data_home_real);
1052 if (! session->db.empty())1051 if (! session->db.empty())
1053 strncat(path, session->db.c_str(), FN_REFLEN-strlen(drizzle_real_data_home)-1);1052 strncat(path, session->db.c_str(), FN_REFLEN-strlen(data_home_real)-1);
1054 (void) internal::fn_format(path, exchange->file_name, path, "", option);1053 (void) internal::fn_format(path, exchange->file_name, path, "", option);
1055 }1054 }
1056 else1055 else
1057 (void) internal::fn_format(path, exchange->file_name, drizzle_real_data_home, "", option);1056 (void) internal::fn_format(path, exchange->file_name, data_home_real, "", option);
10581057
1059 if (opt_secure_file_priv &&1058 if (opt_secure_file_priv &&
1060 strncmp(opt_secure_file_priv, path, strlen(opt_secure_file_priv)))1059 strncmp(opt_secure_file_priv, path, strlen(opt_secure_file_priv)))
10611060
=== modified file 'drizzled/session_list.cc'
--- drizzled/session_list.cc 2010-03-04 16:54:08 +0000
+++ drizzled/session_list.cc 2010-04-19 20:33:26 +0000
@@ -35,7 +35,7 @@
3535
36SessionList session_list;36SessionList session_list;
3737
38vector<Session*> &getSessionList()38SessionList &getSessionList()
39{39{
40 return session_list;40 return session_list;
41}41}
4242
=== modified file 'drizzled/set_var.cc'
--- drizzled/set_var.cc 2010-04-07 15:56:28 +0000
+++ drizzled/set_var.cc 2010-04-19 20:33:26 +0000
@@ -143,7 +143,7 @@
143 fix_completion_type);143 fix_completion_type);
144static sys_var_collation_sv144static sys_var_collation_sv
145sys_collation_server(&vars, "collation_server", &system_variables::collation_server, &default_charset_info);145sys_collation_server(&vars, "collation_server", &system_variables::collation_server, &default_charset_info);
146static sys_var_const_str sys_datadir(&vars, "datadir", drizzle_real_data_home);146static sys_var_const_str sys_datadir(&vars, "datadir", data_home_real);
147147
148static sys_var_session_uint64_t sys_join_buffer_size(&vars, "join_buffer_size",148static sys_var_session_uint64_t sys_join_buffer_size(&vars, "join_buffer_size",
149 &system_variables::join_buff_size);149 &system_variables::join_buff_size);
150150
=== added file 'drizzled/signal_handler.cc'
--- drizzled/signal_handler.cc 1970-01-01 00:00:00 +0000
+++ drizzled/signal_handler.cc 2010-04-19 20:33:26 +0000
@@ -0,0 +1,212 @@
1/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3 *
4 * Copyright (C) 2008 Sun Microsystems
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#include "config.h"
21
22#include <signal.h>
23
24#include "drizzled/signal_handler.h"
25#include "drizzled/drizzled.h"
26#include "drizzled/session.h"
27#include "drizzled/internal/my_sys.h"
28#include "drizzled/probes.h"
29#include "drizzled/plugin.h"
30#include "drizzled/plugin/scheduler.h"
31#include "plugin/myisam/keycache.h"
32
33using namespace drizzled;
34
35static uint32_t killed_threads;
36static bool segfaulted= false;
37
38/*
39 * We declare these extern "C" because they are passed to system callback functions
40 * and Sun Studio does not like it when those don't have C linkage. We prefix them
41 * because extern "C"-ing something effectively removes the namespace from the
42 * linker symbols, meaning they would be exporting symbols like "print_signal_warning
43 */
44extern "C"
45{
46
47void drizzled_print_signal_warning(int sig)
48{
49 if (global_system_variables.log_warnings)
50 errmsg_printf(ERRMSG_LVL_WARN, _("Got signal %d from thread %"PRIu64),
51 sig, global_thread_id);
52#ifndef HAVE_BSD_SIGNALS
53 sigset_t set;
54 sigemptyset(&set);
55
56 struct sigaction sa;
57 sa.sa_handler= drizzled_print_signal_warning;
58 sa.sa_mask= set;
59 sa.sa_flags= 0;
60 sigaction(sig, &sa, NULL); /* int. thread system calls */
61#endif
62 if (sig == SIGALRM)
63 alarm(2); /* reschedule alarm */
64}
65
66/** Called when a thread is aborted. */
67void drizzled_end_thread_signal(int )
68{
69 Session *session=current_session;
70 if (session)
71 {
72 statistic_increment(killed_threads, &LOCK_status);
73 session->scheduler->killSessionNow(session);
74 DRIZZLE_CONNECTION_DONE(session->thread_id);
75 }
76 return;
77}
78
79void drizzled_handle_segfault(int sig)
80{
81 time_t curr_time;
82 struct tm tm;
83
84 /*
85 Strictly speaking, one needs a mutex here
86 but since we have got SIGSEGV already, things are a mess
87 so not having the mutex is not as bad as possibly using a buggy
88 mutex - so we keep things simple
89 */
90 if (segfaulted)
91 {
92 fprintf(stderr, _("Fatal signal %d while backtracing\n"), sig);
93 exit(1);
94 }
95
96 segfaulted= true;
97
98 curr_time= time(NULL);
99 if(curr_time == (time_t)-1)
100 {
101 fprintf(stderr, _("Fatal: time() call failed\n"));
102 exit(1);
103 }
104
105 localtime_r(&curr_time, &tm);
106
107 fprintf(stderr,_("%02d%02d%02d %2d:%02d:%02d - drizzled got signal %d;\n"
108 "This could be because you hit a bug. It is also possible that "
109 "this binary\n or one of the libraries it was linked against is "
110 "corrupt, improperly built,\n or misconfigured. This error can "
111 "also be caused by malfunctioning hardware.\n"),
112 tm.tm_year % 100, tm.tm_mon+1, tm.tm_mday,
113 tm.tm_hour, tm.tm_min, tm.tm_sec,
114 sig);
115 fprintf(stderr, _("We will try our best to scrape up some info that "
116 "will hopefully help diagnose\n"
117 "the problem, but since we have already crashed, "
118 "something is definitely wrong\nand this may fail.\n\n"));
119 fprintf(stderr, "key_buffer_size=%u\n",
120 (uint32_t) dflt_key_cache->key_cache_mem_size);
121 fprintf(stderr, "read_buffer_size=%ld\n", (long) global_system_variables.read_buff_size);
122 fprintf(stderr, "max_used_connections=%u\n", max_used_connections);
123 fprintf(stderr, "connection_count=%u\n", uint32_t(connection_count));
124 fprintf(stderr, _("It is possible that drizzled could use up to \n"
125 "key_buffer_size + (read_buffer_size + "
126 "sort_buffer_size)*thread_count\n"
127 "bytes of memory\n"
128 "Hope that's ok; if not, decrease some variables in the "
129 "equation.\n\n"));
130
131#ifdef HAVE_STACKTRACE
132 Session *session= current_session;
133
134 if (! (test_flags.test(TEST_NO_STACKTRACE)))
135 {
136 fprintf(stderr,"session: 0x%lx\n",(long) session);
137 fprintf(stderr,_("Attempting backtrace. You can use the following "
138 "information to find out\n"
139 "where drizzled died. If you see no messages after this, "
140 "something went\n"
141 "terribly wrong...\n"));
142 print_stacktrace(session ? (unsigned char*) session->thread_stack : (unsigned char*) 0,
143 my_thread_stack_size);
144 }
145 if (session)
146 {
147 const char *kreason= "UNKNOWN";
148 switch (session->killed) {
149 case Session::NOT_KILLED:
150 kreason= "NOT_KILLED";
151 break;
152 case Session::KILL_BAD_DATA:
153 kreason= "KILL_BAD_DATA";
154 break;
155 case Session::KILL_CONNECTION:
156 kreason= "KILL_CONNECTION";
157 break;
158 case Session::KILL_QUERY:
159 kreason= "KILL_QUERY";
160 break;
161 case Session::KILLED_NO_VALUE:
162 kreason= "KILLED_NO_VALUE";
163 break;
164 }
165 fprintf(stderr, _("Trying to get some variables.\n"
166 "Some pointers may be invalid and cause the "
167 "dump to abort...\n"));
168 safe_print_str("session->query", session->query, 1024);
169 fprintf(stderr, "session->thread_id=%"PRIu32"\n", (uint32_t) session->thread_id);
170 fprintf(stderr, "session->killed=%s\n", kreason);
171 }
172 fflush(stderr);
173#endif /* HAVE_STACKTRACE */
174
175 if (calling_initgroups)
176 fprintf(stderr, _("\nThis crash occurred while the server was calling "
177 "initgroups(). This is\n"
178 "often due to the use of a drizzled that is statically "
179 "linked against glibc\n"
180 "and configured to use LDAP in /etc/nsswitch.conf. "
181 "You will need to either\n"
182 "upgrade to a version of glibc that does not have this "
183 "problem (2.3.4 or\n"
184 "later when used with nscd), disable LDAP in your "
185 "nsswitch.conf, or use a\n"
186 "drizzled that is not statically linked.\n"));
187
188 if (internal::thd_lib_detected == THD_LIB_LT && !getenv("LD_ASSUME_KERNEL"))
189 fprintf(stderr,
190 _("\nYou are running a statically-linked LinuxThreads binary "
191 "on an NPTL system.\n"
192 "This can result in crashes on some distributions due "
193 "to LT/NPTL conflicts.\n"
194 "You should either build a dynamically-linked binary, or force "
195 "LinuxThreads\n"
196 "to be used with the LD_ASSUME_KERNEL environment variable. "
197 "Please consult\n"
198 "the documentation for your distribution on how to do that.\n"));
199
200#ifdef HAVE_WRITE_CORE
201 if (test_flags.test(TEST_CORE_ON_SIGNAL))
202 {
203 fprintf(stderr, _("Writing a core file\n"));
204 fflush(stderr);
205 write_core(sig);
206 }
207#endif
208
209 exit(1);
210}
211
212} /* extern "C" */
0213
=== added file 'drizzled/signal_handler.h'
--- drizzled/signal_handler.h 1970-01-01 00:00:00 +0000
+++ drizzled/signal_handler.h 2010-04-19 20:33:26 +0000
@@ -0,0 +1,55 @@
1/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3 *
4 * Copyright (C) 2008 Sun Microsystems
5 * Copyright (C) 2010 Monty Taylor
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#ifndef DRIZZLED_SIGNAL_HANDLER_H
22#define DRIZZLED_SIGNAL_HANDLER_H
23
24#include <signal.h>
25
26#include <cstdlib>
27#include <cassert>
28
29extern "C" void drizzled_print_signal_warning(int sig);
30extern "C" void drizzled_handle_segfault(int sig);
31extern "C" void drizzled_end_thread_signal(int sig);
32
33/*
34 posix sigaction() based signal handler implementation
35 On some systems, such as Mac OS X, sigset() results in flags
36 such as SA_RESTART being set, and we want to make sure that no such
37 flags are set.
38*/
39static inline void ignore_signal(int sig)
40{
41 /* Wow. There is a function sigaction which takes a pointer to a
42 struct sigaction. */
43 struct sigaction l_s;
44 sigset_t l_set;
45 sigemptyset(&l_set);
46
47 assert(sig != 0);
48 l_s.sa_handler= SIG_IGN;
49 l_s.sa_mask= l_set;
50 l_s.sa_flags= 0;
51 int l_rc= sigaction(sig, &l_s, NULL);
52 assert(l_rc == 0);
53}
54
55#endif /* DRIZZLED_SIGNAL_HANDLER_H */
056
=== modified file 'drizzled/sql_base.cc'
--- drizzled/sql_base.cc 2010-04-15 19:22:50 +0000
+++ drizzled/sql_base.cc 2010-04-19 20:33:26 +0000
@@ -51,6 +51,7 @@
51#include "drizzled/global_charset_info.h"51#include "drizzled/global_charset_info.h"
52#include "drizzled/pthread_globals.h"52#include "drizzled/pthread_globals.h"
53#include "drizzled/internal/iocache.h"53#include "drizzled/internal/iocache.h"
54#include "drizzled/drizzled.h"
54#include "drizzled/plugin/authorization.h"55#include "drizzled/plugin/authorization.h"
5556
56using namespace std;57using namespace std;
@@ -60,8 +61,6 @@
6061
61extern bool volatile shutdown_in_progress;62extern bool volatile shutdown_in_progress;
6263
63bool drizzle_rm_tmp_tables();
64
65/**64/**
66 @defgroup Data_Dictionary Data Dictionary65 @defgroup Data_Dictionary Data Dictionary
67 @{66 @{
6867
=== modified file 'drizzled/sql_load.cc'
--- drizzled/sql_load.cc 2010-03-31 21:15:40 +0000
+++ drizzled/sql_load.cc 2010-04-19 20:33:26 +0000
@@ -258,14 +258,14 @@
258#endif258#endif
259 if (!internal::dirname_length(ex->file_name))259 if (!internal::dirname_length(ex->file_name))
260 {260 {
261 strcpy(name, drizzle_real_data_home);261 strcpy(name, data_home_real);
262 strncat(name, tdb, FN_REFLEN-strlen(drizzle_real_data_home)-1);262 strncat(name, tdb, FN_REFLEN-strlen(data_home_real)-1);
263 (void) internal::fn_format(name, ex->file_name, name, "",263 (void) internal::fn_format(name, ex->file_name, name, "",
264 MY_RELATIVE_PATH | MY_UNPACK_FILENAME);264 MY_RELATIVE_PATH | MY_UNPACK_FILENAME);
265 }265 }
266 else266 else
267 {267 {
268 (void) internal::fn_format(name, ex->file_name, drizzle_real_data_home, "",268 (void) internal::fn_format(name, ex->file_name, data_home_real, "",
269 MY_RELATIVE_PATH | MY_UNPACK_FILENAME);269 MY_RELATIVE_PATH | MY_UNPACK_FILENAME);
270270
271 if (opt_secure_file_priv &&271 if (opt_secure_file_priv &&
272272
=== modified file 'drizzled/sql_table.cc'
--- drizzled/sql_table.cc 2010-04-11 17:19:47 +0000
+++ drizzled/sql_table.cc 2010-04-19 20:33:26 +0000
@@ -54,7 +54,6 @@
54namespace drizzled54namespace drizzled
55{55{
5656
57extern plugin::StorageEngine *myisam_engine;
58extern pid_t current_pid;57extern pid_t current_pid;
5958
60bool is_primary_key(KEY *key_info)59bool is_primary_key(KEY *key_info)
@@ -1618,9 +1617,6 @@
1618 old_name The old table name.1617 old_name The old table name.
1619 new_db The new database name.1618 new_db The new database name.
1620 new_name The new table name.1619 new_name The new table name.
1621 flags flags for build_table_filename().
1622 FN_FROM_IS_TMP old_name is temporary.
1623 FN_TO_IS_TMP new_name is temporary.
16241620
1625 RETURN1621 RETURN
1626 false OK1622 false OK
@@ -1630,8 +1626,7 @@
1630bool1626bool
1631mysql_rename_table(plugin::StorageEngine *base,1627mysql_rename_table(plugin::StorageEngine *base,
1632 TableIdentifier &from,1628 TableIdentifier &from,
1633 TableIdentifier &to,1629 TableIdentifier &to)
1634 uint32_t )
1635{1630{
1636 Session *session= current_session;1631 Session *session= current_session;
1637 int error= 0;1632 int error= 0;
16381633
=== modified file 'drizzled/sql_table.h'
--- drizzled/sql_table.h 2010-04-11 17:04:06 +0000
+++ drizzled/sql_table.h 2010-04-19 20:33:26 +0000
@@ -40,10 +40,6 @@
40class AlterInfo;40class AlterInfo;
41class Cursor;41class Cursor;
4242
43/* Flags for conversion functions. */
44static const uint32_t FN_FROM_IS_TMP(1 << 0);
45static const uint32_t FN_TO_IS_TMP(1 << 0);
46
47namespace message { class Table; }43namespace message { class Table; }
48class TableIdentifier;44class TableIdentifier;
4945
5046
=== modified file 'drizzled/stacktrace.cc'
--- drizzled/stacktrace.cc 2010-02-04 08:14:46 +0000
+++ drizzled/stacktrace.cc 2010-04-19 20:33:26 +0000
@@ -36,6 +36,10 @@
36#include <cstdio>36#include <cstdio>
37#include <algorithm>37#include <algorithm>
3838
39#if defined(BACKTRACE_DEMANGLE)
40# include <cxxabi.h>
41#endif
42
39#include "drizzled/definitions.h"43#include "drizzled/definitions.h"
4044
41using namespace std;45using namespace std;
@@ -74,8 +78,13 @@
74#define SIGRETURN_FRAME_OFFSET 2378#define SIGRETURN_FRAME_OFFSET 23
75#endif79#endif
7680
7781#if defined(BACKTRACE_DEMANGLE)
78#if BACKTRACE_DEMANGLE82
83static inline char *my_demangle(const char *mangled_name, int *status)
84{
85 return abi::__cxa_demangle(mangled_name, NULL, NULL, status);
86}
87
79static void my_demangle_symbols(char **addrs, int n)88static void my_demangle_symbols(char **addrs, int n)
80{89{
81 int status, i;90 int status, i;
8291
=== modified file 'drizzled/stacktrace.h'
--- drizzled/stacktrace.h 2010-02-04 08:14:46 +0000
+++ drizzled/stacktrace.h 2010-04-19 20:33:26 +0000
@@ -35,10 +35,6 @@
35#define BACKTRACE_DEMANGLE 135#define BACKTRACE_DEMANGLE 1
36#endif36#endif
3737
38#if defined(BACKTRACE_DEMANGLE)
39extern "C" char *my_demangle(const char *mangled_name, int *status);
40#endif
41
42#ifdef TARGET_OS_LINUX38#ifdef TARGET_OS_LINUX
43#if defined(HAVE_STACKTRACE) || (defined (__x86_64__) || defined (__i386__) )39#if defined(HAVE_STACKTRACE) || (defined (__x86_64__) || defined (__i386__) )
44#undef HAVE_STACKTRACE40#undef HAVE_STACKTRACE
4541
=== modified file 'drizzled/statement/alter_table.cc'
--- drizzled/statement/alter_table.cc 2010-04-08 16:25:53 +0000
+++ drizzled/statement/alter_table.cc 2010-04-19 20:33:26 +0000
@@ -931,7 +931,7 @@
931 }931 }
932 else932 else
933 {933 {
934 if (mysql_rename_table(original_engine, original_table_identifier, new_table_identifier, 0))934 if (mysql_rename_table(original_engine, original_table_identifier, new_table_identifier))
935 {935 {
936 error= -1;936 error= -1;
937 }937 }
@@ -1125,7 +1125,7 @@
11251125
1126 new_table_identifier.setPath(new_table_as_temporary.getPath());1126 new_table_identifier.setPath(new_table_as_temporary.getPath());
11271127
1128 if (mysql_rename_table(new_engine, new_table_as_temporary, new_table_identifier, FN_FROM_IS_TMP) != 0)1128 if (mysql_rename_table(new_engine, new_table_as_temporary, new_table_identifier) != 0)
1129 {1129 {
1130 return true;1130 return true;
1131 }1131 }
@@ -1184,14 +1184,14 @@
1184 TableIdentifier original_table_to_drop(original_table_identifier.getSchemaName(),1184 TableIdentifier original_table_to_drop(original_table_identifier.getSchemaName(),
1185 old_name, message::Table::TEMPORARY);1185 old_name, message::Table::TEMPORARY);
11861186
1187 if (mysql_rename_table(original_engine, original_table_identifier, original_table_to_drop, FN_TO_IS_TMP))1187 if (mysql_rename_table(original_engine, original_table_identifier, original_table_to_drop))
1188 {1188 {
1189 error= 1;1189 error= 1;
1190 quick_rm_table(*session, new_table_as_temporary);1190 quick_rm_table(*session, new_table_as_temporary);
1191 }1191 }
1192 else1192 else
1193 {1193 {
1194 if (mysql_rename_table(new_engine, new_table_as_temporary, new_table_identifier, FN_FROM_IS_TMP) != 0)1194 if (mysql_rename_table(new_engine, new_table_as_temporary, new_table_identifier) != 0)
1195 {1195 {
1196 /* Try to get everything back. */1196 /* Try to get everything back. */
1197 error= 1;1197 error= 1;
@@ -1200,7 +1200,7 @@
12001200
1201 quick_rm_table(*session, new_table_as_temporary);1201 quick_rm_table(*session, new_table_as_temporary);
12021202
1203 mysql_rename_table(original_engine, original_table_to_drop, original_table_identifier, FN_FROM_IS_TMP);1203 mysql_rename_table(original_engine, original_table_to_drop, original_table_identifier);
1204 }1204 }
1205 else1205 else
1206 {1206 {
12071207
=== modified file 'drizzled/statement/rename_table.cc'
--- drizzled/statement/rename_table.cc 2010-03-25 19:25:04 +0000
+++ drizzled/statement/rename_table.cc 2010-04-19 20:33:26 +0000
@@ -171,7 +171,7 @@
171 return 1; // This can't be skipped171 return 1; // This can't be skipped
172 }172 }
173173
174 rc= mysql_rename_table(engine, old_identifier, new_identifier, 0);174 rc= mysql_rename_table(engine, old_identifier, new_identifier);
175 if (rc && ! skip_error)175 if (rc && ! skip_error)
176 return true;176 return true;
177177
178178
=== modified file 'drizzled/table.cc'
--- drizzled/table.cc 2010-04-01 12:38:11 +0000
+++ drizzled/table.cc 2010-04-19 20:33:26 +0000
@@ -1885,32 +1885,6 @@
1885}1885}
18861886
1887/*1887/*
1888 DESCRIPTION
1889 given a buffer with a key value, and a map of keyparts
1890 that are present in this value, returns the length of the value
1891*/
1892uint32_t calculate_key_len(Table *table, uint32_t key,
1893 const unsigned char *,
1894 key_part_map keypart_map)
1895{
1896 /* works only with key prefixes */
1897 assert(((keypart_map + 1) & keypart_map) == 0);
1898
1899 KEY *key_info= table->s->key_info+key;
1900 KEY_PART_INFO *key_part= key_info->key_part;
1901 KEY_PART_INFO *end_key_part= key_part + key_info->key_parts;
1902 uint32_t length= 0;
1903
1904 while (key_part < end_key_part && keypart_map)
1905 {
1906 length+= key_part->store_length;
1907 keypart_map >>= 1;
1908 key_part++;
1909 }
1910 return length;
1911}
1912
1913/*
1914 Check if database name is valid1888 Check if database name is valid
19151889
1916 SYNPOSIS1890 SYNPOSIS
19171891
=== modified file 'drizzled/table_identifier.cc'
--- drizzled/table_identifier.cc 2010-03-31 06:34:03 +0000
+++ drizzled/table_identifier.cc 2010-04-19 20:33:26 +0000
@@ -145,8 +145,7 @@
145 db Database name145 db Database name
146 table_name Table name146 table_name Table name
147 ext File extension.147 ext File extension.
148 flags FN_FROM_IS_TMP or FN_TO_IS_TMP148 flags table_name is temporary, do not change.
149 table_name is temporary, do not change.
150149
151 NOTES150 NOTES
152151
@@ -174,7 +173,7 @@
174 bool conversion_error= false;173 bool conversion_error= false;
175174
176 memset(tbbuff, 0, sizeof(tbbuff));175 memset(tbbuff, 0, sizeof(tbbuff));
177 if (is_tmp) // FN_FROM_IS_TMP | FN_TO_IS_TMP176 if (is_tmp) // It a conversion tmp
178 {177 {
179 strncpy(tbbuff, table_name, sizeof(tbbuff));178 strncpy(tbbuff, table_name, sizeof(tbbuff));
180 }179 }
@@ -201,7 +200,7 @@
201 200
202201
203 int rootdir_len= strlen(FN_ROOTDIR);202 int rootdir_len= strlen(FN_ROOTDIR);
204 path.append(drizzle_data_home);203 path.append(data_home);
205 ssize_t without_rootdir= path.length() - rootdir_len;204 ssize_t without_rootdir= path.length() - rootdir_len;
206205
207 /* Don't add FN_ROOTDIR if dirzzle_data_home already includes it */206 /* Don't add FN_ROOTDIR if dirzzle_data_home already includes it */
208207
=== modified file 'extra/include.am'
--- extra/include.am 2010-01-11 23:50:15 +0000
+++ extra/include.am 2010-04-19 20:33:26 +0000
@@ -4,7 +4,4 @@
44
55
6extra_my_print_defaults_SOURCES= extra/my_print_defaults.cc6extra_my_print_defaults_SOURCES= extra/my_print_defaults.cc
7extra_my_print_defaults_LDADD= \7extra_my_print_defaults_LDADD= $(CLIENT_LDADD)
8 drizzled/internal/libinternal.la \
9 gnulib/libgnu.la \
10 $(LIBINTL)
118
=== modified file 'plugin/archive/ha_archive.cc'
--- plugin/archive/ha_archive.cc 2010-04-01 15:54:57 +0000
+++ plugin/archive/ha_archive.cc 2010-04-19 20:33:26 +0000
@@ -769,20 +769,11 @@
769 the optimizer that we have unique indexes, we scan769 the optimizer that we have unique indexes, we scan
770*/770*/
771int ha_archive::index_read(unsigned char *buf, const unsigned char *key,771int ha_archive::index_read(unsigned char *buf, const unsigned char *key,
772 uint32_t key_len, enum ha_rkey_function find_flag)772 uint32_t key_len, enum ha_rkey_function)
773{
774 int rc;
775 rc= index_read_idx(buf, active_index, key, key_len, find_flag);
776 return(rc);
777}
778
779
780int ha_archive::index_read_idx(unsigned char *buf, uint32_t index, const unsigned char *key,
781 uint32_t key_len, enum ha_rkey_function)
782{773{
783 int rc;774 int rc;
784 bool found= 0;775 bool found= 0;
785 KEY *mkey= &table->s->key_info[index];776 KEY *mkey= &table->s->key_info[0];
786 current_k_offset= mkey->key_part->offset;777 current_k_offset= mkey->key_part->offset;
787 current_key= key;778 current_key= key;
788 current_key_len= key_len;779 current_key_len= key_len;
789780
=== modified file 'plugin/archive/ha_archive.h'
--- plugin/archive/ha_archive.h 2010-02-12 21:18:37 +0000
+++ plugin/archive/ha_archive.h 2010-04-19 20:33:26 +0000
@@ -96,10 +96,6 @@
96 virtual int index_read(unsigned char * buf, const unsigned char * key,96 virtual int index_read(unsigned char * buf, const unsigned char * key,
97 uint32_t key_len,97 uint32_t key_len,
98 drizzled::ha_rkey_function find_flag);98 drizzled::ha_rkey_function find_flag);
99 virtual int index_read_idx(unsigned char * buf, uint32_t index,
100 const unsigned char * key,
101 uint32_t key_len,
102 drizzled::ha_rkey_function find_flag);
103 int index_next(unsigned char * buf);99 int index_next(unsigned char * buf);
104 int open(const char *name, int mode, uint32_t test_if_locked);100 int open(const char *name, int mode, uint32_t test_if_locked);
105 int close(void);101 int close(void);
106102
=== modified file 'plugin/innobase/handler/ha_innodb.cc'
--- plugin/innobase/handler/ha_innodb.cc 2010-04-15 16:00:18 +0000
+++ plugin/innobase/handler/ha_innodb.cc 2010-04-19 20:33:26 +0000
@@ -6469,7 +6469,7 @@
6469 }6469 }
64706470
6471 snprintf(path, sizeof(path), "%s/%s%s",6471 snprintf(path, sizeof(path), "%s/%s%s",
6472 drizzle_data_home, ib_table->name, ".dfe");6472 data_home, ib_table->name, ".dfe");
64736473
6474 internal::unpack_filename(path,path);6474 internal::unpack_filename(path,path);
64756475
64766476
=== modified file 'plugin/myisam/plugin.ini'
--- plugin/myisam/plugin.ini 2010-02-04 08:14:46 +0000
+++ plugin/myisam/plugin.ini 2010-04-19 20:33:26 +0000
@@ -18,6 +18,6 @@
18description=Legacy non-transactional MySQL tables18description=Legacy non-transactional MySQL tables
19load_by_default=yes19load_by_default=yes
20sources=ha_myisam.cc20sources=ha_myisam.cc
21libs=plugin/myisam/libmyisam.la drizzled/internal/libinternal.la21libs=plugin/myisam/libmyisam.la
22ldflags=$(LIBZ) $(LIBINTL)22ldflags=$(LIBZ) $(LIBINTL)
23static=yes23static=yes
2424
=== modified file 'plugin/pbxt/src/ha_pbxt.h'
--- plugin/pbxt/src/ha_pbxt.h 2010-04-14 16:29:40 +0000
+++ plugin/pbxt/src/ha_pbxt.h 2010-04-19 20:33:26 +0000
@@ -256,11 +256,11 @@
256 int index_end();256 int index_end();
257 int index_read(byte * buf, const byte * key,257 int index_read(byte * buf, const byte * key,
258 uint key_len, enum ha_rkey_function find_flag);258 uint key_len, enum ha_rkey_function find_flag);
259 int index_read_idx(byte * buf, uint idx, const byte * key,259 int index_read_idx(byte * buf, uint idx, const byte * key,
260 uint key_len, enum ha_rkey_function find_flag);260 uint key_len, enum ha_rkey_function find_flag);
261 int index_read_xt(byte * buf, uint idx, const byte * key,261 int index_read_xt(byte * buf, uint idx, const byte * key,
262 uint key_len, enum ha_rkey_function find_flag);262 uint key_len, enum ha_rkey_function find_flag);
263 int index_next(byte * buf);263 int index_next(byte * buf);
264 int index_next_same(byte * buf, const byte *key, uint length);264 int index_next_same(byte * buf, const byte *key, uint length);
265 int index_prev(byte * buf);265 int index_prev(byte * buf);
266 int index_first(byte * buf);266 int index_first(byte * buf);
267267
=== modified file 'plugin/pbxt/src/myxt_xt.cc'
--- plugin/pbxt/src/myxt_xt.cc 2010-04-14 16:29:40 +0000
+++ plugin/pbxt/src/myxt_xt.cc 2010-04-19 20:33:26 +0000
@@ -2082,7 +2082,7 @@
2082 message::Table::STANDARD);2082 message::Table::STANDARD);
2083 } else {2083 } else {
2084 std::string n;2084 std::string n;
2085 n.append(drizzle_data_home);2085 n.append(data_home);
2086 n.append("/");2086 n.append("/");
2087 n.append(db_name);2087 n.append(db_name);
2088 n.append("/");2088 n.append("/");
20892089
=== modified file 'plugin/pbxt/src/table_xt.cc'
--- plugin/pbxt/src/table_xt.cc 2010-04-08 17:52:00 +0000
+++ plugin/pbxt/src/table_xt.cc 2010-04-19 20:33:26 +0000
@@ -683,17 +683,25 @@
683 * Previously we only caclulated statistics when a handler was opened683 * Previously we only caclulated statistics when a handler was opened
684 * and the underlying table was also opened.684 * and the underlying table was also opened.
685 */685 */
686 /* This (hack) fixes: warning: variable 'edx' might be clobbered by 'longjmp' or 'vfork' */
687 u_int save_edx;
688
686 xt_enum_tables_init(&edx);689 xt_enum_tables_init(&edx);
687 while ((te_ptr = xt_enum_tables_next(self, db, &edx))) {690 while ((te_ptr = xt_enum_tables_next(self, db, &edx))) {
691 save_edx = edx;
692
688 xt_strcpy(PATH_MAX, pbuf, te_ptr->te_tab_path->tp_path);693 xt_strcpy(PATH_MAX, pbuf, te_ptr->te_tab_path->tp_path);
689 xt_add_dir_char(PATH_MAX, pbuf);694 xt_add_dir_char(PATH_MAX, pbuf);
690 xt_strcat(PATH_MAX, pbuf, te_ptr->te_tab_name);695 xt_strcat(PATH_MAX, pbuf, te_ptr->te_tab_name);
691 try_(a) {696 try_(a) {
697 edx = 0;
692 xt_heap_release(self, xt_use_table_no_lock(self, db, (XTPathStrPtr)pbuf, FALSE, FALSE, NULL));698 xt_heap_release(self, xt_use_table_no_lock(self, db, (XTPathStrPtr)pbuf, FALSE, FALSE, NULL));
693 } catch_(a) {699 } catch_(a) {
700 edx = 0;
694 /* ignore errors */701 /* ignore errors */
695 xt_log_and_clear_warning(self);702 xt_log_and_clear_warning(self);
696 } cont_(a);703 } cont_(a);
704 edx = save_edx;
697 }705 }
698706
699 popr_(); // Discard xt_tab_exit_db(db)707 popr_(); // Discard xt_tab_exit_db(db)
700708
=== modified file 'plugin/pbxt/src/xt_defs.h'
--- plugin/pbxt/src/xt_defs.h 2010-04-08 16:11:29 +0000
+++ plugin/pbxt/src/xt_defs.h 2010-04-19 20:33:26 +0000
@@ -903,7 +903,7 @@
903903
904#define my_pthread_setspecific_ptr(T, V) pthread_setspecific(T, (void*) (V))904#define my_pthread_setspecific_ptr(T, V) pthread_setspecific(T, (void*) (V))
905905
906#define mysql_real_data_home drizzle_real_data_home906#define mysql_real_data_home ::drizzled::data_home
907907
908#define mi_int4store(T,A) { uint32_t def_temp= (uint32_t) (A);\908#define mi_int4store(T,A) { uint32_t def_temp= (uint32_t) (A);\
909 ((unsigned char*) (T))[3]= (unsigned char) (def_temp);\909 ((unsigned char*) (T))[3]= (unsigned char) (def_temp);\
910910
=== modified file 'plugin/schema_engine/schema.cc'
--- plugin/schema_engine/schema.cc 2010-04-01 15:54:57 +0000
+++ plugin/schema_engine/schema.cc 2010-04-19 20:33:26 +0000
@@ -69,7 +69,7 @@
6969
70void Schema::prime()70void Schema::prime()
71{71{
72 CachedDirectory directory(drizzle_data_home, CachedDirectory::DIRECTORY);72 CachedDirectory directory(data_home, CachedDirectory::DIRECTORY);
73 CachedDirectory::Entries files= directory.getEntries();73 CachedDirectory::Entries files= directory.getEntries();
7474
75 pthread_rwlock_wrlock(&schema_lock);75 pthread_rwlock_wrlock(&schema_lock);
@@ -113,7 +113,7 @@
113113
114 // If for some reason getting a lock should fail, we resort to disk114 // If for some reason getting a lock should fail, we resort to disk
115115
116 CachedDirectory directory(drizzle_data_home, CachedDirectory::DIRECTORY);116 CachedDirectory directory(data_home, CachedDirectory::DIRECTORY);
117117
118 CachedDirectory::Entries files= directory.getEntries();118 CachedDirectory::Entries files= directory.getEntries();
119119
120120
=== modified file 'plugin/signal_handler/signal_handler.cc'
--- plugin/signal_handler/signal_handler.cc 2010-03-26 21:36:11 +0000
+++ plugin/signal_handler/signal_handler.cc 2010-04-19 20:33:26 +0000
@@ -23,6 +23,7 @@
23#include "drizzled/internal/my_pthread.h"23#include "drizzled/internal/my_pthread.h"
24#include "drizzled/internal/my_sys.h"24#include "drizzled/internal/my_sys.h"
25#include "drizzled/plugin/daemon.h"25#include "drizzled/plugin/daemon.h"
26#include "drizzled/signal_handler.h"
2627
27#include <sys/stat.h>28#include <sys/stat.h>
28#include <fcntl.h>29#include <fcntl.h>
@@ -67,7 +68,7 @@
67 kill_in_progress=true;68 kill_in_progress=true;
68 abort_loop=1; // This should be set69 abort_loop=1; // This should be set
69 if (sig != 0) // 0 is not a valid signal number70 if (sig != 0) // 0 is not a valid signal number
70 my_sigset(sig, SIG_IGN); /* purify inspected */71 ignore_signal(sig); /* purify inspected */
71 if (sig == SIGTERM || sig == 0)72 if (sig == SIGTERM || sig == 0)
72 errmsg_printf(ERRMSG_LVL_INFO, _(ER(ER_NORMAL_SHUTDOWN)),internal::my_progname);73 errmsg_printf(ERRMSG_LVL_INFO, _(ER(ER_NORMAL_SHUTDOWN)),internal::my_progname);
73 else74 else
7475
=== modified file 'support-files/drizzle.spec.in'
--- support-files/drizzle.spec.in 2010-03-30 09:29:02 +0000
+++ support-files/drizzle.spec.in 2010-04-19 20:33:26 +0000
@@ -479,6 +479,12 @@
479%{_includedir}/drizzled/version.h479%{_includedir}/drizzled/version.h
480%{_includedir}/drizzled/visibility.h480%{_includedir}/drizzled/visibility.h
481%{_includedir}/drizzled/xid.h481%{_includedir}/drizzled/xid.h
482%{_libdir}/libdrizzled.la
483%{_libdir}/libdrizzled.so
484%{_libdir}/libdrizzled.so.*
485%{_libdir}/libdrizzledmessage.la
486%{_libdir}/libdrizzledmessage.so
487%{_libdir}/libdrizzledmessage.so.*
482%{_libdir}/drizzle/libarchive_plugin.la488%{_libdir}/drizzle/libarchive_plugin.la
483%{_libdir}/drizzle/libarchive_plugin.so489%{_libdir}/drizzle/libarchive_plugin.so
484%{_libdir}/drizzle/libascii_plugin.la490%{_libdir}/drizzle/libascii_plugin.la
485491
=== modified file 'tests/test-run.pl'
--- tests/test-run.pl 2010-03-31 18:10:36 +0000
+++ tests/test-run.pl 2010-04-19 20:33:26 +0000
@@ -3337,17 +3337,19 @@
3337 # write init file for mysqld3337 # write init file for mysqld
3338 mtr_tofile($gdb_init_file,3338 mtr_tofile($gdb_init_file,
3339 "set args $str\n" .3339 "set args $str\n" .
3340 "set breakpoint pending on\n" .
3340 "break drizzled::mysql_parse\n" .3341 "break drizzled::mysql_parse\n" .
3341 "commands 1\n" .3342 "commands 1\n" .
3342 "disable 1\n" .3343 "disable 1\n" .
3343 "end\n" .3344 "end\n" .
3345 "set breakpoint pending off\n" .
3344 "run");3346 "run");
3345 }3347 }
33463348
3347 if ( $opt_manual_gdb )3349 if ( $opt_manual_gdb )
3348 {3350 {
3349 print "\nTo start gdb for $type, type in another window:\n";3351 print "\nTo start gdb for $type, type in another window:\n";
3350 print "gdb -cd $glob_mysql_test_dir -x $gdb_init_file $$exe\n";3352 print "$glob_mysql_test_dir/../libtool --mode=execute gdb -cd $glob_mysql_test_dir -x $gdb_init_file $$exe\n";
33513353
3352 # Indicate the exe should not be started3354 # Indicate the exe should not be started
3353 $$exe= undef;3355 $$exe= undef;
33543356
=== modified file 'tests/valgrind.supp'
--- tests/valgrind.supp 2010-04-12 23:31:44 +0000
+++ tests/valgrind.supp 2010-04-19 20:33:26 +0000
@@ -964,6 +964,30 @@
964}964}
965965
966{966{
967 thr_local_hash static initialization
968 Memcheck:Leak
969 fun:malloc
970 fun:mem_heap_create_block
971 ...
972 fun:_ZL13innobase_initR14PluginRegistry
973 fun:_Z11plugin_initPiPPci
974 fun:_ZL22init_server_componentsv
975 fun:main
976}
977
978{
979 thr_local_hash static initialization
980 Memcheck:Leak
981 fun:malloc
982 fun:ut_malloc_low
983 ...
984 fun:_ZL13innobase_initR14PluginRegistry
985 fun:_Z11plugin_initPiPPci
986 fun:_ZL22init_server_componentsv
987 fun:main
988}
989
990{
967 InnoDB Garbage991 InnoDB Garbage
968 Memcheck:Value8992 Memcheck:Value8
969 ...993 ...