summaryrefslogtreecommitdiff
path: root/sql/sp.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sp.cc')
-rw-r--r--sql/sp.cc50
1 files changed, 26 insertions, 24 deletions
diff --git a/sql/sp.cc b/sql/sp.cc
index a5a14ec8d85..207ece47356 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -41,7 +41,7 @@
static int
db_load_routine(THD *thd, stored_procedure_type type, sp_name *name,
sp_head **sphp,
- ulonglong sql_mode, const char *params, const char *returns,
+ sql_mode_t sql_mode, const char *params, const char *returns,
const char *body, st_sp_chistics &chistics,
LEX_STRING *definer_user_name, LEX_STRING *definer_host_name,
longlong created, longlong modified,
@@ -539,7 +539,7 @@ db_find_routine(THD *thd, stored_procedure_type type, sp_name *name,
char buff[65];
String str(buff, sizeof(buff), &my_charset_bin);
bool saved_time_zone_used= thd->time_zone_used;
- ulonglong sql_mode, saved_mode= thd->variables.sql_mode;
+ sql_mode_t sql_mode, saved_mode= thd->variables.sql_mode;
Open_tables_backup open_tables_state_backup;
Stored_program_creation_ctx *creation_ctx;
char definer_user_name_holder[USERNAME_LENGTH + 1];
@@ -691,7 +691,7 @@ public:
virtual bool handle_condition(THD *thd,
uint sql_errno,
const char* sqlstate,
- Sql_condition::enum_warning_level level,
+ Sql_condition::enum_warning_level *level,
const char* msg,
Sql_condition ** cond_hdl);
};
@@ -701,13 +701,13 @@ Silence_deprecated_warning::handle_condition(
THD *,
uint sql_errno,
const char*,
- Sql_condition::enum_warning_level level,
+ Sql_condition::enum_warning_level *level,
const char*,
Sql_condition ** cond_hdl)
{
*cond_hdl= NULL;
if (sql_errno == ER_WARN_DEPRECATED_SYNTAX &&
- level == Sql_condition::WARN_LEVEL_WARN)
+ *level == Sql_condition::WARN_LEVEL_WARN)
return TRUE;
return FALSE;
@@ -727,11 +727,11 @@ Silence_deprecated_warning::handle_condition(
@retval 0 error
*/
-static sp_head *sp_compile(THD *thd, String *defstr, ulonglong sql_mode,
+static sp_head *sp_compile(THD *thd, String *defstr, sql_mode_t sql_mode,
Stored_program_creation_ctx *creation_ctx)
{
sp_head *sp;
- ulonglong old_sql_mode= thd->variables.sql_mode;
+ sql_mode_t old_sql_mode= thd->variables.sql_mode;
ha_rows old_select_limit= thd->variables.select_limit;
sp_rcontext *old_spcont= thd->spcont;
Silence_deprecated_warning warning_handler;
@@ -780,7 +780,7 @@ public:
virtual bool handle_condition(THD *thd,
uint sql_errno,
const char* sqlstate,
- Sql_condition::enum_warning_level level,
+ Sql_condition::enum_warning_level *level,
const char* message,
Sql_condition ** cond_hdl);
@@ -794,7 +794,8 @@ bool
Bad_db_error_handler::handle_condition(THD *thd,
uint sql_errno,
const char* sqlstate,
- Sql_condition::enum_warning_level level,
+ Sql_condition::enum_warning_level
+ *level,
const char* message,
Sql_condition ** cond_hdl)
{
@@ -810,7 +811,7 @@ Bad_db_error_handler::handle_condition(THD *thd,
static int
db_load_routine(THD *thd, stored_procedure_type type,
sp_name *name, sp_head **sphp,
- ulonglong sql_mode, const char *params, const char *returns,
+ sql_mode_t sql_mode, const char *params, const char *returns,
const char *body, st_sp_chistics &chistics,
LEX_STRING *definer_user_name, LEX_STRING *definer_host_name,
longlong created, longlong modified,
@@ -1024,7 +1025,7 @@ sp_create_routine(THD *thd, stored_procedure_type type, sp_head *sp)
TABLE *table;
char definer_buf[USER_HOST_BUFF_SIZE];
LEX_STRING definer;
- ulonglong saved_mode= thd->variables.sql_mode;
+ sql_mode_t saved_mode= thd->variables.sql_mode;
MDL_key::enum_mdl_namespace mdl_type= type == TYPE_ENUM_FUNCTION ?
MDL_key::FUNCTION : MDL_key::PROCEDURE;
@@ -1275,8 +1276,8 @@ log:
{
thd->clear_error();
- String log_query;
- log_query.set_charset(system_charset_info);
+ StringBuffer<128> log_query(thd->variables.character_set_client);
+ DBUG_ASSERT(log_query.charset()->mbminlen == 1);
if (!show_create_sp(thd, &log_query,
sp->m_type,
@@ -1477,7 +1478,7 @@ public:
bool handle_condition(THD *thd,
uint sql_errno,
const char* sqlstate,
- Sql_condition::enum_warning_level level,
+ Sql_condition::enum_warning_level *level,
const char* msg,
Sql_condition ** cond_hdl)
{
@@ -1752,11 +1753,11 @@ sp_find_routine(THD *thd, stored_procedure_type type, sp_name *name,
String retstr(64);
retstr.set_charset(sp->get_creation_ctx()->get_client_cs());
- DBUG_PRINT("info", ("found: 0x%lx", (ulong)sp));
+ DBUG_PRINT("info", ("found:%p", sp));
if (sp->m_first_free_instance)
{
- DBUG_PRINT("info", ("first free: 0x%lx level: %lu flags %x",
- (ulong)sp->m_first_free_instance,
+ DBUG_PRINT("info", ("first free:%p level: %lu flags %x",
+ sp->m_first_free_instance,
sp->m_first_free_instance->m_recursion_level,
sp->m_first_free_instance->m_flags));
DBUG_ASSERT(!(sp->m_first_free_instance->m_flags & sp_head::IS_INVOKED));
@@ -1796,8 +1797,8 @@ sp_find_routine(THD *thd, stored_procedure_type type, sp_name *name,
new_sp->m_recursion_level= level;
new_sp->m_first_instance= sp;
sp->m_last_cached_sp= sp->m_first_free_instance= new_sp;
- DBUG_PRINT("info", ("added level: 0x%lx, level: %lu, flags %x",
- (ulong)new_sp, new_sp->m_recursion_level,
+ DBUG_PRINT("info", ("added level:%p, level: %lu, flags %x",
+ new_sp, new_sp->m_recursion_level,
new_sp->m_flags));
DBUG_RETURN(new_sp);
}
@@ -1808,8 +1809,8 @@ sp_find_routine(THD *thd, stored_procedure_type type, sp_name *name,
if (db_find_routine(thd, type, name, &sp) == SP_OK)
{
sp_cache_insert(cp, sp);
- DBUG_PRINT("info", ("added new: 0x%lx, level: %lu, flags %x",
- (ulong)sp, sp->m_recursion_level,
+ DBUG_PRINT("info", ("added new:%p, level: %lu, flags %x",
+ sp, sp->m_recursion_level,
sp->m_flags));
}
}
@@ -2212,9 +2213,9 @@ show_create_sp(THD *thd, String *buf,
st_sp_chistics *chistics,
const LEX_STRING *definer_user,
const LEX_STRING *definer_host,
- ulonglong sql_mode)
+ sql_mode_t sql_mode)
{
- ulonglong old_sql_mode= thd->variables.sql_mode;
+ sql_mode_t old_sql_mode= thd->variables.sql_mode;
/* Make some room to begin with */
if (buf->alloc(100 + dblen + 1 + namelen + paramslen + returnslen + bodylen +
chistics->comment.length + 10 /* length of " DEFINER= "*/ +
@@ -2301,7 +2302,8 @@ show_create_sp(THD *thd, String *buf,
sp_head *
sp_load_for_information_schema(THD *thd, TABLE *proc_table, String *db,
- String *name, ulong sql_mode, stored_procedure_type type,
+ String *name, sql_mode_t sql_mode,
+ stored_procedure_type type,
const char *returns, const char *params,
bool *free_sp_head)
{