mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
10.0-base merge
This commit is contained in:
@ -13,7 +13,7 @@
|
||||
|
||||
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 St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
|
||||
|
||||
#ifndef SQL_CLASS_INCLUDED
|
||||
#define SQL_CLASS_INCLUDED
|
||||
@ -1661,6 +1661,7 @@ public:
|
||||
Protects THD data accessed from other threads:
|
||||
- thd->query and thd->query_length (used by SHOW ENGINE
|
||||
INNODB STATUS and SHOW PROCESSLIST
|
||||
- thd->db and thd->db_length (used in SHOW PROCESSLIST)
|
||||
- thd->mysys_var (used by KILL statement and shutdown).
|
||||
Is locked when THD is deleted.
|
||||
*/
|
||||
@ -3051,6 +3052,7 @@ public:
|
||||
bool set_db(const char *new_db, size_t new_db_len)
|
||||
{
|
||||
bool result;
|
||||
mysql_mutex_lock(&LOCK_thd_data);
|
||||
/* Do not reallocate memory if current chunk is big enough. */
|
||||
if (db && new_db && db_length >= new_db_len)
|
||||
memcpy(db, new_db, new_db_len+1);
|
||||
@ -3064,6 +3066,7 @@ public:
|
||||
}
|
||||
db_length= db ? new_db_len : 0;
|
||||
result= new_db && !db;
|
||||
mysql_mutex_unlock(&LOCK_thd_data);
|
||||
#ifdef HAVE_PSI_THREAD_INTERFACE
|
||||
if (result)
|
||||
PSI_CALL(set_thread_db)(new_db, new_db_len);
|
||||
@ -3084,11 +3087,16 @@ public:
|
||||
*/
|
||||
void reset_db(char *new_db, size_t new_db_len)
|
||||
{
|
||||
db= new_db;
|
||||
db_length= new_db_len;
|
||||
if (new_db != db || new_db_len != db_length)
|
||||
{
|
||||
mysql_mutex_lock(&LOCK_thd_data);
|
||||
db= new_db;
|
||||
db_length= new_db_len;
|
||||
mysql_mutex_unlock(&LOCK_thd_data);
|
||||
#ifdef HAVE_PSI_THREAD_INTERFACE
|
||||
PSI_CALL(set_thread_db)(new_db, new_db_len);
|
||||
PSI_CALL(set_thread_db)(new_db, new_db_len);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
/*
|
||||
Copy the current database to the argument. Use the current arena to
|
||||
@ -4477,6 +4485,11 @@ inline bool add_order_to_list(THD *thd, Item *item, bool asc)
|
||||
return thd->lex->current_select->add_order_to_list(thd, item, asc);
|
||||
}
|
||||
|
||||
inline bool add_gorder_to_list(THD *thd, Item *item, bool asc)
|
||||
{
|
||||
return thd->lex->current_select->add_gorder_to_list(thd, item, asc);
|
||||
}
|
||||
|
||||
inline bool add_group_to_list(THD *thd, Item *item, bool asc)
|
||||
{
|
||||
return thd->lex->current_select->add_group_to_list(thd, item, asc);
|
||||
|
Reference in New Issue
Block a user