diff options
Diffstat (limited to 'storage/csv')
-rw-r--r-- | storage/csv/Makefile.am | 17 | ||||
-rw-r--r-- | storage/csv/ha_tina.cc | 27 |
2 files changed, 39 insertions, 5 deletions
diff --git a/storage/csv/Makefile.am b/storage/csv/Makefile.am index 07ffac88a96..e4d90334d64 100644 --- a/storage/csv/Makefile.am +++ b/storage/csv/Makefile.am @@ -41,5 +41,22 @@ libcsv_a_CXXFLAGS = $(AM_CFLAGS) libcsv_a_SOURCES = transparent_file.cc ha_tina.cc EXTRA_DIST = CMakeLists.txt plug.in + +if HAVE_DTRACE_DASH_G +abs_top_srcdir = @abs_top_srcdir@ +libcsv_a_LIBADD = probes_mysql.o +libcsv_a_DEPENDENCIES = probes_mysql.o dtrace_files dtrace_providers +CLEANFILES = probes_mysql.o dtrace_files dtrace_providers +DTRACEFILES = libcsv_a-ha_tina.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/csv/ha_tina.cc b/storage/csv/ha_tina.cc index a1ff0e29ad1..cc801b33955 100644 --- a/storage/csv/ha_tina.cc +++ b/storage/csv/ha_tina.cc @@ -48,6 +48,7 @@ TODO: #include "mysql_priv.h" #include <mysql/plugin.h> #include "ha_tina.h" +#include "probes_mysql.h" /* @@ -1095,9 +1096,14 @@ int ha_tina::rnd_next(uchar *buf) { int rc; DBUG_ENTER("ha_tina::rnd_next"); + MYSQL_READ_ROW_START(table_share->db.str, table_share->table_name.str, + TRUE); if (share->crashed) - DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE); + { + rc= HA_ERR_CRASHED_ON_USAGE; + goto end; + } ha_statistic_increment(&SSV::ha_read_rnd_next_count); @@ -1105,13 +1111,19 @@ int ha_tina::rnd_next(uchar *buf) /* don't scan an empty file */ if (!local_saved_data_file_length) - DBUG_RETURN(HA_ERR_END_OF_FILE); + { + rc= HA_ERR_END_OF_FILE; + goto end; + } if ((rc= find_current_row(buf))) - DBUG_RETURN(rc); + goto end; stats.records++; - DBUG_RETURN(0); + rc= 0; +end: + MYSQL_READ_ROW_DONE(rc); + DBUG_RETURN(rc); } /* @@ -1138,10 +1150,15 @@ void ha_tina::position(const uchar *record) int ha_tina::rnd_pos(uchar * buf, uchar *pos) { + int rc; DBUG_ENTER("ha_tina::rnd_pos"); + MYSQL_READ_ROW_START(table_share->db.str, table_share->table_name.str, + FALSE); ha_statistic_increment(&SSV::ha_read_rnd_count); current_position= (off_t)my_get_ptr(pos,ref_length); - DBUG_RETURN(find_current_row(buf)); + rc= find_current_row(buf); + MYSQL_READ_ROW_DONE(rc); + DBUG_RETURN(rc); } /* |