Merge lp:~jaypipes/drizzle/captain-20090915-01 into lp:~drizzle-trunk/drizzle/development
- captain-20090915-01
- Merge into development
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~jaypipes/drizzle/captain-20090915-01 |
Merge into: | lp:~drizzle-trunk/drizzle/development |
Diff against target: | None lines |
To merge this branch: | bzr merge lp:~jaypipes/drizzle/captain-20090915-01 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Brian Aker | Pending | ||
Review via email: mp+12163@code.launchpad.net |
This proposal supersedes a proposal from 2009-09-15.
Commit message
Description of the change
Jay Pipes (jaypipes) wrote : Posted in a previous version of this proposal | # |
Brian Aker (brianaker) wrote : Posted in a previous version of this proposal | # |
A few things:
742 + res= (error >= 0 || session-
743 + DRIZZLE_
On non-dtrace systems this causes an evaluation/assign that will never be used (combine the statement) (once in the code res was the right thing to do, once it was not).
DRIZZLE_
Awesome fixes on all of the conversion work.
I can just fix this stuff BTW (working with someone right now on code reviews).
Jay Pipes (jaypipes) wrote : Posted in a previous version of this proposal | # |
Brian Aker wrote:
> Review: Needs Fixing
> A few things:
> 742 + res= (error >= 0 || session-
> 743 + DRIZZLE_
>
> On non-dtrace systems this causes an evaluation/assign that will never be used (combine the statement) (once in the code res was the right thing to do, once it was not).
>
> DRIZZLE_
Hmmm...agreed. Nice catch. Padraig, can you try using a
const_cast<const char *>(session->db) for both DRIZZLE_
DRIZZLE_
> Awesome fixes on all of the conversion work.
>
> I can just fix this stuff BTW (working with someone right now on code reviews).
I'd prefer if Padraig pushed a fix to his branch and we merge in from there.
Thanks!
Jay
Padraig O'Sullivan (posulliv) wrote : Posted in a previous version of this proposal | # |
> I'd prefer if Padraig pushed a fix to his branch and we merge in from there.
Ok, I made these changes and pushed them to my branch. I'll re-submit the merge proposal now.
Thanks for the comments!
Padraig
>
> Thanks!
>
> Jay
Jay Pipes (jaypipes) wrote : | # |
Adds the fix from Padraig/Trond that you requested on the DTrace Probe branch. All tests passing on all 64-bit platforms, Brian. :)
Cheers,
Jay
Preview Diff
1 | === modified file 'drizzled/Makefile.am' | |||
2 | --- drizzled/Makefile.am 2009-09-16 21:55:09 +0000 | |||
3 | +++ drizzled/Makefile.am 2009-09-21 14:34:41 +0000 | |||
4 | @@ -18,10 +18,16 @@ | |||
5 | 18 | 18 | ||
6 | 19 | DTRACEFILES = handler.o \ | 19 | DTRACEFILES = handler.o \ |
7 | 20 | filesort.o \ | 20 | filesort.o \ |
8 | 21 | drizzled.o \ | ||
9 | 22 | session.o \ | ||
10 | 21 | sql_delete.o \ | 23 | sql_delete.o \ |
11 | 22 | sql_insert.o \ | 24 | sql_insert.o \ |
12 | 23 | sql_select.o \ | 25 | sql_select.o \ |
14 | 24 | sql_update.o | 26 | sql_update.o \ |
15 | 27 | sql_parse.o \ | ||
16 | 28 | statement/delete.o \ | ||
17 | 29 | statement/insert.o \ | ||
18 | 30 | statement/insert_select.o | ||
19 | 25 | 31 | ||
20 | 26 | drizzledincludedir = ${includedir}/drizzled | 32 | drizzledincludedir = ${includedir}/drizzled |
21 | 27 | nobase_dist_drizzledinclude_HEADERS = \ | 33 | nobase_dist_drizzledinclude_HEADERS = \ |
22 | @@ -695,10 +701,6 @@ | |||
23 | 695 | util/convert.cc \ | 701 | util/convert.cc \ |
24 | 696 | xid.cc | 702 | xid.cc |
25 | 697 | 703 | ||
26 | 698 | if HAVE_DTRACE | ||
27 | 699 | drizzled_SOURCES += probes.d | ||
28 | 700 | endif | ||
29 | 701 | |||
30 | 702 | libserialutil_la_SOURCES = db.cc table_proto_write.cc | 704 | libserialutil_la_SOURCES = db.cc table_proto_write.cc |
31 | 703 | libserialutil_la_CXXFLAGS= ${AM_CXXFLAGS} ${PROTOSKIP_WARNINGS} | 705 | libserialutil_la_CXXFLAGS= ${AM_CXXFLAGS} ${PROTOSKIP_WARNINGS} |
32 | 704 | 706 | ||
33 | @@ -726,7 +728,7 @@ | |||
34 | 726 | BUILT_SOURCES = $(BUILT_MAINT_SRC) \ | 728 | BUILT_SOURCES = $(BUILT_MAINT_SRC) \ |
35 | 727 | symbol_hash.h \ | 729 | symbol_hash.h \ |
36 | 728 | function_hash.h \ | 730 | function_hash.h \ |
38 | 729 | $(PCHHEADERS) | 731 | $(PCHHEADERS) |
39 | 730 | 732 | ||
40 | 731 | EXTRA_DIST = \ | 733 | EXTRA_DIST = \ |
41 | 732 | $(BUILT_MAINT_SRC) \ | 734 | $(BUILT_MAINT_SRC) \ |
42 | @@ -745,16 +747,29 @@ | |||
43 | 745 | $(PCHHEADERS) \ | 747 | $(PCHHEADERS) \ |
44 | 746 | $(nodist_drizzled_SOURCES) | 748 | $(nodist_drizzled_SOURCES) |
45 | 747 | 749 | ||
46 | 750 | if DTRACE_NEEDS_OBJECTS | ||
47 | 751 | drizzled_SOURCES += probes.d | ||
48 | 752 | endif | ||
49 | 753 | |||
50 | 754 | if HAVE_DTRACE | ||
51 | 755 | BUILT_SOURCES += generated_probes.h | ||
52 | 756 | CLEANFILES += generated_probes.h | ||
53 | 757 | endif | ||
54 | 758 | |||
55 | 759 | |||
56 | 748 | DISTCLEANFILES = $(EXTRA_PROGRAMS) \ | 760 | DISTCLEANFILES = $(EXTRA_PROGRAMS) \ |
57 | 749 | $(BUILT_MAINT_SRC) | 761 | $(BUILT_MAINT_SRC) |
58 | 750 | 762 | ||
59 | 751 | MAINTAINERCLEANFILES = $(BUILT_MAINT_SRC) | 763 | MAINTAINERCLEANFILES = $(BUILT_MAINT_SRC) |
60 | 752 | 764 | ||
66 | 753 | probes.h: probes.d | 765 | generated_probes.h : probes.d |
67 | 754 | $(DTRACE) $(DTRACEFLAGS) -h -s probes.d | 766 | $(DTRACE) $(DTRACEFLAGS) -h -s probes.d -o generated_probes.h |
68 | 755 | mv probes.h probes.h.bak | 767 | mv generated_probes.h generated_probes.h.bak |
69 | 756 | sed "s/#include <unistd.h>//g" probes.h.bak > probes.h | 768 | sed "s/#include <unistd.h>//g" generated_probes.h.bak > generated_probes.h |
70 | 757 | rm probes.h.bak | 769 | rm generated_probes.h.bak |
71 | 770 | sed -e 's,void \*,const void \*,g' generated_probes.h | \ | ||
72 | 771 | sed -e 's,char \*,const char \*,g' | tr '\t' ' ' > dtrace_probes.tmp | ||
73 | 772 | mv dtrace_probes.tmp generated_probes.h | ||
74 | 758 | 773 | ||
75 | 759 | 774 | ||
76 | 760 | SUFFIXES = .d .gch .gperf .stamp-h | 775 | SUFFIXES = .d .gch .gperf .stamp-h |
77 | 761 | 776 | ||
78 | === modified file 'drizzled/drizzled.cc' | |||
79 | --- drizzled/drizzled.cc 2009-09-15 17:23:06 +0000 | |||
80 | +++ drizzled/drizzled.cc 2009-09-21 14:34:41 +0000 | |||
81 | @@ -44,6 +44,7 @@ | |||
82 | 44 | #include <drizzled/scheduling.h> | 44 | #include <drizzled/scheduling.h> |
83 | 45 | #include "drizzled/temporal_format.h" /* For init_temporal_formats() */ | 45 | #include "drizzled/temporal_format.h" /* For init_temporal_formats() */ |
84 | 46 | #include "drizzled/slot/listen.h" | 46 | #include "drizzled/slot/listen.h" |
85 | 47 | #include "drizzled/probes.h" | ||
86 | 47 | 48 | ||
87 | 48 | #include <google/protobuf/stubs/common.h> | 49 | #include <google/protobuf/stubs/common.h> |
88 | 49 | 50 | ||
89 | @@ -455,6 +456,7 @@ | |||
90 | 455 | tmp= *it; | 456 | tmp= *it; |
91 | 456 | tmp->killed= Session::KILL_CONNECTION; | 457 | tmp->killed= Session::KILL_CONNECTION; |
92 | 457 | tmp->scheduler->killSession(tmp); | 458 | tmp->scheduler->killSession(tmp); |
93 | 459 | DRIZZLE_CONNECTION_DONE(tmp->thread_id); | ||
94 | 458 | if (tmp->mysys_var) | 460 | if (tmp->mysys_var) |
95 | 459 | { | 461 | { |
96 | 460 | tmp->mysys_var->abort=1; | 462 | tmp->mysys_var->abort=1; |
97 | @@ -765,6 +767,7 @@ | |||
98 | 765 | { | 767 | { |
99 | 766 | statistic_increment(killed_threads, &LOCK_status); | 768 | statistic_increment(killed_threads, &LOCK_status); |
100 | 767 | session->scheduler->killSessionNow(session); | 769 | session->scheduler->killSessionNow(session); |
101 | 770 | DRIZZLE_CONNECTION_DONE(session->thread_id); | ||
102 | 768 | } | 771 | } |
103 | 769 | return; | 772 | return; |
104 | 770 | } | 773 | } |
105 | 771 | 774 | ||
106 | === modified file 'drizzled/filesort.cc' | |||
107 | --- drizzled/filesort.cc 2009-08-20 20:29:18 +0000 | |||
108 | +++ drizzled/filesort.cc 2009-09-13 01:09:19 +0000 | |||
109 | @@ -114,7 +114,7 @@ | |||
110 | 114 | TableList *tab= table->pos_in_table_list; | 114 | TableList *tab= table->pos_in_table_list; |
111 | 115 | Item_subselect *subselect= tab ? tab->containing_subselect() : 0; | 115 | Item_subselect *subselect= tab ? tab->containing_subselect() : 0; |
112 | 116 | 116 | ||
114 | 117 | DRIZZLE_FILESORT_START(); | 117 | DRIZZLE_FILESORT_START(table->s->db.str, table->s->table_name.str); |
115 | 118 | 118 | ||
116 | 119 | /* | 119 | /* |
117 | 120 | Release InnoDB's adaptive hash index latch (if holding) before | 120 | Release InnoDB's adaptive hash index latch (if holding) before |
118 | @@ -324,8 +324,8 @@ | |||
119 | 324 | (uint32_t) records, &LOCK_status); | 324 | (uint32_t) records, &LOCK_status); |
120 | 325 | *examined_rows= param.examined_rows; | 325 | *examined_rows= param.examined_rows; |
121 | 326 | memcpy(&table->sort, &table_sort, sizeof(filesort_info_st)); | 326 | memcpy(&table->sort, &table_sort, sizeof(filesort_info_st)); |
124 | 327 | DRIZZLE_FILESORT_END(); | 327 | DRIZZLE_FILESORT_DONE(error, records); |
125 | 328 | return(error ? HA_POS_ERROR : records); | 328 | return (error ? HA_POS_ERROR : records); |
126 | 329 | } /* filesort */ | 329 | } /* filesort */ |
127 | 330 | 330 | ||
128 | 331 | 331 | ||
129 | 332 | 332 | ||
130 | === modified file 'drizzled/handler.cc' | |||
131 | --- drizzled/handler.cc 2009-08-23 01:10:19 +0000 | |||
132 | +++ drizzled/handler.cc 2009-09-14 01:25:59 +0000 | |||
133 | @@ -2696,9 +2696,9 @@ | |||
134 | 2696 | We cache the table flags if the locking succeeded. Otherwise, we | 2696 | We cache the table flags if the locking succeeded. Otherwise, we |
135 | 2697 | keep them as they were when they were fetched in ha_open(). | 2697 | keep them as they were when they were fetched in ha_open(). |
136 | 2698 | */ | 2698 | */ |
137 | 2699 | DRIZZLE_EXTERNAL_LOCK(lock_type); | ||
138 | 2700 | 2699 | ||
139 | 2701 | int error= external_lock(session, lock_type); | 2700 | int error= external_lock(session, lock_type); |
140 | 2701 | |||
141 | 2702 | if (error == 0) | 2702 | if (error == 0) |
142 | 2703 | cached_table_flags= table_flags(); | 2703 | cached_table_flags= table_flags(); |
143 | 2704 | return error; | 2704 | return error; |
144 | @@ -2729,7 +2729,6 @@ | |||
145 | 2729 | int handler::ha_write_row(unsigned char *buf) | 2729 | int handler::ha_write_row(unsigned char *buf) |
146 | 2730 | { | 2730 | { |
147 | 2731 | int error; | 2731 | int error; |
148 | 2732 | DRIZZLE_INSERT_ROW_START(); | ||
149 | 2733 | 2732 | ||
150 | 2734 | /* | 2733 | /* |
151 | 2735 | * If we have a timestamp column, update it to the current time | 2734 | * If we have a timestamp column, update it to the current time |
152 | @@ -2743,12 +2742,13 @@ | |||
153 | 2743 | mark_trx_read_write(); | 2742 | mark_trx_read_write(); |
154 | 2744 | 2743 | ||
155 | 2745 | if (unlikely(error= write_row(buf))) | 2744 | if (unlikely(error= write_row(buf))) |
156 | 2745 | { | ||
157 | 2746 | return error; | 2746 | return error; |
158 | 2747 | } | ||
159 | 2747 | 2748 | ||
160 | 2748 | if (unlikely(log_row_for_replication(table, 0, buf))) | 2749 | if (unlikely(log_row_for_replication(table, 0, buf))) |
161 | 2749 | return HA_ERR_RBR_LOGGING_FAILED; /* purecov: inspected */ | 2750 | return HA_ERR_RBR_LOGGING_FAILED; /* purecov: inspected */ |
162 | 2750 | 2751 | ||
163 | 2751 | DRIZZLE_INSERT_ROW_END(); | ||
164 | 2752 | return 0; | 2752 | return 0; |
165 | 2753 | } | 2753 | } |
166 | 2754 | 2754 | ||
167 | @@ -2766,7 +2766,9 @@ | |||
168 | 2766 | mark_trx_read_write(); | 2766 | mark_trx_read_write(); |
169 | 2767 | 2767 | ||
170 | 2768 | if (unlikely(error= update_row(old_data, new_data))) | 2768 | if (unlikely(error= update_row(old_data, new_data))) |
171 | 2769 | { | ||
172 | 2769 | return error; | 2770 | return error; |
173 | 2771 | } | ||
174 | 2770 | 2772 | ||
175 | 2771 | if (unlikely(log_row_for_replication(table, old_data, new_data))) | 2773 | if (unlikely(log_row_for_replication(table, old_data, new_data))) |
176 | 2772 | return HA_ERR_RBR_LOGGING_FAILED; | 2774 | return HA_ERR_RBR_LOGGING_FAILED; |
177 | 2773 | 2775 | ||
178 | === modified file 'drizzled/probes.d' | |||
179 | --- drizzled/probes.d 2008-11-01 00:46:20 +0000 | |||
180 | +++ drizzled/probes.d 2009-09-14 20:44:27 +0000 | |||
181 | @@ -1,7 +1,7 @@ | |||
182 | 1 | /* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*- | 1 | /* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*- |
183 | 2 | * vim:expandtab:shiftwidth=2:tabstop=2:smarttab: | 2 | * vim:expandtab:shiftwidth=2:tabstop=2:smarttab: |
184 | 3 | * | 3 | * |
186 | 4 | * Copyright (C) 2008 Sun Microsystems | 4 | * Copyright (C) 2009 Sun Microsystems |
187 | 5 | * | 5 | * |
188 | 6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
189 | 7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
190 | @@ -17,18 +17,107 @@ | |||
191 | 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
192 | 18 | */ | 18 | */ |
193 | 19 | 19 | ||
194 | 20 | /* | ||
195 | 21 | The actual probe names in DTrace scripts will replace '__' by '-'. Thus | ||
196 | 22 | insert__row__start will be insert-row-start. | ||
197 | 23 | |||
198 | 24 | Recommendations for adding new probes: | ||
199 | 25 | |||
200 | 26 | - each probe should have the minimal set of arguments required to | ||
201 | 27 | unambiguously identify the context in which the probe fires. Redundant | ||
202 | 28 | probes (i.e. the ones that can be obtained in user scripts from previous | ||
203 | 29 | probes' arguments or otherwise) may be added for convenience. | ||
204 | 30 | |||
205 | 31 | - try to avoid computationally expensive probe arguments. If impossible, | ||
206 | 32 | use *_ENABLED() macros to check if the probe is activated before | ||
207 | 33 | performing expensive calculations for a probe argument. | ||
208 | 34 | |||
209 | 35 | - all *-done probes should have a status argument wherever applicable to make | ||
210 | 36 | it possible for user scripts to figure out whether the completed operation | ||
211 | 37 | was successful or not. | ||
212 | 38 | |||
213 | 39 | - for all status arguments, a non-zero value should be returned on error or | ||
214 | 40 | failure, 0 should be returned on success. | ||
215 | 41 | */ | ||
216 | 42 | |||
217 | 20 | provider drizzle { | 43 | provider drizzle { |
231 | 21 | probe external_lock(int); | 44 | |
232 | 22 | probe insert_row_start(); | 45 | /* The following ones fire when creating or closing a client connection */ |
233 | 23 | probe insert_row_end(); | 46 | probe connection__start(unsigned long conn_id); |
234 | 24 | probe filesort_start(); | 47 | probe connection__done(unsigned long conn_id); |
235 | 25 | probe filesort_end(); | 48 | |
236 | 26 | probe delete_start(); | 49 | /* |
237 | 27 | probe delete_end(); | 50 | * Fire at the start/end of any client command processing (including SQL |
238 | 28 | probe insert_start(); | 51 | * queries). |
239 | 29 | probe insert_end(); | 52 | */ |
240 | 30 | probe select_start(); | 53 | probe command__start(unsigned long conn_id, int command); |
241 | 31 | probe select_end(); | 54 | probe command__done(int status); |
242 | 32 | probe update_start(); | 55 | |
243 | 33 | probe update_end(); | 56 | /* |
244 | 57 | * The following probes fire at the start/end of any SQL query processing, | ||
245 | 58 | * respectively. | ||
246 | 59 | * | ||
247 | 60 | * query_start() has a lot of parameters that can be used to pick up | ||
248 | 61 | * parameters for a lot of other probes here. For simplicity reasons we also | ||
249 | 62 | * add the query string to most other DTrace probes as well. Hostname is | ||
250 | 63 | * either the hostname or the IP address of the Drizzle client. | ||
251 | 64 | */ | ||
252 | 65 | probe query__start(const char *query, | ||
253 | 66 | unsigned long conn_id, | ||
254 | 67 | const char *db_name); | ||
255 | 68 | probe query__done(int status); | ||
256 | 69 | |||
257 | 70 | /* Fire at the start/end of SQL query parsing */ | ||
258 | 71 | probe query__parse__start(const char *query); | ||
259 | 72 | probe query__parse__done(int status); | ||
260 | 73 | |||
261 | 74 | /* | ||
262 | 75 | * This probe fires when the actual query execution starts | ||
263 | 76 | */ | ||
264 | 77 | probe query__exec__start(const char *query, | ||
265 | 78 | unsigned long connid, | ||
266 | 79 | const char *db_name); | ||
267 | 80 | probe query__exec__done(int status); | ||
268 | 81 | |||
269 | 82 | /* These probes fire when performing write operations towards any handler */ | ||
270 | 83 | probe insert__row__start(const char *db, const char *table); | ||
271 | 84 | probe insert__row__done(int status); | ||
272 | 85 | probe update__row__start(const char *db, const char *table); | ||
273 | 86 | probe update__row__done(int status); | ||
274 | 87 | probe delete__row__start(const char *db, const char *table); | ||
275 | 88 | probe delete__row__done(int status); | ||
276 | 89 | |||
277 | 90 | /* | ||
278 | 91 | * These probes fire when calling external_lock for any handler | ||
279 | 92 | * depending on the lock type being acquired or released. | ||
280 | 93 | */ | ||
281 | 94 | probe handler__rdlock__start(const char *db, const char *table); | ||
282 | 95 | probe handler__wrlock__start(const char *db, const char *table); | ||
283 | 96 | probe handler__unlock__start(const char *db, const char *table); | ||
284 | 97 | probe handler__rdlock__done(int status); | ||
285 | 98 | probe handler__wrlock__done(int status); | ||
286 | 99 | probe handler__unlock__done(int status); | ||
287 | 100 | |||
288 | 101 | /* | ||
289 | 102 | * These probes fire when a filesort activity happens in a query. | ||
290 | 103 | */ | ||
291 | 104 | probe filesort__start(const char *db, const char *table); | ||
292 | 105 | probe filesort__done(int status, unsigned long rows); | ||
293 | 106 | /* | ||
294 | 107 | * The query types SELECT, INSERT, INSERT AS SELECT, UPDATE, DELETE | ||
295 | 108 | * are all probed. | ||
296 | 109 | * The start probe always contains the query text. | ||
297 | 110 | */ | ||
298 | 111 | probe select__start(const char *query); | ||
299 | 112 | probe select__done(int status, unsigned long rows); | ||
300 | 113 | probe insert__start(const char *query); | ||
301 | 114 | probe insert__done(int status, unsigned long rows); | ||
302 | 115 | probe insert__select__start(const char *query); | ||
303 | 116 | probe insert__select__done(int status, unsigned long rows); | ||
304 | 117 | probe update__start(const char *query); | ||
305 | 118 | probe update__done(int status, | ||
306 | 119 | unsigned long rowsmatches, unsigned long rowschanged); | ||
307 | 120 | probe delete__start(const char *query); | ||
308 | 121 | probe delete__done(int status, unsigned long rows); | ||
309 | 122 | |||
310 | 34 | }; | 123 | }; |
311 | 35 | 124 | ||
312 | === added file 'drizzled/probes.h' | |||
313 | --- drizzled/probes.h 1970-01-01 00:00:00 +0000 | |||
314 | +++ drizzled/probes.h 2009-09-14 20:12:21 +0000 | |||
315 | @@ -0,0 +1,97 @@ | |||
316 | 1 | /* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*- | ||
317 | 2 | * vim:expandtab:shiftwidth=2:tabstop=2:smarttab: | ||
318 | 3 | * | ||
319 | 4 | * Copyright (C) 2009 Sun Microsystems | ||
320 | 5 | * | ||
321 | 6 | * This program is free software; you can redistribute it and/or modify | ||
322 | 7 | * it under the terms of the GNU General Public License as published by | ||
323 | 8 | * the Free Software Foundation; either version 2 of the License, or | ||
324 | 9 | * (at your option) any later version. | ||
325 | 10 | * | ||
326 | 11 | * This program is distributed in the hope that it will be useful, | ||
327 | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
328 | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
329 | 14 | * GNU General Public License for more details. | ||
330 | 15 | * | ||
331 | 16 | * You should have received a copy of the GNU General Public License | ||
332 | 17 | * along with this program; if not, write to the Free Software | ||
333 | 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
334 | 19 | */ | ||
335 | 20 | |||
336 | 21 | #ifndef DRIZZLED_PROBES_H | ||
337 | 22 | #define DRIZZLED_PROBES_H | ||
338 | 23 | |||
339 | 24 | #ifdef HAVE_DTRACE | ||
340 | 25 | #include "drizzled/generated_probes.h" | ||
341 | 26 | #else | ||
342 | 27 | #define DRIZZLE_COMMAND_DONE(arg0) | ||
343 | 28 | #define DRIZZLE_COMMAND_DONE_ENABLED() (0) | ||
344 | 29 | #define DRIZZLE_COMMAND_START(arg0, arg1) | ||
345 | 30 | #define DRIZZLE_COMMAND_START_ENABLED() (0) | ||
346 | 31 | #define DRIZZLE_CONNECTION_DONE(arg0) | ||
347 | 32 | #define DRIZZLE_CONNECTION_DONE_ENABLED() (0) | ||
348 | 33 | #define DRIZZLE_CONNECTION_START(arg0) | ||
349 | 34 | #define DRIZZLE_CONNECTION_START_ENABLED() (0) | ||
350 | 35 | #define DRIZZLE_DELETE_DONE(arg0, arg1) | ||
351 | 36 | #define DRIZZLE_DELETE_DONE_ENABLED() (0) | ||
352 | 37 | #define DRIZZLE_DELETE_ROW_DONE(arg0) | ||
353 | 38 | #define DRIZZLE_DELETE_ROW_DONE_ENABLED() (0) | ||
354 | 39 | #define DRIZZLE_DELETE_ROW_START(arg0, arg1) | ||
355 | 40 | #define DRIZZLE_DELETE_ROW_START_ENABLED() (0) | ||
356 | 41 | #define DRIZZLE_DELETE_START(arg0) | ||
357 | 42 | #define DRIZZLE_DELETE_START_ENABLED() (0) | ||
358 | 43 | #define DRIZZLE_FILESORT_DONE(arg0, arg1) | ||
359 | 44 | #define DRIZZLE_FILESORT_DONE_ENABLED() (0) | ||
360 | 45 | #define DRIZZLE_FILESORT_START(arg0, arg1) | ||
361 | 46 | #define DRIZZLE_FILESORT_START_ENABLED() (0) | ||
362 | 47 | #define DRIZZLE_HANDLER_RDLOCK_DONE(arg0) | ||
363 | 48 | #define DRIZZLE_HANDLER_RDLOCK_DONE_ENABLED() (0) | ||
364 | 49 | #define DRIZZLE_HANDLER_RDLOCK_START(arg0, arg1) | ||
365 | 50 | #define DRIZZLE_HANDLER_RDLOCK_START_ENABLED() (0) | ||
366 | 51 | #define DRIZZLE_HANDLER_UNLOCK_DONE(arg0) | ||
367 | 52 | #define DRIZZLE_HANDLER_UNLOCK_DONE_ENABLED() (0) | ||
368 | 53 | #define DRIZZLE_HANDLER_UNLOCK_START(arg0, arg1) | ||
369 | 54 | #define DRIZZLE_HANDLER_UNLOCK_START_ENABLED() (0) | ||
370 | 55 | #define DRIZZLE_HANDLER_WRLOCK_DONE(arg0) | ||
371 | 56 | #define DRIZZLE_HANDLER_WRLOCK_DONE_ENABLED() (0) | ||
372 | 57 | #define DRIZZLE_HANDLER_WRLOCK_START(arg0, arg1) | ||
373 | 58 | #define DRIZZLE_HANDLER_WRLOCK_START_ENABLED() (0) | ||
374 | 59 | #define DRIZZLE_INSERT_DONE(arg0, arg1) | ||
375 | 60 | #define DRIZZLE_INSERT_DONE_ENABLED() (0) | ||
376 | 61 | #define DRIZZLE_INSERT_ROW_DONE(arg0) | ||
377 | 62 | #define DRIZZLE_INSERT_ROW_DONE_ENABLED() (0) | ||
378 | 63 | #define DRIZZLE_INSERT_ROW_START(arg0, arg1) | ||
379 | 64 | #define DRIZZLE_INSERT_ROW_START_ENABLED() (0) | ||
380 | 65 | #define DRIZZLE_INSERT_SELECT_DONE(arg0, arg1) | ||
381 | 66 | #define DRIZZLE_INSERT_SELECT_DONE_ENABLED() (0) | ||
382 | 67 | #define DRIZZLE_INSERT_SELECT_START(arg0) | ||
383 | 68 | #define DRIZZLE_INSERT_SELECT_START_ENABLED() (0) | ||
384 | 69 | #define DRIZZLE_INSERT_START(arg0) | ||
385 | 70 | #define DRIZZLE_INSERT_START_ENABLED() (0) | ||
386 | 71 | #define DRIZZLE_QUERY_DONE(arg0) | ||
387 | 72 | #define DRIZZLE_QUERY_DONE_ENABLED() (0) | ||
388 | 73 | #define DRIZZLE_QUERY_EXEC_DONE(arg0) | ||
389 | 74 | #define DRIZZLE_QUERY_EXEC_DONE_ENABLED() (0) | ||
390 | 75 | #define DRIZZLE_QUERY_EXEC_START(arg0, arg1, arg2) | ||
391 | 76 | #define DRIZZLE_QUERY_EXEC_START_ENABLED() (0) | ||
392 | 77 | #define DRIZZLE_QUERY_PARSE_DONE(arg0) | ||
393 | 78 | #define DRIZZLE_QUERY_PARSE_DONE_ENABLED() (0) | ||
394 | 79 | #define DRIZZLE_QUERY_PARSE_START(arg0) | ||
395 | 80 | #define DRIZZLE_QUERY_PARSE_START_ENABLED() (0) | ||
396 | 81 | #define DRIZZLE_QUERY_START(arg0, arg1, arg2) | ||
397 | 82 | #define DRIZZLE_QUERY_START_ENABLED() (0) | ||
398 | 83 | #define DRIZZLE_SELECT_DONE(arg0, arg1) | ||
399 | 84 | #define DRIZZLE_SELECT_DONE_ENABLED() (0) | ||
400 | 85 | #define DRIZZLE_SELECT_START(arg0) | ||
401 | 86 | #define DRIZZLE_SELECT_START_ENABLED() (0) | ||
402 | 87 | #define DRIZZLE_UPDATE_DONE(arg0, arg1, arg2) | ||
403 | 88 | #define DRIZZLE_UPDATE_DONE_ENABLED() (0) | ||
404 | 89 | #define DRIZZLE_UPDATE_ROW_DONE(arg0) | ||
405 | 90 | #define DRIZZLE_UPDATE_ROW_DONE_ENABLED() (0) | ||
406 | 91 | #define DRIZZLE_UPDATE_ROW_START(arg0, arg1) | ||
407 | 92 | #define DRIZZLE_UPDATE_ROW_START_ENABLED() (0) | ||
408 | 93 | #define DRIZZLE_UPDATE_START(arg0) | ||
409 | 94 | #define DRIZZLE_UPDATE_START_ENABLED() (0) | ||
410 | 95 | #endif | ||
411 | 96 | |||
412 | 97 | #endif /* DRIZZLED_PROBES_H */ | ||
413 | 0 | 98 | ||
414 | === removed file 'drizzled/probes.h' | |||
415 | --- drizzled/probes.h 2009-05-21 17:05:14 +0000 | |||
416 | +++ drizzled/probes.h 1970-01-01 00:00:00 +0000 | |||
417 | @@ -1,250 +0,0 @@ | |||
418 | 1 | /* | ||
419 | 2 | * Generated by dtrace(1M). | ||
420 | 3 | */ | ||
421 | 4 | |||
422 | 5 | #ifndef _PROBES_H | ||
423 | 6 | #define _PROBES_H | ||
424 | 7 | |||
425 | 8 | |||
426 | 9 | |||
427 | 10 | #ifdef __cplusplus | ||
428 | 11 | extern "C" { | ||
429 | 12 | #endif | ||
430 | 13 | |||
431 | 14 | #if _DTRACE_VERSION | ||
432 | 15 | |||
433 | 16 | #define DRIZZLE_DELETE_END() \ | ||
434 | 17 | __dtrace_drizzle___delete_end() | ||
435 | 18 | #ifndef __sparc | ||
436 | 19 | #define DRIZZLE_DELETE_END_ENABLED() \ | ||
437 | 20 | __dtraceenabled_drizzle___delete_end() | ||
438 | 21 | #else | ||
439 | 22 | #define DRIZZLE_DELETE_END_ENABLED() \ | ||
440 | 23 | __dtraceenabled_drizzle___delete_end(0) | ||
441 | 24 | #endif | ||
442 | 25 | #define DRIZZLE_DELETE_START() \ | ||
443 | 26 | __dtrace_drizzle___delete_start() | ||
444 | 27 | #ifndef __sparc | ||
445 | 28 | #define DRIZZLE_DELETE_START_ENABLED() \ | ||
446 | 29 | __dtraceenabled_drizzle___delete_start() | ||
447 | 30 | #else | ||
448 | 31 | #define DRIZZLE_DELETE_START_ENABLED() \ | ||
449 | 32 | __dtraceenabled_drizzle___delete_start(0) | ||
450 | 33 | #endif | ||
451 | 34 | #define DRIZZLE_EXTERNAL_LOCK(arg0) \ | ||
452 | 35 | __dtrace_drizzle___external_lock(arg0) | ||
453 | 36 | #ifndef __sparc | ||
454 | 37 | #define DRIZZLE_EXTERNAL_LOCK_ENABLED() \ | ||
455 | 38 | __dtraceenabled_drizzle___external_lock() | ||
456 | 39 | #else | ||
457 | 40 | #define DRIZZLE_EXTERNAL_LOCK_ENABLED() \ | ||
458 | 41 | __dtraceenabled_drizzle___external_lock(0) | ||
459 | 42 | #endif | ||
460 | 43 | #define DRIZZLE_FILESORT_END() \ | ||
461 | 44 | __dtrace_drizzle___filesort_end() | ||
462 | 45 | #ifndef __sparc | ||
463 | 46 | #define DRIZZLE_FILESORT_END_ENABLED() \ | ||
464 | 47 | __dtraceenabled_drizzle___filesort_end() | ||
465 | 48 | #else | ||
466 | 49 | #define DRIZZLE_FILESORT_END_ENABLED() \ | ||
467 | 50 | __dtraceenabled_drizzle___filesort_end(0) | ||
468 | 51 | #endif | ||
469 | 52 | #define DRIZZLE_FILESORT_START() \ | ||
470 | 53 | __dtrace_drizzle___filesort_start() | ||
471 | 54 | #ifndef __sparc | ||
472 | 55 | #define DRIZZLE_FILESORT_START_ENABLED() \ | ||
473 | 56 | __dtraceenabled_drizzle___filesort_start() | ||
474 | 57 | #else | ||
475 | 58 | #define DRIZZLE_FILESORT_START_ENABLED() \ | ||
476 | 59 | __dtraceenabled_drizzle___filesort_start(0) | ||
477 | 60 | #endif | ||
478 | 61 | #define DRIZZLE_INSERT_END() \ | ||
479 | 62 | __dtrace_drizzle___insert_end() | ||
480 | 63 | #ifndef __sparc | ||
481 | 64 | #define DRIZZLE_INSERT_END_ENABLED() \ | ||
482 | 65 | __dtraceenabled_drizzle___insert_end() | ||
483 | 66 | #else | ||
484 | 67 | #define DRIZZLE_INSERT_END_ENABLED() \ | ||
485 | 68 | __dtraceenabled_drizzle___insert_end(0) | ||
486 | 69 | #endif | ||
487 | 70 | #define DRIZZLE_INSERT_ROW_END() \ | ||
488 | 71 | __dtrace_drizzle___insert_row_end() | ||
489 | 72 | #ifndef __sparc | ||
490 | 73 | #define DRIZZLE_INSERT_ROW_END_ENABLED() \ | ||
491 | 74 | __dtraceenabled_drizzle___insert_row_end() | ||
492 | 75 | #else | ||
493 | 76 | #define DRIZZLE_INSERT_ROW_END_ENABLED() \ | ||
494 | 77 | __dtraceenabled_drizzle___insert_row_end(0) | ||
495 | 78 | #endif | ||
496 | 79 | #define DRIZZLE_INSERT_ROW_START() \ | ||
497 | 80 | __dtrace_drizzle___insert_row_start() | ||
498 | 81 | #ifndef __sparc | ||
499 | 82 | #define DRIZZLE_INSERT_ROW_START_ENABLED() \ | ||
500 | 83 | __dtraceenabled_drizzle___insert_row_start() | ||
501 | 84 | #else | ||
502 | 85 | #define DRIZZLE_INSERT_ROW_START_ENABLED() \ | ||
503 | 86 | __dtraceenabled_drizzle___insert_row_start(0) | ||
504 | 87 | #endif | ||
505 | 88 | #define DRIZZLE_INSERT_START() \ | ||
506 | 89 | __dtrace_drizzle___insert_start() | ||
507 | 90 | #ifndef __sparc | ||
508 | 91 | #define DRIZZLE_INSERT_START_ENABLED() \ | ||
509 | 92 | __dtraceenabled_drizzle___insert_start() | ||
510 | 93 | #else | ||
511 | 94 | #define DRIZZLE_INSERT_START_ENABLED() \ | ||
512 | 95 | __dtraceenabled_drizzle___insert_start(0) | ||
513 | 96 | #endif | ||
514 | 97 | #define DRIZZLE_SELECT_END() \ | ||
515 | 98 | __dtrace_drizzle___select_end() | ||
516 | 99 | #ifndef __sparc | ||
517 | 100 | #define DRIZZLE_SELECT_END_ENABLED() \ | ||
518 | 101 | __dtraceenabled_drizzle___select_end() | ||
519 | 102 | #else | ||
520 | 103 | #define DRIZZLE_SELECT_END_ENABLED() \ | ||
521 | 104 | __dtraceenabled_drizzle___select_end(0) | ||
522 | 105 | #endif | ||
523 | 106 | #define DRIZZLE_SELECT_START() \ | ||
524 | 107 | __dtrace_drizzle___select_start() | ||
525 | 108 | #ifndef __sparc | ||
526 | 109 | #define DRIZZLE_SELECT_START_ENABLED() \ | ||
527 | 110 | __dtraceenabled_drizzle___select_start() | ||
528 | 111 | #else | ||
529 | 112 | #define DRIZZLE_SELECT_START_ENABLED() \ | ||
530 | 113 | __dtraceenabled_drizzle___select_start(0) | ||
531 | 114 | #endif | ||
532 | 115 | #define DRIZZLE_UPDATE_END() \ | ||
533 | 116 | __dtrace_drizzle___update_end() | ||
534 | 117 | #ifndef __sparc | ||
535 | 118 | #define DRIZZLE_UPDATE_END_ENABLED() \ | ||
536 | 119 | __dtraceenabled_drizzle___update_end() | ||
537 | 120 | #else | ||
538 | 121 | #define DRIZZLE_UPDATE_END_ENABLED() \ | ||
539 | 122 | __dtraceenabled_drizzle___update_end(0) | ||
540 | 123 | #endif | ||
541 | 124 | #define DRIZZLE_UPDATE_START() \ | ||
542 | 125 | __dtrace_drizzle___update_start() | ||
543 | 126 | #ifndef __sparc | ||
544 | 127 | #define DRIZZLE_UPDATE_START_ENABLED() \ | ||
545 | 128 | __dtraceenabled_drizzle___update_start() | ||
546 | 129 | #else | ||
547 | 130 | #define DRIZZLE_UPDATE_START_ENABLED() \ | ||
548 | 131 | __dtraceenabled_drizzle___update_start(0) | ||
549 | 132 | #endif | ||
550 | 133 | |||
551 | 134 | |||
552 | 135 | extern void __dtrace_drizzle___delete_end(void); | ||
553 | 136 | #ifndef __sparc | ||
554 | 137 | extern int __dtraceenabled_drizzle___delete_end(void); | ||
555 | 138 | #else | ||
556 | 139 | extern int __dtraceenabled_drizzle___delete_end(long); | ||
557 | 140 | #endif | ||
558 | 141 | extern void __dtrace_drizzle___delete_start(void); | ||
559 | 142 | #ifndef __sparc | ||
560 | 143 | extern int __dtraceenabled_drizzle___delete_start(void); | ||
561 | 144 | #else | ||
562 | 145 | extern int __dtraceenabled_drizzle___delete_start(long); | ||
563 | 146 | #endif | ||
564 | 147 | extern void __dtrace_drizzle___external_lock(int); | ||
565 | 148 | #ifndef __sparc | ||
566 | 149 | extern int __dtraceenabled_drizzle___external_lock(void); | ||
567 | 150 | #else | ||
568 | 151 | extern int __dtraceenabled_drizzle___external_lock(long); | ||
569 | 152 | #endif | ||
570 | 153 | extern void __dtrace_drizzle___filesort_end(void); | ||
571 | 154 | #ifndef __sparc | ||
572 | 155 | extern int __dtraceenabled_drizzle___filesort_end(void); | ||
573 | 156 | #else | ||
574 | 157 | extern int __dtraceenabled_drizzle___filesort_end(long); | ||
575 | 158 | #endif | ||
576 | 159 | extern void __dtrace_drizzle___filesort_start(void); | ||
577 | 160 | #ifndef __sparc | ||
578 | 161 | extern int __dtraceenabled_drizzle___filesort_start(void); | ||
579 | 162 | #else | ||
580 | 163 | extern int __dtraceenabled_drizzle___filesort_start(long); | ||
581 | 164 | #endif | ||
582 | 165 | extern void __dtrace_drizzle___insert_end(void); | ||
583 | 166 | #ifndef __sparc | ||
584 | 167 | extern int __dtraceenabled_drizzle___insert_end(void); | ||
585 | 168 | #else | ||
586 | 169 | extern int __dtraceenabled_drizzle___insert_end(long); | ||
587 | 170 | #endif | ||
588 | 171 | extern void __dtrace_drizzle___insert_row_end(void); | ||
589 | 172 | #ifndef __sparc | ||
590 | 173 | extern int __dtraceenabled_drizzle___insert_row_end(void); | ||
591 | 174 | #else | ||
592 | 175 | extern int __dtraceenabled_drizzle___insert_row_end(long); | ||
593 | 176 | #endif | ||
594 | 177 | extern void __dtrace_drizzle___insert_row_start(void); | ||
595 | 178 | #ifndef __sparc | ||
596 | 179 | extern int __dtraceenabled_drizzle___insert_row_start(void); | ||
597 | 180 | #else | ||
598 | 181 | extern int __dtraceenabled_drizzle___insert_row_start(long); | ||
599 | 182 | #endif | ||
600 | 183 | extern void __dtrace_drizzle___insert_start(void); | ||
601 | 184 | #ifndef __sparc | ||
602 | 185 | extern int __dtraceenabled_drizzle___insert_start(void); | ||
603 | 186 | #else | ||
604 | 187 | extern int __dtraceenabled_drizzle___insert_start(long); | ||
605 | 188 | #endif | ||
606 | 189 | extern void __dtrace_drizzle___select_end(void); | ||
607 | 190 | #ifndef __sparc | ||
608 | 191 | extern int __dtraceenabled_drizzle___select_end(void); | ||
609 | 192 | #else | ||
610 | 193 | extern int __dtraceenabled_drizzle___select_end(long); | ||
611 | 194 | #endif | ||
612 | 195 | extern void __dtrace_drizzle___select_start(void); | ||
613 | 196 | #ifndef __sparc | ||
614 | 197 | extern int __dtraceenabled_drizzle___select_start(void); | ||
615 | 198 | #else | ||
616 | 199 | extern int __dtraceenabled_drizzle___select_start(long); | ||
617 | 200 | #endif | ||
618 | 201 | extern void __dtrace_drizzle___update_end(void); | ||
619 | 202 | #ifndef __sparc | ||
620 | 203 | extern int __dtraceenabled_drizzle___update_end(void); | ||
621 | 204 | #else | ||
622 | 205 | extern int __dtraceenabled_drizzle___update_end(long); | ||
623 | 206 | #endif | ||
624 | 207 | extern void __dtrace_drizzle___update_start(void); | ||
625 | 208 | #ifndef __sparc | ||
626 | 209 | extern int __dtraceenabled_drizzle___update_start(void); | ||
627 | 210 | #else | ||
628 | 211 | extern int __dtraceenabled_drizzle___update_start(long); | ||
629 | 212 | #endif | ||
630 | 213 | |||
631 | 214 | #else | ||
632 | 215 | |||
633 | 216 | #define DRIZZLE_DELETE_END() | ||
634 | 217 | #define DRIZZLE_DELETE_END_ENABLED() (0) | ||
635 | 218 | #define DRIZZLE_DELETE_START() | ||
636 | 219 | #define DRIZZLE_DELETE_START_ENABLED() (0) | ||
637 | 220 | #define DRIZZLE_EXTERNAL_LOCK(arg0) | ||
638 | 221 | #define DRIZZLE_EXTERNAL_LOCK_ENABLED() (0) | ||
639 | 222 | #define DRIZZLE_FILESORT_END() | ||
640 | 223 | #define DRIZZLE_FILESORT_END_ENABLED() (0) | ||
641 | 224 | #define DRIZZLE_FILESORT_START() | ||
642 | 225 | #define DRIZZLE_FILESORT_START_ENABLED() (0) | ||
643 | 226 | #define DRIZZLE_INSERT_END() | ||
644 | 227 | #define DRIZZLE_INSERT_END_ENABLED() (0) | ||
645 | 228 | #define DRIZZLE_INSERT_ROW_END() | ||
646 | 229 | #define DRIZZLE_INSERT_ROW_END_ENABLED() (0) | ||
647 | 230 | #define DRIZZLE_INSERT_ROW_START() | ||
648 | 231 | #define DRIZZLE_INSERT_ROW_START_ENABLED() (0) | ||
649 | 232 | #define DRIZZLE_INSERT_START() | ||
650 | 233 | #define DRIZZLE_INSERT_START_ENABLED() (0) | ||
651 | 234 | #define DRIZZLE_SELECT_END() | ||
652 | 235 | #define DRIZZLE_SELECT_END_ENABLED() (0) | ||
653 | 236 | #define DRIZZLE_SELECT_START() | ||
654 | 237 | #define DRIZZLE_SELECT_START_ENABLED() (0) | ||
655 | 238 | #define DRIZZLE_UPDATE_END() | ||
656 | 239 | #define DRIZZLE_UPDATE_END_ENABLED() (0) | ||
657 | 240 | #define DRIZZLE_UPDATE_START() | ||
658 | 241 | #define DRIZZLE_UPDATE_START_ENABLED() (0) | ||
659 | 242 | |||
660 | 243 | #endif | ||
661 | 244 | |||
662 | 245 | |||
663 | 246 | #ifdef __cplusplus | ||
664 | 247 | } | ||
665 | 248 | #endif | ||
666 | 249 | |||
667 | 250 | #endif /* _PROBES_H */ | ||
668 | 251 | 0 | ||
669 | === modified file 'drizzled/session.cc' | |||
670 | --- drizzled/session.cc 2009-09-15 21:35:52 +0000 | |||
671 | +++ drizzled/session.cc 2009-09-21 14:34:41 +0000 | |||
672 | @@ -37,6 +37,7 @@ | |||
673 | 37 | #include <drizzled/item/empty_string.h> | 37 | #include <drizzled/item/empty_string.h> |
674 | 38 | #include <drizzled/show.h> | 38 | #include <drizzled/show.h> |
675 | 39 | #include <drizzled/scheduling.h> | 39 | #include <drizzled/scheduling.h> |
676 | 40 | #include "drizzled/probes.h" | ||
677 | 40 | 41 | ||
678 | 41 | #include <algorithm> | 42 | #include <algorithm> |
679 | 42 | 43 | ||
680 | @@ -481,6 +482,7 @@ | |||
681 | 481 | if (state_to_set != Session::KILL_QUERY) | 482 | if (state_to_set != Session::KILL_QUERY) |
682 | 482 | { | 483 | { |
683 | 483 | scheduler->killSession(this); | 484 | scheduler->killSession(this); |
684 | 485 | DRIZZLE_CONNECTION_DONE(thread_id); | ||
685 | 484 | } | 486 | } |
686 | 485 | if (mysys_var) | 487 | if (mysys_var) |
687 | 486 | { | 488 | { |
688 | @@ -620,6 +622,7 @@ | |||
689 | 620 | 622 | ||
690 | 621 | if (scheduler->addSession(this)) | 623 | if (scheduler->addSession(this)) |
691 | 622 | { | 624 | { |
692 | 625 | DRIZZLE_CONNECTION_START(thread_id); | ||
693 | 623 | char error_message_buff[DRIZZLE_ERRMSG_SIZE]; | 626 | char error_message_buff[DRIZZLE_ERRMSG_SIZE]; |
694 | 624 | 627 | ||
695 | 625 | killed= Session::KILL_CONNECTION; | 628 | killed= Session::KILL_CONNECTION; |
696 | 626 | 629 | ||
697 | === modified file 'drizzled/sql_delete.cc' | |||
698 | --- drizzled/sql_delete.cc 2009-08-06 16:51:53 +0000 | |||
699 | +++ drizzled/sql_delete.cc 2009-09-17 00:08:20 +0000 | |||
700 | @@ -25,6 +25,7 @@ | |||
701 | 25 | #include <drizzled/sql_parse.h> | 25 | #include <drizzled/sql_parse.h> |
702 | 26 | #include <drizzled/sql_base.h> | 26 | #include <drizzled/sql_base.h> |
703 | 27 | #include <drizzled/lock.h> | 27 | #include <drizzled/lock.h> |
704 | 28 | #include "drizzled/probes.h" | ||
705 | 28 | 29 | ||
706 | 29 | /** | 30 | /** |
707 | 30 | Implement DELETE SQL word. | 31 | Implement DELETE SQL word. |
708 | @@ -51,9 +52,11 @@ | |||
709 | 51 | Select_Lex *select_lex= &session->lex->select_lex; | 52 | Select_Lex *select_lex= &session->lex->select_lex; |
710 | 52 | Session::killed_state killed_status= Session::NOT_KILLED; | 53 | Session::killed_state killed_status= Session::NOT_KILLED; |
711 | 53 | 54 | ||
712 | 54 | |||
713 | 55 | if (session->openTablesLock(table_list)) | 55 | if (session->openTablesLock(table_list)) |
714 | 56 | { | ||
715 | 57 | DRIZZLE_DELETE_DONE(1, 0); | ||
716 | 56 | return true; | 58 | return true; |
717 | 59 | } | ||
718 | 57 | 60 | ||
719 | 58 | table= table_list->table; | 61 | table= table_list->table; |
720 | 59 | assert(table); | 62 | assert(table); |
721 | @@ -162,14 +165,14 @@ | |||
722 | 162 | delete select; | 165 | delete select; |
723 | 163 | free_underlaid_joins(session, select_lex); | 166 | free_underlaid_joins(session, select_lex); |
724 | 164 | session->row_count_func= 0; | 167 | session->row_count_func= 0; |
726 | 165 | DRIZZLE_DELETE_END(); | 168 | DRIZZLE_DELETE_DONE(0, 0); |
727 | 166 | session->my_ok((ha_rows) session->row_count_func); | 169 | session->my_ok((ha_rows) session->row_count_func); |
728 | 167 | /* | 170 | /* |
729 | 168 | We don't need to call reset_auto_increment in this case, because | 171 | We don't need to call reset_auto_increment in this case, because |
730 | 169 | mysql_truncate always gives a NULL conds argument, hence we never | 172 | mysql_truncate always gives a NULL conds argument, hence we never |
731 | 170 | get here. | 173 | get here. |
732 | 171 | */ | 174 | */ |
734 | 172 | return(0); // Nothing to delete | 175 | return 0; // Nothing to delete |
735 | 173 | } | 176 | } |
736 | 174 | 177 | ||
737 | 175 | /* If running in safe sql mode, don't allow updates without keys */ | 178 | /* If running in safe sql mode, don't allow updates without keys */ |
738 | @@ -322,17 +325,17 @@ | |||
739 | 322 | assert(transactional_table || !deleted || session->transaction.stmt.modified_non_trans_table); | 325 | assert(transactional_table || !deleted || session->transaction.stmt.modified_non_trans_table); |
740 | 323 | free_underlaid_joins(session, select_lex); | 326 | free_underlaid_joins(session, select_lex); |
741 | 324 | 327 | ||
743 | 325 | DRIZZLE_DELETE_END(); | 328 | DRIZZLE_DELETE_DONE((error >= 0 || session->is_error()), deleted); |
744 | 326 | if (error < 0 || (session->lex->ignore && !session->is_fatal_error)) | 329 | if (error < 0 || (session->lex->ignore && !session->is_fatal_error)) |
745 | 327 | { | 330 | { |
746 | 328 | session->row_count_func= deleted; | 331 | session->row_count_func= deleted; |
747 | 329 | session->my_ok((ha_rows) session->row_count_func); | 332 | session->my_ok((ha_rows) session->row_count_func); |
748 | 330 | } | 333 | } |
750 | 331 | return(error >= 0 || session->is_error()); | 334 | return (error >= 0 || session->is_error()); |
751 | 332 | 335 | ||
752 | 333 | err: | 336 | err: |
755 | 334 | DRIZZLE_DELETE_END(); | 337 | DRIZZLE_DELETE_DONE(1, 0); |
756 | 335 | return(true); | 338 | return true; |
757 | 336 | } | 339 | } |
758 | 337 | 340 | ||
759 | 338 | 341 | ||
760 | 339 | 342 | ||
761 | === modified file 'drizzled/sql_insert.cc' | |||
762 | --- drizzled/sql_insert.cc 2009-09-15 21:01:42 +0000 | |||
763 | +++ drizzled/sql_insert.cc 2009-09-21 14:34:41 +0000 | |||
764 | @@ -240,7 +240,10 @@ | |||
765 | 240 | values_list.elements > 1); | 240 | values_list.elements > 1); |
766 | 241 | 241 | ||
767 | 242 | if (session->openTablesLock(table_list)) | 242 | if (session->openTablesLock(table_list)) |
768 | 243 | { | ||
769 | 244 | DRIZZLE_INSERT_DONE(1, 0); | ||
770 | 243 | return true; | 245 | return true; |
771 | 246 | } | ||
772 | 244 | 247 | ||
773 | 245 | lock_type= table_list->lock_type; | 248 | lock_type= table_list->lock_type; |
774 | 246 | 249 | ||
775 | @@ -466,8 +469,8 @@ | |||
776 | 466 | info.copied + info.deleted + info.touched, id, buff); | 469 | info.copied + info.deleted + info.touched, id, buff); |
777 | 467 | } | 470 | } |
778 | 468 | session->abort_on_warning= 0; | 471 | session->abort_on_warning= 0; |
781 | 469 | DRIZZLE_INSERT_END(); | 472 | DRIZZLE_INSERT_DONE(0, session->row_count_func); |
782 | 470 | return(false); | 473 | return false; |
783 | 471 | 474 | ||
784 | 472 | abort: | 475 | abort: |
785 | 473 | if (table != NULL) | 476 | if (table != NULL) |
786 | @@ -475,8 +478,8 @@ | |||
787 | 475 | if (!joins_freed) | 478 | if (!joins_freed) |
788 | 476 | free_underlaid_joins(session, &session->lex->select_lex); | 479 | free_underlaid_joins(session, &session->lex->select_lex); |
789 | 477 | session->abort_on_warning= 0; | 480 | session->abort_on_warning= 0; |
792 | 478 | DRIZZLE_INSERT_END(); | 481 | DRIZZLE_INSERT_DONE(1, 0); |
793 | 479 | return(true); | 482 | return true; |
794 | 480 | } | 483 | } |
795 | 481 | 484 | ||
796 | 482 | 485 | ||
797 | @@ -1336,7 +1339,8 @@ | |||
798 | 1336 | if (error) | 1339 | if (error) |
799 | 1337 | { | 1340 | { |
800 | 1338 | table->file->print_error(error,MYF(0)); | 1341 | table->file->print_error(error,MYF(0)); |
802 | 1339 | return(1); | 1342 | DRIZZLE_INSERT_SELECT_DONE(error, 0); |
803 | 1343 | return 1; | ||
804 | 1340 | } | 1344 | } |
805 | 1341 | char buff[160]; | 1345 | char buff[160]; |
806 | 1342 | if (info.ignore) | 1346 | if (info.ignore) |
807 | @@ -1354,7 +1358,8 @@ | |||
808 | 1354 | (info.copied ? autoinc_value_of_last_inserted_row : 0)); | 1358 | (info.copied ? autoinc_value_of_last_inserted_row : 0)); |
809 | 1355 | session->my_ok((ulong) session->row_count_func, | 1359 | session->my_ok((ulong) session->row_count_func, |
810 | 1356 | info.copied + info.deleted + info.touched, id, buff); | 1360 | info.copied + info.deleted + info.touched, id, buff); |
812 | 1357 | return(0); | 1361 | DRIZZLE_INSERT_SELECT_DONE(0, session->row_count_func); |
813 | 1362 | return 0; | ||
814 | 1358 | } | 1363 | } |
815 | 1359 | 1364 | ||
816 | 1360 | void select_insert::abort() { | 1365 | void select_insert::abort() { |
817 | @@ -1393,6 +1398,11 @@ | |||
818 | 1393 | table->file->ha_release_auto_increment(); | 1398 | table->file->ha_release_auto_increment(); |
819 | 1394 | } | 1399 | } |
820 | 1395 | 1400 | ||
821 | 1401 | if (DRIZZLE_INSERT_SELECT_DONE_ENABLED()) | ||
822 | 1402 | { | ||
823 | 1403 | DRIZZLE_INSERT_SELECT_DONE(0, info.copied + info.deleted + info.updated); | ||
824 | 1404 | } | ||
825 | 1405 | |||
826 | 1396 | return; | 1406 | return; |
827 | 1397 | } | 1407 | } |
828 | 1398 | 1408 | ||
829 | 1399 | 1409 | ||
830 | === modified file 'drizzled/sql_parse.cc' | |||
831 | --- drizzled/sql_parse.cc 2009-08-27 01:04:45 +0000 | |||
832 | +++ drizzled/sql_parse.cc 2009-09-17 00:08:20 +0000 | |||
833 | @@ -35,6 +35,7 @@ | |||
834 | 35 | #include <drizzled/lock.h> | 35 | #include <drizzled/lock.h> |
835 | 36 | #include <drizzled/select_send.h> | 36 | #include <drizzled/select_send.h> |
836 | 37 | #include <drizzled/statement.h> | 37 | #include <drizzled/statement.h> |
837 | 38 | #include "drizzled/probes.h" | ||
838 | 38 | 39 | ||
839 | 39 | #include <bitset> | 40 | #include <bitset> |
840 | 40 | #include <algorithm> | 41 | #include <algorithm> |
841 | @@ -166,7 +167,10 @@ | |||
842 | 166 | bool error= 0; | 167 | bool error= 0; |
843 | 167 | Query_id &query_id= Query_id::get_query_id(); | 168 | Query_id &query_id= Query_id::get_query_id(); |
844 | 168 | 169 | ||
846 | 169 | session->command=command; | 170 | DRIZZLE_COMMAND_START(session->thread_id, |
847 | 171 | command); | ||
848 | 172 | |||
849 | 173 | session->command= command; | ||
850 | 170 | session->lex->sql_command= SQLCOM_END; /* to avoid confusing VIEW detectors */ | 174 | session->lex->sql_command= SQLCOM_END; /* to avoid confusing VIEW detectors */ |
851 | 171 | session->set_time(); | 175 | session->set_time(); |
852 | 172 | session->query_id= query_id.value(); | 176 | session->query_id= query_id.value(); |
853 | @@ -204,6 +208,9 @@ | |||
854 | 204 | { | 208 | { |
855 | 205 | if (! session->readAndStoreQuery(packet, packet_length)) | 209 | if (! session->readAndStoreQuery(packet, packet_length)) |
856 | 206 | break; // fatal error is set | 210 | break; // fatal error is set |
857 | 211 | DRIZZLE_QUERY_START(session->query, | ||
858 | 212 | session->thread_id, | ||
859 | 213 | const_cast<const char *>(session->db ? session->db : "")); | ||
860 | 207 | const char* end_of_stmt= NULL; | 214 | const char* end_of_stmt= NULL; |
861 | 208 | 215 | ||
862 | 209 | mysql_parse(session, session->query, session->query_length, &end_of_stmt); | 216 | mysql_parse(session, session->query, session->query_length, &end_of_stmt); |
863 | @@ -295,15 +302,25 @@ | |||
864 | 295 | 302 | ||
865 | 296 | /* Store temp state for processlist */ | 303 | /* Store temp state for processlist */ |
866 | 297 | session->set_proc_info("cleaning up"); | 304 | session->set_proc_info("cleaning up"); |
868 | 298 | session->command=COM_SLEEP; | 305 | session->command= COM_SLEEP; |
869 | 299 | memset(session->process_list_info, 0, PROCESS_LIST_WIDTH); | 306 | memset(session->process_list_info, 0, PROCESS_LIST_WIDTH); |
872 | 300 | session->query=0; | 307 | session->query= 0; |
873 | 301 | session->query_length=0; | 308 | session->query_length= 0; |
874 | 302 | 309 | ||
875 | 303 | session->set_proc_info(NULL); | 310 | session->set_proc_info(NULL); |
876 | 304 | session->packet.shrink(session->variables.net_buffer_length); // Reclaim some memory | 311 | session->packet.shrink(session->variables.net_buffer_length); // Reclaim some memory |
877 | 305 | free_root(session->mem_root,MYF(MY_KEEP_PREALLOC)); | 312 | free_root(session->mem_root,MYF(MY_KEEP_PREALLOC)); |
879 | 306 | return(error); | 313 | |
880 | 314 | if (DRIZZLE_QUERY_DONE_ENABLED() || DRIZZLE_COMMAND_DONE_ENABLED()) | ||
881 | 315 | { | ||
882 | 316 | if (command == COM_QUERY) | ||
883 | 317 | { | ||
884 | 318 | DRIZZLE_QUERY_DONE(session->is_error()); | ||
885 | 319 | } | ||
886 | 320 | DRIZZLE_COMMAND_DONE(session->is_error()); | ||
887 | 321 | } | ||
888 | 322 | |||
889 | 323 | return error; | ||
890 | 307 | } | 324 | } |
891 | 308 | 325 | ||
892 | 309 | 326 | ||
893 | @@ -759,8 +776,12 @@ | |||
894 | 759 | if (*found_semicolon && | 776 | if (*found_semicolon && |
895 | 760 | (session->query_length= (ulong)(*found_semicolon - session->query))) | 777 | (session->query_length= (ulong)(*found_semicolon - session->query))) |
896 | 761 | session->query_length--; | 778 | session->query_length--; |
897 | 779 | DRIZZLE_QUERY_EXEC_START(session->query, | ||
898 | 780 | session->thread_id, | ||
899 | 781 | const_cast<const char *>(session->db ? session->db : "")); | ||
900 | 762 | /* Actually execute the query */ | 782 | /* Actually execute the query */ |
901 | 763 | mysql_execute_command(session); | 783 | mysql_execute_command(session); |
902 | 784 | DRIZZLE_QUERY_EXEC_DONE(0); | ||
903 | 764 | } | 785 | } |
904 | 765 | } | 786 | } |
905 | 766 | } | 787 | } |
906 | @@ -1819,6 +1840,8 @@ | |||
907 | 1819 | { | 1840 | { |
908 | 1820 | assert(session->m_lip == NULL); | 1841 | assert(session->m_lip == NULL); |
909 | 1821 | 1842 | ||
910 | 1843 | DRIZZLE_QUERY_PARSE_START(session->query); | ||
911 | 1844 | |||
912 | 1822 | /* Set Lex_input_stream. */ | 1845 | /* Set Lex_input_stream. */ |
913 | 1823 | 1846 | ||
914 | 1824 | session->m_lip= lip; | 1847 | session->m_lip= lip; |
915 | @@ -1835,6 +1858,8 @@ | |||
916 | 1835 | 1858 | ||
917 | 1836 | session->m_lip= NULL; | 1859 | session->m_lip= NULL; |
918 | 1837 | 1860 | ||
919 | 1861 | DRIZZLE_QUERY_PARSE_DONE(mysql_parse_status || session->is_fatal_error); | ||
920 | 1862 | |||
921 | 1838 | /* That's it. */ | 1863 | /* That's it. */ |
922 | 1839 | 1864 | ||
923 | 1840 | return mysql_parse_status || session->is_fatal_error; | 1865 | return mysql_parse_status || session->is_fatal_error; |
924 | 1841 | 1866 | ||
925 | === modified file 'drizzled/sql_select.cc' | |||
926 | --- drizzled/sql_select.cc 2009-09-16 20:58:28 +0000 | |||
927 | +++ drizzled/sql_select.cc 2009-09-21 14:34:41 +0000 | |||
928 | @@ -124,7 +124,7 @@ | |||
929 | 124 | { | 124 | { |
930 | 125 | bool res; | 125 | bool res; |
931 | 126 | register Select_Lex *select_lex= &lex->select_lex; | 126 | register Select_Lex *select_lex= &lex->select_lex; |
933 | 127 | DRIZZLE_SELECT_START(); | 127 | DRIZZLE_SELECT_START(session->query); |
934 | 128 | 128 | ||
935 | 129 | if (select_lex->master_unit()->is_union() || | 129 | if (select_lex->master_unit()->is_union() || |
936 | 130 | select_lex->master_unit()->fake_select_lex) | 130 | select_lex->master_unit()->fake_select_lex) |
937 | @@ -157,8 +157,8 @@ | |||
938 | 157 | if (unlikely(res)) | 157 | if (unlikely(res)) |
939 | 158 | result->abort(); | 158 | result->abort(); |
940 | 159 | 159 | ||
943 | 160 | DRIZZLE_SELECT_END(); | 160 | DRIZZLE_SELECT_DONE(res, session->limit_found_rows); |
944 | 161 | return(res); | 161 | return res; |
945 | 162 | } | 162 | } |
946 | 163 | 163 | ||
947 | 164 | /* | 164 | /* |
948 | 165 | 165 | ||
949 | === modified file 'drizzled/sql_update.cc' | |||
950 | --- drizzled/sql_update.cc 2009-08-20 20:29:18 +0000 | |||
951 | +++ drizzled/sql_update.cc 2009-09-17 00:08:20 +0000 | |||
952 | @@ -139,9 +139,12 @@ | |||
953 | 139 | List<Item> all_fields; | 139 | List<Item> all_fields; |
954 | 140 | Session::killed_state killed_status= Session::NOT_KILLED; | 140 | Session::killed_state killed_status= Session::NOT_KILLED; |
955 | 141 | 141 | ||
957 | 142 | DRIZZLE_UPDATE_START(); | 142 | DRIZZLE_UPDATE_START(session->query); |
958 | 143 | if (session->openTablesLock(table_list)) | 143 | if (session->openTablesLock(table_list)) |
959 | 144 | { | ||
960 | 145 | DRIZZLE_UPDATE_DONE(1, 0, 0); | ||
961 | 144 | return 1; | 146 | return 1; |
962 | 147 | } | ||
963 | 145 | 148 | ||
964 | 146 | session->set_proc_info("init"); | 149 | session->set_proc_info("init"); |
965 | 147 | table= table_list->table; | 150 | table= table_list->table; |
966 | @@ -179,8 +182,8 @@ | |||
967 | 179 | if (select_lex->inner_refs_list.elements && | 182 | if (select_lex->inner_refs_list.elements && |
968 | 180 | fix_inner_refs(session, all_fields, select_lex, select_lex->ref_pointer_array)) | 183 | fix_inner_refs(session, all_fields, select_lex, select_lex->ref_pointer_array)) |
969 | 181 | { | 184 | { |
972 | 182 | DRIZZLE_UPDATE_END(); | 185 | DRIZZLE_UPDATE_DONE(1, 0, 0); |
973 | 183 | return(-1); | 186 | return -1; |
974 | 184 | } | 187 | } |
975 | 185 | 188 | ||
976 | 186 | if (conds) | 189 | if (conds) |
977 | @@ -215,9 +218,9 @@ | |||
978 | 215 | free_underlaid_joins(session, select_lex); | 218 | free_underlaid_joins(session, select_lex); |
979 | 216 | if (error) | 219 | if (error) |
980 | 217 | goto abort; // Error in where | 220 | goto abort; // Error in where |
982 | 218 | DRIZZLE_UPDATE_END(); | 221 | DRIZZLE_UPDATE_DONE(0, 0, 0); |
983 | 219 | session->my_ok(); // No matching records | 222 | session->my_ok(); // No matching records |
985 | 220 | return(0); | 223 | return 0; |
986 | 221 | } | 224 | } |
987 | 222 | if (!select && limit != HA_POS_ERROR) | 225 | if (!select && limit != HA_POS_ERROR) |
988 | 223 | { | 226 | { |
989 | @@ -627,7 +630,6 @@ | |||
990 | 627 | id= session->arg_of_last_insert_id_function ? | 630 | id= session->arg_of_last_insert_id_function ? |
991 | 628 | session->first_successful_insert_id_in_prev_stmt : 0; | 631 | session->first_successful_insert_id_in_prev_stmt : 0; |
992 | 629 | 632 | ||
993 | 630 | DRIZZLE_UPDATE_END(); | ||
994 | 631 | if (error < 0) | 633 | if (error < 0) |
995 | 632 | { | 634 | { |
996 | 633 | char buff[STRING_BUFFER_USUAL_SIZE]; | 635 | char buff[STRING_BUFFER_USUAL_SIZE]; |
997 | @@ -638,7 +640,8 @@ | |||
998 | 638 | } | 640 | } |
999 | 639 | session->count_cuted_fields= CHECK_FIELD_IGNORE; /* calc cuted fields */ | 641 | session->count_cuted_fields= CHECK_FIELD_IGNORE; /* calc cuted fields */ |
1000 | 640 | session->abort_on_warning= 0; | 642 | session->abort_on_warning= 0; |
1002 | 641 | return((error >= 0 || session->is_error()) ? 1 : 0); | 643 | DRIZZLE_UPDATE_DONE((error >= 0 || session->is_error()), found, updated); |
1003 | 644 | return ((error >= 0 || session->is_error()) ? 1 : 0); | ||
1004 | 642 | 645 | ||
1005 | 643 | err: | 646 | err: |
1006 | 644 | delete select; | 647 | delete select; |
1007 | @@ -651,8 +654,8 @@ | |||
1008 | 651 | session->abort_on_warning= 0; | 654 | session->abort_on_warning= 0; |
1009 | 652 | 655 | ||
1010 | 653 | abort: | 656 | abort: |
1013 | 654 | DRIZZLE_UPDATE_END(); | 657 | DRIZZLE_UPDATE_DONE(1, 0, 0); |
1014 | 655 | return(1); | 658 | return 1; |
1015 | 656 | } | 659 | } |
1016 | 657 | 660 | ||
1017 | 658 | /* | 661 | /* |
1018 | 659 | 662 | ||
1019 | === modified file 'drizzled/statement/delete.cc' | |||
1020 | --- drizzled/statement/delete.cc 2009-08-10 18:03:39 +0000 | |||
1021 | +++ drizzled/statement/delete.cc 2009-09-13 04:30:14 +0000 | |||
1022 | @@ -22,12 +22,14 @@ | |||
1023 | 22 | #include <drizzled/show.h> | 22 | #include <drizzled/show.h> |
1024 | 23 | #include <drizzled/session.h> | 23 | #include <drizzled/session.h> |
1025 | 24 | #include <drizzled/lock.h> | 24 | #include <drizzled/lock.h> |
1026 | 25 | #include <drizzled/probes.h> | ||
1027 | 25 | #include <drizzled/statement/delete.h> | 26 | #include <drizzled/statement/delete.h> |
1028 | 26 | 27 | ||
1029 | 27 | using namespace drizzled; | 28 | using namespace drizzled; |
1030 | 28 | 29 | ||
1031 | 29 | bool statement::Delete::execute() | 30 | bool statement::Delete::execute() |
1032 | 30 | { | 31 | { |
1033 | 32 | DRIZZLE_DELETE_START(session->query); | ||
1034 | 31 | TableList *first_table= (TableList *) session->lex->select_lex.table_list.first; | 33 | TableList *first_table= (TableList *) session->lex->select_lex.table_list.first; |
1035 | 32 | TableList *all_tables= session->lex->query_tables; | 34 | TableList *all_tables= session->lex->query_tables; |
1036 | 33 | Select_Lex *select_lex= &session->lex->select_lex; | 35 | Select_Lex *select_lex= &session->lex->select_lex; |
1037 | 34 | 36 | ||
1038 | === modified file 'drizzled/statement/insert.cc' | |||
1039 | --- drizzled/statement/insert.cc 2009-08-26 23:47:28 +0000 | |||
1040 | +++ drizzled/statement/insert.cc 2009-09-13 04:30:14 +0000 | |||
1041 | @@ -22,6 +22,7 @@ | |||
1042 | 22 | #include <drizzled/show.h> | 22 | #include <drizzled/show.h> |
1043 | 23 | #include <drizzled/lock.h> | 23 | #include <drizzled/lock.h> |
1044 | 24 | #include <drizzled/session.h> | 24 | #include <drizzled/session.h> |
1045 | 25 | #include <drizzled/probes.h> | ||
1046 | 25 | #include <drizzled/statement/insert.h> | 26 | #include <drizzled/statement/insert.h> |
1047 | 26 | 27 | ||
1048 | 27 | using namespace drizzled; | 28 | using namespace drizzled; |
1049 | @@ -43,6 +44,8 @@ | |||
1050 | 43 | return true; | 44 | return true; |
1051 | 44 | } | 45 | } |
1052 | 45 | 46 | ||
1053 | 47 | DRIZZLE_INSERT_START(session->query); | ||
1054 | 48 | |||
1055 | 46 | bool res= mysql_insert(session, | 49 | bool res= mysql_insert(session, |
1056 | 47 | all_tables, | 50 | all_tables, |
1057 | 48 | session->lex->field_list, | 51 | session->lex->field_list, |
1058 | 49 | 52 | ||
1059 | === modified file 'drizzled/statement/insert_select.cc' | |||
1060 | --- drizzled/statement/insert_select.cc 2009-08-27 00:39:15 +0000 | |||
1061 | +++ drizzled/statement/insert_select.cc 2009-09-13 04:30:14 +0000 | |||
1062 | @@ -22,6 +22,7 @@ | |||
1063 | 22 | #include <drizzled/show.h> | 22 | #include <drizzled/show.h> |
1064 | 23 | #include <drizzled/lock.h> | 23 | #include <drizzled/lock.h> |
1065 | 24 | #include <drizzled/session.h> | 24 | #include <drizzled/session.h> |
1066 | 25 | #include <drizzled/probes.h> | ||
1067 | 25 | #include <drizzled/statement/insert_select.h> | 26 | #include <drizzled/statement/insert_select.h> |
1068 | 26 | 27 | ||
1069 | 27 | using namespace drizzled; | 28 | using namespace drizzled; |
1070 | @@ -54,6 +55,7 @@ | |||
1071 | 54 | 55 | ||
1072 | 55 | if (! (res= session->openTablesLock(all_tables))) | 56 | if (! (res= session->openTablesLock(all_tables))) |
1073 | 56 | { | 57 | { |
1074 | 58 | DRIZZLE_INSERT_SELECT_START(session->query); | ||
1075 | 57 | /* Skip first table, which is the table we are inserting in */ | 59 | /* Skip first table, which is the table we are inserting in */ |
1076 | 58 | TableList *second_table= first_table->next_local; | 60 | TableList *second_table= first_table->next_local; |
1077 | 59 | select_lex->table_list.first= (unsigned char*) second_table; | 61 | select_lex->table_list.first= (unsigned char*) second_table; |
1078 | 60 | 62 | ||
1079 | === modified file 'm4/pandora_64bit.m4' | |||
1080 | --- m4/pandora_64bit.m4 2009-08-04 17:58:31 +0000 | |||
1081 | +++ m4/pandora_64bit.m4 2009-09-14 18:37:34 +0000 | |||
1082 | @@ -23,7 +23,7 @@ | |||
1083 | 23 | AS_IF([test "$isainfo_b" != "x"],[ | 23 | AS_IF([test "$isainfo_b" != "x"],[ |
1084 | 24 | 24 | ||
1085 | 25 | isainfo_k=`${ISAINFO} -k` | 25 | isainfo_k=`${ISAINFO} -k` |
1087 | 26 | DTRACEFLAGS="${DTRACEFLAGS} -${isainfo_k}" | 26 | DTRACEFLAGS="${DTRACEFLAGS} -${isainfo_b}" |
1088 | 27 | 27 | ||
1089 | 28 | AS_IF([test "x$ac_enable_64bit" = "xyes"],[ | 28 | AS_IF([test "x$ac_enable_64bit" = "xyes"],[ |
1090 | 29 | 29 | ||
1091 | 30 | 30 | ||
1092 | === modified file 'mysys/my_bitmap.cc' | |||
1093 | --- mysys/my_bitmap.cc 2009-07-30 02:39:13 +0000 | |||
1094 | +++ mysys/my_bitmap.cc 2009-09-15 01:32:36 +0000 | |||
1095 | @@ -29,7 +29,7 @@ | |||
1096 | 29 | Create a mask with the upper 'unused' bits set and the lower 'used' | 29 | Create a mask with the upper 'unused' bits set and the lower 'used' |
1097 | 30 | bits clear. The bits within each byte is stored in big-endian order. | 30 | bits clear. The bits within each byte is stored in big-endian order. |
1098 | 31 | */ | 31 | */ |
1100 | 32 | unsigned char const mask= (~((1 << used) - 1)) & 255; | 32 | unsigned char const mask= static_cast<unsigned char const>((~((1 << used) - 1)) & 255); |
1101 | 33 | 33 | ||
1102 | 34 | /* | 34 | /* |
1103 | 35 | The first bytes are to be set to zero since they represent real bits | 35 | The first bytes are to be set to zero since they represent real bits |
1104 | @@ -87,9 +87,9 @@ | |||
1105 | 87 | bool MyBitmap::testAndSet(const uint32_t bitPos) | 87 | bool MyBitmap::testAndSet(const uint32_t bitPos) |
1106 | 88 | { | 88 | { |
1107 | 89 | unsigned char *value= ((unsigned char*) bitmap) + (bitPos / 8); | 89 | unsigned char *value= ((unsigned char*) bitmap) + (bitPos / 8); |
1111 | 90 | unsigned char bit= 1 << ((bitPos) & 7); | 90 | unsigned char bit= static_cast<unsigned char>(1 << ((bitPos) & 7)); |
1112 | 91 | unsigned char res= (*value) & bit; | 91 | unsigned char res= static_cast<unsigned char>((*value) & bit); |
1113 | 92 | *value|= bit; | 92 | *value= static_cast<unsigned char>(*value | bit); |
1114 | 93 | return res; | 93 | return res; |
1115 | 94 | } | 94 | } |
1116 | 95 | 95 | ||
1117 | @@ -98,9 +98,9 @@ | |||
1118 | 98 | bool MyBitmap::testAndClear(const uint32_t bitPos) | 98 | bool MyBitmap::testAndClear(const uint32_t bitPos) |
1119 | 99 | { | 99 | { |
1120 | 100 | unsigned char *byte= (unsigned char*) bitmap + (bitPos / 8); | 100 | unsigned char *byte= (unsigned char*) bitmap + (bitPos / 8); |
1124 | 101 | unsigned char bit= 1 << ((bitPos) & 7); | 101 | unsigned char bit= static_cast<unsigned char>(1 << ((bitPos) & 7)); |
1125 | 102 | unsigned char res= (*byte) & bit; | 102 | unsigned char res= static_cast<unsigned char>((*byte) & bit); |
1126 | 103 | *byte&= ~bit; | 103 | *byte= static_cast<unsigned char>(*byte & ~bit); |
1127 | 104 | return res; | 104 | return res; |
1128 | 105 | } | 105 | } |
1129 | 106 | 106 | ||
1130 | @@ -133,7 +133,7 @@ | |||
1131 | 133 | m+= prefix_bytes; | 133 | m+= prefix_bytes; |
1132 | 134 | if ((prefix_bits= prefix_size & 7)) | 134 | if ((prefix_bits= prefix_size & 7)) |
1133 | 135 | { | 135 | { |
1135 | 136 | *m++= (1 << prefix_bits)-1; | 136 | *m++= static_cast<unsigned char>((1 << prefix_bits)-1); |
1136 | 137 | } | 137 | } |
1137 | 138 | if ((d= numOfBytesInMap() - prefix_bytes)) | 138 | if ((d= numOfBytesInMap() - prefix_bytes)) |
1138 | 139 | { | 139 | { |
1139 | @@ -284,7 +284,7 @@ | |||
1140 | 284 | 284 | ||
1141 | 285 | void MyBitmap::setAbove(const uint32_t from_byte, const uint32_t use_bit) | 285 | void MyBitmap::setAbove(const uint32_t from_byte, const uint32_t use_bit) |
1142 | 286 | { | 286 | { |
1144 | 287 | unsigned char use_byte= use_bit ? 0xff : 0; | 287 | unsigned char use_byte= static_cast<unsigned char>(use_bit ? 0xff : 0); |
1145 | 288 | unsigned char *to= (unsigned char *) bitmap + from_byte; | 288 | unsigned char *to= (unsigned char *) bitmap + from_byte; |
1146 | 289 | unsigned char *end= (unsigned char *) bitmap + (n_bits+7)/8; | 289 | unsigned char *end= (unsigned char *) bitmap + (n_bits+7)/8; |
1147 | 290 | 290 | ||
1148 | 291 | 291 | ||
1149 | === modified file 'mysys/my_bitmap.h' | |||
1150 | --- mysys/my_bitmap.h 2009-07-30 04:00:24 +0000 | |||
1151 | +++ mysys/my_bitmap.h 2009-09-15 01:32:36 +0000 | |||
1152 | @@ -171,7 +171,10 @@ | |||
1153 | 171 | */ | 171 | */ |
1154 | 172 | void setBit(const uint32_t bit) | 172 | void setBit(const uint32_t bit) |
1155 | 173 | { | 173 | { |
1157 | 174 | ((unsigned char *)bitmap)[bit / 8] |= (1 << ((bit) & 7)); | 174 | reinterpret_cast<unsigned char *>(bitmap)[bit / 8]= |
1158 | 175 | static_cast<unsigned char>( | ||
1159 | 176 | (reinterpret_cast<unsigned char *>(bitmap))[bit / 8] | | ||
1160 | 177 | (1 << ((bit) & 7))); | ||
1161 | 175 | } | 178 | } |
1162 | 176 | 179 | ||
1163 | 177 | /** | 180 | /** |
1164 | @@ -181,7 +184,10 @@ | |||
1165 | 181 | */ | 184 | */ |
1166 | 182 | void flipBit(const uint32_t bit) | 185 | void flipBit(const uint32_t bit) |
1167 | 183 | { | 186 | { |
1169 | 184 | ((unsigned char *)bitmap)[bit / 8] ^= (1 << ((bit) & 7)); | 187 | reinterpret_cast<unsigned char *>(bitmap)[bit / 8]= |
1170 | 188 | static_cast<unsigned char>( | ||
1171 | 189 | (reinterpret_cast<unsigned char *>(bitmap))[bit / 8] ^ | ||
1172 | 190 | (1 << ((bit) & 7))); | ||
1173 | 185 | } | 191 | } |
1174 | 186 | 192 | ||
1175 | 187 | /** | 193 | /** |
1176 | @@ -191,7 +197,10 @@ | |||
1177 | 191 | */ | 197 | */ |
1178 | 192 | void clearBit(const uint32_t bit) | 198 | void clearBit(const uint32_t bit) |
1179 | 193 | { | 199 | { |
1181 | 194 | ((unsigned char *)bitmap)[bit / 8] &= ~ (1 << ((bit) & 7)); | 200 | reinterpret_cast<unsigned char *>(bitmap)[bit / 8]= |
1182 | 201 | static_cast<unsigned char>( | ||
1183 | 202 | (reinterpret_cast<unsigned char *>(bitmap))[bit / 8] & | ||
1184 | 203 | ~ (1 << ((bit) & 7))); | ||
1185 | 195 | } | 204 | } |
1186 | 196 | 205 | ||
1187 | 197 | /** | 206 | /** |
1188 | 198 | 207 | ||
1189 | === modified file 'mysys/my_copy.cc' | |||
1190 | --- mysys/my_copy.cc 2009-04-17 21:01:47 +0000 | |||
1191 | +++ mysys/my_copy.cc 2009-09-15 01:32:36 +0000 | |||
1192 | @@ -79,7 +79,8 @@ | |||
1193 | 79 | MyFlags)) < 0) | 79 | MyFlags)) < 0) |
1194 | 80 | goto err; | 80 | goto err; |
1195 | 81 | 81 | ||
1197 | 82 | while ((Count=my_read(from_file, buff, sizeof(buff), MyFlags)) != 0) | 82 | while ((Count= static_cast<uint32_t>(my_read(from_file, buff, |
1198 | 83 | sizeof(buff), MyFlags))) != 0) | ||
1199 | 83 | { | 84 | { |
1200 | 84 | if (Count == (uint32_t) -1 || | 85 | if (Count == (uint32_t) -1 || |
1201 | 85 | my_write(to_file,buff,Count,MYF(MyFlags | MY_NABP))) | 86 | my_write(to_file,buff,Count,MYF(MyFlags | MY_NABP))) |
1202 | 86 | 87 | ||
1203 | === modified file 'mysys/my_getopt.cc' | |||
1204 | --- mysys/my_getopt.cc 2009-06-24 23:48:15 +0000 | |||
1205 | +++ mysys/my_getopt.cc 2009-09-15 01:32:36 +0000 | |||
1206 | @@ -217,7 +217,7 @@ | |||
1207 | 217 | } | 217 | } |
1208 | 218 | else | 218 | else |
1209 | 219 | { | 219 | { |
1211 | 220 | length= strlen(opt_str); | 220 | length= static_cast<uint32_t>(strlen(opt_str)); |
1212 | 221 | optend= 0; | 221 | optend= 0; |
1213 | 222 | } | 222 | } |
1214 | 223 | 223 | ||
1215 | 224 | 224 | ||
1216 | === modified file 'mysys/my_init.cc' | |||
1217 | --- mysys/my_init.cc 2009-05-04 18:11:56 +0000 | |||
1218 | +++ mysys/my_init.cc 2009-09-15 01:32:36 +0000 | |||
1219 | @@ -121,10 +121,10 @@ | |||
1220 | 121 | Non-physical pagefaults %ld, Physical pagefaults %ld, Swaps %ld\n\ | 121 | Non-physical pagefaults %ld, Physical pagefaults %ld, Swaps %ld\n\ |
1221 | 122 | Blocks in %ld out %ld, Messages in %ld out %ld, Signals %ld\n\ | 122 | Blocks in %ld out %ld, Messages in %ld out %ld, Signals %ld\n\ |
1222 | 123 | Voluntary context switches %ld, Involuntary context switches %ld\n", | 123 | Voluntary context switches %ld, Involuntary context switches %ld\n", |
1227 | 124 | (rus.ru_utime.tv_sec * SCALE_SEC + | 124 | static_cast<double>((rus.ru_utime.tv_sec * SCALE_SEC + |
1228 | 125 | rus.ru_utime.tv_usec / SCALE_USEC) / 100.0, | 125 | rus.ru_utime.tv_usec / SCALE_USEC)) / 100.0, |
1229 | 126 | (rus.ru_stime.tv_sec * SCALE_SEC + | 126 | static_cast<double>((rus.ru_stime.tv_sec * SCALE_SEC + |
1230 | 127 | rus.ru_stime.tv_usec / SCALE_USEC) / 100.0, | 127 | rus.ru_stime.tv_usec / SCALE_USEC)) / 100.0, |
1231 | 128 | rus.ru_maxrss, rus.ru_idrss, | 128 | rus.ru_maxrss, rus.ru_idrss, |
1232 | 129 | rus.ru_minflt, rus.ru_majflt, | 129 | rus.ru_minflt, rus.ru_majflt, |
1233 | 130 | rus.ru_nswap, rus.ru_inblock, rus.ru_oublock, | 130 | rus.ru_nswap, rus.ru_inblock, rus.ru_oublock, |
1234 | 131 | 131 | ||
1235 | === modified file 'mysys/my_lib.cc' | |||
1236 | --- mysys/my_lib.cc 2009-05-23 16:15:00 +0000 | |||
1237 | +++ mysys/my_lib.cc 2009-09-15 01:32:36 +0000 | |||
1238 | @@ -142,7 +142,7 @@ | |||
1239 | 142 | (void) closedir(dirp); | 142 | (void) closedir(dirp); |
1240 | 143 | 143 | ||
1241 | 144 | result->dir_entry= (FILEINFO *)dir_entries_storage->buffer; | 144 | result->dir_entry= (FILEINFO *)dir_entries_storage->buffer; |
1243 | 145 | result->number_off_files= dir_entries_storage->elements; | 145 | result->number_off_files= static_cast<uint>(dir_entries_storage->elements); |
1244 | 146 | 146 | ||
1245 | 147 | if (!(MyFlags & MY_DONT_SORT)) | 147 | if (!(MyFlags & MY_DONT_SORT)) |
1246 | 148 | my_qsort((void *) result->dir_entry, result->number_off_files, | 148 | my_qsort((void *) result->dir_entry, result->number_off_files, |
1247 | 149 | 149 | ||
1248 | === modified file 'mysys/my_symlink2.cc' | |||
1249 | --- mysys/my_symlink2.cc 2009-06-16 01:36:01 +0000 | |||
1250 | +++ mysys/my_symlink2.cc 2009-09-15 01:32:36 +0000 | |||
1251 | @@ -134,7 +134,8 @@ | |||
1252 | 134 | char link_name[FN_REFLEN], tmp_name[FN_REFLEN]; | 134 | char link_name[FN_REFLEN], tmp_name[FN_REFLEN]; |
1253 | 135 | int sym_link_size= -1; | 135 | int sym_link_size= -1; |
1254 | 136 | int was_symlink= (!my_disable_symlinks && | 136 | int was_symlink= (!my_disable_symlinks && |
1256 | 137 | (sym_link_size= readlink(from,link_name,FN_REFLEN-1)) != -1); | 137 | (sym_link_size= static_cast<int>(readlink(from,link_name, |
1257 | 138 | FN_REFLEN-1))) != -1); | ||
1258 | 138 | int result=0; | 139 | int result=0; |
1259 | 139 | int name_is_different; | 140 | int name_is_different; |
1260 | 140 | 141 |
Contains Joe Daly's -Wconversion fixes for mysys/ files and Padraig's enhancements and port of MySQL DTrace Probes.
All tests pass on all 64-bit platforms.