You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-05 16:15:50 +03:00
Merge pull request #1439 from mariadb-corporation/develop-mcol-4264
MCOL-4264 [Cross-Engine] UPDATE to INNODB table with WHERE clause usi…
This commit is contained in:
@@ -2348,8 +2348,19 @@ int ha_mcs_impl_rnd_init(TABLE* table, const std::vector<COND*>& condStack)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Update and delete code
|
/*
|
||||||
if ( ((thd->lex)->sql_command == SQLCOM_UPDATE) || ((thd->lex)->sql_command == SQLCOM_DELETE) || ((thd->lex)->sql_command == SQLCOM_DELETE_MULTI) || ((thd->lex)->sql_command == SQLCOM_UPDATE_MULTI))
|
Update and delete code.
|
||||||
|
Note, we may be updating/deleting a different table,
|
||||||
|
and the current one is only needed for reading,
|
||||||
|
e.g. cstab1 is needed for reading in this example:
|
||||||
|
|
||||||
|
UPDATE innotab1 SET a=100 WHERE a NOT IN (SELECT a FROM cstab1 WHERE a=1);
|
||||||
|
*/
|
||||||
|
if (!ci->isReadOnly() && // make sure the current table is being modified
|
||||||
|
(thd->lex->sql_command == SQLCOM_UPDATE ||
|
||||||
|
thd->lex->sql_command == SQLCOM_DELETE ||
|
||||||
|
thd->lex->sql_command == SQLCOM_DELETE_MULTI ||
|
||||||
|
thd->lex->sql_command == SQLCOM_UPDATE_MULTI))
|
||||||
return doUpdateDelete(thd, gwi, condStack);
|
return doUpdateDelete(thd, gwi, condStack);
|
||||||
|
|
||||||
uint32_t sessionID = tid2sid(thd->thread_id);
|
uint32_t sessionID = tid2sid(thd->thread_id);
|
||||||
@@ -4079,6 +4090,7 @@ int ha_mcs_impl_external_lock(THD* thd, TABLE* table, int lock_type)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ci->lock_type= lock_type;
|
||||||
|
|
||||||
CalTableMap::iterator mapiter = ci->tableMap.find(table);
|
CalTableMap::iterator mapiter = ci->tableMap.find(table);
|
||||||
// make sure this is a release lock (2nd) call called in
|
// make sure this is a release lock (2nd) call called in
|
||||||
|
@@ -262,7 +262,8 @@ struct cal_connection_info
|
|||||||
utf8(false),
|
utf8(false),
|
||||||
useCpimport(1),
|
useCpimport(1),
|
||||||
delimiter('\7'),
|
delimiter('\7'),
|
||||||
affectedRows(0)
|
affectedRows(0),
|
||||||
|
lock_type(F_UNLCK)
|
||||||
{
|
{
|
||||||
// check if this is a slave mysql daemon
|
// check if this is a slave mysql daemon
|
||||||
isSlaveNode = checkSlave();
|
isSlaveNode = checkSlave();
|
||||||
@@ -285,6 +286,11 @@ struct cal_connection_info
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isReadOnly() const
|
||||||
|
{
|
||||||
|
return lock_type == F_RDLCK;
|
||||||
|
}
|
||||||
|
|
||||||
sm::cpsm_conhdl_t* cal_conn_hndl;
|
sm::cpsm_conhdl_t* cal_conn_hndl;
|
||||||
std::stack<sm::cpsm_conhdl_t*> cal_conn_hndl_st;
|
std::stack<sm::cpsm_conhdl_t*> cal_conn_hndl_st;
|
||||||
int queryState;
|
int queryState;
|
||||||
@@ -335,6 +341,7 @@ struct cal_connection_info
|
|||||||
// MCOL-1101 remove compilation unit variable rmParms
|
// MCOL-1101 remove compilation unit variable rmParms
|
||||||
std::vector <execplan::RMParam> rmParms;
|
std::vector <execplan::RMParam> rmParms;
|
||||||
long long affectedRows;
|
long long affectedRows;
|
||||||
|
int lock_type;
|
||||||
};
|
};
|
||||||
|
|
||||||
const std::string infinidb_err_msg = "\nThe query includes syntax that is not supported by MariaDB Columnstore. Use 'show warnings;' to get more information. Review the MariaDB Columnstore Syntax guide for additional information on supported distributed syntax or consider changing the MariaDB Columnstore Operating Mode (infinidb_vtable_mode).";
|
const std::string infinidb_err_msg = "\nThe query includes syntax that is not supported by MariaDB Columnstore. Use 'show warnings;' to get more information. Review the MariaDB Columnstore Syntax guide for additional information on supported distributed syntax or consider changing the MariaDB Columnstore Operating Mode (infinidb_vtable_mode).";
|
||||||
|
Reference in New Issue
Block a user