mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
cleanup: remove ONLY_FOR_MYSQL_CLOSED_SOURCE_SCHEDULED
This commit is contained in:
179
sql/sql_class.cc
179
sql/sql_class.cc
@ -267,185 +267,6 @@ bool Foreign_key::validate(List<Create_field> &table_fields)
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
** Thread specific functions
|
** Thread specific functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#ifdef ONLY_FOR_MYSQL_CLOSED_SOURCE_SCHEDULED
|
|
||||||
/**
|
|
||||||
Get reference to scheduler data object
|
|
||||||
|
|
||||||
@param thd THD object
|
|
||||||
|
|
||||||
@retval Scheduler data object on THD
|
|
||||||
*/
|
|
||||||
void *thd_get_scheduler_data(THD *thd)
|
|
||||||
{
|
|
||||||
return thd->scheduler.data;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
Set reference to Scheduler data object for THD object
|
|
||||||
|
|
||||||
@param thd THD object
|
|
||||||
@param psi Scheduler data object to set on THD
|
|
||||||
*/
|
|
||||||
void thd_set_scheduler_data(THD *thd, void *data)
|
|
||||||
{
|
|
||||||
thd->scheduler.data= data;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
Get reference to Performance Schema object for THD object
|
|
||||||
|
|
||||||
@param thd THD object
|
|
||||||
|
|
||||||
@retval Performance schema object for thread on THD
|
|
||||||
*/
|
|
||||||
PSI_thread *thd_get_psi(THD *thd)
|
|
||||||
{
|
|
||||||
return thd->scheduler.m_psi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
Get net_wait_timeout for THD object
|
|
||||||
|
|
||||||
@param thd THD object
|
|
||||||
|
|
||||||
@retval net_wait_timeout value for thread on THD
|
|
||||||
*/
|
|
||||||
ulong thd_get_net_wait_timeout(THD* thd)
|
|
||||||
{
|
|
||||||
return thd->variables.net_wait_timeout;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
Set reference to Performance Schema object for THD object
|
|
||||||
|
|
||||||
@param thd THD object
|
|
||||||
@param psi Performance schema object for thread
|
|
||||||
*/
|
|
||||||
void thd_set_psi(THD *thd, PSI_thread *psi)
|
|
||||||
{
|
|
||||||
thd->scheduler.m_psi= psi;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
Set the state on connection to killed
|
|
||||||
|
|
||||||
@param thd THD object
|
|
||||||
*/
|
|
||||||
void thd_set_killed(THD *thd)
|
|
||||||
{
|
|
||||||
thd->killed= KILL_CONNECTION;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
Set thread stack in THD object
|
|
||||||
|
|
||||||
@param thd Thread object
|
|
||||||
@param stack_start Start of stack to set in THD object
|
|
||||||
*/
|
|
||||||
void thd_set_thread_stack(THD *thd, char *stack_start)
|
|
||||||
{
|
|
||||||
thd->thread_stack= stack_start;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
Close the socket used by this connection
|
|
||||||
|
|
||||||
@param thd THD object
|
|
||||||
*/
|
|
||||||
void thd_close_connection(THD *thd)
|
|
||||||
{
|
|
||||||
if (thd->net.vio)
|
|
||||||
vio_close(thd->net.vio);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
Lock data that needs protection in THD object
|
|
||||||
|
|
||||||
@param thd THD object
|
|
||||||
*/
|
|
||||||
void thd_lock_data(THD *thd)
|
|
||||||
{
|
|
||||||
mysql_mutex_lock(&thd->LOCK_thd_data);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
Unlock data that needs protection in THD object
|
|
||||||
|
|
||||||
@param thd THD object
|
|
||||||
*/
|
|
||||||
void thd_unlock_data(THD *thd)
|
|
||||||
{
|
|
||||||
mysql_mutex_unlock(&thd->LOCK_thd_data);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
Support method to check if connection has already started transcaction
|
|
||||||
|
|
||||||
@param client_cntx Low level client context
|
|
||||||
|
|
||||||
@retval TRUE if connection already started transaction
|
|
||||||
*/
|
|
||||||
bool thd_is_transaction_active(THD *thd)
|
|
||||||
{
|
|
||||||
return thd->transaction.is_active();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
Check if there is buffered data on the socket representing the connection
|
|
||||||
|
|
||||||
@param thd THD object
|
|
||||||
*/
|
|
||||||
int thd_connection_has_data(THD *thd)
|
|
||||||
{
|
|
||||||
Vio *vio= thd->net.vio;
|
|
||||||
return vio->has_data(vio);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
Set reading/writing on socket, used by SHOW PROCESSLIST
|
|
||||||
|
|
||||||
@param thd THD object
|
|
||||||
@param val Value to set it to (0 or 1)
|
|
||||||
*/
|
|
||||||
void thd_set_net_read_write(THD *thd, uint val)
|
|
||||||
{
|
|
||||||
thd->net.reading_or_writing= val;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
Get reading/writing on socket from THD object
|
|
||||||
@param thd THD object
|
|
||||||
|
|
||||||
@retval net.reading_or_writing value for thread on THD.
|
|
||||||
*/
|
|
||||||
uint thd_get_net_read_write(THD *thd)
|
|
||||||
{
|
|
||||||
return thd->net.reading_or_writing;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
Set reference to mysys variable in THD object
|
|
||||||
|
|
||||||
@param thd THD object
|
|
||||||
@param mysys_var Reference to set
|
|
||||||
*/
|
|
||||||
void thd_set_mysys_var(THD *thd, st_my_thread_var *mysys_var)
|
|
||||||
{
|
|
||||||
thd->set_mysys_var(mysys_var);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
Get socket file descriptor for this connection
|
|
||||||
|
|
||||||
@param thd THD object
|
|
||||||
|
|
||||||
@retval Socket of the connection
|
|
||||||
*/
|
|
||||||
my_socket thd_get_fd(THD *thd)
|
|
||||||
{
|
|
||||||
return mysql_socket_getfd(thd->net.vio->mysql_socket);
|
|
||||||
}
|
|
||||||
#endif /* ONLY_FOR_MYSQL_CLOSED_SOURCE_SCHEDULED */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Get current THD object from thread local data
|
Get current THD object from thread local data
|
||||||
|
Reference in New Issue
Block a user