mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Manual merge from mysql-5.1.
This commit is contained in:
@ -753,7 +753,7 @@ static bool insert_params_with_log(Prepared_statement *stmt, uchar *null_array,
|
||||
const String *res;
|
||||
DBUG_ENTER("insert_params_with_log");
|
||||
|
||||
if (query->copy(stmt->query, stmt->query_length, default_charset_info))
|
||||
if (query->copy(stmt->query(), stmt->query_length(), default_charset_info))
|
||||
DBUG_RETURN(1);
|
||||
|
||||
for (Item_param **it= begin; it < end; ++it)
|
||||
@ -915,7 +915,7 @@ static bool emb_insert_params_with_log(Prepared_statement *stmt,
|
||||
|
||||
DBUG_ENTER("emb_insert_params_with_log");
|
||||
|
||||
if (query->copy(stmt->query, stmt->query_length, default_charset_info))
|
||||
if (query->copy(stmt->query(), stmt->query_length(), default_charset_info))
|
||||
DBUG_RETURN(1);
|
||||
|
||||
for (; it < end; ++it, ++client_param)
|
||||
@ -1066,7 +1066,7 @@ static bool insert_params_from_vars_with_log(Prepared_statement *stmt,
|
||||
|
||||
DBUG_ENTER("insert_params_from_vars");
|
||||
|
||||
if (query->copy(stmt->query, stmt->query_length, default_charset_info))
|
||||
if (query->copy(stmt->query(), stmt->query_length(), default_charset_info))
|
||||
DBUG_RETURN(1);
|
||||
|
||||
for (Item_param **it= begin; it < end; ++it)
|
||||
@ -2458,9 +2458,9 @@ void mysqld_stmt_execute(THD *thd, char *packet_arg, uint packet_length)
|
||||
}
|
||||
|
||||
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
|
||||
thd->profiling.set_query_source(stmt->query, stmt->query_length);
|
||||
thd->profiling.set_query_source(stmt->query(), stmt->query_length());
|
||||
#endif
|
||||
DBUG_PRINT("exec_query", ("%s", stmt->query));
|
||||
DBUG_PRINT("exec_query", ("%s", stmt->query()));
|
||||
DBUG_PRINT("info",("stmt: 0x%lx", (long) stmt));
|
||||
|
||||
sp_cache_flush_obsolete(&thd->sp_proc_cache);
|
||||
@ -3030,7 +3030,7 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
|
||||
old_stmt_arena= thd->stmt_arena;
|
||||
thd->stmt_arena= this;
|
||||
|
||||
Parser_state parser_state(thd, thd->query, thd->query_length);
|
||||
Parser_state parser_state(thd, thd->query(), thd->query_length());
|
||||
parser_state.m_lip.stmt_prepare_mode= TRUE;
|
||||
lex_start(thd);
|
||||
|
||||
@ -3119,7 +3119,7 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
|
||||
the general log.
|
||||
*/
|
||||
if (thd->spcont == NULL)
|
||||
general_log_write(thd, COM_STMT_PREPARE, query, query_length);
|
||||
general_log_write(thd, COM_STMT_PREPARE, query(), query_length());
|
||||
}
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
@ -3310,7 +3310,7 @@ Prepared_statement::reprepare()
|
||||
return TRUE;
|
||||
|
||||
error= ((name.str && copy.set_name(&name)) ||
|
||||
copy.prepare(query, query_length) ||
|
||||
copy.prepare(query(), query_length()) ||
|
||||
validate_metadata(©));
|
||||
|
||||
if (cur_db_changed)
|
||||
@ -3548,8 +3548,7 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor)
|
||||
to point at it even after we restore from backup. This is ok, as
|
||||
expanded query was allocated in thd->mem_root.
|
||||
*/
|
||||
stmt_backup.query= thd->query;
|
||||
stmt_backup.query_length= thd->query_length;
|
||||
stmt_backup.set_query_inner(thd->query(), thd->query_length());
|
||||
|
||||
/*
|
||||
At first execution of prepared statement we may perform logical
|
||||
@ -3574,8 +3573,8 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor)
|
||||
Note that multi-statements cannot exist here (they are not supported in
|
||||
prepared statements).
|
||||
*/
|
||||
if (query_cache_send_result_to_client(thd, thd->query,
|
||||
thd->query_length) <= 0)
|
||||
if (query_cache_send_result_to_client(thd, thd->query(),
|
||||
thd->query_length()) <= 0)
|
||||
{
|
||||
MYSQL_QUERY_EXEC_START(thd->query,
|
||||
thd->thread_id,
|
||||
@ -3627,7 +3626,7 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor)
|
||||
the general log.
|
||||
*/
|
||||
if (error == 0 && thd->spcont == NULL)
|
||||
general_log_write(thd, COM_STMT_EXECUTE, thd->query, thd->query_length);
|
||||
general_log_write(thd, COM_STMT_EXECUTE, thd->query(), thd->query_length());
|
||||
|
||||
error:
|
||||
flags&= ~ (uint) IS_IN_USE;
|
||||
|
Reference in New Issue
Block a user