mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge bodhi.netgear:/opt/local/work/tmp_merge
into bodhi.netgear:/opt/local/work/mysql-5.1-runtime-merge-with-5.0
This commit is contained in:
@ -1135,7 +1135,7 @@ public:
|
||||
uint tmp_table, global_read_lock;
|
||||
uint server_status,open_options;
|
||||
enum enum_thread_type system_thread;
|
||||
uint32 db_length;
|
||||
uint db_length;
|
||||
uint select_number; //number of select (used for EXPLAIN)
|
||||
/* variables.transaction_isolation is reset to this after each commit */
|
||||
enum_tx_isolation session_tx_isolation;
|
||||
@ -1443,6 +1443,47 @@ public:
|
||||
current_stmt_binlog_row_based= FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
Initialize the current database from a NULL-terminated string with length
|
||||
*/
|
||||
void set_db(const char *new_db, uint new_db_len)
|
||||
{
|
||||
if (new_db)
|
||||
{
|
||||
/* Do not reallocate memory if current chunk is big enough. */
|
||||
if (db && db_length >= new_db_len)
|
||||
memcpy(db, new_db, new_db_len+1);
|
||||
else
|
||||
{
|
||||
safeFree(db);
|
||||
db= my_strndup(new_db, new_db_len, MYF(MY_WME));
|
||||
}
|
||||
db_length= db ? new_db_len: 0;
|
||||
}
|
||||
}
|
||||
void reset_db(char *new_db, uint new_db_len)
|
||||
{
|
||||
db= new_db;
|
||||
db_length= new_db_len;
|
||||
}
|
||||
/*
|
||||
Copy the current database to the argument. Use the current arena to
|
||||
allocate memory for a deep copy: current database may be freed after
|
||||
a statement is parsed but before it's executed.
|
||||
*/
|
||||
bool copy_db_to(char **p_db, uint *p_db_length)
|
||||
{
|
||||
if (db == NULL)
|
||||
{
|
||||
my_message(ER_NO_DB_ERROR, ER(ER_NO_DB_ERROR), MYF(0));
|
||||
return TRUE;
|
||||
}
|
||||
*p_db= strmake(db, db_length);
|
||||
if (p_db_length)
|
||||
*p_db_length= db_length;
|
||||
return FALSE;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -1790,7 +1831,7 @@ typedef struct st_sort_buffer {
|
||||
|
||||
class Table_ident :public Sql_alloc
|
||||
{
|
||||
public:
|
||||
public:
|
||||
LEX_STRING db;
|
||||
LEX_STRING table;
|
||||
SELECT_LEX_UNIT *sel;
|
||||
|
Reference in New Issue
Block a user