summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNayuta Yanagisawa <nayuta.yanagisawa@hey.com>2022-02-16 22:21:25 +0900
committerNayuta Yanagisawa <nayuta.yanagisawa@hey.com>2022-02-16 22:21:25 +0900
commitae80e17bab0c8fe64e0cf32244ae70eec305082f (patch)
tree92684c6fd792b9feec29e0bd7f83c650c20092ae
parentc9bc10e6e87229e7990e03a6903c5529ac82d7a8 (diff)
downloadmariadb-git-bb-10.4-MDEV-27260.tar.gz
MDEV-27260 Implement and evaluate select handlers for Spiderbb-10.4-MDEV-27260
Do nothing implementation
-rw-r--r--sql/select_handler.h4
-rw-r--r--storage/spider/CMakeLists.txt2
-rw-r--r--storage/spider/spd_select_handler.cc38
-rw-r--r--storage/spider/spd_select_handler.h28
-rw-r--r--storage/spider/spd_table.cc2
5 files changed, 73 insertions, 1 deletions
diff --git a/sql/select_handler.h b/sql/select_handler.h
index e2ad13b7cdf..6eb92b58fc8 100644
--- a/sql/select_handler.h
+++ b/sql/select_handler.h
@@ -20,6 +20,10 @@
#include "mariadb.h"
#include "sql_priv.h"
+class st_select_lex;
+typedef st_select_lex SELECT_LEX;
+struct TABLE;
+
/**
@class select_handler
diff --git a/storage/spider/CMakeLists.txt b/storage/spider/CMakeLists.txt
index 706b11ac141..55e6852d8b0 100644
--- a/storage/spider/CMakeLists.txt
+++ b/storage/spider/CMakeLists.txt
@@ -18,7 +18,7 @@ SET(SPIDER_SOURCES
spd_table.cc spd_direct_sql.cc spd_udf.cc spd_ping_table.cc
spd_copy_tables.cc spd_i_s.cc spd_malloc.cc ha_spider.cc spd_udf.def
spd_db_mysql.cc spd_db_handlersocket.cc spd_db_oracle.cc
- spd_group_by_handler.cc spd_db_include.cc
+ spd_group_by_handler.cc spd_select_handler.cc spd_db_include.cc
hs_client/config.cpp hs_client/escape.cpp hs_client/fatal.cpp
hs_client/hstcpcli.cpp hs_client/socket.cpp hs_client/string_util.cpp
)
diff --git a/storage/spider/spd_select_handler.cc b/storage/spider/spd_select_handler.cc
new file mode 100644
index 00000000000..3e566a9b93d
--- /dev/null
+++ b/storage/spider/spd_select_handler.cc
@@ -0,0 +1,38 @@
+/* Copyright (C) 2022 MariaDB Corporation.
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free Software
+Foundation; version 2 of the License.
+
+This program is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#include "spd_select_handler.h"
+
+extern handlerton *spider_hton_ptr;
+
+select_handler *spider_create_select_handler(THD *thd, SELECT_LEX *sel)
+{
+ return NULL;
+}
+
+ha_spider_select_handler::ha_spider_select_handler(THD *thd, SELECT_LEX *sel)
+ : select_handler(thd, spider_hton_ptr)
+{
+ select= sel;
+}
+
+ha_spider_select_handler::~ha_spider_select_handler() {}
+
+int ha_spider_select_handler::init_scan() { return 0; }
+
+int ha_spider_select_handler::next_row() { return 0; }
+
+int ha_spider_select_handler::end_scan() { return 0; }
+
+void ha_spider_select_handler::print_error(int, unsigned long){};
diff --git a/storage/spider/spd_select_handler.h b/storage/spider/spd_select_handler.h
new file mode 100644
index 00000000000..6065b470835
--- /dev/null
+++ b/storage/spider/spd_select_handler.h
@@ -0,0 +1,28 @@
+/* Copyright (C) 2022 MariaDB Corporation.
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free Software
+Foundation; version 2 of the License.
+
+This program is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#include "select_handler.h"
+
+select_handler *spider_create_select_handler(THD *thd, SELECT_LEX *sel);
+
+class ha_spider_select_handler: public select_handler
+{
+public:
+ ha_spider_select_handler(THD *thd, SELECT_LEX *sel);
+ ~ha_spider_select_handler();
+ int init_scan();
+ int next_row();
+ int end_scan();
+ void print_error(int, unsigned long);
+};
diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc
index 495e1483ee6..1ec35a11a09 100644
--- a/storage/spider/spd_table.cc
+++ b/storage/spider/spd_table.cc
@@ -46,6 +46,7 @@
#include "spd_direct_sql.h"
#include "spd_malloc.h"
#include "spd_group_by_handler.h"
+#include "spd_select_handler.h"
#include "spd_init_query.h"
/* Background thread management */
@@ -6967,6 +6968,7 @@ int spider_db_init(
#ifdef SPIDER_HAS_GROUP_BY_HANDLER
spider_hton->create_group_by = spider_create_group_by_handler;
#endif
+ spider_hton->create_select = spider_create_select_handler;
memset(&spider_alloc_func_name, 0, sizeof(spider_alloc_func_name));
memset(&spider_alloc_file_name, 0, sizeof(spider_alloc_file_name));