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

Proposed by Monty Taylor
Status: Superseded
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: 3631 lines (+1667/-960) (has conflicts)
41 files modified
Makefile.am (+3/-14)
config/lint-source.am (+1/-1)
config/pandora-plugin (+113/-55)
config/pandora_plugin_config.py (+33/-0)
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/pthread_globals.h (+1/-0)
drizzled/schema_identifier.cc (+1/-1)
drizzled/session.cc (+4/-5)
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/stacktrace.cc (+11/-2)
drizzled/stacktrace.h (+0/-4)
drizzled/table_identifier.cc (+1/-1)
extra/include.am (+1/-4)
m4/pandora_canonical.m4 (+1/-1)
m4/pandora_have_libgtest.m4 (+44/-0)
m4/pandora_have_libmemcached.m4 (+1/-1)
m4/pandora_have_sasl.m4 (+133/-0)
m4/pandora_platform.m4 (+5/-0)
m4/pandora_warnings.m4 (+4/-0)
plugin/innobase/handler/ha_innodb.cc (+194/-0)
plugin/myisam/plugin.ini (+1/-1)
plugin/pbxt/src/myxt_xt.cc (+1/-1)
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/include.am (+2/-2)
tests/test-run.pl (+2/-0)
tests/valgrind.supp (+24/-0)
Text conflict in plugin/innobase/handler/ha_innodb.cc
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+22655@code.launchpad.net

This proposal supersedes a proposal from 2010-03-30.

This proposal has been superseded by a proposal from 2010-04-16.

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 :

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.

1477. By Monty Taylor

Merged up with build.

1478. By Monty Taylor

We need to launch drizzled via libtool now.

Unmerged revisions

Preview Diff

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