Commit 211421d5 authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup: remove unused argument

parent c1c5222c
......@@ -35,8 +35,8 @@
#endif
#ifdef HAVE_PSI_PS_INTERFACE
#define MYSQL_CREATE_PS(IDENTITY, ID, LOCKER, NAME, NAME_LENGTH, SQLTEXT, SQLTEXT_LENGTH) \
inline_mysql_create_prepared_stmt(IDENTITY, ID, LOCKER, NAME, NAME_LENGTH, SQLTEXT, SQLTEXT_LENGTH)
#define MYSQL_CREATE_PS(IDENTITY, ID, LOCKER, NAME, NAME_LENGTH) \
inline_mysql_create_prepared_stmt(IDENTITY, ID, LOCKER, NAME, NAME_LENGTH)
#define MYSQL_EXECUTE_PS(LOCKER, PREPARED_STMT) \
inline_mysql_execute_prepared_stmt(LOCKER, PREPARED_STMT)
#define MYSQL_DESTROY_PS(PREPARED_STMT) \
......@@ -46,7 +46,7 @@
#define MYSQL_SET_PS_TEXT(PREPARED_STMT, SQLTEXT, SQLTEXT_LENGTH) \
inline_mysql_set_prepared_stmt_text(PREPARED_STMT, SQLTEXT, SQLTEXT_LENGTH)
#else
#define MYSQL_CREATE_PS(IDENTITY, ID, LOCKER, NAME, NAME_LENGTH, SQLTEXT, SQLTEXT_LENGTH) \
#define MYSQL_CREATE_PS(IDENTITY, ID, LOCKER, NAME, NAME_LENGTH) \
NULL
#define MYSQL_EXECUTE_PS(LOCKER, PREPARED_STMT) \
do {} while (0)
......@@ -62,15 +62,13 @@
static inline struct PSI_prepared_stmt*
inline_mysql_create_prepared_stmt(void *identity, uint stmt_id,
PSI_statement_locker *locker,
const char *stmt_name, size_t stmt_name_length,
const char *sqltext, size_t sqltext_length)
const char *stmt_name, size_t stmt_name_length)
{
if (locker == NULL)
return NULL;
return PSI_PS_CALL(create_prepared_stmt)(identity, stmt_id,
locker,
stmt_name, stmt_name_length,
sqltext, sqltext_length);
stmt_name, stmt_name_length);
}
static inline void
......
......@@ -2350,8 +2350,7 @@ typedef void (*set_socket_thread_owner_v1_t)(struct PSI_socket *socket);
*/
typedef PSI_prepared_stmt* (*create_prepared_stmt_v1_t)
(void *identity, uint stmt_id, PSI_statement_locker *locker,
const char *stmt_name, size_t stmt_name_length,
const char *name, size_t length);
const char *stmt_name, size_t stmt_name_length);
/**
destroy a prepare statement.
......
......@@ -645,8 +645,7 @@ typedef void (*set_socket_info_v1_t)(struct PSI_socket *socket,
typedef void (*set_socket_thread_owner_v1_t)(struct PSI_socket *socket);
typedef PSI_prepared_stmt* (*create_prepared_stmt_v1_t)
(void *identity, uint stmt_id, PSI_statement_locker *locker,
const char *stmt_name, size_t stmt_name_length,
const char *name, size_t length);
const char *stmt_name, size_t stmt_name_length);
typedef void (*destroy_prepared_stmt_v1_t)
(PSI_prepared_stmt *prepared_stmt);
typedef void (*reprepare_prepared_stmt_v1_t)
......
......@@ -732,8 +732,7 @@ static void set_socket_thread_owner_noop(PSI_socket *socket NNN)
static PSI_prepared_stmt*
create_prepare_stmt_noop(void *identity NNN, uint stmt_id NNN,
PSI_statement_locker *locker NNN,
const char *stmt_name NNN, size_t stmt_name_length NNN,
const char *name NNN, size_t length NNN)
const char *stmt_name NNN, size_t stmt_name_length NNN)
{
return NULL;
}
......
......@@ -2669,8 +2669,7 @@ void mysqld_stmt_prepare(THD *thd, const char *packet, uint packet_length)
/* Create PS table entry, set query text after rewrite. */
stmt->m_prepared_stmt= MYSQL_CREATE_PS(stmt, stmt->id,
thd->m_statement_psi,
stmt->name.str, stmt->name.length,
NULL, 0);
stmt->name.str, stmt->name.length);
if (stmt->prepare(packet, packet_length))
{
......@@ -2876,8 +2875,7 @@ void mysql_sql_stmt_prepare(THD *thd)
/* Create PS table entry, set query text after rewrite. */
stmt->m_prepared_stmt= MYSQL_CREATE_PS(stmt, stmt->id,
thd->m_statement_psi,
stmt->name.str, stmt->name.length,
NULL, 0);
stmt->name.str, stmt->name.length);
if (stmt->prepare(query.str, (uint) query.length))
{
......@@ -4901,8 +4899,7 @@ bool Prepared_statement::execute_immediate(const char *query, uint query_len)
name= execute_immediate_stmt_name; // for DBUG_PRINT etc
m_prepared_stmt= MYSQL_CREATE_PS(this, id, thd->m_statement_psi,
name.str, name.length,
NULL, 0);
name.str, name.length);
if (prepare(query, query_len))
DBUG_RETURN(true);
......
......@@ -6379,8 +6379,7 @@ void pfs_digest_end_v1(PSI_digest_locker *locker, const sql_digest_storage *dige
PSI_prepared_stmt*
pfs_create_prepared_stmt_v1(void *identity, uint stmt_id,
PSI_statement_locker *locker,
const char *stmt_name, size_t stmt_name_length,
const char *sql_text, size_t sql_text_length)
const char *stmt_name, size_t stmt_name_length)
{
PSI_statement_locker_state *state= reinterpret_cast<PSI_statement_locker_state*> (locker);
PFS_events_statements *pfs_stmt= reinterpret_cast<PFS_events_statements*> (state->m_statement);
......@@ -6390,14 +6389,10 @@ pfs_create_prepared_stmt_v1(void *identity, uint stmt_id,
if (unlikely(pfs_thread == NULL))
return NULL;
if (sql_text_length > COL_INFO_SIZE)
sql_text_length= COL_INFO_SIZE;
PFS_prepared_stmt *pfs= create_prepared_stmt(identity,
pfs_thread, pfs_program,
pfs_stmt, stmt_id,
stmt_name, static_cast<uint>(stmt_name_length),
sql_text, static_cast<uint>(sql_text_length));
stmt_name, static_cast<uint>(stmt_name_length));
state->m_parent_prepared_stmt= reinterpret_cast<PSI_prepared_stmt*>(pfs);
state->m_in_prepare= true;
......
......@@ -78,8 +78,7 @@ PFS_prepared_stmt*
create_prepared_stmt(void *identity,
PFS_thread *thread, PFS_program *pfs_program,
PFS_events_statements *pfs_stmt, uint stmt_id,
const char* stmt_name, uint stmt_name_length,
const char* sqltext, uint sqltext_length)
const char* stmt_name, uint stmt_name_length)
{
PFS_prepared_stmt *pfs= NULL;
pfs_dirty_state dirty_state;
......@@ -92,11 +91,8 @@ create_prepared_stmt(void *identity,
pfs->reset_data();
/* Do the assignments. */
pfs->m_identity= identity;
/* Set query text if available, else it will be set later. */
if (sqltext_length > 0)
strncpy(pfs->m_sqltext, sqltext, sqltext_length);
pfs->m_sqltext_length= sqltext_length;
pfs->m_sqltext_length= 0;
if (stmt_name != NULL)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment