mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Merge bodhi.netgear:/opt/local/work/tmp_merge
into bodhi.netgear:/opt/local/work/mysql-5.1-runtime-merge-with-5.0 mysql-test/r/create.result: Auto merged mysql-test/r/ps.result: Auto merged mysql-test/r/sp.result: Auto merged mysql-test/t/create.test: Auto merged mysql-test/t/ps.test: Auto merged mysql-test/t/sp.test: Auto merged sql/item_strfunc.cc: Auto merged sql/sp.cc: Auto merged sql/sp.h: Auto merged sql/sp_head.cc: Auto merged sql/sp_head.h: Auto merged sql/sql_db.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_parse.cc: Auto merged sql/sql_trigger.cc: Auto merged sql/sql_view.cc: Auto merged sql/table.h: Auto merged sql/tztime.cc: Auto merged include/my_sys.h: Manual merge (second attempt). mysql-test/r/bdb.result: Manual merge (second attempt). mysql-test/t/bdb.test: Manual merge (second attempt). mysys/my_malloc.c: Manual merge (second attempt). mysys/safemalloc.c: Manual merge (second attempt). sql/ha_federated.cc: Manual merge (second attempt). sql/log_event.cc: Manual merge (second attempt). sql/set_var.cc: Manual merge (second attempt). sql/set_var.h: Manual merge (second attempt). sql/slave.cc: Manual merge (second attempt). sql/slave.h: Manual merge (second attempt). sql/sql_class.h: Manual merge (second attempt). sql/sql_table.cc: Manual merge (second attempt). sql/sql_udf.cc: Manual merge (second attempt). sql/sql_yacc.yy: Manual merge (second attempt).
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