1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

Replace ha_calpont with ha_mcs in the source code and filenames in the plugin code.

This commit is contained in:
Gagan Goel
2019-10-09 19:49:37 +00:00
parent 6b650e859d
commit c8df46ed26
23 changed files with 312 additions and 312 deletions

View File

@ -1293,7 +1293,7 @@
<codegenerator language="C++" > <codegenerator language="C++" >
<classifiercodedocument writeOutCode="true" package="" id="632" parent_class="632" fileExt=".cpp" fileName="ha_calpont" > <classifiercodedocument writeOutCode="true" package="" id="632" parent_class="632" fileExt=".cpp" fileName="ha_calpont" >
<textblocks> <textblocks>
<codeblockwithcomments tag="includes" text="#include &quot;ha_calpont.h&quot;&amp;#010;" > <codeblockwithcomments tag="includes" text="#include &quot;ha_mcs.h&quot;&amp;#010;" >
<header> <header>
<cppcodedocumentation tag="" writeOutText="false" /> <cppcodedocumentation tag="" writeOutText="false" />
</header> </header>

View File

@ -7,11 +7,11 @@ SET ( libcalmysql_SRCS
ha_mcs_sysvars.cpp ha_mcs_sysvars.cpp
ha_mcs_client_udfs.cpp ha_mcs_client_udfs.cpp
ha_mcs_pushdown.cpp ha_mcs_pushdown.cpp
ha_calpont.cpp ha_mcs.cpp
ha_calpont_impl.cpp ha_mcs_impl.cpp
ha_calpont_dml.cpp ha_mcs_dml.cpp
ha_calpont_ddl.cpp ha_mcs_ddl.cpp
ha_calpont_execplan.cpp ha_mcs_execplan.cpp
ha_scalar_sub.cpp ha_scalar_sub.cpp
ha_in_sub.cpp ha_in_sub.cpp
ha_exists_sub.cpp ha_exists_sub.cpp
@ -19,12 +19,12 @@ SET ( libcalmysql_SRCS
ha_select_sub.cpp ha_select_sub.cpp
ha_view.cpp sm.cpp ha_view.cpp sm.cpp
ha_window_function.cpp ha_window_function.cpp
ha_calpont_partition.cpp ha_mcs_partition.cpp
ha_pseudocolumn.cpp) ha_pseudocolumn.cpp)
add_definitions(-DMYSQL_DYNAMIC_PLUGIN) add_definitions(-DMYSQL_DYNAMIC_PLUGIN)
set_source_files_properties(ha_calpont.cpp PROPERTIES COMPILE_FLAGS "-fno-implicit-templates") set_source_files_properties(ha_mcs.cpp PROPERTIES COMPILE_FLAGS "-fno-implicit-templates")
add_library(calmysql SHARED ${libcalmysql_SRCS}) add_library(calmysql SHARED ${libcalmysql_SRCS})
@ -89,7 +89,7 @@ install(FILES syscatalog_mysql.sql
calshowprocesslist.sql calshowprocesslist.sql
columnstore_info.sql columnstore_info.sql
DESTINATION ${ENGINE_MYSQLDIR} COMPONENT storage-engine) DESTINATION ${ENGINE_MYSQLDIR} COMPONENT storage-engine)
install(PROGRAMS install_calpont_mysql.sh mysql-Columnstore install(PROGRAMS install_mcs_mysql.sh mysql-Columnstore
DESTINATION ${ENGINE_MYSQLDIR} COMPONENT storage-engine) DESTINATION ${ENGINE_MYSQLDIR} COMPONENT storage-engine)
install(FILES columnstore.cnf install(FILES columnstore.cnf
@ -101,15 +101,15 @@ install(FILES columnstore.cnf
#AM_CXXFLAGS = $(idb_cxxflags) #AM_CXXFLAGS = $(idb_cxxflags)
#AM_LDFLAGS = $(idb_ldflags) #AM_LDFLAGS = $(idb_ldflags)
#lib_LTLIBRARIES = libcalmysql.la #lib_LTLIBRARIES = libcalmysql.la
#libcalmysql_la_SOURCES = ha_calpont.cpp ha_calpont_impl.cpp ha_calpont_dml.cpp ha_calpont_ddl.cpp ha_calpont_execplan.cpp ha_scalar_sub.cpp ha_in_sub.cpp ha_exists_sub.cpp ha_from_sub.cpp ha_select_sub.cpp ha_view.cpp sm.cpp ha_window_function.cpp ha_calpont_partition.cpp ha_pseudocolumn.cpp #libcalmysql_la_SOURCES = ha_mcs.cpp ha_mcs_impl.cpp ha_mcs_dml.cpp ha_mcs_ddl.cpp ha_mcs_execplan.cpp ha_scalar_sub.cpp ha_in_sub.cpp ha_exists_sub.cpp ha_from_sub.cpp ha_select_sub.cpp ha_view.cpp sm.cpp ha_window_function.cpp ha_mcs_partition.cpp ha_pseudocolumn.cpp
#libcalmysql_la_LDFLAGS = -version-info 1:0:0 $(idb_common_ldflags) $(idb_common_libs) $(idb_write_libs) $(AM_LDFLAGS) #libcalmysql_la_LDFLAGS = -version-info 1:0:0 $(idb_common_ldflags) $(idb_common_libs) $(idb_write_libs) $(AM_LDFLAGS)
#libcalmysql_la_CPPFLAGS = -I/usr/include/libxml2 -I../../../mysql/include -I../../../mysql/sql -I../../../mysql/regex -DMYSQL_DYNAMIC_PLUGIN $(AM_CPPFLAGS) #libcalmysql_la_CPPFLAGS = -I/usr/include/libxml2 -I../../../mysql/include -I../../../mysql/sql -I../../../mysql/regex -DMYSQL_DYNAMIC_PLUGIN $(AM_CPPFLAGS)
#include_HEADERS = idb_mysql.h #include_HEADERS = idb_mysql.h
# #
#dist_mysql_DATA = syscatalog_mysql.sql dumpcat_mysql.sql calsetuserpriority.sql calremoveuserpriority.sql calshowprocesslist.sql my.cnf #dist_mysql_DATA = syscatalog_mysql.sql dumpcat_mysql.sql calsetuserpriority.sql calremoveuserpriority.sql calshowprocesslist.sql my.cnf
#dist_mysql_SCRIPTS = install_calpont_mysql.sh mysql-Columnstore dumpcat.pl #dist_mysql_SCRIPTS = install_mcs_mysql.sh mysql-Columnstore dumpcat.pl
# #
#libcalmysql_la-ha_calpont.lo: ha_calpont.cpp #libcalmysql_la-ha_mcs.lo: ha_mcs.cpp
# if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcalmysql_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -fno-rtti -fno-implicit-templates -MT libcalmysql_la-ha_calpont.lo -MD -MP -MF "$(DEPDIR)/libcalmysql_la-ha_calpont.Tpo" -c -o libcalmysql_la-ha_calpont.lo `test -f 'ha_calpont.cpp' || echo '$(srcdir)/'`ha_calpont.cpp; \ # if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcalmysql_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -fno-rtti -fno-implicit-templates -MT libcalmysql_la-ha_mcs.lo -MD -MP -MF "$(DEPDIR)/libcalmysql_la-ha_mcs.Tpo" -c -o libcalmysql_la-ha_mcs.lo `test -f 'ha_mcs.cpp' || echo '$(srcdir)/'`ha_mcs.cpp; \
# then mv -f "$(DEPDIR)/libcalmysql_la-ha_calpont.Tpo" "$(DEPDIR)/libcalmysql_la-ha_calpont.Plo"; else rm -f "$(DEPDIR)/libcalmysql_la-ha_calpont.Tpo"; exit 1; fi # then mv -f "$(DEPDIR)/libcalmysql_la-ha_mcs.Tpo" "$(DEPDIR)/libcalmysql_la-ha_mcs.Plo"; else rm -f "$(DEPDIR)/libcalmysql_la-ha_mcs.Tpo"; exit 1; fi

View File

@ -1,78 +0,0 @@
/* Copyright (C) 2014 InfiniDB, Inc.
Copyright (C) 2016 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., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA. */
#ifndef HA_CALPONT_IMPL_H__
#define HA_CALPONT_IMPL_H__
#include "idb_mysql.h"
#ifdef NEED_CALPONT_EXTERNS
// Forward declaration.
struct mcs_handler_info;
extern int ha_calpont_impl_discover_existence(const char* schema, const char* name);
extern int ha_calpont_impl_create(const char* name, TABLE* table_arg, HA_CREATE_INFO* create_info);
extern int ha_calpont_impl_delete_table(const char* name);
extern int ha_calpont_impl_open(const char* name, int mode, uint32_t test_if_locked);
extern int ha_calpont_impl_close(void);
extern int ha_calpont_impl_rnd_init(TABLE* table);
extern int ha_calpont_impl_rnd_next(uchar* buf, TABLE* table);
extern int ha_calpont_impl_rnd_end(TABLE* table, bool is_derived_hand = false);
extern int ha_calpont_impl_write_row(const uchar* buf, TABLE* table);
extern void ha_calpont_impl_start_bulk_insert(ha_rows rows, TABLE* table);
extern int ha_calpont_impl_end_bulk_insert(bool abort, TABLE* table);
extern int ha_calpont_impl_rename_table(const char* from, const char* to);
extern int ha_calpont_impl_commit (handlerton* hton, THD* thd, bool all);
extern int ha_calpont_impl_rollback (handlerton* hton, THD* thd, bool all);
extern int ha_calpont_impl_close_connection (handlerton* hton, THD* thd);
extern COND* ha_calpont_impl_cond_push(COND* cond, TABLE* table);
extern int ha_calpont_impl_external_lock(THD* thd, TABLE* table, int lock_type);
extern int ha_calpont_impl_update_row();
extern int ha_calpont_impl_delete_row();
extern int ha_calpont_impl_rnd_pos(uchar* buf, uchar* pos);
extern int ha_cs_impl_pushdown_init(mcs_handler_info* handler_info, TABLE* table);
extern int ha_cs_impl_select_next(uchar *buf, TABLE *table);
extern int ha_calpont_impl_group_by_init(mcs_handler_info *handler_info, TABLE* table);
extern int ha_calpont_impl_group_by_next(TABLE* table);
extern int ha_calpont_impl_group_by_end(TABLE* table);
#endif
#ifdef NEED_CALPONT_INTERFACE
#include "ha_calpont_impl_if.h"
#include "calpontsystemcatalog.h"
#include "ha_calpont.h"
extern int ha_calpont_impl_rename_table_(const char* from, const char* to, cal_impl_if::cal_connection_info& ci);
extern int ha_calpont_impl_write_row_(const uchar* buf, TABLE* table, cal_impl_if::cal_connection_info& ci, ha_rows& rowsInserted);
extern int ha_calpont_impl_write_batch_row_(const uchar* buf, TABLE* table, cal_impl_if::cal_connection_info& ci);
extern int ha_calpont_impl_write_last_batch(TABLE* table, cal_impl_if::cal_connection_info& ci, bool abort);
extern int ha_calpont_impl_commit_ (handlerton* hton, THD* thd, bool all, cal_impl_if::cal_connection_info& ci);
extern int ha_calpont_impl_rollback_ (handlerton* hton, THD* thd, bool all, cal_impl_if::cal_connection_info& ci);
extern int ha_calpont_impl_close_connection_ (handlerton* hton, THD* thd, cal_impl_if::cal_connection_info& ci);
extern int ha_calpont_impl_delete_table_(const char* db, const char* name, cal_impl_if::cal_connection_info& ci);
extern int ha_calpont_impl_create_(const char* name, TABLE* table_arg, HA_CREATE_INFO* create_info,
cal_impl_if::cal_connection_info& ci);
extern std::string ha_calpont_impl_markpartition_ (execplan::CalpontSystemCatalog::TableName tableName, uint32_t partition);
extern std::string ha_calpont_impl_restorepartition_ (execplan::CalpontSystemCatalog::TableName tableName, uint32_t partition);
extern std::string ha_calpont_impl_droppartition_ (execplan::CalpontSystemCatalog::TableName tableName, uint32_t partition);
extern std::string ha_calpont_impl_viewtablelock( cal_impl_if::cal_connection_info& ci, execplan::CalpontSystemCatalog::TableName& tablename);
extern std::string ha_calpont_impl_cleartablelock( cal_impl_if::cal_connection_info& ci, uint64_t tableLockID);
#endif
#endif

View File

@ -17,12 +17,12 @@
MA 02110-1301, USA. */ MA 02110-1301, USA. */
#include <typeinfo> #include <typeinfo>
#include "ha_calpont.h" #include "ha_mcs.h"
#include "columnstoreversion.h" #include "columnstoreversion.h"
#include "ha_mcs_pushdown.h" #include "ha_mcs_pushdown.h"
#define NEED_CALPONT_EXTERNS #define NEED_CALPONT_EXTERNS
#include "ha_calpont_impl.h" #include "ha_mcs_impl.h"
static handler* calpont_create_handler(handlerton* hton, static handler* calpont_create_handler(handlerton* hton,
TABLE_SHARE* table, TABLE_SHARE* table,
@ -39,7 +39,7 @@ char cs_commit_hash[41]; // a commit hash is 40 characters
// handlers creation function for hton. // handlers creation function for hton.
// Look into ha_mcs_pushdown.* for more details. // Look into ha_mcs_pushdown.* for more details.
group_by_handler* group_by_handler*
create_calpont_group_by_handler(THD* thd, Query* query); create_columnstore_group_by_handler(THD* thd, Query* query);
derived_handler* derived_handler*
create_columnstore_derived_handler(THD* thd, TABLE_LIST *derived); create_columnstore_derived_handler(THD* thd, TABLE_LIST *derived);
@ -93,7 +93,7 @@ int calpont_discover(handlerton* hton, THD* thd, TABLE_SHARE* share)
size_t frm_len = 0; size_t frm_len = 0;
int error = 0; int error = 0;
if (!ha_calpont_impl_discover_existence(share->db.str, share->table_name.str)) if (!ha_mcs_impl_discover_existence(share->db.str, share->table_name.str))
DBUG_RETURN(HA_ERR_NO_SUCH_TABLE); DBUG_RETURN(HA_ERR_NO_SUCH_TABLE);
error = share->read_frm_image((const uchar**)&frm_data, &frm_len); error = share->read_frm_image((const uchar**)&frm_data, &frm_len);
@ -111,7 +111,7 @@ int calpont_discover(handlerton* hton, THD* thd, TABLE_SHARE* share)
int calpont_discover_existence(handlerton* hton, const char* db, int calpont_discover_existence(handlerton* hton, const char* db,
const char* table_name) const char* table_name)
{ {
return ha_calpont_impl_discover_existence(db, table_name); return ha_mcs_impl_discover_existence(db, table_name);
} }
static int columnstore_init_func(void* p) static int columnstore_init_func(void* p)
@ -151,7 +151,7 @@ static int columnstore_init_func(void* p)
mcs_hton->commit = calpont_commit; mcs_hton->commit = calpont_commit;
mcs_hton->rollback = calpont_rollback; mcs_hton->rollback = calpont_rollback;
mcs_hton->close_connection = calpont_close_connection; mcs_hton->close_connection = calpont_close_connection;
mcs_hton->create_group_by = create_calpont_group_by_handler; mcs_hton->create_group_by = create_columnstore_group_by_handler;
mcs_hton->create_derived = create_columnstore_derived_handler; mcs_hton->create_derived = create_columnstore_derived_handler;
mcs_hton->create_select = create_columnstore_select_handler; mcs_hton->create_select = create_columnstore_select_handler;
DBUG_RETURN(0); DBUG_RETURN(0);
@ -172,28 +172,28 @@ static handler* calpont_create_handler(handlerton* hton,
TABLE_SHARE* table, TABLE_SHARE* table,
MEM_ROOT* mem_root) MEM_ROOT* mem_root)
{ {
return new (mem_root) ha_calpont(hton, table); return new (mem_root) ha_mcs(hton, table);
} }
static int calpont_commit(handlerton* hton, THD* thd, bool all) static int calpont_commit(handlerton* hton, THD* thd, bool all)
{ {
int rc = ha_calpont_impl_commit( hton, thd, all); int rc = ha_mcs_impl_commit( hton, thd, all);
return rc; return rc;
} }
static int calpont_rollback(handlerton* hton, THD* thd, bool all) static int calpont_rollback(handlerton* hton, THD* thd, bool all)
{ {
int rc = ha_calpont_impl_rollback( hton, thd, all); int rc = ha_mcs_impl_rollback( hton, thd, all);
return rc; return rc;
} }
static int calpont_close_connection ( handlerton* hton, THD* thd ) static int calpont_close_connection ( handlerton* hton, THD* thd )
{ {
int rc = ha_calpont_impl_close_connection( hton, thd); int rc = ha_mcs_impl_close_connection( hton, thd);
return rc; return rc;
} }
ha_calpont::ha_calpont(handlerton* hton, TABLE_SHARE* table_arg) : ha_mcs::ha_mcs(handlerton* hton, TABLE_SHARE* table_arg) :
handler(hton, table_arg), handler(hton, table_arg),
int_table_flags(HA_BINLOG_STMT_CAPABLE | HA_BINLOG_ROW_CAPABLE | int_table_flags(HA_BINLOG_STMT_CAPABLE | HA_BINLOG_ROW_CAPABLE |
HA_TABLE_SCAN_ON_INDEX | HA_TABLE_SCAN_ON_INDEX |
@ -221,14 +221,14 @@ ha_calpont::ha_calpont(handlerton* hton, TABLE_SHARE* table_arg) :
delete_table method in handler.cc delete_table method in handler.cc
*/ */
static const char* ha_calpont_exts[] = static const char* ha_mcs_exts[] =
{ {
NullS NullS
}; };
const char** ha_calpont::bas_ext() const const char** ha_mcs::bas_ext() const
{ {
return ha_calpont_exts; return ha_mcs_exts;
} }
/** /**
@ -247,11 +247,11 @@ const char** ha_calpont::bas_ext() const
handler::ha_open() in handler.cc handler::ha_open() in handler.cc
*/ */
int ha_calpont::open(const char* name, int mode, uint32_t test_if_locked) int ha_mcs::open(const char* name, int mode, uint32_t test_if_locked)
{ {
DBUG_ENTER("ha_calpont::open"); DBUG_ENTER("ha_mcs::open");
int rc = ha_calpont_impl_open(name, mode, test_if_locked); int rc = ha_mcs_impl_open(name, mode, test_if_locked);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
@ -273,11 +273,11 @@ int ha_calpont::open(const char* name, int mode, uint32_t test_if_locked)
sql_base.cc, sql_select.cc and table.cc sql_base.cc, sql_select.cc and table.cc
*/ */
int ha_calpont::close(void) int ha_mcs::close(void)
{ {
DBUG_ENTER("ha_calpont::close"); DBUG_ENTER("ha_mcs::close");
int rc = ha_calpont_impl_close(); int rc = ha_mcs_impl_close();
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
@ -313,33 +313,33 @@ int ha_calpont::close(void)
sql_insert.cc, sql_select.cc, sql_table.cc, sql_udf.cc and sql_update.cc sql_insert.cc, sql_select.cc, sql_table.cc, sql_udf.cc and sql_update.cc
*/ */
int ha_calpont::write_row(const uchar* buf) int ha_mcs::write_row(const uchar* buf)
{ {
DBUG_ENTER("ha_calpont::write_row"); DBUG_ENTER("ha_mcs::write_row");
int rc = ha_calpont_impl_write_row(buf, table); int rc = ha_mcs_impl_write_row(buf, table);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
void ha_calpont::start_bulk_insert(ha_rows rows, uint flags) void ha_mcs::start_bulk_insert(ha_rows rows, uint flags)
{ {
DBUG_ENTER("ha_calpont::start_bulk_insert"); DBUG_ENTER("ha_mcs::start_bulk_insert");
ha_calpont_impl_start_bulk_insert(rows, table); ha_mcs_impl_start_bulk_insert(rows, table);
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
int ha_calpont::end_bulk_insert(bool abort) int ha_mcs::end_bulk_insert(bool abort)
{ {
DBUG_ENTER("ha_calpont::end_bulk_insert"); DBUG_ENTER("ha_mcs::end_bulk_insert");
int rc = ha_calpont_impl_end_bulk_insert(abort, table); int rc = ha_mcs_impl_end_bulk_insert(abort, table);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
/**@bug 2461 - Overloaded end_bulk_insert. MariaDB uses the abort bool, mysql does not. */ /**@bug 2461 - Overloaded end_bulk_insert. MariaDB uses the abort bool, mysql does not. */
int ha_calpont::end_bulk_insert() int ha_mcs::end_bulk_insert()
{ {
DBUG_ENTER("ha_calpont::end_bulk_insert"); DBUG_ENTER("ha_mcs::end_bulk_insert");
int rc = ha_calpont_impl_end_bulk_insert(false, table); int rc = ha_mcs_impl_end_bulk_insert(false, table);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
@ -365,11 +365,11 @@ int ha_calpont::end_bulk_insert()
@see @see
sql_select.cc, sql_acl.cc, sql_update.cc and sql_insert.cc sql_select.cc, sql_acl.cc, sql_update.cc and sql_insert.cc
*/ */
int ha_calpont::update_row(const uchar* old_data, uchar* new_data) int ha_mcs::update_row(const uchar* old_data, uchar* new_data)
{ {
DBUG_ENTER("ha_calpont::update_row"); DBUG_ENTER("ha_mcs::update_row");
int rc = ha_calpont_impl_update_row(); int rc = ha_mcs_impl_update_row();
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
@ -394,10 +394,10 @@ int ha_calpont::update_row(const uchar* old_data, uchar* new_data)
sql_acl.cc, sql_udf.cc, sql_delete.cc, sql_insert.cc and sql_select.cc sql_acl.cc, sql_udf.cc, sql_delete.cc, sql_insert.cc and sql_select.cc
*/ */
int ha_calpont::delete_row(const uchar* buf) int ha_mcs::delete_row(const uchar* buf)
{ {
DBUG_ENTER("ha_calpont::delete_row"); DBUG_ENTER("ha_mcs::delete_row");
int rc = ha_calpont_impl_delete_row(); int rc = ha_mcs_impl_delete_row();
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
@ -408,12 +408,12 @@ int ha_calpont::delete_row(const uchar* buf)
index. index.
*/ */
int ha_calpont::index_read_map(uchar* buf, const uchar* key, int ha_mcs::index_read_map(uchar* buf, const uchar* key,
key_part_map keypart_map __attribute__((unused)), key_part_map keypart_map __attribute__((unused)),
enum ha_rkey_function find_flag enum ha_rkey_function find_flag
__attribute__((unused))) __attribute__((unused)))
{ {
DBUG_ENTER("ha_calpont::index_read"); DBUG_ENTER("ha_mcs::index_read");
DBUG_RETURN(HA_ERR_WRONG_COMMAND); DBUG_RETURN(HA_ERR_WRONG_COMMAND);
} }
@ -423,9 +423,9 @@ int ha_calpont::index_read_map(uchar* buf, const uchar* key,
Used to read forward through the index. Used to read forward through the index.
*/ */
int ha_calpont::index_next(uchar* buf) int ha_mcs::index_next(uchar* buf)
{ {
DBUG_ENTER("ha_calpont::index_next"); DBUG_ENTER("ha_mcs::index_next");
DBUG_RETURN(HA_ERR_WRONG_COMMAND); DBUG_RETURN(HA_ERR_WRONG_COMMAND);
} }
@ -435,9 +435,9 @@ int ha_calpont::index_next(uchar* buf)
Used to read backwards through the index. Used to read backwards through the index.
*/ */
int ha_calpont::index_prev(uchar* buf) int ha_mcs::index_prev(uchar* buf)
{ {
DBUG_ENTER("ha_calpont::index_prev"); DBUG_ENTER("ha_mcs::index_prev");
DBUG_RETURN(HA_ERR_WRONG_COMMAND); DBUG_RETURN(HA_ERR_WRONG_COMMAND);
} }
@ -452,9 +452,9 @@ int ha_calpont::index_prev(uchar* buf)
@see @see
opt_range.cc, opt_sum.cc, sql_handler.cc and sql_select.cc opt_range.cc, opt_sum.cc, sql_handler.cc and sql_select.cc
*/ */
int ha_calpont::index_first(uchar* buf) int ha_mcs::index_first(uchar* buf)
{ {
DBUG_ENTER("ha_calpont::index_first"); DBUG_ENTER("ha_mcs::index_first");
DBUG_RETURN(HA_ERR_WRONG_COMMAND); DBUG_RETURN(HA_ERR_WRONG_COMMAND);
} }
@ -469,9 +469,9 @@ int ha_calpont::index_first(uchar* buf)
@see @see
opt_range.cc, opt_sum.cc, sql_handler.cc and sql_select.cc opt_range.cc, opt_sum.cc, sql_handler.cc and sql_select.cc
*/ */
int ha_calpont::index_last(uchar* buf) int ha_mcs::index_last(uchar* buf)
{ {
DBUG_ENTER("ha_calpont::index_last"); DBUG_ENTER("ha_mcs::index_last");
DBUG_RETURN(HA_ERR_WRONG_COMMAND); DBUG_RETURN(HA_ERR_WRONG_COMMAND);
} }
@ -489,24 +489,24 @@ int ha_calpont::index_last(uchar* buf)
@see @see
filesort.cc, records.cc, sql_handler.cc, sql_select.cc, sql_table.cc and sql_update.cc filesort.cc, records.cc, sql_handler.cc, sql_select.cc, sql_table.cc and sql_update.cc
*/ */
int ha_calpont::rnd_init(bool scan) int ha_mcs::rnd_init(bool scan)
{ {
DBUG_ENTER("ha_calpont::rnd_init"); DBUG_ENTER("ha_mcs::rnd_init");
int rc = 0; int rc = 0;
if(scan) if(scan)
{ {
rc = ha_calpont_impl_rnd_init(table); rc = ha_mcs_impl_rnd_init(table);
} }
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
int ha_calpont::rnd_end() int ha_mcs::rnd_end()
{ {
DBUG_ENTER("ha_calpont::rnd_end"); DBUG_ENTER("ha_mcs::rnd_end");
int rc = ha_calpont_impl_rnd_end(table); int rc = ha_mcs_impl_rnd_end(table);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
@ -526,11 +526,11 @@ int ha_calpont::rnd_end()
@see @see
filesort.cc, records.cc, sql_handler.cc, sql_select.cc, sql_table.cc and sql_update.cc filesort.cc, records.cc, sql_handler.cc, sql_select.cc, sql_table.cc and sql_update.cc
*/ */
int ha_calpont::rnd_next(uchar* buf) int ha_mcs::rnd_next(uchar* buf)
{ {
DBUG_ENTER("ha_calpont::rnd_next"); DBUG_ENTER("ha_mcs::rnd_next");
int rc = ha_calpont_impl_rnd_next(buf, table); int rc = ha_mcs_impl_rnd_next(buf, table);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
@ -563,9 +563,9 @@ int ha_calpont::rnd_next(uchar* buf)
// allow for implementing blobs (is that the same as varbinary?). Perhaps using // allow for implementing blobs (is that the same as varbinary?). Perhaps using
// lbid and offset as key would work, or something. We also need to add functionality // lbid and offset as key would work, or something. We also need to add functionality
// to retrieve records quickly by this "key" // to retrieve records quickly by this "key"
void ha_calpont::position(const uchar* record) void ha_mcs::position(const uchar* record)
{ {
DBUG_ENTER("ha_calpont::position"); DBUG_ENTER("ha_mcs::position");
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
@ -583,10 +583,10 @@ void ha_calpont::position(const uchar* record)
@see @see
filesort.cc, records.cc, sql_insert.cc, sql_select.cc and sql_update.cc filesort.cc, records.cc, sql_insert.cc, sql_select.cc and sql_update.cc
*/ */
int ha_calpont::rnd_pos(uchar* buf, uchar* pos) int ha_mcs::rnd_pos(uchar* buf, uchar* pos)
{ {
DBUG_ENTER("ha_calpont::rnd_pos"); DBUG_ENTER("ha_mcs::rnd_pos");
int rc = ha_calpont_impl_rnd_pos(buf, pos); int rc = ha_mcs_impl_rnd_pos(buf, pos);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
@ -629,9 +629,9 @@ int ha_calpont::rnd_pos(uchar* buf, uchar* pos)
sql_select.cc, sql_show.cc, sql_show.cc, sql_show.cc, sql_show.cc, sql_table.cc, sql_select.cc, sql_show.cc, sql_show.cc, sql_show.cc, sql_show.cc, sql_table.cc,
sql_union.cc and sql_update.cc sql_union.cc and sql_update.cc
*/ */
int ha_calpont::info(uint32_t flag) int ha_mcs::info(uint32_t flag)
{ {
DBUG_ENTER("ha_calpont::info"); DBUG_ENTER("ha_mcs::info");
// @bug 1635. Raise this number magically fix the filesort crash issue. May need to twist // @bug 1635. Raise this number magically fix the filesort crash issue. May need to twist
// the number again if the issue re-occurs // the number again if the issue re-occurs
stats.records = 2000; stats.records = 2000;
@ -651,9 +651,9 @@ int ha_calpont::info(uint32_t flag)
@see @see
ha_innodb.cc ha_innodb.cc
*/ */
int ha_calpont::extra(enum ha_extra_function operation) int ha_mcs::extra(enum ha_extra_function operation)
{ {
DBUG_ENTER("ha_calpont::extra"); DBUG_ENTER("ha_mcs::extra");
#ifdef INFINIDB_DEBUG #ifdef INFINIDB_DEBUG
{ {
const char* hefs; const char* hefs;
@ -685,7 +685,7 @@ int ha_calpont::extra(enum ha_extra_function operation)
break; break;
} }
fprintf(stderr, "ha_calpont::extra(\"%s\", %d: %s)\n", table->s->table_name.str, operation, hefs); fprintf(stderr, "ha_mcs::extra(\"%s\", %d: %s)\n", table->s->table_name.str, operation, hefs);
} }
#endif #endif
DBUG_RETURN(0); DBUG_RETURN(0);
@ -711,9 +711,9 @@ int ha_calpont::extra(enum ha_extra_function operation)
JOIN::reinit() in sql_select.cc and JOIN::reinit() in sql_select.cc and
st_select_lex_unit::exec() in sql_union.cc. st_select_lex_unit::exec() in sql_union.cc.
*/ */
int ha_calpont::delete_all_rows() int ha_mcs::delete_all_rows()
{ {
DBUG_ENTER("ha_calpont::delete_all_rows"); DBUG_ENTER("ha_mcs::delete_all_rows");
DBUG_RETURN(HA_ERR_WRONG_COMMAND); DBUG_RETURN(HA_ERR_WRONG_COMMAND);
} }
@ -735,15 +735,15 @@ int ha_calpont::delete_all_rows()
the section "locking functions for mysql" in lock.cc; the section "locking functions for mysql" in lock.cc;
copy_data_between_tables() in sql_table.cc. copy_data_between_tables() in sql_table.cc.
*/ */
int ha_calpont::external_lock(THD* thd, int lock_type) int ha_mcs::external_lock(THD* thd, int lock_type)
{ {
DBUG_ENTER("ha_calpont::external_lock"); DBUG_ENTER("ha_mcs::external_lock");
//@Bug 2526 Only register the transaction when autocommit is off //@Bug 2526 Only register the transaction when autocommit is off
if ((thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) if ((thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
trans_register_ha( thd, true, mcs_hton); trans_register_ha( thd, true, mcs_hton);
int rc = ha_calpont_impl_external_lock(thd, table, lock_type); int rc = ha_mcs_impl_external_lock(thd, table, lock_type);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
@ -786,7 +786,7 @@ int ha_calpont::external_lock(THD* thd, int lock_type)
get_lock_data() in lock.cc get_lock_data() in lock.cc
*/ */
THR_LOCK_DATA** ha_calpont::store_lock(THD* thd, THR_LOCK_DATA** ha_mcs::store_lock(THD* thd,
THR_LOCK_DATA** to, THR_LOCK_DATA** to,
enum thr_lock_type lock_type) enum thr_lock_type lock_type)
{ {
@ -819,12 +819,12 @@ THR_LOCK_DATA** ha_calpont::store_lock(THD* thd,
@see @see
delete_table and ha_create_table() in handler.cc delete_table and ha_create_table() in handler.cc
*/ */
int ha_calpont::delete_table(const char* name) int ha_mcs::delete_table(const char* name)
{ {
DBUG_ENTER("ha_calpont::delete_table"); DBUG_ENTER("ha_mcs::delete_table");
/* This is not implemented but we want someone to be able that it works. */ /* This is not implemented but we want someone to be able that it works. */
int rc = ha_calpont_impl_delete_table(name); int rc = ha_mcs_impl_delete_table(name);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
@ -844,10 +844,10 @@ int ha_calpont::delete_table(const char* name)
@see @see
mysql_rename_table() in sql_table.cc mysql_rename_table() in sql_table.cc
*/ */
int ha_calpont::rename_table(const char* from, const char* to) int ha_mcs::rename_table(const char* from, const char* to)
{ {
DBUG_ENTER("ha_calpont::rename_table "); DBUG_ENTER("ha_mcs::rename_table ");
int rc = ha_calpont_impl_rename_table(from, to); int rc = ha_mcs_impl_rename_table(from, to);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
@ -865,10 +865,10 @@ int ha_calpont::rename_table(const char* from, const char* to)
@see @see
check_quick_keys() in opt_range.cc check_quick_keys() in opt_range.cc
*/ */
ha_rows ha_calpont::records_in_range(uint32_t inx, key_range* min_key, ha_rows ha_mcs::records_in_range(uint32_t inx, key_range* min_key,
key_range* max_key) key_range* max_key)
{ {
DBUG_ENTER("ha_calpont::records_in_range"); DBUG_ENTER("ha_mcs::records_in_range");
DBUG_RETURN(10); // low number to force index usage DBUG_RETURN(10); // low number to force index usage
} }
@ -892,19 +892,19 @@ ha_rows ha_calpont::records_in_range(uint32_t inx, key_range* min_key,
ha_create_table() in handle.cc ha_create_table() in handle.cc
*/ */
int ha_calpont::create(const char* name, TABLE* table_arg, int ha_mcs::create(const char* name, TABLE* table_arg,
HA_CREATE_INFO* create_info) HA_CREATE_INFO* create_info)
{ {
DBUG_ENTER("ha_calpont::create"); DBUG_ENTER("ha_mcs::create");
int rc = ha_calpont_impl_create(name, table_arg, create_info); int rc = ha_mcs_impl_create(name, table_arg, create_info);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
const COND* ha_calpont::cond_push(const COND* cond) const COND* ha_mcs::cond_push(const COND* cond)
{ {
DBUG_ENTER("ha_calpont::cond_push"); DBUG_ENTER("ha_mcs::cond_push");
DBUG_RETURN(ha_calpont_impl_cond_push(const_cast<COND*>(cond), table)); DBUG_RETURN(ha_mcs_impl_cond_push(const_cast<COND*>(cond), table));
} }

View File

@ -15,8 +15,8 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA. */ MA 02110-1301, USA. */
#ifndef HA_CALPONT_H__ #ifndef HA_MCS_H__
#define HA_CALPONT_H__ #define HA_MCS_H__
#include <my_config.h> #include <my_config.h>
#include "idb_mysql.h" #include "idb_mysql.h"
#include "ha_mcs_sysvars.h" #include "ha_mcs_sysvars.h"
@ -38,15 +38,15 @@ typedef struct st_calpont_share
/** @brief /** @brief
Class definition for the storage engine Class definition for the storage engine
*/ */
class ha_calpont: public handler class ha_mcs: public handler
{ {
THR_LOCK_DATA lock; ///< MySQL lock THR_LOCK_DATA lock; ///< MySQL lock
COLUMNSTORE_SHARE* share; ///< Shared lock info COLUMNSTORE_SHARE* share; ///< Shared lock info
ulonglong int_table_flags; ulonglong int_table_flags;
public: public:
ha_calpont(handlerton* hton, TABLE_SHARE* table_arg); ha_mcs(handlerton* hton, TABLE_SHARE* table_arg);
~ha_calpont() ~ha_mcs()
{ {
} }
@ -228,4 +228,4 @@ public:
} }
}; };
#endif //HA_CALPONT_H__ #endif //HA_MCS_H__

View File

@ -17,9 +17,9 @@
MA 02110-1301, USA. */ MA 02110-1301, USA. */
#define NEED_CALPONT_INTERFACE #define NEED_CALPONT_INTERFACE
#include "ha_calpont_impl.h" #include "ha_mcs_impl.h"
#include "ha_calpont_impl_if.h" #include "ha_mcs_impl_if.h"
using namespace cal_impl_if; using namespace cal_impl_if;
#include "configcpp.h" #include "configcpp.h"
@ -497,7 +497,7 @@ extern "C"
//cout << "viewtablelock starts a new client " << ci->dmlProc << " for session " << thd->thread_id << endl; //cout << "viewtablelock starts a new client " << ci->dmlProc << " for session " << thd->thread_id << endl;
} }
std::string lockinfo = ha_calpont_impl_viewtablelock(*ci, tableName); std::string lockinfo = ha_mcs_impl_viewtablelock(*ci, tableName);
memcpy(result, lockinfo.c_str(), lockinfo.length()); memcpy(result, lockinfo.c_str(), lockinfo.length());
*length = lockinfo.length(); *length = lockinfo.length();
@ -550,7 +550,7 @@ extern "C"
} }
unsigned long long uLockID = lockID; unsigned long long uLockID = lockID;
std::string lockinfo = ha_calpont_impl_cleartablelock(*ci, uLockID); std::string lockinfo = ha_mcs_impl_cleartablelock(*ci, uLockID);
memcpy(result, lockinfo.c_str(), lockinfo.length()); memcpy(result, lockinfo.c_str(), lockinfo.length());
*length = lockinfo.length(); *length = lockinfo.length();

View File

@ -17,7 +17,7 @@
MA 02110-1301, USA. */ MA 02110-1301, USA. */
/* /*
* $Id: ha_calpont_ddl.cpp 9675 2013-07-11 15:38:12Z chao $ * $Id: ha_mcs_ddl.cpp 9675 2013-07-11 15:38:12Z chao $
*/ */
#include <my_config.h> #include <my_config.h>
@ -51,7 +51,7 @@ using namespace boost;
#include "ha_mcs_sysvars.h" #include "ha_mcs_sysvars.h"
#include "idb_mysql.h" #include "idb_mysql.h"
#include "ha_calpont_impl_if.h" #include "ha_mcs_impl_if.h"
using namespace cal_impl_if; using namespace cal_impl_if;
#include "ddlpkg.h" #include "ddlpkg.h"
@ -2257,10 +2257,10 @@ static bool get_field_default_value(THD *thd, Field *field, String *def_value,
return has_default; return has_default;
} }
int ha_calpont_impl_create_(const char* name, TABLE* table_arg, HA_CREATE_INFO* create_info, cal_connection_info& ci) int ha_mcs_impl_create_(const char* name, TABLE* table_arg, HA_CREATE_INFO* create_info, cal_connection_info& ci)
{ {
#ifdef MCS_DEBUG #ifdef MCS_DEBUG
cout << "ha_calpont_impl_create_: " << name << endl; cout << "ha_mcs_impl_create_: " << name << endl;
#endif #endif
THD* thd = current_thd; THD* thd = current_thd;
@ -2321,7 +2321,7 @@ int ha_calpont_impl_create_(const char* name, TABLE* table_arg, HA_CREATE_INFO*
if (isCreate) if (isCreate)
{ {
#ifdef MCS_DEBUG #ifdef MCS_DEBUG
cout << "ha_calpont_impl_create_: SCHEMA SYNC ONLY found, returning" << endl; cout << "ha_mcs_impl_create_: SCHEMA SYNC ONLY found, returning" << endl;
#endif #endif
return 0; return 0;
} }
@ -2347,7 +2347,7 @@ int ha_calpont_impl_create_(const char* name, TABLE* table_arg, HA_CREATE_INFO*
ci.isAlter = true; ci.isAlter = true;
ci.alterTableState = cal_connection_info::ALTER_FIRST_RENAME; ci.alterTableState = cal_connection_info::ALTER_FIRST_RENAME;
#ifdef MCS_DEBUG #ifdef MCS_DEBUG
cout << "ha_calpont_impl_create_: now in state ALTER_FIRST_RENAME" << endl; cout << "ha_mcs_impl_create_: now in state ALTER_FIRST_RENAME" << endl;
#endif #endif
} }
@ -2524,17 +2524,17 @@ int ha_calpont_impl_create_(const char* name, TABLE* table_arg, HA_CREATE_INFO*
ci.alterTableState = cal_connection_info::NOT_ALTER; ci.alterTableState = cal_connection_info::NOT_ALTER;
ci.isAlter = false; ci.isAlter = false;
#ifdef MCS_DEBUG #ifdef MCS_DEBUG
cout << "ha_calpont_impl_create_: ProcessDDL error, now in state NOT_ALTER" << endl; cout << "ha_mcs_impl_create_: ProcessDDL error, now in state NOT_ALTER" << endl;
#endif #endif
} }
return rc; return rc;
} }
int ha_calpont_impl_delete_table_(const char* db, const char* name, cal_connection_info& ci) int ha_mcs_impl_delete_table_(const char* db, const char* name, cal_connection_info& ci)
{ {
#ifdef MCS_DEBUG #ifdef MCS_DEBUG
cout << "ha_calpont_impl_delete_table: " << db << name << endl; cout << "ha_mcs_impl_delete_table: " << db << name << endl;
#endif #endif
THD* thd = current_thd; THD* thd = current_thd;
std::string tbl(name); std::string tbl(name);
@ -2603,7 +2603,7 @@ int ha_calpont_impl_delete_table_(const char* db, const char* name, cal_connecti
This f() finds and returns position of the last slash sign found in This f() finds and returns position of the last slash sign found in
the path or NULL. the path or NULL.
Called from ha_calpont_ddl.cpp by decode_table_name(). Called from ha_mcs_ddl.cpp by decode_table_name().
*/ */
const char* last_slash_pos(const char *name, size_t name_len) const char* last_slash_pos(const char *name, size_t name_len)
{ {
@ -2625,7 +2625,7 @@ const char* last_slash_pos(const char *name, size_t name_len)
Replaces the encoded table name in the path with a decoded variant, Replaces the encoded table name in the path with a decoded variant,
e.g if path contains ./test/d@0024. This f() makes it ./test/d$ e.g if path contains ./test/d@0024. This f() makes it ./test/d$
Called from ha_calpont_ddl.cpp by ha_calpont_impl_rename_table_(). Called from ha_mcs_ddl.cpp by ha_mcs_impl_rename_table_().
*/ */
void decode_table_name(char *buf, const char *path, size_t pathLen) void decode_table_name(char *buf, const char *path, size_t pathLen)
{ {
@ -2660,7 +2660,7 @@ void decode_table_name(char *buf, const char *path, size_t pathLen)
symbol in table names. The f() supports international symbol in table names. The f() supports international
glyphs in db or table names. glyphs in db or table names.
Called from ha_calpont_ddl.cpp by ha_calpont_impl_rename_table_(). Called from ha_mcs_ddl.cpp by ha_mcs_impl_rename_table_().
*/ */
pair<string, string> parseTableName(const char *path) pair<string, string> parseTableName(const char *path)
{ {
@ -2683,7 +2683,7 @@ pair<string, string> parseTableName(const char *path)
return make_pair(db, tb); return make_pair(db, tb);
} }
int ha_calpont_impl_rename_table_(const char* from, const char* to, cal_connection_info& ci) int ha_mcs_impl_rename_table_(const char* from, const char* to, cal_connection_info& ci)
{ {
THD* thd = current_thd; THD* thd = current_thd;
string emsg; string emsg;

View File

@ -17,7 +17,7 @@
MA 02110-1301, USA. */ MA 02110-1301, USA. */
/* /*
* $Id: ha_calpont_dml.cpp 9711 2013-07-23 21:01:27Z chao $ * $Id: ha_mcs_dml.cpp 9711 2013-07-23 21:01:27Z chao $
*/ */
#include <my_config.h> #include <my_config.h>
@ -43,9 +43,9 @@ using namespace boost;
#include "idb_mysql.h" #include "idb_mysql.h"
#define NEED_CALPONT_INTERFACE #define NEED_CALPONT_INTERFACE
#include "ha_calpont_impl.h" #include "ha_mcs_impl.h"
#include "ha_calpont_impl_if.h" #include "ha_mcs_impl_if.h"
using namespace cal_impl_if; using namespace cal_impl_if;
#include "vendordmlstatement.h" #include "vendordmlstatement.h"
@ -469,7 +469,7 @@ int doProcessInsertValues ( TABLE* table, uint32_t size, cal_connection_info& ci
} }
int ha_calpont_impl_write_last_batch(TABLE* table, cal_connection_info& ci, bool abort) int ha_mcs_impl_write_last_batch(TABLE* table, cal_connection_info& ci, bool abort)
{ {
int rc = 0; int rc = 0;
THD* thd = current_thd; THD* thd = current_thd;
@ -550,7 +550,7 @@ int ha_calpont_impl_write_last_batch(TABLE* table, cal_connection_info& ci, bool
} }
int ha_calpont_impl_write_row_(const uchar* buf, TABLE* table, cal_connection_info& ci, ha_rows& rowsInserted) int ha_mcs_impl_write_row_(const uchar* buf, TABLE* table, cal_connection_info& ci, ha_rows& rowsInserted)
{ {
int rc = 0; int rc = 0;
//timer.start( "buildValueList"); //timer.start( "buildValueList");
@ -640,7 +640,7 @@ int ha_calpont_impl_write_row_(const uchar* buf, TABLE* table, cal_connection_in
} }
} }
int ha_calpont_impl_write_batch_row_(const uchar* buf, TABLE* table, cal_impl_if::cal_connection_info& ci) int ha_mcs_impl_write_batch_row_(const uchar* buf, TABLE* table, cal_impl_if::cal_connection_info& ci)
{ {
ByteStream rowData; ByteStream rowData;
int rc = 0; int rc = 0;
@ -1829,7 +1829,7 @@ int ha_calpont_impl_write_batch_row_(const uchar* buf, TABLE* table, cal_impl_if
return rc; return rc;
} }
std::string ha_calpont_impl_viewtablelock( cal_impl_if::cal_connection_info& ci, execplan::CalpontSystemCatalog::TableName& tablename) std::string ha_mcs_impl_viewtablelock( cal_impl_if::cal_connection_info& ci, execplan::CalpontSystemCatalog::TableName& tablename)
{ {
THD* thd = current_thd; THD* thd = current_thd;
ulong sessionID = tid2sid(thd->thread_id); ulong sessionID = tid2sid(thd->thread_id);
@ -1893,7 +1893,7 @@ std::string ha_calpont_impl_viewtablelock( cal_impl_if::cal_connection_info& ci
// Any bulk rollback that is pending will be applied before the table // Any bulk rollback that is pending will be applied before the table
// lock is released. // lock is released.
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
std::string ha_calpont_impl_cleartablelock( std::string ha_mcs_impl_cleartablelock(
cal_impl_if::cal_connection_info& ci, cal_impl_if::cal_connection_info& ci,
uint64_t tableLockID) uint64_t tableLockID)
{ {
@ -2005,7 +2005,7 @@ std::string ha_calpont_impl_cleartablelock(
return tableLockInfo; return tableLockInfo;
} }
int ha_calpont_impl_commit_ (handlerton* hton, THD* thd, bool all, cal_connection_info& ci ) int ha_mcs_impl_commit_ (handlerton* hton, THD* thd, bool all, cal_connection_info& ci )
{ {
int rc = 0; int rc = 0;
@ -2020,7 +2020,7 @@ int ha_calpont_impl_commit_ (handlerton* hton, THD* thd, bool all, cal_connectio
return rc; return rc;
} }
int ha_calpont_impl_rollback_ (handlerton* hton, THD* thd, bool all, cal_connection_info& ci) int ha_mcs_impl_rollback_ (handlerton* hton, THD* thd, bool all, cal_connection_info& ci)
{ {
int rc = 0; int rc = 0;
#ifdef INFINIDB_DEBUG #ifdef INFINIDB_DEBUG
@ -2040,7 +2040,7 @@ int ha_calpont_impl_rollback_ (handlerton* hton, THD* thd, bool all, cal_connect
return rc; return rc;
} }
int ha_calpont_impl_close_connection_ (handlerton* hton, THD* thd, cal_connection_info& ci ) int ha_mcs_impl_close_connection_ (handlerton* hton, THD* thd, cal_connection_info& ci )
{ {
int rc = 0; int rc = 0;
#ifdef INFINIDB_DEBUG #ifdef INFINIDB_DEBUG

View File

@ -17,7 +17,7 @@
MA 02110-1301, USA. */ MA 02110-1301, USA. */
/* /*
* $Id: ha_calpont_execplan.cpp 9749 2013-08-15 04:00:39Z zzhu $ * $Id: ha_mcs_execplan.cpp 9749 2013-08-15 04:00:39Z zzhu $
*/ */
/** @file */ /** @file */
@ -58,7 +58,7 @@ using namespace logging;
#include "idb_mysql.h" #include "idb_mysql.h"
#include "ha_calpont_impl_if.h" #include "ha_mcs_impl_if.h"
#include "ha_mcs_sysvars.h" #include "ha_mcs_sysvars.h"
#include "ha_subquery.h" #include "ha_subquery.h"
//#include "ha_view.h" //#include "ha_view.h"

View File

@ -17,7 +17,7 @@
MA 02110-1301, USA. */ MA 02110-1301, USA. */
/* /*
* $Id: ha_calpont_impl.cpp 9642 2013-06-24 14:57:42Z rdempsey $ * $Id: ha_mcs_impl.cpp 9642 2013-06-24 14:57:42Z rdempsey $
*/ */
//#define DEBUG_WALK_COND //#define DEBUG_WALK_COND
@ -66,9 +66,9 @@ using namespace std;
#include "idb_mysql.h" #include "idb_mysql.h"
#define NEED_CALPONT_INTERFACE #define NEED_CALPONT_INTERFACE
#include "ha_calpont_impl.h" #include "ha_mcs_impl.h"
#include "ha_calpont_impl_if.h" #include "ha_mcs_impl_if.h"
using namespace cal_impl_if; using namespace cal_impl_if;
#include "calpontselectexecutionplan.h" #include "calpontselectexecutionplan.h"
@ -187,7 +187,7 @@ inline uint32_t tid2sid(const uint32_t tid)
Reduces the boiler plate code. Reduces the boiler plate code.
Called from number of places(mostly DML) in Called from number of places(mostly DML) in
ha_calpont_impl.cpp(). ha_mcs_impl.cpp().
*/ */
void log_this(THD *thd, const char *message, void log_this(THD *thd, const char *message,
logging::LOG_TYPE log_type, unsigned sid) logging::LOG_TYPE log_type, unsigned sid)
@ -219,7 +219,7 @@ void log_this(THD *thd, const char *message,
code 0. This causes ExeMgr loop to drop the code 0. This causes ExeMgr loop to drop the
connection. connection.
Called from many places in ha_calpont_impl.cpp(). Called from many places in ha_mcs_impl.cpp().
*/ */
void force_close_fep_conn(THD *thd, cal_connection_info* ci, bool check_prev_rc = false) void force_close_fep_conn(THD *thd, cal_connection_info* ci, bool check_prev_rc = false)
{ {
@ -2233,20 +2233,20 @@ uint32_t doUpdateDelete(THD* thd, gp_walk_info& gwi)
} //anon namespace } //anon namespace
int ha_calpont_impl_open(const char* name, int mode, uint32_t test_if_locked) int ha_mcs_impl_open(const char* name, int mode, uint32_t test_if_locked)
{ {
IDEBUG ( cout << "ha_calpont_impl_open: " << name << ", " << mode << ", " << test_if_locked << endl ); IDEBUG ( cout << "ha_mcs_impl_open: " << name << ", " << mode << ", " << test_if_locked << endl );
Config::makeConfig(); Config::makeConfig();
return 0; return 0;
} }
int ha_calpont_impl_close(void) int ha_mcs_impl_close(void)
{ {
IDEBUG( cout << "ha_calpont_impl_close" << endl ); IDEBUG( cout << "ha_mcs_impl_close" << endl );
return 0; return 0;
} }
int ha_calpont_impl_discover_existence(const char* schema, const char* name) int ha_mcs_impl_discover_existence(const char* schema, const char* name)
{ {
boost::shared_ptr<CalpontSystemCatalog> csc = CalpontSystemCatalog::makeCalpontSystemCatalog(); boost::shared_ptr<CalpontSystemCatalog> csc = CalpontSystemCatalog::makeCalpontSystemCatalog();
@ -2264,7 +2264,7 @@ int ha_calpont_impl_discover_existence(const char* schema, const char* name)
return 0; return 0;
} }
int ha_calpont_impl_rnd_init(TABLE* table) int ha_mcs_impl_rnd_init(TABLE* table)
{ {
IDEBUG( cout << "rnd_init for table " << table->s->table_name.str << endl ); IDEBUG( cout << "rnd_init for table " << table->s->table_name.str << endl );
THD* thd = current_thd; THD* thd = current_thd;
@ -2626,7 +2626,7 @@ internal_error:
return ER_INTERNAL_ERROR; return ER_INTERNAL_ERROR;
} }
int ha_calpont_impl_rnd_next(uchar* buf, TABLE* table) int ha_mcs_impl_rnd_next(uchar* buf, TABLE* table)
{ {
THD* thd = current_thd; THD* thd = current_thd;
@ -2713,7 +2713,7 @@ int ha_calpont_impl_rnd_next(uchar* buf, TABLE* table)
return rc; return rc;
} }
int ha_calpont_impl_rnd_end(TABLE* table, bool is_pushdown_hand) int ha_mcs_impl_rnd_end(TABLE* table, bool is_pushdown_hand)
{ {
int rc = 0; int rc = 0;
THD* thd = current_thd; THD* thd = current_thd;
@ -2858,7 +2858,7 @@ int ha_calpont_impl_rnd_end(TABLE* table, bool is_pushdown_hand)
return rc; return rc;
} }
int ha_calpont_impl_create(const char* name, TABLE* table_arg, HA_CREATE_INFO* create_info) int ha_mcs_impl_create(const char* name, TABLE* table_arg, HA_CREATE_INFO* create_info)
{ {
THD* thd = current_thd; THD* thd = current_thd;
@ -2873,22 +2873,22 @@ int ha_calpont_impl_create(const char* name, TABLE* table_arg, HA_CREATE_INFO* c
// Just to be sure // Just to be sure
if (!table_arg) if (!table_arg)
{ {
setError(thd, ER_INTERNAL_ERROR, "ha_calpont_impl_create_: table_arg is NULL"); setError(thd, ER_INTERNAL_ERROR, "ha_mcs_impl_create_: table_arg is NULL");
return 1; return 1;
} }
if (!table_arg->s) if (!table_arg->s)
{ {
setError(thd, ER_INTERNAL_ERROR, "ha_calpont_impl_create_: table_arg->s is NULL"); setError(thd, ER_INTERNAL_ERROR, "ha_mcs_impl_create_: table_arg->s is NULL");
return 1; return 1;
} }
int rc = ha_calpont_impl_create_(name, table_arg, create_info, *ci); int rc = ha_mcs_impl_create_(name, table_arg, create_info, *ci);
return rc; return rc;
} }
int ha_calpont_impl_delete_table(const char* name) int ha_mcs_impl_delete_table(const char* name)
{ {
THD* thd = current_thd; THD* thd = current_thd;
char* dbName = NULL; char* dbName = NULL;
@ -2938,10 +2938,10 @@ int ha_calpont_impl_delete_table(const char* name)
return 0; return 0;
} }
int rc = ha_calpont_impl_delete_table_(dbName, name, *ci); int rc = ha_mcs_impl_delete_table_(dbName, name, *ci);
return rc; return rc;
} }
int ha_calpont_impl_write_row(const uchar* buf, TABLE* table) int ha_mcs_impl_write_row(const uchar* buf, TABLE* table)
{ {
THD* thd = current_thd; THD* thd = current_thd;
// Error out INSERT on VIEW. It's currently not supported. // Error out INSERT on VIEW. It's currently not supported.
@ -2978,7 +2978,7 @@ int ha_calpont_impl_write_row(const uchar* buf, TABLE* table)
((thd->lex)->sql_command == SQLCOM_INSERT) || ((thd->lex)->sql_command == SQLCOM_LOAD) || ((thd->lex)->sql_command == SQLCOM_INSERT) || ((thd->lex)->sql_command == SQLCOM_LOAD) ||
((thd->lex)->sql_command == SQLCOM_INSERT_SELECT)) ) ((thd->lex)->sql_command == SQLCOM_INSERT_SELECT)) )
{ {
rc = ha_calpont_impl_write_batch_row_(buf, table, *ci); rc = ha_mcs_impl_write_batch_row_(buf, table, *ci);
} }
else else
{ {
@ -2988,7 +2988,7 @@ int ha_calpont_impl_write_row(const uchar* buf, TABLE* table)
//cout << "write_row starts a client " << ci->dmlProc << " for session " << thd->thread_id << endl; //cout << "write_row starts a client " << ci->dmlProc << " for session " << thd->thread_id << endl;
} }
rc = ha_calpont_impl_write_row_(buf, table, *ci, rowsInserted); rc = ha_mcs_impl_write_row_(buf, table, *ci, rowsInserted);
} }
@ -3001,7 +3001,7 @@ int ha_calpont_impl_write_row(const uchar* buf, TABLE* table)
return rc; return rc;
} }
int ha_calpont_impl_update_row() int ha_mcs_impl_update_row()
{ {
if (get_fe_conn_info_ptr() == NULL) if (get_fe_conn_info_ptr() == NULL)
set_fe_conn_info_ptr((void*)new cal_connection_info()); set_fe_conn_info_ptr((void*)new cal_connection_info());
@ -3015,7 +3015,7 @@ int ha_calpont_impl_update_row()
return ( rc ); return ( rc );
} }
int ha_calpont_impl_delete_row() int ha_mcs_impl_delete_row()
{ {
if (get_fe_conn_info_ptr() == NULL) if (get_fe_conn_info_ptr() == NULL)
set_fe_conn_info_ptr((void*)new cal_connection_info()); set_fe_conn_info_ptr((void*)new cal_connection_info());
@ -3029,7 +3029,7 @@ int ha_calpont_impl_delete_row()
return ( rc ); return ( rc );
} }
void ha_calpont_impl_start_bulk_insert(ha_rows rows, TABLE* table) void ha_mcs_impl_start_bulk_insert(ha_rows rows, TABLE* table)
{ {
THD* thd = current_thd; THD* thd = current_thd;
@ -3565,7 +3565,7 @@ void ha_calpont_impl_start_bulk_insert(ha_rows rows, TABLE* table)
int ha_calpont_impl_end_bulk_insert(bool abort, TABLE* table) int ha_mcs_impl_end_bulk_insert(bool abort, TABLE* table)
{ {
THD* thd = current_thd; THD* thd = current_thd;
@ -3600,7 +3600,7 @@ int ha_calpont_impl_end_bulk_insert(bool abort, TABLE* table)
ci->dmlProc = new MessageQueueClient("DMLProc"); ci->dmlProc = new MessageQueueClient("DMLProc");
//cout << "end_bulk_insert starts a client " << ci->dmlProc << " for session " << thd->thread_id << endl; //cout << "end_bulk_insert starts a client " << ci->dmlProc << " for session " << thd->thread_id << endl;
} }
rc = ha_calpont_impl_write_last_batch(table, *ci, abort); rc = ha_mcs_impl_write_last_batch(table, *ci, abort);
} }
else if ((ci->useCpimport > 0) && (!(thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) && (!ci->singleInsert) && ((ci->isLoaddataInfile) || else if ((ci->useCpimport > 0) && (!(thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) && (!ci->singleInsert) && ((ci->isLoaddataInfile) ||
} */ } */
@ -3774,7 +3774,7 @@ int ha_calpont_impl_end_bulk_insert(bool abort, TABLE* table)
} }
if (((thd->lex)->sql_command == SQLCOM_INSERT_SELECT) || ((thd->lex)->sql_command == SQLCOM_LOAD)) if (((thd->lex)->sql_command == SQLCOM_INSERT_SELECT) || ((thd->lex)->sql_command == SQLCOM_LOAD))
rc = ha_calpont_impl_write_last_batch(table, *ci, abort); rc = ha_mcs_impl_write_last_batch(table, *ci, abort);
} }
} }
@ -3813,7 +3813,7 @@ int ha_calpont_impl_end_bulk_insert(bool abort, TABLE* table)
return rc; return rc;
} }
int ha_calpont_impl_commit (handlerton* hton, THD* thd, bool all) int ha_mcs_impl_commit (handlerton* hton, THD* thd, bool all)
{ {
if (get_fe_conn_info_ptr() == NULL) if (get_fe_conn_info_ptr() == NULL)
set_fe_conn_info_ptr((void*)new cal_connection_info()); set_fe_conn_info_ptr((void*)new cal_connection_info());
@ -3836,7 +3836,7 @@ int ha_calpont_impl_commit (handlerton* hton, THD* thd, bool all)
//cout << "commit starts a client " << ci->dmlProc << " for session " << thd->thread_id << endl; //cout << "commit starts a client " << ci->dmlProc << " for session " << thd->thread_id << endl;
} }
int rc = ha_calpont_impl_commit_(hton, thd, all, *ci); int rc = ha_mcs_impl_commit_(hton, thd, all, *ci);
thd->server_status &= ~SERVER_STATUS_IN_TRANS; thd->server_status &= ~SERVER_STATUS_IN_TRANS;
ci->singleInsert = true; // reset the flag ci->singleInsert = true; // reset the flag
ci->isLoaddataInfile = false; ci->isLoaddataInfile = false;
@ -3845,7 +3845,7 @@ int ha_calpont_impl_commit (handlerton* hton, THD* thd, bool all)
return rc; return rc;
} }
int ha_calpont_impl_rollback (handlerton* hton, THD* thd, bool all) int ha_mcs_impl_rollback (handlerton* hton, THD* thd, bool all)
{ {
if (get_fe_conn_info_ptr() == NULL) if (get_fe_conn_info_ptr() == NULL)
set_fe_conn_info_ptr((void*)new cal_connection_info()); set_fe_conn_info_ptr((void*)new cal_connection_info());
@ -3858,7 +3858,7 @@ int ha_calpont_impl_rollback (handlerton* hton, THD* thd, bool all)
ci->dmlProc = new MessageQueueClient("DMLProc"); ci->dmlProc = new MessageQueueClient("DMLProc");
} }
int rc = ha_calpont_impl_rollback_(hton, thd, all, *ci); int rc = ha_mcs_impl_rollback_(hton, thd, all, *ci);
ci->singleInsert = true; // reset the flag ci->singleInsert = true; // reset the flag
ci->isLoaddataInfile = false; ci->isLoaddataInfile = false;
ci->tableOid = 0; ci->tableOid = 0;
@ -3867,7 +3867,7 @@ int ha_calpont_impl_rollback (handlerton* hton, THD* thd, bool all)
return rc; return rc;
} }
int ha_calpont_impl_close_connection (handlerton* hton, THD* thd) int ha_mcs_impl_close_connection (handlerton* hton, THD* thd)
{ {
if (!thd) return 0; if (!thd) return 0;
@ -3893,7 +3893,7 @@ int ha_calpont_impl_close_connection (handlerton* hton, THD* thd)
if ( ci->dmlProc ) if ( ci->dmlProc )
{ {
rc = ha_calpont_impl_close_connection_(hton, thd, *ci); rc = ha_mcs_impl_close_connection_(hton, thd, *ci);
delete ci->dmlProc; delete ci->dmlProc;
ci->dmlProc = NULL; ci->dmlProc = NULL;
} }
@ -3909,9 +3909,9 @@ int ha_calpont_impl_close_connection (handlerton* hton, THD* thd)
return rc; return rc;
} }
int ha_calpont_impl_rename_table(const char* from, const char* to) int ha_mcs_impl_rename_table(const char* from, const char* to)
{ {
IDEBUG( cout << "ha_calpont_impl_rename_table: " << from << " => " << to << endl ); IDEBUG( cout << "ha_mcs_impl_rename_table: " << from << " => " << to << endl );
if (get_fe_conn_info_ptr() == NULL) if (get_fe_conn_info_ptr() == NULL)
set_fe_conn_info_ptr((void*)new cal_connection_info()); set_fe_conn_info_ptr((void*)new cal_connection_info());
@ -3922,27 +3922,27 @@ int ha_calpont_impl_rename_table(const char* from, const char* to)
if ( ci->alterTableState == cal_connection_info::ALTER_FIRST_RENAME ) if ( ci->alterTableState == cal_connection_info::ALTER_FIRST_RENAME )
{ {
ci->alterTableState = cal_connection_info::ALTER_SECOND_RENAME; ci->alterTableState = cal_connection_info::ALTER_SECOND_RENAME;
IDEBUG( cout << "ha_calpont_impl_rename_table: was in state ALTER_FIRST_RENAME, now in ALTER_SECOND_RENAME" << endl ); IDEBUG( cout << "ha_mcs_impl_rename_table: was in state ALTER_FIRST_RENAME, now in ALTER_SECOND_RENAME" << endl );
return 0; return 0;
} }
else if (ci->alterTableState == cal_connection_info::ALTER_SECOND_RENAME) else if (ci->alterTableState == cal_connection_info::ALTER_SECOND_RENAME)
{ {
ci->alterTableState = cal_connection_info::NOT_ALTER; ci->alterTableState = cal_connection_info::NOT_ALTER;
IDEBUG( cout << "ha_calpont_impl_rename_table: was in state ALTER_SECOND_RENAME, now in NOT_ALTER" << endl ); IDEBUG( cout << "ha_mcs_impl_rename_table: was in state ALTER_SECOND_RENAME, now in NOT_ALTER" << endl );
return 0; return 0;
} }
int rc = ha_calpont_impl_rename_table_(from, to, *ci); int rc = ha_mcs_impl_rename_table_(from, to, *ci);
return rc; return rc;
} }
int ha_calpont_impl_delete_row(const uchar* buf) int ha_mcs_impl_delete_row(const uchar* buf)
{ {
IDEBUG( cout << "ha_calpont_impl_delete_row" << endl ); IDEBUG( cout << "ha_mcs_impl_delete_row" << endl );
return 0; return 0;
} }
COND* ha_calpont_impl_cond_push(COND* cond, TABLE* table) COND* ha_mcs_impl_cond_push(COND* cond, TABLE* table)
{ {
THD* thd = current_thd; THD* thd = current_thd;
@ -3954,7 +3954,7 @@ COND* ha_calpont_impl_cond_push(COND* cond, TABLE* table)
string alias; string alias;
alias.assign(table->alias.ptr(), table->alias.length()); alias.assign(table->alias.ptr(), table->alias.length());
IDEBUG( cout << "ha_calpont_impl_cond_push: " << alias << endl ); IDEBUG( cout << "ha_mcs_impl_cond_push: " << alias << endl );
if (get_fe_conn_info_ptr() == NULL) if (get_fe_conn_info_ptr() == NULL)
set_fe_conn_info_ptr((void*)new cal_connection_info()); set_fe_conn_info_ptr((void*)new cal_connection_info());
@ -4015,7 +4015,7 @@ COND* ha_calpont_impl_cond_push(COND* cond, TABLE* table)
return cond; return cond;
} }
int ha_calpont_impl_external_lock(THD* thd, TABLE* table, int lock_type) int ha_mcs_impl_external_lock(THD* thd, TABLE* table, int lock_type)
{ {
// @bug 3014. Error out locking table command. IDB does not support it now. // @bug 3014. Error out locking table command. IDB does not support it now.
if (thd->lex->sql_command == SQLCOM_LOCK_TABLES) if (thd->lex->sql_command == SQLCOM_LOCK_TABLES)
@ -4134,15 +4134,15 @@ int ha_calpont_impl_external_lock(THD* thd, TABLE* table, int lock_type)
} }
// for sorting length exceeds blob limit. Just error out for now. // for sorting length exceeds blob limit. Just error out for now.
int ha_calpont_impl_rnd_pos(uchar* buf, uchar* pos) int ha_mcs_impl_rnd_pos(uchar* buf, uchar* pos)
{ {
IDEBUG( cout << "ha_calpont_impl_rnd_pos" << endl); IDEBUG( cout << "ha_mcs_impl_rnd_pos" << endl);
string emsg = logging::IDBErrorInfo::instance()->errorMsg(ERR_ORDERBY_TOO_BIG); string emsg = logging::IDBErrorInfo::instance()->errorMsg(ERR_ORDERBY_TOO_BIG);
setError(current_thd, ER_INTERNAL_ERROR, emsg); setError(current_thd, ER_INTERNAL_ERROR, emsg);
return ER_INTERNAL_ERROR; return ER_INTERNAL_ERROR;
} }
/*@brief ha_calpont_impl_group_by_init - Get data for MariaDB group_by /*@brief ha_mcs_impl_group_by_init - Get data for MariaDB group_by
pushdown handler */ pushdown handler */
/*********************************************************** /***********************************************************
* DESCRIPTION: * DESCRIPTION:
@ -4154,10 +4154,10 @@ int ha_calpont_impl_rnd_pos(uchar* buf, uchar* pos)
* 0 if success * 0 if success
* others if something went wrong whilst getting the result set * others if something went wrong whilst getting the result set
***********************************************************/ ***********************************************************/
int ha_calpont_impl_group_by_init(mcs_handler_info *handler_info, TABLE* table) int ha_mcs_impl_group_by_init(mcs_handler_info *handler_info, TABLE* table)
{ {
ha_calpont_group_by_handler *group_hand= ha_mcs_group_by_handler *group_hand=
reinterpret_cast<ha_calpont_group_by_handler*>(handler_info->hndl_ptr); reinterpret_cast<ha_mcs_group_by_handler*>(handler_info->hndl_ptr);
string tableName = group_hand->table_list->table->s->table_name.str; string tableName = group_hand->table_list->table->s->table_name.str;
IDEBUG( cout << "group_by_init for table " << tableName << endl ); IDEBUG( cout << "group_by_init for table " << tableName << endl );
THD* thd = current_thd; THD* thd = current_thd;
@ -4580,7 +4580,7 @@ internal_error:
return ER_INTERNAL_ERROR; return ER_INTERNAL_ERROR;
} }
/*@brief ha_calpont_impl_group_by_next - Return result set for MariaDB group_by /*@brief ha_mcs_impl_group_by_next - Return result set for MariaDB group_by
pushdown handler pushdown handler
*/ */
/*********************************************************** /***********************************************************
@ -4594,7 +4594,7 @@ internal_error:
* HA_ERR_END_OF_FILE if the record set has come to an end * HA_ERR_END_OF_FILE if the record set has come to an end
* others if something went wrong whilst getting the result set * others if something went wrong whilst getting the result set
***********************************************************/ ***********************************************************/
int ha_calpont_impl_group_by_next(TABLE* table) int ha_mcs_impl_group_by_next(TABLE* table)
{ {
THD* thd = current_thd; THD* thd = current_thd;
@ -4682,7 +4682,7 @@ int ha_calpont_impl_group_by_next(TABLE* table)
return rc; return rc;
} }
int ha_calpont_impl_group_by_end(TABLE* table) int ha_mcs_impl_group_by_end(TABLE* table)
{ {
int rc = 0; int rc = 0;
THD* thd = current_thd; THD* thd = current_thd;
@ -4856,7 +4856,7 @@ int ha_calpont_impl_group_by_end(TABLE* table)
* Execute the query and saves derived table query. * Execute the query and saves derived table query.
* There is an extra handler argument so I ended up with a * There is an extra handler argument so I ended up with a
* new init function. The code is a copy of * new init function. The code is a copy of
* ha_calpont_impl_rnd_init() mostly. * ha_mcs_impl_rnd_init() mostly.
* PARAMETERS: * PARAMETERS:
* mcs_handler_info* pnt to an envelope struct * mcs_handler_info* pnt to an envelope struct
* TABLE* table - dest table to put the results into * TABLE* table - dest table to put the results into

78
dbcon/mysql/ha_mcs_impl.h Normal file
View File

@ -0,0 +1,78 @@
/* Copyright (C) 2014 InfiniDB, Inc.
Copyright (C) 2016 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., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA. */
#ifndef HA_MCS_IMPL_H__
#define HA_MCS_IMPL_H__
#include "idb_mysql.h"
#ifdef NEED_CALPONT_EXTERNS
// Forward declaration.
struct mcs_handler_info;
extern int ha_mcs_impl_discover_existence(const char* schema, const char* name);
extern int ha_mcs_impl_create(const char* name, TABLE* table_arg, HA_CREATE_INFO* create_info);
extern int ha_mcs_impl_delete_table(const char* name);
extern int ha_mcs_impl_open(const char* name, int mode, uint32_t test_if_locked);
extern int ha_mcs_impl_close(void);
extern int ha_mcs_impl_rnd_init(TABLE* table);
extern int ha_mcs_impl_rnd_next(uchar* buf, TABLE* table);
extern int ha_mcs_impl_rnd_end(TABLE* table, bool is_derived_hand = false);
extern int ha_mcs_impl_write_row(const uchar* buf, TABLE* table);
extern void ha_mcs_impl_start_bulk_insert(ha_rows rows, TABLE* table);
extern int ha_mcs_impl_end_bulk_insert(bool abort, TABLE* table);
extern int ha_mcs_impl_rename_table(const char* from, const char* to);
extern int ha_mcs_impl_commit (handlerton* hton, THD* thd, bool all);
extern int ha_mcs_impl_rollback (handlerton* hton, THD* thd, bool all);
extern int ha_mcs_impl_close_connection (handlerton* hton, THD* thd);
extern COND* ha_mcs_impl_cond_push(COND* cond, TABLE* table);
extern int ha_mcs_impl_external_lock(THD* thd, TABLE* table, int lock_type);
extern int ha_mcs_impl_update_row();
extern int ha_mcs_impl_delete_row();
extern int ha_mcs_impl_rnd_pos(uchar* buf, uchar* pos);
extern int ha_cs_impl_pushdown_init(mcs_handler_info* handler_info, TABLE* table);
extern int ha_cs_impl_select_next(uchar *buf, TABLE *table);
extern int ha_mcs_impl_group_by_init(mcs_handler_info *handler_info, TABLE* table);
extern int ha_mcs_impl_group_by_next(TABLE* table);
extern int ha_mcs_impl_group_by_end(TABLE* table);
#endif
#ifdef NEED_CALPONT_INTERFACE
#include "ha_mcs_impl_if.h"
#include "calpontsystemcatalog.h"
#include "ha_mcs.h"
extern int ha_mcs_impl_rename_table_(const char* from, const char* to, cal_impl_if::cal_connection_info& ci);
extern int ha_mcs_impl_write_row_(const uchar* buf, TABLE* table, cal_impl_if::cal_connection_info& ci, ha_rows& rowsInserted);
extern int ha_mcs_impl_write_batch_row_(const uchar* buf, TABLE* table, cal_impl_if::cal_connection_info& ci);
extern int ha_mcs_impl_write_last_batch(TABLE* table, cal_impl_if::cal_connection_info& ci, bool abort);
extern int ha_mcs_impl_commit_ (handlerton* hton, THD* thd, bool all, cal_impl_if::cal_connection_info& ci);
extern int ha_mcs_impl_rollback_ (handlerton* hton, THD* thd, bool all, cal_impl_if::cal_connection_info& ci);
extern int ha_mcs_impl_close_connection_ (handlerton* hton, THD* thd, cal_impl_if::cal_connection_info& ci);
extern int ha_mcs_impl_delete_table_(const char* db, const char* name, cal_impl_if::cal_connection_info& ci);
extern int ha_mcs_impl_create_(const char* name, TABLE* table_arg, HA_CREATE_INFO* create_info,
cal_impl_if::cal_connection_info& ci);
extern std::string ha_mcs_impl_markpartition_ (execplan::CalpontSystemCatalog::TableName tableName, uint32_t partition);
extern std::string ha_mcs_impl_restorepartition_ (execplan::CalpontSystemCatalog::TableName tableName, uint32_t partition);
extern std::string ha_mcs_impl_droppartition_ (execplan::CalpontSystemCatalog::TableName tableName, uint32_t partition);
extern std::string ha_mcs_impl_viewtablelock( cal_impl_if::cal_connection_info& ci, execplan::CalpontSystemCatalog::TableName& tablename);
extern std::string ha_mcs_impl_cleartablelock( cal_impl_if::cal_connection_info& ci, uint64_t tableLockID);
#endif
#endif

View File

@ -16,10 +16,10 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA. */ MA 02110-1301, USA. */
// $Id: ha_calpont_impl_if.h 9701 2013-07-17 18:51:55Z zzhu $ // $Id: ha_mcs_impl_if.h 9701 2013-07-17 18:51:55Z zzhu $
/** @file */ /** @file */
#ifndef HA_CALPONT_IMPL_IF_H__ #ifndef HA_MCS_IMPL_IF_H__
#define HA_CALPONT_IMPL_IF_H__ #define HA_MCS_IMPL_IF_H__
#include <string> #include <string>
#include <stdint.h> #include <stdint.h>
#ifdef _MSC_VER #ifdef _MSC_VER

View File

@ -17,7 +17,7 @@
MA 02110-1301, USA. */ MA 02110-1301, USA. */
/* /*
* $Id: ha_calpont_partition.cpp 9642 2013-06-24 14:57:42Z rdempsey $ * $Id: ha_mcs_partition.cpp 9642 2013-06-24 14:57:42Z rdempsey $
*/ */
#include <my_config.h> #include <my_config.h>
@ -878,7 +878,7 @@ void partitionByValue_common(UDF_ARGS* args, // input
} }
} }
std::string ha_calpont_impl_markpartitions_( std::string ha_mcs_impl_markpartitions_(
execplan::CalpontSystemCatalog::TableName tableName, set<LogicalPartition>& partitionNums) execplan::CalpontSystemCatalog::TableName tableName, set<LogicalPartition>& partitionNums)
{ {
ddlpackage::QualifiedName* qualifiedName = new QualifiedName(); ddlpackage::QualifiedName* qualifiedName = new QualifiedName();
@ -900,7 +900,7 @@ std::string ha_calpont_impl_markpartitions_(
return msg; return msg;
} }
std::string ha_calpont_impl_restorepartitions_( std::string ha_mcs_impl_restorepartitions_(
execplan::CalpontSystemCatalog::TableName tableName, set<LogicalPartition>& partitionNums) execplan::CalpontSystemCatalog::TableName tableName, set<LogicalPartition>& partitionNums)
{ {
ddlpackage::QualifiedName* qualifiedName = new QualifiedName(); ddlpackage::QualifiedName* qualifiedName = new QualifiedName();
@ -923,7 +923,7 @@ std::string ha_calpont_impl_restorepartitions_(
return msg; return msg;
} }
std::string ha_calpont_impl_droppartitions_( std::string ha_mcs_impl_droppartitions_(
execplan::CalpontSystemCatalog::TableName tableName, set<LogicalPartition>& partitionNums) execplan::CalpontSystemCatalog::TableName tableName, set<LogicalPartition>& partitionNums)
{ {
ddlpackage::QualifiedName* qualifiedName = new QualifiedName(); ddlpackage::QualifiedName* qualifiedName = new QualifiedName();
@ -1238,7 +1238,7 @@ extern "C"
} }
if (errMsg.empty()) if (errMsg.empty())
errMsg = ha_calpont_impl_markpartitions_(tableName, partitionNums ); errMsg = ha_mcs_impl_markpartitions_(tableName, partitionNums );
memcpy(result, errMsg.c_str(), errMsg.length()); memcpy(result, errMsg.c_str(), errMsg.length());
*length = errMsg.length(); *length = errMsg.length();
@ -1325,7 +1325,7 @@ extern "C"
} }
if (errMsg.empty()) if (errMsg.empty())
errMsg = ha_calpont_impl_restorepartitions_(tableName, partitionNums ); errMsg = ha_mcs_impl_restorepartitions_(tableName, partitionNums );
memcpy(result, errMsg.c_str(), errMsg.length()); memcpy(result, errMsg.c_str(), errMsg.length());
*length = errMsg.length(); *length = errMsg.length();
@ -1412,7 +1412,7 @@ extern "C"
} }
if (errMsg.empty()) if (errMsg.empty())
errMsg = ha_calpont_impl_droppartitions_(tableName, partSet); errMsg = ha_mcs_impl_droppartitions_(tableName, partSet);
memcpy(result, errMsg.c_str(), errMsg.length()); memcpy(result, errMsg.c_str(), errMsg.length());
*length = errMsg.length(); *length = errMsg.length();
@ -1495,7 +1495,7 @@ extern "C"
return result; return result;
} }
msg = ha_calpont_impl_droppartitions_(tableName, partSet); msg = ha_mcs_impl_droppartitions_(tableName, partSet);
memcpy(result, msg.c_str(), msg.length()); memcpy(result, msg.c_str(), msg.length());
*length = msg.length(); *length = msg.length();
@ -1567,7 +1567,7 @@ extern "C"
return result; return result;
} }
msg = ha_calpont_impl_markpartitions_(tableName, partSet); msg = ha_mcs_impl_markpartitions_(tableName, partSet);
memcpy(result, msg.c_str(), msg.length()); memcpy(result, msg.c_str(), msg.length());
*length = msg.length(); *length = msg.length();
@ -1639,7 +1639,7 @@ extern "C"
return result; return result;
} }
msg = ha_calpont_impl_restorepartitions_(tableName, partSet); msg = ha_mcs_impl_restorepartitions_(tableName, partSet);
memcpy(result, msg.c_str(), msg.length()); memcpy(result, msg.c_str(), msg.length());
*length = msg.length(); *length = msg.length();

View File

@ -351,7 +351,7 @@ void item_check(Item* item, bool* unsupported_feature)
} }
} }
/*@brief create_calpont_group_by_handler- Creates handler*/ /*@brief create_columnstore_group_by_handler- Creates handler*/
/*********************************************************** /***********************************************************
* DESCRIPTION: * DESCRIPTION:
* Creates a group_by pushdown handler if there is no: * Creates a group_by pushdown handler if there is no:
@ -372,9 +372,9 @@ void item_check(Item* item, bool* unsupported_feature)
* NULL in other case * NULL in other case
***********************************************************/ ***********************************************************/
group_by_handler* group_by_handler*
create_calpont_group_by_handler(THD* thd, Query* query) create_columnstore_group_by_handler(THD* thd, Query* query)
{ {
ha_calpont_group_by_handler* handler = NULL; ha_mcs_group_by_handler* handler = NULL;
// same as thd->lex->current_select // same as thd->lex->current_select
SELECT_LEX *select_lex = query->from->select_lex; SELECT_LEX *select_lex = query->from->select_lex;
@ -446,7 +446,7 @@ create_calpont_group_by_handler(THD* thd, Query* query)
if (!unsupported_feature) if (!unsupported_feature)
{ {
handler = new ha_calpont_group_by_handler(thd, query); handler = new ha_mcs_group_by_handler(thd, query);
// Notify the server, that CS handles GROUP BY, ORDER BY and HAVING clauses. // Notify the server, that CS handles GROUP BY, ORDER BY and HAVING clauses.
query->group_by = NULL; query->group_by = NULL;
@ -626,7 +626,7 @@ int ha_columnstore_derived_handler::next_row()
{ {
DBUG_ENTER("ha_columnstore_derived_handler::next_row"); DBUG_ENTER("ha_columnstore_derived_handler::next_row");
int rc = ha_calpont_impl_rnd_next(table->record[0], table); int rc = ha_mcs_impl_rnd_next(table->record[0], table);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
@ -645,7 +645,7 @@ int ha_columnstore_derived_handler::end_scan()
{ {
DBUG_ENTER("ha_columnstore_derived_handler::end_scan"); DBUG_ENTER("ha_columnstore_derived_handler::end_scan");
int rc = ha_calpont_impl_rnd_end(table, true); int rc = ha_mcs_impl_rnd_end(table, true);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
@ -661,7 +661,7 @@ void ha_columnstore_derived_handler::print_error(int, unsigned long)
* thd - THD pointer. * thd - THD pointer.
* query - Query describing structure * query - Query describing structure
***********************************************************/ ***********************************************************/
ha_calpont_group_by_handler::ha_calpont_group_by_handler(THD* thd_arg, Query* query) ha_mcs_group_by_handler::ha_mcs_group_by_handler(THD* thd_arg, Query* query)
: group_by_handler(thd_arg, mcs_hton), : group_by_handler(thd_arg, mcs_hton),
select(query->select), select(query->select),
table_list(query->from), table_list(query->from),
@ -677,7 +677,7 @@ ha_calpont_group_by_handler::ha_calpont_group_by_handler(THD* thd_arg, Query* qu
* DESCRIPTION: * DESCRIPTION:
* GROUP BY destructor * GROUP BY destructor
***********************************************************/ ***********************************************************/
ha_calpont_group_by_handler::~ha_calpont_group_by_handler() ha_mcs_group_by_handler::~ha_mcs_group_by_handler()
{ {
} }
@ -687,12 +687,12 @@ ha_calpont_group_by_handler::~ha_calpont_group_by_handler()
* RETURN: * RETURN:
* int rc * int rc
***********************************************************/ ***********************************************************/
int ha_calpont_group_by_handler::init_scan() int ha_mcs_group_by_handler::init_scan()
{ {
DBUG_ENTER("ha_calpont_group_by_handler::init_scan"); DBUG_ENTER("ha_mcs_group_by_handler::init_scan");
mcs_handler_info mhi = mcs_handler_info(reinterpret_cast<void*>(this), GROUP_BY); mcs_handler_info mhi = mcs_handler_info(reinterpret_cast<void*>(this), GROUP_BY);
int rc = ha_calpont_impl_group_by_init(&mhi, table); int rc = ha_mcs_impl_group_by_init(&mhi, table);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
@ -703,10 +703,10 @@ int ha_calpont_group_by_handler::init_scan()
* RETURN: * RETURN:
* int rc * int rc
***********************************************************/ ***********************************************************/
int ha_calpont_group_by_handler::next_row() int ha_mcs_group_by_handler::next_row()
{ {
DBUG_ENTER("ha_calpont_group_by_handler::next_row"); DBUG_ENTER("ha_mcs_group_by_handler::next_row");
int rc = ha_calpont_impl_group_by_next(table); int rc = ha_mcs_impl_group_by_next(table);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
@ -717,10 +717,10 @@ int ha_calpont_group_by_handler::next_row()
* RETURN: * RETURN:
* int rc * int rc
***********************************************************/ ***********************************************************/
int ha_calpont_group_by_handler::end_scan() int ha_mcs_group_by_handler::end_scan()
{ {
DBUG_ENTER("ha_calpont_group_by_handler::end_scan"); DBUG_ENTER("ha_mcs_group_by_handler::end_scan");
int rc = ha_calpont_impl_group_by_end(table); int rc = ha_mcs_impl_group_by_end(table);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
@ -935,7 +935,7 @@ int ha_columnstore_select_handler::end_scan()
{ {
DBUG_ENTER("ha_columnstore_select_handler::end_scan"); DBUG_ENTER("ha_columnstore_select_handler::end_scan");
int rc = ha_calpont_impl_rnd_end(table, true); int rc = ha_mcs_impl_rnd_end(table, true);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }

View File

@ -19,10 +19,10 @@
#define HA_MCS_PUSH #define HA_MCS_PUSH
#include "idb_mysql.h" #include "idb_mysql.h"
#include "ha_calpont.h" #include "ha_mcs.h"
#include "ha_mcs_sysvars.h" #include "ha_mcs_sysvars.h"
#define NEED_CALPONT_EXTERNS #define NEED_CALPONT_EXTERNS
#include "ha_calpont_impl.h" #include "ha_mcs_impl.h"
void mutate_optimizer_flags(THD *thd_); void mutate_optimizer_flags(THD *thd_);
void restore_optimizer_flags(THD *thd_); void restore_optimizer_flags(THD *thd_);
@ -73,11 +73,11 @@ struct mcs_handler_info
* next_row - get a row back from sm. * next_row - get a row back from sm.
* end_scan - finish and clean the things up. * end_scan - finish and clean the things up.
***********************************************************/ ***********************************************************/
class ha_calpont_group_by_handler: public group_by_handler class ha_mcs_group_by_handler: public group_by_handler
{ {
public: public:
ha_calpont_group_by_handler(THD* thd_arg, Query* query); ha_mcs_group_by_handler(THD* thd_arg, Query* query);
~ha_calpont_group_by_handler(); ~ha_mcs_group_by_handler();
int init_scan(); int init_scan();
int next_row(); int next_row();
int end_scan(); int end_scan();

View File

@ -17,7 +17,7 @@
MA 02110-1301, USA. */ MA 02110-1301, USA. */
/* /*
* $Id: ha_calpont_udf.cpp 9210 2013-01-21 14:10:42Z rdempsey $ * $Id: ha_mcs_udf.cpp 9210 2013-01-21 14:10:42Z rdempsey $
*/ */
#include <my_config.h> #include <my_config.h>

View File

@ -19,7 +19,7 @@ using namespace execplan;
#include "functor.h" #include "functor.h"
#include "functor_str.h" #include "functor_str.h"
#include "ha_calpont_impl_if.h" #include "ha_mcs_impl_if.h"
#include "ha_mcs_sysvars.h" #include "ha_mcs_sysvars.h"
using namespace cal_impl_if; using namespace cal_impl_if;

View File

@ -30,7 +30,7 @@
//#undef LOG_INFO //#undef LOG_INFO
#include <my_config.h> #include <my_config.h>
#include "idb_mysql.h" #include "idb_mysql.h"
#include "ha_calpont_impl_if.h" #include "ha_mcs_impl_if.h"
namespace execplan namespace execplan
{ {

View File

@ -27,7 +27,7 @@
#define HA_VIEW #define HA_VIEW
//#undef LOG_INFO //#undef LOG_INFO
#include "ha_calpont_impl_if.h" #include "ha_mcs_impl_if.h"
#include "idb_mysql.h" #include "idb_mysql.h"
namespace execplan namespace execplan

View File

@ -27,7 +27,7 @@
using namespace std; using namespace std;
#include "idb_mysql.h" #include "idb_mysql.h"
#include "ha_calpont_impl_if.h" #include "ha_mcs_impl_if.h"
#include "ha_mcs_sysvars.h" #include "ha_mcs_sysvars.h"
#include "arithmeticcolumn.h" #include "arithmeticcolumn.h"

View File

@ -104,7 +104,7 @@ if [ -x $installdir/mysql/mysql-Columnstore ]; then
sleep 5 sleep 5
# Install various Calpont stuff... # Install various Calpont stuff...
$installdir/mysql/install_calpont_mysql.sh --installdir=$installdir --tmpdir=$tmpdir $installdir/mysql/install_mcs_mysql.sh --installdir=$installdir --tmpdir=$tmpdir
checkForError checkForError
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "ERROR: Invalid password in .my.cnf, or Columnstore plugin install missing" echo "ERROR: Invalid password in .my.cnf, or Columnstore plugin install missing"

View File

@ -1225,7 +1225,7 @@ inline void DataConvert::decimalToString(int64_t int_val, uint8_t scale, char* b
// Need to convert a string with a binary unsigned number in it to a 64-bit signed int // Need to convert a string with a binary unsigned number in it to a 64-bit signed int
// MySQL seems to round off values unless we use the string store method. Groan. // MySQL seems to round off values unless we use the string store method. Groan.
// Taken from ha_calpont_impl.cpp // Taken from ha_mcs_impl.cpp
//biggest Calpont supports is DECIMAL(18,x), or 18 total digits+dp+sign for column //biggest Calpont supports is DECIMAL(18,x), or 18 total digits+dp+sign for column
// Need 19 digits maxium to hold a sum result of 18 digits decimal column. // Need 19 digits maxium to hold a sum result of 18 digits decimal column.