summaryrefslogtreecommitdiff
path: root/sql/sp_head.cc
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2017-09-19 17:45:17 +0000
committerVladislav Vaintroub <wlad@mariadb.com>2017-09-28 17:20:46 +0000
commiteba44874ca9fc317696630cb371623142289fa99 (patch)
treef67cd5dbcaf102abef2fb26f76357d14feaded04 /sql/sp_head.cc
parentde7c2e5e545df90fc9814c60a8a5a8d20f22b2c3 (diff)
downloadmariadb-git-eba44874ca9fc317696630cb371623142289fa99.tar.gz
MDEV-13844 : Fix Windows warnings. Fix DBUG_PRINT.
- Fix win64 pointer truncation warnings (usually coming from misusing 0x%lx and long cast in DBUG) - Also fix printf-format warnings Make the above mentioned warnings fatal. - fix pthread_join on Windows to set return value.
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r--sql/sp_head.cc32
1 files changed, 16 insertions, 16 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index 473e1929369..b3edcdca474 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -549,7 +549,7 @@ sp_head::operator new(size_t size) throw()
if (sp == NULL)
DBUG_RETURN(NULL);
sp->main_mem_root= own_root;
- DBUG_PRINT("info", ("mem_root 0x%lx", (ulong) &sp->mem_root));
+ DBUG_PRINT("info", ("mem_root %p", &sp->mem_root));
DBUG_RETURN(sp);
}
@@ -566,8 +566,8 @@ sp_head::operator delete(void *ptr, size_t size) throw()
/* Make a copy of main_mem_root as free_root will free the sp */
own_root= sp->main_mem_root;
- DBUG_PRINT("info", ("mem_root 0x%lx moved to 0x%lx",
- (ulong) &sp->mem_root, (ulong) &own_root));
+ DBUG_PRINT("info", ("mem_root %p moved to %p",
+ &sp->mem_root, &own_root));
free_root(&own_root, MYF(0));
DBUG_VOID_RETURN;
@@ -1154,9 +1154,9 @@ sp_head::execute(THD *thd, bool merge_da_on_success)
if (m_next_cached_sp)
{
DBUG_PRINT("info",
- ("first free for 0x%lx ++: 0x%lx->0x%lx level: %lu flags %x",
- (ulong)m_first_instance, (ulong) this,
- (ulong) m_next_cached_sp,
+ ("first free for %p ++: %p->%p level: %lu flags %x",
+ m_first_instance, this,
+ m_next_cached_sp,
m_next_cached_sp->m_recursion_level,
m_next_cached_sp->m_flags));
}
@@ -1454,10 +1454,10 @@ sp_head::execute(THD *thd, bool merge_da_on_success)
}
m_flags&= ~IS_INVOKED;
DBUG_PRINT("info",
- ("first free for 0x%lx --: 0x%lx->0x%lx, level: %lu, flags %x",
- (ulong) m_first_instance,
- (ulong) m_first_instance->m_first_free_instance,
- (ulong) this, m_recursion_level, m_flags));
+ ("first free for %p --: %p->%p, level: %lu, flags %x",
+ m_first_instance,
+ m_first_instance->m_first_free_instance,
+ this, m_recursion_level, m_flags));
/*
Check that we have one of following:
@@ -2346,8 +2346,8 @@ sp_head::backpatch(sp_label *lab)
{
if (bp->lab == lab)
{
- DBUG_PRINT("info", ("backpatch: (m_ip %d, label 0x%lx <%s>) to dest %d",
- bp->instr->m_ip, (ulong) lab, lab->name.str, dest));
+ DBUG_PRINT("info", ("backpatch: (m_ip %d, label %p <%s>) to dest %d",
+ bp->instr->m_ip, lab, lab->name.str, dest));
bp->instr->backpatch(dest, lab->ctx);
}
}
@@ -2483,8 +2483,8 @@ sp_head::reset_thd_mem_root(THD *thd)
DBUG_ENTER("sp_head::reset_thd_mem_root");
m_thd_root= thd->mem_root;
thd->mem_root= &main_mem_root;
- DBUG_PRINT("info", ("mem_root 0x%lx moved to thd mem root 0x%lx",
- (ulong) &mem_root, (ulong) &thd->mem_root));
+ DBUG_PRINT("info", ("mem_root %p moved to thd mem root %p",
+ &mem_root, &thd->mem_root));
free_list= thd->free_list; // Keep the old list
thd->free_list= NULL; // Start a new one
m_thd= thd;
@@ -2514,8 +2514,8 @@ sp_head::restore_thd_mem_root(THD *thd)
set_query_arena(thd); // Get new free_list and mem_root
state= STMT_INITIALIZED_FOR_SP;
- DBUG_PRINT("info", ("mem_root 0x%lx returned from thd mem root 0x%lx",
- (ulong) &mem_root, (ulong) &thd->mem_root));
+ DBUG_PRINT("info", ("mem_root %p returned from thd mem root %p",
+ &mem_root, &thd->mem_root));
thd->free_list= flist; // Restore the old one
thd->mem_root= m_thd_root;
m_thd= NULL;