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

cleanup: remove unused argument

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