Merge lp:~jaypipes/drizzle/captain-20090915-01 into lp:~drizzle-trunk/drizzle/development

Proposed by Jay Pipes
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
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.

To post a comment you must log in.
Revision history for this message
Jay Pipes (jaypipes) wrote : Posted in a previous version of this proposal

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.

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

A few things:
742 + res= (error >= 0 || session->is_error());
743 + DRIZZLE_DELETE_DONE(res, deleted);

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_QUERY_EXEC_START() <-- why is the third param not const?

Awesome fixes on all of the conversion work.

I can just fix this stuff BTW (working with someone right now on code reviews).

review: Needs Fixing
Revision history for this message
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->is_error());
> 743 + DRIZZLE_DELETE_DONE(res, deleted);
>
> 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_QUERY_EXEC_START() <-- why is the third param not const?

Hmmm...agreed. Nice catch. Padraig, can you try using a
const_cast<const char *>(session->db) for both DRIZZLE_QUERY_START() and
DRIZZLE_QUERY_EXEC_START() calls? Thanks!

> 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

Revision history for this message
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

Revision history for this message
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

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'drizzled/Makefile.am'
--- drizzled/Makefile.am 2009-09-16 21:55:09 +0000
+++ drizzled/Makefile.am 2009-09-21 14:34:41 +0000
@@ -18,10 +18,16 @@
1818
19DTRACEFILES = handler.o \19DTRACEFILES = handler.o \
20 filesort.o \20 filesort.o \
21 drizzled.o \
22 session.o \
21 sql_delete.o \23 sql_delete.o \
22 sql_insert.o \24 sql_insert.o \
23 sql_select.o \25 sql_select.o \
24 sql_update.o26 sql_update.o \
27 sql_parse.o \
28 statement/delete.o \
29 statement/insert.o \
30 statement/insert_select.o
2531
26drizzledincludedir = ${includedir}/drizzled32drizzledincludedir = ${includedir}/drizzled
27nobase_dist_drizzledinclude_HEADERS = \33nobase_dist_drizzledinclude_HEADERS = \
@@ -695,10 +701,6 @@
695 util/convert.cc \701 util/convert.cc \
696 xid.cc702 xid.cc
697703
698if HAVE_DTRACE
699drizzled_SOURCES += probes.d
700endif
701
702libserialutil_la_SOURCES = db.cc table_proto_write.cc704libserialutil_la_SOURCES = db.cc table_proto_write.cc
703libserialutil_la_CXXFLAGS= ${AM_CXXFLAGS} ${PROTOSKIP_WARNINGS}705libserialutil_la_CXXFLAGS= ${AM_CXXFLAGS} ${PROTOSKIP_WARNINGS}
704706
@@ -726,7 +728,7 @@
726BUILT_SOURCES = $(BUILT_MAINT_SRC) \728BUILT_SOURCES = $(BUILT_MAINT_SRC) \
727 symbol_hash.h \729 symbol_hash.h \
728 function_hash.h \730 function_hash.h \
729 $(PCHHEADERS)731 $(PCHHEADERS)
730732
731EXTRA_DIST = \733EXTRA_DIST = \
732 $(BUILT_MAINT_SRC) \734 $(BUILT_MAINT_SRC) \
@@ -745,16 +747,29 @@
745 $(PCHHEADERS) \747 $(PCHHEADERS) \
746 $(nodist_drizzled_SOURCES)748 $(nodist_drizzled_SOURCES)
747749
750if DTRACE_NEEDS_OBJECTS
751drizzled_SOURCES += probes.d
752endif
753
754if HAVE_DTRACE
755BUILT_SOURCES += generated_probes.h
756CLEANFILES += generated_probes.h
757endif
758
759
748DISTCLEANFILES = $(EXTRA_PROGRAMS) \760DISTCLEANFILES = $(EXTRA_PROGRAMS) \
749 $(BUILT_MAINT_SRC)761 $(BUILT_MAINT_SRC)
750762
751MAINTAINERCLEANFILES = $(BUILT_MAINT_SRC)763MAINTAINERCLEANFILES = $(BUILT_MAINT_SRC)
752764
753probes.h: probes.d765generated_probes.h : probes.d
754 $(DTRACE) $(DTRACEFLAGS) -h -s probes.d766 $(DTRACE) $(DTRACEFLAGS) -h -s probes.d -o generated_probes.h
755 mv probes.h probes.h.bak767 mv generated_probes.h generated_probes.h.bak
756 sed "s/#include <unistd.h>//g" probes.h.bak > probes.h768 sed "s/#include <unistd.h>//g" generated_probes.h.bak > generated_probes.h
757 rm probes.h.bak769 rm generated_probes.h.bak
770 sed -e 's,void \*,const void \*,g' generated_probes.h | \
771 sed -e 's,char \*,const char \*,g' | tr '\t' ' ' > dtrace_probes.tmp
772 mv dtrace_probes.tmp generated_probes.h
758773
759774
760SUFFIXES = .d .gch .gperf .stamp-h775SUFFIXES = .d .gch .gperf .stamp-h
761776
=== modified file 'drizzled/drizzled.cc'
--- drizzled/drizzled.cc 2009-09-15 17:23:06 +0000
+++ drizzled/drizzled.cc 2009-09-21 14:34:41 +0000
@@ -44,6 +44,7 @@
44#include <drizzled/scheduling.h>44#include <drizzled/scheduling.h>
45#include "drizzled/temporal_format.h" /* For init_temporal_formats() */45#include "drizzled/temporal_format.h" /* For init_temporal_formats() */
46#include "drizzled/slot/listen.h"46#include "drizzled/slot/listen.h"
47#include "drizzled/probes.h"
4748
48#include <google/protobuf/stubs/common.h>49#include <google/protobuf/stubs/common.h>
4950
@@ -455,6 +456,7 @@
455 tmp= *it;456 tmp= *it;
456 tmp->killed= Session::KILL_CONNECTION;457 tmp->killed= Session::KILL_CONNECTION;
457 tmp->scheduler->killSession(tmp);458 tmp->scheduler->killSession(tmp);
459 DRIZZLE_CONNECTION_DONE(tmp->thread_id);
458 if (tmp->mysys_var)460 if (tmp->mysys_var)
459 {461 {
460 tmp->mysys_var->abort=1;462 tmp->mysys_var->abort=1;
@@ -765,6 +767,7 @@
765 {767 {
766 statistic_increment(killed_threads, &LOCK_status);768 statistic_increment(killed_threads, &LOCK_status);
767 session->scheduler->killSessionNow(session);769 session->scheduler->killSessionNow(session);
770 DRIZZLE_CONNECTION_DONE(session->thread_id);
768 }771 }
769 return;772 return;
770}773}
771774
=== modified file 'drizzled/filesort.cc'
--- drizzled/filesort.cc 2009-08-20 20:29:18 +0000
+++ drizzled/filesort.cc 2009-09-13 01:09:19 +0000
@@ -114,7 +114,7 @@
114 TableList *tab= table->pos_in_table_list;114 TableList *tab= table->pos_in_table_list;
115 Item_subselect *subselect= tab ? tab->containing_subselect() : 0;115 Item_subselect *subselect= tab ? tab->containing_subselect() : 0;
116116
117 DRIZZLE_FILESORT_START();117 DRIZZLE_FILESORT_START(table->s->db.str, table->s->table_name.str);
118118
119 /*119 /*
120 Release InnoDB's adaptive hash index latch (if holding) before120 Release InnoDB's adaptive hash index latch (if holding) before
@@ -324,8 +324,8 @@
324 (uint32_t) records, &LOCK_status);324 (uint32_t) records, &LOCK_status);
325 *examined_rows= param.examined_rows;325 *examined_rows= param.examined_rows;
326 memcpy(&table->sort, &table_sort, sizeof(filesort_info_st));326 memcpy(&table->sort, &table_sort, sizeof(filesort_info_st));
327 DRIZZLE_FILESORT_END();327 DRIZZLE_FILESORT_DONE(error, records);
328 return(error ? HA_POS_ERROR : records);328 return (error ? HA_POS_ERROR : records);
329} /* filesort */329} /* filesort */
330330
331331
332332
=== modified file 'drizzled/handler.cc'
--- drizzled/handler.cc 2009-08-23 01:10:19 +0000
+++ drizzled/handler.cc 2009-09-14 01:25:59 +0000
@@ -2696,9 +2696,9 @@
2696 We cache the table flags if the locking succeeded. Otherwise, we2696 We cache the table flags if the locking succeeded. Otherwise, we
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().
2698 */2698 */
2699 DRIZZLE_EXTERNAL_LOCK(lock_type);
27002699
2701 int error= external_lock(session, lock_type);2700 int error= external_lock(session, lock_type);
2701
2702 if (error == 0)2702 if (error == 0)
2703 cached_table_flags= table_flags();2703 cached_table_flags= table_flags();
2704 return error;2704 return error;
@@ -2729,7 +2729,6 @@
2729int handler::ha_write_row(unsigned char *buf)2729int handler::ha_write_row(unsigned char *buf)
2730{2730{
2731 int error;2731 int error;
2732 DRIZZLE_INSERT_ROW_START();
27332732
2734 /* 2733 /*
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
@@ -2743,12 +2742,13 @@
2743 mark_trx_read_write();2742 mark_trx_read_write();
27442743
2745 if (unlikely(error= write_row(buf)))2744 if (unlikely(error= write_row(buf)))
2745 {
2746 return error;2746 return error;
2747 }
27472748
2748 if (unlikely(log_row_for_replication(table, 0, buf)))2749 if (unlikely(log_row_for_replication(table, 0, buf)))
2749 return HA_ERR_RBR_LOGGING_FAILED; /* purecov: inspected */2750 return HA_ERR_RBR_LOGGING_FAILED; /* purecov: inspected */
27502751
2751 DRIZZLE_INSERT_ROW_END();
2752 return 0;2752 return 0;
2753}2753}
27542754
@@ -2766,7 +2766,9 @@
2766 mark_trx_read_write();2766 mark_trx_read_write();
27672767
2768 if (unlikely(error= update_row(old_data, new_data)))2768 if (unlikely(error= update_row(old_data, new_data)))
2769 {
2769 return error;2770 return error;
2771 }
27702772
2771 if (unlikely(log_row_for_replication(table, old_data, new_data)))2773 if (unlikely(log_row_for_replication(table, old_data, new_data)))
2772 return HA_ERR_RBR_LOGGING_FAILED;2774 return HA_ERR_RBR_LOGGING_FAILED;
27732775
=== modified file 'drizzled/probes.d'
--- drizzled/probes.d 2008-11-01 00:46:20 +0000
+++ drizzled/probes.d 2009-09-14 20:44:27 +0000
@@ -1,7 +1,7 @@
1/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-1/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:2 * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3 *3 *
4 * Copyright (C) 2008 Sun Microsystems4 * Copyright (C) 2009 Sun Microsystems
5 *5 *
6 * This program is free software; you can redistribute it and/or modify6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by7 * it under the terms of the GNU General Public License as published by
@@ -17,18 +17,107 @@
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */18 */
1919
20/*
21 The actual probe names in DTrace scripts will replace '__' by '-'. Thus
22 insert__row__start will be insert-row-start.
23
24 Recommendations for adding new probes:
25
26 - each probe should have the minimal set of arguments required to
27 unambiguously identify the context in which the probe fires. Redundant
28 probes (i.e. the ones that can be obtained in user scripts from previous
29 probes' arguments or otherwise) may be added for convenience.
30
31 - try to avoid computationally expensive probe arguments. If impossible,
32 use *_ENABLED() macros to check if the probe is activated before
33 performing expensive calculations for a probe argument.
34
35 - all *-done probes should have a status argument wherever applicable to make
36 it possible for user scripts to figure out whether the completed operation
37 was successful or not.
38
39 - for all status arguments, a non-zero value should be returned on error or
40 failure, 0 should be returned on success.
41*/
42
20provider drizzle {43provider drizzle {
21probe external_lock(int);44
22probe insert_row_start();45 /* The following ones fire when creating or closing a client connection */
23probe insert_row_end();46 probe connection__start(unsigned long conn_id);
24probe filesort_start();47 probe connection__done(unsigned long conn_id);
25probe filesort_end();48
26probe delete_start();49 /*
27probe delete_end();50 * Fire at the start/end of any client command processing (including SQL
28probe insert_start();51 * queries).
29probe insert_end();52 */
30probe select_start();53 probe command__start(unsigned long conn_id, int command);
31probe select_end();54 probe command__done(int status);
32probe update_start();55
33probe update_end();56 /*
57 * The following probes fire at the start/end of any SQL query processing,
58 * respectively.
59 *
60 * query_start() has a lot of parameters that can be used to pick up
61 * parameters for a lot of other probes here. For simplicity reasons we also
62 * add the query string to most other DTrace probes as well. Hostname is
63 * either the hostname or the IP address of the Drizzle client.
64 */
65 probe query__start(const char *query,
66 unsigned long conn_id,
67 const char *db_name);
68 probe query__done(int status);
69
70 /* Fire at the start/end of SQL query parsing */
71 probe query__parse__start(const char *query);
72 probe query__parse__done(int status);
73
74 /*
75 * This probe fires when the actual query execution starts
76 */
77 probe query__exec__start(const char *query,
78 unsigned long connid,
79 const char *db_name);
80 probe query__exec__done(int status);
81
82 /* These probes fire when performing write operations towards any handler */
83 probe insert__row__start(const char *db, const char *table);
84 probe insert__row__done(int status);
85 probe update__row__start(const char *db, const char *table);
86 probe update__row__done(int status);
87 probe delete__row__start(const char *db, const char *table);
88 probe delete__row__done(int status);
89
90 /*
91 * These probes fire when calling external_lock for any handler
92 * depending on the lock type being acquired or released.
93 */
94 probe handler__rdlock__start(const char *db, const char *table);
95 probe handler__wrlock__start(const char *db, const char *table);
96 probe handler__unlock__start(const char *db, const char *table);
97 probe handler__rdlock__done(int status);
98 probe handler__wrlock__done(int status);
99 probe handler__unlock__done(int status);
100
101 /*
102 * These probes fire when a filesort activity happens in a query.
103 */
104 probe filesort__start(const char *db, const char *table);
105 probe filesort__done(int status, unsigned long rows);
106 /*
107 * The query types SELECT, INSERT, INSERT AS SELECT, UPDATE, DELETE
108 * are all probed.
109 * The start probe always contains the query text.
110 */
111 probe select__start(const char *query);
112 probe select__done(int status, unsigned long rows);
113 probe insert__start(const char *query);
114 probe insert__done(int status, unsigned long rows);
115 probe insert__select__start(const char *query);
116 probe insert__select__done(int status, unsigned long rows);
117 probe update__start(const char *query);
118 probe update__done(int status,
119 unsigned long rowsmatches, unsigned long rowschanged);
120 probe delete__start(const char *query);
121 probe delete__done(int status, unsigned long rows);
122
34};123};
35124
=== added file 'drizzled/probes.h'
--- drizzled/probes.h 1970-01-01 00:00:00 +0000
+++ drizzled/probes.h 2009-09-14 20:12:21 +0000
@@ -0,0 +1,97 @@
1/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3 *
4 * Copyright (C) 2009 Sun Microsystems
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#ifndef DRIZZLED_PROBES_H
22#define DRIZZLED_PROBES_H
23
24#ifdef HAVE_DTRACE
25#include "drizzled/generated_probes.h"
26#else
27#define DRIZZLE_COMMAND_DONE(arg0)
28#define DRIZZLE_COMMAND_DONE_ENABLED() (0)
29#define DRIZZLE_COMMAND_START(arg0, arg1)
30#define DRIZZLE_COMMAND_START_ENABLED() (0)
31#define DRIZZLE_CONNECTION_DONE(arg0)
32#define DRIZZLE_CONNECTION_DONE_ENABLED() (0)
33#define DRIZZLE_CONNECTION_START(arg0)
34#define DRIZZLE_CONNECTION_START_ENABLED() (0)
35#define DRIZZLE_DELETE_DONE(arg0, arg1)
36#define DRIZZLE_DELETE_DONE_ENABLED() (0)
37#define DRIZZLE_DELETE_ROW_DONE(arg0)
38#define DRIZZLE_DELETE_ROW_DONE_ENABLED() (0)
39#define DRIZZLE_DELETE_ROW_START(arg0, arg1)
40#define DRIZZLE_DELETE_ROW_START_ENABLED() (0)
41#define DRIZZLE_DELETE_START(arg0)
42#define DRIZZLE_DELETE_START_ENABLED() (0)
43#define DRIZZLE_FILESORT_DONE(arg0, arg1)
44#define DRIZZLE_FILESORT_DONE_ENABLED() (0)
45#define DRIZZLE_FILESORT_START(arg0, arg1)
46#define DRIZZLE_FILESORT_START_ENABLED() (0)
47#define DRIZZLE_HANDLER_RDLOCK_DONE(arg0)
48#define DRIZZLE_HANDLER_RDLOCK_DONE_ENABLED() (0)
49#define DRIZZLE_HANDLER_RDLOCK_START(arg0, arg1)
50#define DRIZZLE_HANDLER_RDLOCK_START_ENABLED() (0)
51#define DRIZZLE_HANDLER_UNLOCK_DONE(arg0)
52#define DRIZZLE_HANDLER_UNLOCK_DONE_ENABLED() (0)
53#define DRIZZLE_HANDLER_UNLOCK_START(arg0, arg1)
54#define DRIZZLE_HANDLER_UNLOCK_START_ENABLED() (0)
55#define DRIZZLE_HANDLER_WRLOCK_DONE(arg0)
56#define DRIZZLE_HANDLER_WRLOCK_DONE_ENABLED() (0)
57#define DRIZZLE_HANDLER_WRLOCK_START(arg0, arg1)
58#define DRIZZLE_HANDLER_WRLOCK_START_ENABLED() (0)
59#define DRIZZLE_INSERT_DONE(arg0, arg1)
60#define DRIZZLE_INSERT_DONE_ENABLED() (0)
61#define DRIZZLE_INSERT_ROW_DONE(arg0)
62#define DRIZZLE_INSERT_ROW_DONE_ENABLED() (0)
63#define DRIZZLE_INSERT_ROW_START(arg0, arg1)
64#define DRIZZLE_INSERT_ROW_START_ENABLED() (0)
65#define DRIZZLE_INSERT_SELECT_DONE(arg0, arg1)
66#define DRIZZLE_INSERT_SELECT_DONE_ENABLED() (0)
67#define DRIZZLE_INSERT_SELECT_START(arg0)
68#define DRIZZLE_INSERT_SELECT_START_ENABLED() (0)
69#define DRIZZLE_INSERT_START(arg0)
70#define DRIZZLE_INSERT_START_ENABLED() (0)
71#define DRIZZLE_QUERY_DONE(arg0)
72#define DRIZZLE_QUERY_DONE_ENABLED() (0)
73#define DRIZZLE_QUERY_EXEC_DONE(arg0)
74#define DRIZZLE_QUERY_EXEC_DONE_ENABLED() (0)
75#define DRIZZLE_QUERY_EXEC_START(arg0, arg1, arg2)
76#define DRIZZLE_QUERY_EXEC_START_ENABLED() (0)
77#define DRIZZLE_QUERY_PARSE_DONE(arg0)
78#define DRIZZLE_QUERY_PARSE_DONE_ENABLED() (0)
79#define DRIZZLE_QUERY_PARSE_START(arg0)
80#define DRIZZLE_QUERY_PARSE_START_ENABLED() (0)
81#define DRIZZLE_QUERY_START(arg0, arg1, arg2)
82#define DRIZZLE_QUERY_START_ENABLED() (0)
83#define DRIZZLE_SELECT_DONE(arg0, arg1)
84#define DRIZZLE_SELECT_DONE_ENABLED() (0)
85#define DRIZZLE_SELECT_START(arg0)
86#define DRIZZLE_SELECT_START_ENABLED() (0)
87#define DRIZZLE_UPDATE_DONE(arg0, arg1, arg2)
88#define DRIZZLE_UPDATE_DONE_ENABLED() (0)
89#define DRIZZLE_UPDATE_ROW_DONE(arg0)
90#define DRIZZLE_UPDATE_ROW_DONE_ENABLED() (0)
91#define DRIZZLE_UPDATE_ROW_START(arg0, arg1)
92#define DRIZZLE_UPDATE_ROW_START_ENABLED() (0)
93#define DRIZZLE_UPDATE_START(arg0)
94#define DRIZZLE_UPDATE_START_ENABLED() (0)
95#endif
96
97#endif /* DRIZZLED_PROBES_H */
098
=== removed file 'drizzled/probes.h'
--- drizzled/probes.h 2009-05-21 17:05:14 +0000
+++ drizzled/probes.h 1970-01-01 00:00:00 +0000
@@ -1,250 +0,0 @@
1/*
2 * Generated by dtrace(1M).
3 */
4
5#ifndef _PROBES_H
6#define _PROBES_H
7
8
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14#if _DTRACE_VERSION
15
16#define DRIZZLE_DELETE_END() \
17 __dtrace_drizzle___delete_end()
18#ifndef __sparc
19#define DRIZZLE_DELETE_END_ENABLED() \
20 __dtraceenabled_drizzle___delete_end()
21#else
22#define DRIZZLE_DELETE_END_ENABLED() \
23 __dtraceenabled_drizzle___delete_end(0)
24#endif
25#define DRIZZLE_DELETE_START() \
26 __dtrace_drizzle___delete_start()
27#ifndef __sparc
28#define DRIZZLE_DELETE_START_ENABLED() \
29 __dtraceenabled_drizzle___delete_start()
30#else
31#define DRIZZLE_DELETE_START_ENABLED() \
32 __dtraceenabled_drizzle___delete_start(0)
33#endif
34#define DRIZZLE_EXTERNAL_LOCK(arg0) \
35 __dtrace_drizzle___external_lock(arg0)
36#ifndef __sparc
37#define DRIZZLE_EXTERNAL_LOCK_ENABLED() \
38 __dtraceenabled_drizzle___external_lock()
39#else
40#define DRIZZLE_EXTERNAL_LOCK_ENABLED() \
41 __dtraceenabled_drizzle___external_lock(0)
42#endif
43#define DRIZZLE_FILESORT_END() \
44 __dtrace_drizzle___filesort_end()
45#ifndef __sparc
46#define DRIZZLE_FILESORT_END_ENABLED() \
47 __dtraceenabled_drizzle___filesort_end()
48#else
49#define DRIZZLE_FILESORT_END_ENABLED() \
50 __dtraceenabled_drizzle___filesort_end(0)
51#endif
52#define DRIZZLE_FILESORT_START() \
53 __dtrace_drizzle___filesort_start()
54#ifndef __sparc
55#define DRIZZLE_FILESORT_START_ENABLED() \
56 __dtraceenabled_drizzle___filesort_start()
57#else
58#define DRIZZLE_FILESORT_START_ENABLED() \
59 __dtraceenabled_drizzle___filesort_start(0)
60#endif
61#define DRIZZLE_INSERT_END() \
62 __dtrace_drizzle___insert_end()
63#ifndef __sparc
64#define DRIZZLE_INSERT_END_ENABLED() \
65 __dtraceenabled_drizzle___insert_end()
66#else
67#define DRIZZLE_INSERT_END_ENABLED() \
68 __dtraceenabled_drizzle___insert_end(0)
69#endif
70#define DRIZZLE_INSERT_ROW_END() \
71 __dtrace_drizzle___insert_row_end()
72#ifndef __sparc
73#define DRIZZLE_INSERT_ROW_END_ENABLED() \
74 __dtraceenabled_drizzle___insert_row_end()
75#else
76#define DRIZZLE_INSERT_ROW_END_ENABLED() \
77 __dtraceenabled_drizzle___insert_row_end(0)
78#endif
79#define DRIZZLE_INSERT_ROW_START() \
80 __dtrace_drizzle___insert_row_start()
81#ifndef __sparc
82#define DRIZZLE_INSERT_ROW_START_ENABLED() \
83 __dtraceenabled_drizzle___insert_row_start()
84#else
85#define DRIZZLE_INSERT_ROW_START_ENABLED() \
86 __dtraceenabled_drizzle___insert_row_start(0)
87#endif
88#define DRIZZLE_INSERT_START() \
89 __dtrace_drizzle___insert_start()
90#ifndef __sparc
91#define DRIZZLE_INSERT_START_ENABLED() \
92 __dtraceenabled_drizzle___insert_start()
93#else
94#define DRIZZLE_INSERT_START_ENABLED() \
95 __dtraceenabled_drizzle___insert_start(0)
96#endif
97#define DRIZZLE_SELECT_END() \
98 __dtrace_drizzle___select_end()
99#ifndef __sparc
100#define DRIZZLE_SELECT_END_ENABLED() \
101 __dtraceenabled_drizzle___select_end()
102#else
103#define DRIZZLE_SELECT_END_ENABLED() \
104 __dtraceenabled_drizzle___select_end(0)
105#endif
106#define DRIZZLE_SELECT_START() \
107 __dtrace_drizzle___select_start()
108#ifndef __sparc
109#define DRIZZLE_SELECT_START_ENABLED() \
110 __dtraceenabled_drizzle___select_start()
111#else
112#define DRIZZLE_SELECT_START_ENABLED() \
113 __dtraceenabled_drizzle___select_start(0)
114#endif
115#define DRIZZLE_UPDATE_END() \
116 __dtrace_drizzle___update_end()
117#ifndef __sparc
118#define DRIZZLE_UPDATE_END_ENABLED() \
119 __dtraceenabled_drizzle___update_end()
120#else
121#define DRIZZLE_UPDATE_END_ENABLED() \
122 __dtraceenabled_drizzle___update_end(0)
123#endif
124#define DRIZZLE_UPDATE_START() \
125 __dtrace_drizzle___update_start()
126#ifndef __sparc
127#define DRIZZLE_UPDATE_START_ENABLED() \
128 __dtraceenabled_drizzle___update_start()
129#else
130#define DRIZZLE_UPDATE_START_ENABLED() \
131 __dtraceenabled_drizzle___update_start(0)
132#endif
133
134
135extern void __dtrace_drizzle___delete_end(void);
136#ifndef __sparc
137extern int __dtraceenabled_drizzle___delete_end(void);
138#else
139extern int __dtraceenabled_drizzle___delete_end(long);
140#endif
141extern void __dtrace_drizzle___delete_start(void);
142#ifndef __sparc
143extern int __dtraceenabled_drizzle___delete_start(void);
144#else
145extern int __dtraceenabled_drizzle___delete_start(long);
146#endif
147extern void __dtrace_drizzle___external_lock(int);
148#ifndef __sparc
149extern int __dtraceenabled_drizzle___external_lock(void);
150#else
151extern int __dtraceenabled_drizzle___external_lock(long);
152#endif
153extern void __dtrace_drizzle___filesort_end(void);
154#ifndef __sparc
155extern int __dtraceenabled_drizzle___filesort_end(void);
156#else
157extern int __dtraceenabled_drizzle___filesort_end(long);
158#endif
159extern void __dtrace_drizzle___filesort_start(void);
160#ifndef __sparc
161extern int __dtraceenabled_drizzle___filesort_start(void);
162#else
163extern int __dtraceenabled_drizzle___filesort_start(long);
164#endif
165extern void __dtrace_drizzle___insert_end(void);
166#ifndef __sparc
167extern int __dtraceenabled_drizzle___insert_end(void);
168#else
169extern int __dtraceenabled_drizzle___insert_end(long);
170#endif
171extern void __dtrace_drizzle___insert_row_end(void);
172#ifndef __sparc
173extern int __dtraceenabled_drizzle___insert_row_end(void);
174#else
175extern int __dtraceenabled_drizzle___insert_row_end(long);
176#endif
177extern void __dtrace_drizzle___insert_row_start(void);
178#ifndef __sparc
179extern int __dtraceenabled_drizzle___insert_row_start(void);
180#else
181extern int __dtraceenabled_drizzle___insert_row_start(long);
182#endif
183extern void __dtrace_drizzle___insert_start(void);
184#ifndef __sparc
185extern int __dtraceenabled_drizzle___insert_start(void);
186#else
187extern int __dtraceenabled_drizzle___insert_start(long);
188#endif
189extern void __dtrace_drizzle___select_end(void);
190#ifndef __sparc
191extern int __dtraceenabled_drizzle___select_end(void);
192#else
193extern int __dtraceenabled_drizzle___select_end(long);
194#endif
195extern void __dtrace_drizzle___select_start(void);
196#ifndef __sparc
197extern int __dtraceenabled_drizzle___select_start(void);
198#else
199extern int __dtraceenabled_drizzle___select_start(long);
200#endif
201extern void __dtrace_drizzle___update_end(void);
202#ifndef __sparc
203extern int __dtraceenabled_drizzle___update_end(void);
204#else
205extern int __dtraceenabled_drizzle___update_end(long);
206#endif
207extern void __dtrace_drizzle___update_start(void);
208#ifndef __sparc
209extern int __dtraceenabled_drizzle___update_start(void);
210#else
211extern int __dtraceenabled_drizzle___update_start(long);
212#endif
213
214#else
215
216#define DRIZZLE_DELETE_END()
217#define DRIZZLE_DELETE_END_ENABLED() (0)
218#define DRIZZLE_DELETE_START()
219#define DRIZZLE_DELETE_START_ENABLED() (0)
220#define DRIZZLE_EXTERNAL_LOCK(arg0)
221#define DRIZZLE_EXTERNAL_LOCK_ENABLED() (0)
222#define DRIZZLE_FILESORT_END()
223#define DRIZZLE_FILESORT_END_ENABLED() (0)
224#define DRIZZLE_FILESORT_START()
225#define DRIZZLE_FILESORT_START_ENABLED() (0)
226#define DRIZZLE_INSERT_END()
227#define DRIZZLE_INSERT_END_ENABLED() (0)
228#define DRIZZLE_INSERT_ROW_END()
229#define DRIZZLE_INSERT_ROW_END_ENABLED() (0)
230#define DRIZZLE_INSERT_ROW_START()
231#define DRIZZLE_INSERT_ROW_START_ENABLED() (0)
232#define DRIZZLE_INSERT_START()
233#define DRIZZLE_INSERT_START_ENABLED() (0)
234#define DRIZZLE_SELECT_END()
235#define DRIZZLE_SELECT_END_ENABLED() (0)
236#define DRIZZLE_SELECT_START()
237#define DRIZZLE_SELECT_START_ENABLED() (0)
238#define DRIZZLE_UPDATE_END()
239#define DRIZZLE_UPDATE_END_ENABLED() (0)
240#define DRIZZLE_UPDATE_START()
241#define DRIZZLE_UPDATE_START_ENABLED() (0)
242
243#endif
244
245
246#ifdef __cplusplus
247}
248#endif
249
250#endif /* _PROBES_H */
2510
=== modified file 'drizzled/session.cc'
--- drizzled/session.cc 2009-09-15 21:35:52 +0000
+++ drizzled/session.cc 2009-09-21 14:34:41 +0000
@@ -37,6 +37,7 @@
37#include <drizzled/item/empty_string.h>37#include <drizzled/item/empty_string.h>
38#include <drizzled/show.h>38#include <drizzled/show.h>
39#include <drizzled/scheduling.h>39#include <drizzled/scheduling.h>
40#include "drizzled/probes.h"
4041
41#include <algorithm>42#include <algorithm>
4243
@@ -481,6 +482,7 @@
481 if (state_to_set != Session::KILL_QUERY)482 if (state_to_set != Session::KILL_QUERY)
482 {483 {
483 scheduler->killSession(this);484 scheduler->killSession(this);
485 DRIZZLE_CONNECTION_DONE(thread_id);
484 }486 }
485 if (mysys_var)487 if (mysys_var)
486 {488 {
@@ -620,6 +622,7 @@
620622
621 if (scheduler->addSession(this))623 if (scheduler->addSession(this))
622 {624 {
625 DRIZZLE_CONNECTION_START(thread_id);
623 char error_message_buff[DRIZZLE_ERRMSG_SIZE];626 char error_message_buff[DRIZZLE_ERRMSG_SIZE];
624627
625 killed= Session::KILL_CONNECTION;628 killed= Session::KILL_CONNECTION;
626629
=== modified file 'drizzled/sql_delete.cc'
--- drizzled/sql_delete.cc 2009-08-06 16:51:53 +0000
+++ drizzled/sql_delete.cc 2009-09-17 00:08:20 +0000
@@ -25,6 +25,7 @@
25#include <drizzled/sql_parse.h>25#include <drizzled/sql_parse.h>
26#include <drizzled/sql_base.h>26#include <drizzled/sql_base.h>
27#include <drizzled/lock.h>27#include <drizzled/lock.h>
28#include "drizzled/probes.h"
2829
29/**30/**
30 Implement DELETE SQL word.31 Implement DELETE SQL word.
@@ -51,9 +52,11 @@
51 Select_Lex *select_lex= &session->lex->select_lex;52 Select_Lex *select_lex= &session->lex->select_lex;
52 Session::killed_state killed_status= Session::NOT_KILLED;53 Session::killed_state killed_status= Session::NOT_KILLED;
5354
54
55 if (session->openTablesLock(table_list))55 if (session->openTablesLock(table_list))
56 {
57 DRIZZLE_DELETE_DONE(1, 0);
56 return true;58 return true;
59 }
5760
58 table= table_list->table;61 table= table_list->table;
59 assert(table);62 assert(table);
@@ -162,14 +165,14 @@
162 delete select;165 delete select;
163 free_underlaid_joins(session, select_lex);166 free_underlaid_joins(session, select_lex);
164 session->row_count_func= 0;167 session->row_count_func= 0;
165 DRIZZLE_DELETE_END();168 DRIZZLE_DELETE_DONE(0, 0);
166 session->my_ok((ha_rows) session->row_count_func);169 session->my_ok((ha_rows) session->row_count_func);
167 /*170 /*
168 We don't need to call reset_auto_increment in this case, because171 We don't need to call reset_auto_increment in this case, because
169 mysql_truncate always gives a NULL conds argument, hence we never172 mysql_truncate always gives a NULL conds argument, hence we never
170 get here.173 get here.
171 */174 */
172 return(0); // Nothing to delete175 return 0; // Nothing to delete
173 }176 }
174177
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 */
@@ -322,17 +325,17 @@
322 assert(transactional_table || !deleted || session->transaction.stmt.modified_non_trans_table);325 assert(transactional_table || !deleted || session->transaction.stmt.modified_non_trans_table);
323 free_underlaid_joins(session, select_lex);326 free_underlaid_joins(session, select_lex);
324327
325 DRIZZLE_DELETE_END();328 DRIZZLE_DELETE_DONE((error >= 0 || session->is_error()), deleted);
326 if (error < 0 || (session->lex->ignore && !session->is_fatal_error))329 if (error < 0 || (session->lex->ignore && !session->is_fatal_error))
327 {330 {
328 session->row_count_func= deleted;331 session->row_count_func= deleted;
329 session->my_ok((ha_rows) session->row_count_func);332 session->my_ok((ha_rows) session->row_count_func);
330 }333 }
331 return(error >= 0 || session->is_error());334 return (error >= 0 || session->is_error());
332335
333err:336err:
334 DRIZZLE_DELETE_END();337 DRIZZLE_DELETE_DONE(1, 0);
335 return(true);338 return true;
336}339}
337340
338341
339342
=== modified file 'drizzled/sql_insert.cc'
--- drizzled/sql_insert.cc 2009-09-15 21:01:42 +0000
+++ drizzled/sql_insert.cc 2009-09-21 14:34:41 +0000
@@ -240,7 +240,10 @@
240 values_list.elements > 1);240 values_list.elements > 1);
241241
242 if (session->openTablesLock(table_list))242 if (session->openTablesLock(table_list))
243 {
244 DRIZZLE_INSERT_DONE(1, 0);
243 return true;245 return true;
246 }
244247
245 lock_type= table_list->lock_type;248 lock_type= table_list->lock_type;
246249
@@ -466,8 +469,8 @@
466 info.copied + info.deleted + info.touched, id, buff);469 info.copied + info.deleted + info.touched, id, buff);
467 }470 }
468 session->abort_on_warning= 0;471 session->abort_on_warning= 0;
469 DRIZZLE_INSERT_END();472 DRIZZLE_INSERT_DONE(0, session->row_count_func);
470 return(false);473 return false;
471474
472abort:475abort:
473 if (table != NULL)476 if (table != NULL)
@@ -475,8 +478,8 @@
475 if (!joins_freed)478 if (!joins_freed)
476 free_underlaid_joins(session, &session->lex->select_lex);479 free_underlaid_joins(session, &session->lex->select_lex);
477 session->abort_on_warning= 0;480 session->abort_on_warning= 0;
478 DRIZZLE_INSERT_END();481 DRIZZLE_INSERT_DONE(1, 0);
479 return(true);482 return true;
480}483}
481484
482485
@@ -1336,7 +1339,8 @@
1336 if (error)1339 if (error)
1337 {1340 {
1338 table->file->print_error(error,MYF(0));1341 table->file->print_error(error,MYF(0));
1339 return(1);1342 DRIZZLE_INSERT_SELECT_DONE(error, 0);
1343 return 1;
1340 }1344 }
1341 char buff[160];1345 char buff[160];
1342 if (info.ignore)1346 if (info.ignore)
@@ -1354,7 +1358,8 @@
1354 (info.copied ? autoinc_value_of_last_inserted_row : 0));1358 (info.copied ? autoinc_value_of_last_inserted_row : 0));
1355 session->my_ok((ulong) session->row_count_func,1359 session->my_ok((ulong) session->row_count_func,
1356 info.copied + info.deleted + info.touched, id, buff);1360 info.copied + info.deleted + info.touched, id, buff);
1357 return(0);1361 DRIZZLE_INSERT_SELECT_DONE(0, session->row_count_func);
1362 return 0;
1358}1363}
13591364
1360void select_insert::abort() {1365void select_insert::abort() {
@@ -1393,6 +1398,11 @@
1393 table->file->ha_release_auto_increment();1398 table->file->ha_release_auto_increment();
1394 }1399 }
13951400
1401 if (DRIZZLE_INSERT_SELECT_DONE_ENABLED())
1402 {
1403 DRIZZLE_INSERT_SELECT_DONE(0, info.copied + info.deleted + info.updated);
1404 }
1405
1396 return;1406 return;
1397}1407}
13981408
13991409
=== modified file 'drizzled/sql_parse.cc'
--- drizzled/sql_parse.cc 2009-08-27 01:04:45 +0000
+++ drizzled/sql_parse.cc 2009-09-17 00:08:20 +0000
@@ -35,6 +35,7 @@
35#include <drizzled/lock.h>35#include <drizzled/lock.h>
36#include <drizzled/select_send.h>36#include <drizzled/select_send.h>
37#include <drizzled/statement.h>37#include <drizzled/statement.h>
38#include "drizzled/probes.h"
3839
39#include <bitset>40#include <bitset>
40#include <algorithm>41#include <algorithm>
@@ -166,7 +167,10 @@
166 bool error= 0;167 bool error= 0;
167 Query_id &query_id= Query_id::get_query_id();168 Query_id &query_id= Query_id::get_query_id();
168169
169 session->command=command;170 DRIZZLE_COMMAND_START(session->thread_id,
171 command);
172
173 session->command= command;
170 session->lex->sql_command= SQLCOM_END; /* to avoid confusing VIEW detectors */174 session->lex->sql_command= SQLCOM_END; /* to avoid confusing VIEW detectors */
171 session->set_time();175 session->set_time();
172 session->query_id= query_id.value();176 session->query_id= query_id.value();
@@ -204,6 +208,9 @@
204 {208 {
205 if (! session->readAndStoreQuery(packet, packet_length))209 if (! session->readAndStoreQuery(packet, packet_length))
206 break; // fatal error is set210 break; // fatal error is set
211 DRIZZLE_QUERY_START(session->query,
212 session->thread_id,
213 const_cast<const char *>(session->db ? session->db : ""));
207 const char* end_of_stmt= NULL;214 const char* end_of_stmt= NULL;
208215
209 mysql_parse(session, session->query, session->query_length, &end_of_stmt);216 mysql_parse(session, session->query, session->query_length, &end_of_stmt);
@@ -295,15 +302,25 @@
295302
296 /* Store temp state for processlist */303 /* Store temp state for processlist */
297 session->set_proc_info("cleaning up");304 session->set_proc_info("cleaning up");
298 session->command=COM_SLEEP;305 session->command= COM_SLEEP;
299 memset(session->process_list_info, 0, PROCESS_LIST_WIDTH);306 memset(session->process_list_info, 0, PROCESS_LIST_WIDTH);
300 session->query=0;307 session->query= 0;
301 session->query_length=0;308 session->query_length= 0;
302309
303 session->set_proc_info(NULL);310 session->set_proc_info(NULL);
304 session->packet.shrink(session->variables.net_buffer_length); // Reclaim some memory311 session->packet.shrink(session->variables.net_buffer_length); // Reclaim some memory
305 free_root(session->mem_root,MYF(MY_KEEP_PREALLOC));312 free_root(session->mem_root,MYF(MY_KEEP_PREALLOC));
306 return(error);313
314 if (DRIZZLE_QUERY_DONE_ENABLED() || DRIZZLE_COMMAND_DONE_ENABLED())
315 {
316 if (command == COM_QUERY)
317 {
318 DRIZZLE_QUERY_DONE(session->is_error());
319 }
320 DRIZZLE_COMMAND_DONE(session->is_error());
321 }
322
323 return error;
307}324}
308325
309326
@@ -759,8 +776,12 @@
759 if (*found_semicolon &&776 if (*found_semicolon &&
760 (session->query_length= (ulong)(*found_semicolon - session->query)))777 (session->query_length= (ulong)(*found_semicolon - session->query)))
761 session->query_length--;778 session->query_length--;
779 DRIZZLE_QUERY_EXEC_START(session->query,
780 session->thread_id,
781 const_cast<const char *>(session->db ? session->db : ""));
762 /* Actually execute the query */782 /* Actually execute the query */
763 mysql_execute_command(session);783 mysql_execute_command(session);
784 DRIZZLE_QUERY_EXEC_DONE(0);
764 }785 }
765 }786 }
766 }787 }
@@ -1819,6 +1840,8 @@
1819{1840{
1820 assert(session->m_lip == NULL);1841 assert(session->m_lip == NULL);
18211842
1843 DRIZZLE_QUERY_PARSE_START(session->query);
1844
1822 /* Set Lex_input_stream. */1845 /* Set Lex_input_stream. */
18231846
1824 session->m_lip= lip;1847 session->m_lip= lip;
@@ -1835,6 +1858,8 @@
18351858
1836 session->m_lip= NULL;1859 session->m_lip= NULL;
18371860
1861 DRIZZLE_QUERY_PARSE_DONE(mysql_parse_status || session->is_fatal_error);
1862
1838 /* That's it. */1863 /* That's it. */
18391864
1840 return mysql_parse_status || session->is_fatal_error;1865 return mysql_parse_status || session->is_fatal_error;
18411866
=== modified file 'drizzled/sql_select.cc'
--- drizzled/sql_select.cc 2009-09-16 20:58:28 +0000
+++ drizzled/sql_select.cc 2009-09-21 14:34:41 +0000
@@ -124,7 +124,7 @@
124{124{
125 bool res;125 bool res;
126 register Select_Lex *select_lex= &lex->select_lex;126 register Select_Lex *select_lex= &lex->select_lex;
127 DRIZZLE_SELECT_START();127 DRIZZLE_SELECT_START(session->query);
128128
129 if (select_lex->master_unit()->is_union() ||129 if (select_lex->master_unit()->is_union() ||
130 select_lex->master_unit()->fake_select_lex)130 select_lex->master_unit()->fake_select_lex)
@@ -157,8 +157,8 @@
157 if (unlikely(res))157 if (unlikely(res))
158 result->abort();158 result->abort();
159159
160 DRIZZLE_SELECT_END();160 DRIZZLE_SELECT_DONE(res, session->limit_found_rows);
161 return(res);161 return res;
162}162}
163163
164/*164/*
165165
=== modified file 'drizzled/sql_update.cc'
--- drizzled/sql_update.cc 2009-08-20 20:29:18 +0000
+++ drizzled/sql_update.cc 2009-09-17 00:08:20 +0000
@@ -139,9 +139,12 @@
139 List<Item> all_fields;139 List<Item> all_fields;
140 Session::killed_state killed_status= Session::NOT_KILLED;140 Session::killed_state killed_status= Session::NOT_KILLED;
141141
142 DRIZZLE_UPDATE_START();142 DRIZZLE_UPDATE_START(session->query);
143 if (session->openTablesLock(table_list))143 if (session->openTablesLock(table_list))
144 {
145 DRIZZLE_UPDATE_DONE(1, 0, 0);
144 return 1;146 return 1;
147 }
145148
146 session->set_proc_info("init");149 session->set_proc_info("init");
147 table= table_list->table;150 table= table_list->table;
@@ -179,8 +182,8 @@
179 if (select_lex->inner_refs_list.elements &&182 if (select_lex->inner_refs_list.elements &&
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))
181 {184 {
182 DRIZZLE_UPDATE_END();185 DRIZZLE_UPDATE_DONE(1, 0, 0);
183 return(-1);186 return -1;
184 }187 }
185188
186 if (conds)189 if (conds)
@@ -215,9 +218,9 @@
215 free_underlaid_joins(session, select_lex);218 free_underlaid_joins(session, select_lex);
216 if (error)219 if (error)
217 goto abort; // Error in where220 goto abort; // Error in where
218 DRIZZLE_UPDATE_END();221 DRIZZLE_UPDATE_DONE(0, 0, 0);
219 session->my_ok(); // No matching records222 session->my_ok(); // No matching records
220 return(0);223 return 0;
221 }224 }
222 if (!select && limit != HA_POS_ERROR)225 if (!select && limit != HA_POS_ERROR)
223 {226 {
@@ -627,7 +630,6 @@
627 id= session->arg_of_last_insert_id_function ?630 id= session->arg_of_last_insert_id_function ?
628 session->first_successful_insert_id_in_prev_stmt : 0;631 session->first_successful_insert_id_in_prev_stmt : 0;
629632
630 DRIZZLE_UPDATE_END();
631 if (error < 0)633 if (error < 0)
632 {634 {
633 char buff[STRING_BUFFER_USUAL_SIZE];635 char buff[STRING_BUFFER_USUAL_SIZE];
@@ -638,7 +640,8 @@
638 }640 }
639 session->count_cuted_fields= CHECK_FIELD_IGNORE; /* calc cuted fields */641 session->count_cuted_fields= CHECK_FIELD_IGNORE; /* calc cuted fields */
640 session->abort_on_warning= 0;642 session->abort_on_warning= 0;
641 return((error >= 0 || session->is_error()) ? 1 : 0);643 DRIZZLE_UPDATE_DONE((error >= 0 || session->is_error()), found, updated);
644 return ((error >= 0 || session->is_error()) ? 1 : 0);
642645
643err:646err:
644 delete select;647 delete select;
@@ -651,8 +654,8 @@
651 session->abort_on_warning= 0;654 session->abort_on_warning= 0;
652655
653abort:656abort:
654 DRIZZLE_UPDATE_END();657 DRIZZLE_UPDATE_DONE(1, 0, 0);
655 return(1);658 return 1;
656}659}
657660
658/*661/*
659662
=== modified file 'drizzled/statement/delete.cc'
--- drizzled/statement/delete.cc 2009-08-10 18:03:39 +0000
+++ drizzled/statement/delete.cc 2009-09-13 04:30:14 +0000
@@ -22,12 +22,14 @@
22#include <drizzled/show.h>22#include <drizzled/show.h>
23#include <drizzled/session.h>23#include <drizzled/session.h>
24#include <drizzled/lock.h>24#include <drizzled/lock.h>
25#include <drizzled/probes.h>
25#include <drizzled/statement/delete.h>26#include <drizzled/statement/delete.h>
2627
27using namespace drizzled;28using namespace drizzled;
2829
29bool statement::Delete::execute()30bool statement::Delete::execute()
30{31{
32 DRIZZLE_DELETE_START(session->query);
31 TableList *first_table= (TableList *) session->lex->select_lex.table_list.first;33 TableList *first_table= (TableList *) session->lex->select_lex.table_list.first;
32 TableList *all_tables= session->lex->query_tables;34 TableList *all_tables= session->lex->query_tables;
33 Select_Lex *select_lex= &session->lex->select_lex;35 Select_Lex *select_lex= &session->lex->select_lex;
3436
=== modified file 'drizzled/statement/insert.cc'
--- drizzled/statement/insert.cc 2009-08-26 23:47:28 +0000
+++ drizzled/statement/insert.cc 2009-09-13 04:30:14 +0000
@@ -22,6 +22,7 @@
22#include <drizzled/show.h>22#include <drizzled/show.h>
23#include <drizzled/lock.h>23#include <drizzled/lock.h>
24#include <drizzled/session.h>24#include <drizzled/session.h>
25#include <drizzled/probes.h>
25#include <drizzled/statement/insert.h>26#include <drizzled/statement/insert.h>
2627
27using namespace drizzled;28using namespace drizzled;
@@ -43,6 +44,8 @@
43 return true;44 return true;
44 }45 }
4546
47 DRIZZLE_INSERT_START(session->query);
48
46 bool res= mysql_insert(session, 49 bool res= mysql_insert(session,
47 all_tables, 50 all_tables,
48 session->lex->field_list, 51 session->lex->field_list,
4952
=== modified file 'drizzled/statement/insert_select.cc'
--- drizzled/statement/insert_select.cc 2009-08-27 00:39:15 +0000
+++ drizzled/statement/insert_select.cc 2009-09-13 04:30:14 +0000
@@ -22,6 +22,7 @@
22#include <drizzled/show.h>22#include <drizzled/show.h>
23#include <drizzled/lock.h>23#include <drizzled/lock.h>
24#include <drizzled/session.h>24#include <drizzled/session.h>
25#include <drizzled/probes.h>
25#include <drizzled/statement/insert_select.h>26#include <drizzled/statement/insert_select.h>
2627
27using namespace drizzled;28using namespace drizzled;
@@ -54,6 +55,7 @@
5455
55 if (! (res= session->openTablesLock(all_tables)))56 if (! (res= session->openTablesLock(all_tables)))
56 {57 {
58 DRIZZLE_INSERT_SELECT_START(session->query);
57 /* Skip first table, which is the table we are inserting in */59 /* Skip first table, which is the table we are inserting in */
58 TableList *second_table= first_table->next_local;60 TableList *second_table= first_table->next_local;
59 select_lex->table_list.first= (unsigned char*) second_table;61 select_lex->table_list.first= (unsigned char*) second_table;
6062
=== modified file 'm4/pandora_64bit.m4'
--- m4/pandora_64bit.m4 2009-08-04 17:58:31 +0000
+++ m4/pandora_64bit.m4 2009-09-14 18:37:34 +0000
@@ -23,7 +23,7 @@
23 AS_IF([test "$isainfo_b" != "x"],[23 AS_IF([test "$isainfo_b" != "x"],[
2424
25 isainfo_k=`${ISAINFO} -k` 25 isainfo_k=`${ISAINFO} -k`
26 DTRACEFLAGS="${DTRACEFLAGS} -${isainfo_k}"26 DTRACEFLAGS="${DTRACEFLAGS} -${isainfo_b}"
2727
28 AS_IF([test "x$ac_enable_64bit" = "xyes"],[28 AS_IF([test "x$ac_enable_64bit" = "xyes"],[
2929
3030
=== modified file 'mysys/my_bitmap.cc'
--- mysys/my_bitmap.cc 2009-07-30 02:39:13 +0000
+++ mysys/my_bitmap.cc 2009-09-15 01:32:36 +0000
@@ -29,7 +29,7 @@
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'
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.
31 */31 */
32 unsigned char const mask= (~((1 << used) - 1)) & 255;32 unsigned char const mask= static_cast<unsigned char const>((~((1 << used) - 1)) & 255);
3333
34 /*34 /*
35 The first bytes are to be set to zero since they represent real bits35 The first bytes are to be set to zero since they represent real bits
@@ -87,9 +87,9 @@
87bool MyBitmap::testAndSet(const uint32_t bitPos)87bool MyBitmap::testAndSet(const uint32_t bitPos)
88{88{
89 unsigned char *value= ((unsigned char*) bitmap) + (bitPos / 8);89 unsigned char *value= ((unsigned char*) bitmap) + (bitPos / 8);
90 unsigned char bit= 1 << ((bitPos) & 7);90 unsigned char bit= static_cast<unsigned char>(1 << ((bitPos) & 7));
91 unsigned char res= (*value) & bit;91 unsigned char res= static_cast<unsigned char>((*value) & bit);
92 *value|= bit;92 *value= static_cast<unsigned char>(*value | bit);
93 return res;93 return res;
94}94}
9595
@@ -98,9 +98,9 @@
98bool MyBitmap::testAndClear(const uint32_t bitPos)98bool MyBitmap::testAndClear(const uint32_t bitPos)
99{99{
100 unsigned char *byte= (unsigned char*) bitmap + (bitPos / 8);100 unsigned char *byte= (unsigned char*) bitmap + (bitPos / 8);
101 unsigned char bit= 1 << ((bitPos) & 7);101 unsigned char bit= static_cast<unsigned char>(1 << ((bitPos) & 7));
102 unsigned char res= (*byte) & bit;102 unsigned char res= static_cast<unsigned char>((*byte) & bit);
103 *byte&= ~bit;103 *byte= static_cast<unsigned char>(*byte & ~bit);
104 return res;104 return res;
105}105}
106106
@@ -133,7 +133,7 @@
133 m+= prefix_bytes;133 m+= prefix_bytes;
134 if ((prefix_bits= prefix_size & 7))134 if ((prefix_bits= prefix_size & 7))
135 {135 {
136 *m++= (1 << prefix_bits)-1;136 *m++= static_cast<unsigned char>((1 << prefix_bits)-1);
137 }137 }
138 if ((d= numOfBytesInMap() - prefix_bytes))138 if ((d= numOfBytesInMap() - prefix_bytes))
139 {139 {
@@ -284,7 +284,7 @@
284284
285void MyBitmap::setAbove(const uint32_t from_byte, const uint32_t use_bit)285void MyBitmap::setAbove(const uint32_t from_byte, const uint32_t use_bit)
286{286{
287 unsigned char use_byte= use_bit ? 0xff : 0;287 unsigned char use_byte= static_cast<unsigned char>(use_bit ? 0xff : 0);
288 unsigned char *to= (unsigned char *) bitmap + from_byte;288 unsigned char *to= (unsigned char *) bitmap + from_byte;
289 unsigned char *end= (unsigned char *) bitmap + (n_bits+7)/8;289 unsigned char *end= (unsigned char *) bitmap + (n_bits+7)/8;
290290
291291
=== modified file 'mysys/my_bitmap.h'
--- mysys/my_bitmap.h 2009-07-30 04:00:24 +0000
+++ mysys/my_bitmap.h 2009-09-15 01:32:36 +0000
@@ -171,7 +171,10 @@
171 */171 */
172 void setBit(const uint32_t bit)172 void setBit(const uint32_t bit)
173 {173 {
174 ((unsigned char *)bitmap)[bit / 8] |= (1 << ((bit) & 7));174 reinterpret_cast<unsigned char *>(bitmap)[bit / 8]=
175 static_cast<unsigned char>(
176 (reinterpret_cast<unsigned char *>(bitmap))[bit / 8] |
177 (1 << ((bit) & 7)));
175 }178 }
176179
177 /**180 /**
@@ -181,7 +184,10 @@
181 */184 */
182 void flipBit(const uint32_t bit)185 void flipBit(const uint32_t bit)
183 {186 {
184 ((unsigned char *)bitmap)[bit / 8] ^= (1 << ((bit) & 7));187 reinterpret_cast<unsigned char *>(bitmap)[bit / 8]=
188 static_cast<unsigned char>(
189 (reinterpret_cast<unsigned char *>(bitmap))[bit / 8] ^
190 (1 << ((bit) & 7)));
185 }191 }
186192
187 /**193 /**
@@ -191,7 +197,10 @@
191 */197 */
192 void clearBit(const uint32_t bit)198 void clearBit(const uint32_t bit)
193 {199 {
194 ((unsigned char *)bitmap)[bit / 8] &= ~ (1 << ((bit) & 7));200 reinterpret_cast<unsigned char *>(bitmap)[bit / 8]=
201 static_cast<unsigned char>(
202 (reinterpret_cast<unsigned char *>(bitmap))[bit / 8] &
203 ~ (1 << ((bit) & 7)));
195 }204 }
196205
197 /**206 /**
198207
=== modified file 'mysys/my_copy.cc'
--- mysys/my_copy.cc 2009-04-17 21:01:47 +0000
+++ mysys/my_copy.cc 2009-09-15 01:32:36 +0000
@@ -79,7 +79,8 @@
79 MyFlags)) < 0)79 MyFlags)) < 0)
80 goto err;80 goto err;
8181
82 while ((Count=my_read(from_file, buff, sizeof(buff), MyFlags)) != 0)82 while ((Count= static_cast<uint32_t>(my_read(from_file, buff,
83 sizeof(buff), MyFlags))) != 0)
83 {84 {
84 if (Count == (uint32_t) -1 ||85 if (Count == (uint32_t) -1 ||
85 my_write(to_file,buff,Count,MYF(MyFlags | MY_NABP)))86 my_write(to_file,buff,Count,MYF(MyFlags | MY_NABP)))
8687
=== modified file 'mysys/my_getopt.cc'
--- mysys/my_getopt.cc 2009-06-24 23:48:15 +0000
+++ mysys/my_getopt.cc 2009-09-15 01:32:36 +0000
@@ -217,7 +217,7 @@
217 }217 }
218 else218 else
219 {219 {
220 length= strlen(opt_str);220 length= static_cast<uint32_t>(strlen(opt_str));
221 optend= 0;221 optend= 0;
222 }222 }
223223
224224
=== modified file 'mysys/my_init.cc'
--- mysys/my_init.cc 2009-05-04 18:11:56 +0000
+++ mysys/my_init.cc 2009-09-15 01:32:36 +0000
@@ -121,10 +121,10 @@
121Non-physical pagefaults %ld, Physical pagefaults %ld, Swaps %ld\n\121Non-physical pagefaults %ld, Physical pagefaults %ld, Swaps %ld\n\
122Blocks in %ld out %ld, Messages in %ld out %ld, Signals %ld\n\122Blocks in %ld out %ld, Messages in %ld out %ld, Signals %ld\n\
123Voluntary context switches %ld, Involuntary context switches %ld\n",123Voluntary context switches %ld, Involuntary context switches %ld\n",
124 (rus.ru_utime.tv_sec * SCALE_SEC +124 static_cast<double>((rus.ru_utime.tv_sec * SCALE_SEC +
125 rus.ru_utime.tv_usec / SCALE_USEC) / 100.0,125 rus.ru_utime.tv_usec / SCALE_USEC)) / 100.0,
126 (rus.ru_stime.tv_sec * SCALE_SEC +126 static_cast<double>((rus.ru_stime.tv_sec * SCALE_SEC +
127 rus.ru_stime.tv_usec / SCALE_USEC) / 100.0,127 rus.ru_stime.tv_usec / SCALE_USEC)) / 100.0,
128 rus.ru_maxrss, rus.ru_idrss,128 rus.ru_maxrss, rus.ru_idrss,
129 rus.ru_minflt, rus.ru_majflt,129 rus.ru_minflt, rus.ru_majflt,
130 rus.ru_nswap, rus.ru_inblock, rus.ru_oublock,130 rus.ru_nswap, rus.ru_inblock, rus.ru_oublock,
131131
=== modified file 'mysys/my_lib.cc'
--- mysys/my_lib.cc 2009-05-23 16:15:00 +0000
+++ mysys/my_lib.cc 2009-09-15 01:32:36 +0000
@@ -142,7 +142,7 @@
142 (void) closedir(dirp);142 (void) closedir(dirp);
143143
144 result->dir_entry= (FILEINFO *)dir_entries_storage->buffer;144 result->dir_entry= (FILEINFO *)dir_entries_storage->buffer;
145 result->number_off_files= dir_entries_storage->elements;145 result->number_off_files= static_cast<uint>(dir_entries_storage->elements);
146146
147 if (!(MyFlags & MY_DONT_SORT))147 if (!(MyFlags & MY_DONT_SORT))
148 my_qsort((void *) result->dir_entry, result->number_off_files,148 my_qsort((void *) result->dir_entry, result->number_off_files,
149149
=== modified file 'mysys/my_symlink2.cc'
--- mysys/my_symlink2.cc 2009-06-16 01:36:01 +0000
+++ mysys/my_symlink2.cc 2009-09-15 01:32:36 +0000
@@ -134,7 +134,8 @@
134 char link_name[FN_REFLEN], tmp_name[FN_REFLEN];134 char link_name[FN_REFLEN], tmp_name[FN_REFLEN];
135 int sym_link_size= -1;135 int sym_link_size= -1;
136 int was_symlink= (!my_disable_symlinks &&136 int was_symlink= (!my_disable_symlinks &&
137 (sym_link_size= readlink(from,link_name,FN_REFLEN-1)) != -1);137 (sym_link_size= static_cast<int>(readlink(from,link_name,
138 FN_REFLEN-1))) != -1);
138 int result=0;139 int result=0;
139 int name_is_different;140 int name_is_different;
140141