diff --git a/dbcon/mysql/CMakeLists.txt b/dbcon/mysql/CMakeLists.txt index d478843b0..4c423ed16 100644 --- a/dbcon/mysql/CMakeLists.txt +++ b/dbcon/mysql/CMakeLists.txt @@ -25,7 +25,7 @@ set_source_files_properties(ha_calpont.cpp PROPERTIES COMPILE_FLAGS "-fno-rtti - add_library(calmysql SHARED ${libcalmysql_SRCS}) -target_link_libraries(calmysql ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} ${NETSNMP_LIBRARIES} threadpool) +target_link_libraries(calmysql ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} ${NETSNMP_LIBRARIES} mysqlservices threadpool) set_target_properties(calmysql PROPERTIES VERSION 1.0.0 SOVERSION 1) @@ -34,7 +34,7 @@ SET ( is_columnstore_tables_SRCS ) add_library(is_columnstore_tables SHARED ${is_columnstore_tables_SRCS}) -target_link_libraries(is_columnstore_tables ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} threadpool) +target_link_libraries(is_columnstore_tables ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} mysqlservices threadpool) # Don't prepend .so file with 'lib' set_target_properties(is_columnstore_tables PROPERTIES PREFIX "") @@ -45,7 +45,7 @@ SET ( is_columnstore_columns_SRCS ) add_library(is_columnstore_columns SHARED ${is_columnstore_columns_SRCS}) -target_link_libraries(is_columnstore_columns ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} threadpool) +target_link_libraries(is_columnstore_columns ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} mysqlservices threadpool) # Don't prepend .so file with 'lib' set_target_properties(is_columnstore_columns PROPERTIES PREFIX "") @@ -56,7 +56,7 @@ SET ( is_columnstore_extents_SRCS ) add_library(is_columnstore_extents SHARED ${is_columnstore_extents_SRCS}) -target_link_libraries(is_columnstore_extents ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} threadpool) +target_link_libraries(is_columnstore_extents ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} mysqlservices threadpool) # Don't prepend .so file with 'lib' set_target_properties(is_columnstore_extents PROPERTIES PREFIX "") @@ -67,7 +67,7 @@ SET ( is_columnstore_files_SRCS ) add_library(is_columnstore_files SHARED ${is_columnstore_files_SRCS}) -target_link_libraries(is_columnstore_files ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} threadpool) +target_link_libraries(is_columnstore_files ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} mysqlservices threadpool) # Don't prepend .so file with 'lib' set_target_properties(is_columnstore_files PROPERTIES PREFIX "") diff --git a/dbcon/mysql/ha_calpont_execplan.cpp b/dbcon/mysql/ha_calpont_execplan.cpp index 56df504dd..85fe0b45f 100755 --- a/dbcon/mysql/ha_calpont_execplan.cpp +++ b/dbcon/mysql/ha_calpont_execplan.cpp @@ -423,7 +423,7 @@ void debug_walk(const Item *item, void *arg) char* item_name = item->name; if (!item_name) { - item_name = ""; + item_name = (char*)""; } switch (isp->sum_func()) { @@ -1111,6 +1111,15 @@ bool buildRowColumnFilter(gp_walk_info* gwip, RowColumn* rhs, RowColumn* lhs, It bool buildPredicateItem(Item_func* ifp, gp_walk_info* gwip) { boost::shared_ptr sop(new PredicateOperator(ifp->func_name())); + if (ifp->functype() == Item_func::LIKE_FUNC) + { + // Starting with MariaDB 10.2, LIKE uses a negated flag instead of FUNC_NOT + // Further processing is done below as before for LIKE + if (((Item_func_like*)ifp)->negated) + { + sop->reverseOp(); + } + } if (!(gwip->thd->infinidb_vtable.cal_conn_info)) gwip->thd->infinidb_vtable.cal_conn_info = (void*)(new cal_connection_info()); cal_connection_info* ci = reinterpret_cast(gwip->thd->infinidb_vtable.cal_conn_info); @@ -6035,7 +6044,7 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, bool i ostringstream oss; oss << ordercol->counter; ord_cols += oss.str(); - if (!ordercol->direction == ORDER::ORDER_ASC) + if (ordercol->direction != ORDER::ORDER_ASC) ord_cols += " desc"; continue; } @@ -6160,7 +6169,7 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, bool i gwi.returnedCols.push_back(srcp); ord_cols += " `" + escapeBackTick(str.c_ptr()) + "`"; } - if (!ordercol->direction == ORDER::ORDER_ASC) + if (ordercol->direction != ORDER::ORDER_ASC) ord_cols += " desc"; continue; } @@ -6224,7 +6233,7 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, bool i ord_item->print(&str, QT_INFINIDB); ord_cols += str.c_ptr(); } - if (!ordercol->direction == ORDER::ORDER_ASC) + if (ordercol->direction != ORDER::ORDER_ASC) ord_cols += " desc"; } } @@ -6564,7 +6573,7 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, bool i ord_item->print(&str, QT_INFINIDB_NO_QUOTE); ord_cols += string(str.c_ptr()); } - if (!ordercol->direction == ORDER::ORDER_ASC) + if (ordercol->direction != ORDER::ORDER_ASC) ord_cols += " desc"; } } diff --git a/dbcon/mysql/ha_window_function.cpp b/dbcon/mysql/ha_window_function.cpp index c7bed4f15..4106329da 100755 --- a/dbcon/mysql/ha_window_function.cpp +++ b/dbcon/mysql/ha_window_function.cpp @@ -186,7 +186,7 @@ ReturnedColumn* buildWindowFunctionColumn(Item* item, gp_walk_info& gwi, bool& n //cout << str.c_ptr() << endl; if (!(gwi.thd->infinidb_vtable.cal_conn_info)) gwi.thd->infinidb_vtable.cal_conn_info = (void*)(new cal_connection_info()); - cal_connection_info* ci = reinterpret_cast(gwi.thd->infinidb_vtable.cal_conn_info); +// cal_connection_info* ci = reinterpret_cast(gwi.thd->infinidb_vtable.cal_conn_info); gwi.hasWindowFunc = true; // Item_func_window* wf = (Item_func_window*)item; diff --git a/dbcon/mysql/install_calpont_mysql.sh b/dbcon/mysql/install_calpont_mysql.sh index 9b55f9448..611b50ef3 100755 --- a/dbcon/mysql/install_calpont_mysql.sh +++ b/dbcon/mysql/install_calpont_mysql.sh @@ -99,7 +99,7 @@ CREATE TABLE IF NOT EXISTS infinidb_querystats.querystats query varchar(8000), startTime timestamp NOT NULL, endTime timestamp NOT NULL, - rows bigint, + `rows` bigint, errno int, phyIO bigint, cacheIO bigint, diff --git a/dbcon/mysql/my.cnf b/dbcon/mysql/my.cnf index 9d9907daa..d4f595062 100644 --- a/dbcon/mysql/my.cnf +++ b/dbcon/mysql/my.cnf @@ -44,6 +44,7 @@ query_cache_size = 0 thread_stack = 512K lower_case_table_names=1 group_concat_max_len=512 +sql_mode="ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" # Enable compression by default on create, set to 0 to turn off infinidb_compression_type=2 diff --git a/dbcon/mysql/mysql.vpj b/dbcon/mysql/mysql.vpj index cdb8f4f12..fd92a4562 100644 --- a/dbcon/mysql/mysql.vpj +++ b/dbcon/mysql/mysql.vpj @@ -197,6 +197,198 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -218,204 +410,210 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 ? val1 + 0.5 : val1 - 0.5); // MCOL-176 If abs(int_val2) is small enough (like -1), then, this may cause overflow. @@ -78,7 +78,7 @@ uint64_t Func_div::getUintVal(rowgroup::Row& row, if (val2 == 0) { isNull = true; - return NULL; + return 0; } return val1 / val2; } diff --git a/utils/loggingcpp/ErrorMessage.txt b/utils/loggingcpp/ErrorMessage.txt index 1266a21e4..c4d134899 100644 --- a/utils/loggingcpp/ErrorMessage.txt +++ b/utils/loggingcpp/ErrorMessage.txt @@ -27,7 +27,7 @@ 1008 ERR_CREATE_DATATYPE_NOT_SUPPORT The syntax or the data type(s) is not supported by Columnstore. Please check the Columnstore syntax guide for supported syntax or data types. 1010 ERR_AGGREGATE_TYPE_NOT_SUPPORT '%1%' for column type '%2%' isn't supported. 1011 ERR_DML_VIEW %1% on VIEW is currently not supported. -#1012 ERR_UPDATE_NOT_SUPPORT_FEATURE This version of Columstore supports update of only one table at a time. +1012 ERR_UPDATE_NOT_SUPPORT_FEATURE This version of Columnstore supports update of only one table at a time. 1014 ERR_ROLLUP_NOT_SUPPORT Rollup is currently not supported. 1015 ERR_OUTER_JOIN_SUBSELECT Subquery on OUTER JOIN ON clause is currently not supported. 1016 ERR_PARTITION_BY_RANGE The column type %1% is currently not supported in %2% function.