summaryrefslogtreecommitdiff
path: root/storage/federated
diff options
context:
space:
mode:
authorMikael Ronstrom <mikael@mysql.com>2008-12-20 11:01:41 +0100
committerMikael Ronstrom <mikael@mysql.com>2008-12-20 11:01:41 +0100
commitcc958a18dd9554870edd3b1c6119edf72b661879 (patch)
tree36aa1edfd94289934ffa3aa66af64b899e9a9e77 /storage/federated
parent602f612af09c3ccb6db19286291ae0bca403db5c (diff)
downloadmariadb-git-cc958a18dd9554870edd3b1c6119edf72b661879.tar.gz
Backport of DTrace patches from 6.0
Diffstat (limited to 'storage/federated')
-rw-r--r--storage/federated/Makefile.am17
-rw-r--r--storage/federated/ha_federated.cc38
-rw-r--r--storage/federated/ha_federated.h1
3 files changed, 51 insertions, 5 deletions
diff --git a/storage/federated/Makefile.am b/storage/federated/Makefile.am
index 64ea0207017..221b30092d2 100644
--- a/storage/federated/Makefile.am
+++ b/storage/federated/Makefile.am
@@ -48,5 +48,22 @@ libfederated_a_SOURCES= ha_federated.cc
EXTRA_DIST = CMakeLists.txt plug.in
+
+if HAVE_DTRACE_DASH_G
+abs_top_srcdir = @abs_top_srcdir@
+libfederated_a_LIBADD = probes_mysql.o
+libfederated_a_DEPENDENCIES = probes_mysql.o dtrace_files dtrace_providers
+CLEANFILES = probes_mysql.o dtrace_files dtrace_providers
+DTRACEFILES = libfederated_a-ha_federated.o
+DTRACEPROVIDER = $(abs_top_srcdir)/sql/probes_mysql.d
+
+dtrace_files:
+ echo $(DTRACEFILES) > $@
+dtrace_providers:
+ echo $(DTRACEPROVIDER) > $@
+probes_mysql.o: $(DTRACEPROVIDER) $(DTRACEFILES)
+ $(DTRACE) $(DTRACEFLAGS) -G -s $< $(DTRACEFILES) -o $@
+endif
+
# Don't update the files from bitkeeper
%::SCCS/s.%
diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc
index 2f1c5e51caa..69cb2599740 100644
--- a/storage/federated/ha_federated.cc
+++ b/storage/federated/ha_federated.cc
@@ -380,6 +380,7 @@
#endif
#include "ha_federated.h"
+#include "probes_mysql.h"
#include "m_string.h"
@@ -2324,13 +2325,17 @@ int ha_federated::delete_row(const uchar *buf)
int ha_federated::index_read(uchar *buf, const uchar *key,
uint key_len, ha_rkey_function find_flag)
{
+ int rc;
DBUG_ENTER("ha_federated::index_read");
+ MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
if (stored_result)
mysql_free_result(stored_result);
- DBUG_RETURN(index_read_idx_with_result_set(buf, active_index, key,
- key_len, find_flag,
- &stored_result));
+ rc= index_read_idx_with_result_set(buf, active_index, key,
+ key_len, find_flag,
+ &stored_result);
+ MYSQL_INDEX_READ_ROW_DONE(retval);
+ DBUG_RETURN(rc);
}
@@ -2478,6 +2483,7 @@ int ha_federated::read_range_first(const key_range *start_key,
sizeof(sql_query_buffer),
&my_charset_bin);
DBUG_ENTER("ha_federated::read_range_first");
+ MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
DBUG_ASSERT(!(start_key == NULL && end_key == NULL));
@@ -2506,10 +2512,12 @@ int ha_federated::read_range_first(const key_range *start_key,
}
retval= read_next(table->record[0], stored_result);
+ MYSQL_INDEX_READ_ROW_DONE(retval);
DBUG_RETURN(retval);
error:
table->status= STATUS_NOT_FOUND;
+ MYSQL_INDEX_READ_ROW_DONE(retval);
DBUG_RETURN(retval);
}
@@ -2518,7 +2526,9 @@ int ha_federated::read_range_next()
{
int retval;
DBUG_ENTER("ha_federated::read_range_next");
- retval= rnd_next(table->record[0]);
+ MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
+ retval= rnd_next_int(table->record[0]);
+ MYSQL_INDEX_READ_ROW_DONE(retval);
DBUG_RETURN(retval);
}
@@ -2526,9 +2536,13 @@ int ha_federated::read_range_next()
/* Used to read forward through the index. */
int ha_federated::index_next(uchar *buf)
{
+ int retval;
DBUG_ENTER("ha_federated::index_next");
+ MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
ha_statistic_increment(&SSV::ha_read_next_count);
- DBUG_RETURN(read_next(buf, stored_result));
+ retval= read_next(buf, stored_result);
+ MYSQL_INDEX_READ_ROW_DONE(retval);
+ DBUG_RETURN(retval);
}
@@ -2637,7 +2651,18 @@ int ha_federated::index_end(void)
int ha_federated::rnd_next(uchar *buf)
{
+ int rc;
DBUG_ENTER("ha_federated::rnd_next");
+ MYSQL_READ_ROW_START(table_share->db.str, table_share->table_name.str,
+ TRUE);
+ rc= rnd_next_int(buf);
+ MYSQL_READ_ROW_DONE(rc);
+ DBUG_RETURN(rc);
+}
+
+int ha_federated::rnd_next_int(uchar *buf)
+{
+ DBUG_ENTER("ha_federated::rnd_next_int");
if (stored_result == 0)
{
@@ -2726,6 +2751,8 @@ int ha_federated::rnd_pos(uchar *buf, uchar *pos)
{
int result;
DBUG_ENTER("ha_federated::rnd_pos");
+ MYSQL_READ_ROW_START(table_share->db.str, table_share->table_name.str,
+ FALSE);
ha_statistic_increment(&SSV::ha_read_rnd_count);
if (table->s->primary_key != MAX_KEY)
{
@@ -2740,6 +2767,7 @@ int ha_federated::rnd_pos(uchar *buf, uchar *pos)
result= 0;
}
table->status= result ? STATUS_NOT_FOUND : 0;
+ MYSQL_READ_ROW_DONE(result);
DBUG_RETURN(result);
}
diff --git a/storage/federated/ha_federated.h b/storage/federated/ha_federated.h
index 1974f9936fc..552676b6ae8 100644
--- a/storage/federated/ha_federated.h
+++ b/storage/federated/ha_federated.h
@@ -232,6 +232,7 @@ public:
int rnd_init(bool scan); //required
int rnd_end();
int rnd_next(uchar *buf); //required
+ int rnd_next_int(uchar *buf);
int rnd_pos(uchar *buf, uchar *pos); //required
void position(const uchar *record); //required
int info(uint); //required