1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

Merge branch 'develop' into MCOL-4126

This commit is contained in:
David Hall
2020-06-30 11:25:11 -05:00
113 changed files with 417 additions and 341 deletions

View File

@ -35,9 +35,12 @@ add_definitions(-DMYSQL_DYNAMIC_PLUGIN)
set_source_files_properties(ha_mcs.cpp PROPERTIES COMPILE_FLAGS "-fno-implicit-templates")
if (COMMAND mysql_add_plugin)
mysql_add_plugin(columnstore ${libcalmysql_SRCS} STORAGE_ENGINE MODULE_ONLY DEFAULT
LINK_LIBRARIES ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} ${NETSNMP_LIBRARIES} threadpool
COMPONENT columnstore-engine)
IF(NOT(RPM OR DEB))
SET(disabled DISABLED)
ENDIF()
mysql_add_plugin(columnstore ${libcalmysql_SRCS} STORAGE_ENGINE MODULE_ONLY ${disabled}
LINK_LIBRARIES ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} ${NETSNMP_LIBRARIES} threadpool
COMPONENT columnstore-engine)
else ()
add_library(ha_columnstore SHARED ${libcalmysql_SRCS})
SET_TARGET_PROPERTIES(ha_columnstore PROPERTIES PREFIX "")

View File

@ -2128,6 +2128,11 @@ int ProcessDDLStatement(string& ddlStatement, string& schema, const string& tabl
ci->isAlter = false;
}
if (b == ddlpackageprocessor::DDLPackageProcessor::DROP_TABLE_NOT_IN_CATALOG_ERROR)
{
return ER_NO_SUCH_TABLE_IN_ENGINE;
}
if ((b != 0) && (b != ddlpackageprocessor::DDLPackageProcessor::WARNING))
{
thd->get_stmt_da()->set_overwrite_status(true);
@ -2583,7 +2588,7 @@ int ha_mcs_impl_delete_table_(const char* db, const char* name, cal_connection_i
stmt += ";";
int rc = ProcessDDLStatement(stmt, schema, tbl, tid2sid(thd->thread_id), emsg);
if (rc != 0)
if (rc != 0 && rc != ER_NO_SUCH_TABLE_IN_ENGINE)
{
push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 9999, emsg.c_str());
}

View File

@ -545,28 +545,26 @@ int ha_mcs_impl_write_last_batch(TABLE* table, cal_connection_info& ci, bool abo
return rc;
//@Bug 4605
int rc1 = 0;
if ( (rc == 0) && !abort && (!(thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))))
{
ci.rowsHaveInserted += size;
command = "COMMIT";
ProcessCommandStatement ( thd, command, ci, schema );
rc1 = ProcessCommandStatement ( thd, command, ci, schema );
}
else if (useHdfs)
{
ci.rowsHaveInserted += size;
command = "COMMIT";
ProcessCommandStatement ( thd, command, ci, schema );
rc1 = ProcessCommandStatement ( thd, command, ci, schema );
}
else if (( rc != 0) || abort )
{
command = "ROLLBACK";
ProcessCommandStatement ( thd, command, ci, schema );
rc1 = ProcessCommandStatement ( thd, command, ci, schema );
}
else
{
return rc;
}
rc = max(rc, rc1);
return rc;
}
@ -630,26 +628,28 @@ int ha_mcs_impl_write_row_(const uchar* buf, TABLE* table, cal_connection_info&
if ( thd->killed > 0 )
{
command = "ROLLBACK";
ProcessCommandStatement ( thd, command, ci, schema );
rc = ProcessCommandStatement ( thd, command, ci, schema );
}
else if (rc != dmlpackageprocessor::DMLPackageProcessor::ACTIVE_TRANSACTION_ERROR)
{
//@Bug 4605
int rc1 = 0;
if ( rc != 0 )
{
command = "ROLLBACK";
ProcessCommandStatement ( thd, command, ci, schema );
rc1 = ProcessCommandStatement ( thd, command, ci, schema );
}
else if (( rc == 0 ) && (!(thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))))
{
command = "COMMIT";
ProcessCommandStatement ( thd, command, ci, schema );
rc1 = ProcessCommandStatement ( thd, command, ci, schema );
}
else if (useHdfs)
{
command = "COMMIT";
ProcessCommandStatement ( thd, command, ci, schema );
rc1 = ProcessCommandStatement ( thd, command, ci, schema );
}
rc = max(rc, rc1);
}
}
@ -1702,7 +1702,7 @@ int ha_mcs_impl_write_batch_row_(const uchar* buf, TABLE* table, cal_impl_if::ca
}
else
{
buf = buf + 2 ;
buf = buf + 2;
}
}
else //utf8

View File

@ -3323,6 +3323,7 @@ ReturnedColumn* buildReturnedColumn(
break;
}
}
/* fall through */
case Item::NULL_ITEM:
{
@ -4087,7 +4088,20 @@ ReturnedColumn* buildFunctionColumn(
fc->operationType(functor->operationType(funcParms, fc->resultType()));
fc->expressionId(ci->expressionId++);
fc->charsetNumber(ifp->collation.collation->number);
// A few functions use a different collation than that found in
// the base ifp class
if (funcName == "locate" ||
funcName == "find_in_set" ||
funcName == "strcmp")
{
DTCollation dt;
ifp->Type_std_attributes::agg_arg_charsets_for_comparison(dt, ifp->func_name(), ifp->arguments(), 1, 1);
fc->charsetNumber(dt.collation->number);
}
else
{
fc->charsetNumber(ifp->collation.collation->number);
}
}
else if (ifp->type() == Item::COND_ITEM ||
ifp->functype() == Item_func::EQ_FUNC ||
@ -4828,6 +4842,7 @@ ReturnedColumn* buildAggregateColumn(Item* item, gp_walk_info& gwi)
break;
}
}
/* fall through */
default:
{

View File

@ -1604,27 +1604,7 @@ uint32_t doUpdateDelete(THD* thd, gp_walk_info& gwi, const std::vector<COND*>& c
aTableName.schema = first_table->table->s->db.str;
aTableName.table = first_table->table->s->table_name.str;
}
#if 0
CalpontSystemCatalog::ROPair roPair;
try
{
roPair = csc->tableRID( aTableName );
}
catch (IDBExcept& ie)
{
setError(thd, ER_INTERNAL_ERROR, ie.what());
return ER_INTERNAL_ERROR;
}
catch (std::exception& ex)
{
setError(thd, ER_INTERNAL_ERROR,
logging::IDBErrorInfo::instance()->errorMsg(ERR_SYSTEM_CATALOG) + ex.what());
return ER_INTERNAL_ERROR;
}
ci->tableOid = roPair.objnum;
#endif
CalpontDMLPackage* pDMLPackage = 0;
// dmlStmt += ";";
IDEBUG( cout << "STMT: " << dmlStmt << " and sessionID " << thd->thread_id << endl );
@ -2271,7 +2251,6 @@ uint32_t doUpdateDelete(THD* thd, gp_walk_info& gwi, const std::vector<COND*>& c
delete ci->dmlProc;
ci->dmlProc = nullptr;
return rc;
}

View File

@ -263,6 +263,7 @@ const string format(int64_t v, CalpontSystemCatalog::ColType& ct)
case CalpontSystemCatalog::TIME:
oss << DataConvert::timeToString(v);
break;
case CalpontSystemCatalog::CHAR:
case CalpontSystemCatalog::VARCHAR:
@ -314,7 +315,7 @@ const string format(int64_t v, CalpontSystemCatalog::ColType& ct)
return oss.str();
}
const int64_t IDB_format(char* str, CalpontSystemCatalog::ColType& ct, uint8_t& rf)
int64_t IDB_format(char* str, CalpontSystemCatalog::ColType& ct, uint8_t& rf)
{
int64_t v = 0;
bool pushWarning = false;

View File

@ -54,7 +54,7 @@ public:
{
return fGwip;
}
const bool correlated() const
bool correlated() const
{
return fCorrelated;
}
@ -126,7 +126,7 @@ public:
execplan::ParseTree* transform_between();
execplan::ParseTree* transform_in();
execplan::ParseTree* buildParseTree(execplan::PredicateOperator* op);
const uint64_t returnedColPos() const
uint64_t returnedColPos() const
{
return fReturnedColPos;
}