diff options
author | Sergei Golubchik <sergii@pisem.net> | 2011-07-14 18:24:01 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2011-07-14 18:24:01 +0200 |
commit | 4b70fc0c56065ba0d0f482add41676d6749ee96e (patch) | |
tree | 6326b830fdc65d7828e5b0d23e3e54aca85b25cd /storage/example | |
parent | a8446356373e84530a4c83759370178ec2bce571 (diff) | |
download | mariadb-git-4b70fc0c56065ba0d0f482add41676d6749ee96e.tar.gz |
less boilerplate code - move common operations to wrappers
Diffstat (limited to 'storage/example')
-rw-r--r-- | storage/example/ha_example.cc | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/storage/example/ha_example.cc b/storage/example/ha_example.cc index 3701957ec4f..f8bb67a5665 100644 --- a/storage/example/ha_example.cc +++ b/storage/example/ha_example.cc @@ -91,11 +91,9 @@ #pragma implementation // gcc: Class implementation #endif -#include "sql_priv.h" -#include "sql_class.h" // MYSQL_HANDLERTON_INTERFACE_VERSION +#include <mysql/plugin.h> #include "ha_example.h" -#include "probes_mysql.h" -#include "sql_plugin.h" +#include "sql_class.h" static handler *example_create_handler(handlerton *hton, TABLE_SHARE *table, @@ -547,9 +545,7 @@ int ha_example::index_read_map(uchar *buf, const uchar *key, { int rc; DBUG_ENTER("ha_example::index_read"); - MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str); rc= HA_ERR_WRONG_COMMAND; - MYSQL_INDEX_READ_ROW_DONE(rc); DBUG_RETURN(rc); } @@ -563,9 +559,7 @@ int ha_example::index_next(uchar *buf) { int rc; DBUG_ENTER("ha_example::index_next"); - MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str); rc= HA_ERR_WRONG_COMMAND; - MYSQL_INDEX_READ_ROW_DONE(rc); DBUG_RETURN(rc); } @@ -579,9 +573,7 @@ int ha_example::index_prev(uchar *buf) { int rc; DBUG_ENTER("ha_example::index_prev"); - MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str); rc= HA_ERR_WRONG_COMMAND; - MYSQL_INDEX_READ_ROW_DONE(rc); DBUG_RETURN(rc); } @@ -600,9 +592,7 @@ int ha_example::index_first(uchar *buf) { int rc; DBUG_ENTER("ha_example::index_first"); - MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str); rc= HA_ERR_WRONG_COMMAND; - MYSQL_INDEX_READ_ROW_DONE(rc); DBUG_RETURN(rc); } @@ -621,9 +611,7 @@ int ha_example::index_last(uchar *buf) { int rc; DBUG_ENTER("ha_example::index_last"); - MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str); rc= HA_ERR_WRONG_COMMAND; - MYSQL_INDEX_READ_ROW_DONE(rc); DBUG_RETURN(rc); } @@ -672,10 +660,7 @@ int ha_example::rnd_next(uchar *buf) { int rc; DBUG_ENTER("ha_example::rnd_next"); - MYSQL_READ_ROW_START(table_share->db.str, table_share->table_name.str, - TRUE); rc= HA_ERR_END_OF_FILE; - MYSQL_READ_ROW_DONE(rc); DBUG_RETURN(rc); } @@ -725,10 +710,7 @@ int ha_example::rnd_pos(uchar *buf, uchar *pos) { int rc; DBUG_ENTER("ha_example::rnd_pos"); - MYSQL_READ_ROW_START(table_share->db.str, table_share->table_name.str, - TRUE); rc= HA_ERR_WRONG_COMMAND; - MYSQL_READ_ROW_DONE(rc); DBUG_RETURN(rc); } |