Commit 1ed1ec4c authored by unknown's avatar unknown

Portability fix.

Fixed linking problem with InnoDB.


BUILD/compile-alpha-cxx:
  Fix for using innodb
acinclude.m4:
  Fix problem with linking mysqld after Heikkis last changes.
client/mysql.cc:
  Fixed linking problem
client/mysqlmanager-pwgen.c:
  Portability fix
innobase/que/que0que.c:
  Removed some blanks
myisam/ft_boolean_search.c:
  Portability fix
myisam/sort.c:
  Portability fix
mysys/queues.c:
  Portability fix
strings/ctype-latin1_de.c:
  Portability fix
tools/mysqlmanager.c:
  Portability fix
parent d207a0c2
...@@ -11,7 +11,7 @@ rm */.deps/* ...@@ -11,7 +11,7 @@ rm */.deps/*
make make
if [ $? = 0 ] if [ $? = 0 ]
then then
rm */.deps/* find . -name ".deps" | xargs rm -r
bin/mysqladmin shutdown bin/mysqladmin shutdown
sur make install sur make install
if [ $? = 0 ] if [ $? = 0 ]
......
...@@ -1126,9 +1126,9 @@ dnl circular references. ...@@ -1126,9 +1126,9 @@ dnl circular references.
\$(top_builddir)/innobase/usr/libusr.a\ \$(top_builddir)/innobase/usr/libusr.a\
\$(top_builddir)/innobase/odbc/libodbc.a\ \$(top_builddir)/innobase/odbc/libodbc.a\
\$(top_builddir)/innobase/srv/libsrv.a\ \$(top_builddir)/innobase/srv/libsrv.a\
\$(top_builddir)/innobase/dict/libdict.a\
\$(top_builddir)/innobase/que/libque.a\ \$(top_builddir)/innobase/que/libque.a\
\$(top_builddir)/innobase/srv/libsrv.a\ \$(top_builddir)/innobase/srv/libsrv.a\
\$(top_builddir)/innobase/dict/libdict.a\
\$(top_builddir)/innobase/ibuf/libibuf.a\ \$(top_builddir)/innobase/ibuf/libibuf.a\
\$(top_builddir)/innobase/row/librow.a\ \$(top_builddir)/innobase/row/librow.a\
\$(top_builddir)/innobase/pars/libpars.a\ \$(top_builddir)/innobase/pars/libpars.a\
......
...@@ -129,7 +129,7 @@ static String glob_buffer,old_buffer; ...@@ -129,7 +129,7 @@ static String glob_buffer,old_buffer;
static int wait_time = 5; static int wait_time = 5;
static STATUS status; static STATUS status;
static ulong select_limit,max_join_size,opt_connect_timeout=0; static ulong select_limit,max_join_size,opt_connect_timeout=0;
char mysql_charsets_dir[FN_REFLEN+1]; static char mysql_charsets_dir[FN_REFLEN+1];
static const char *xmlmeta[] = { static const char *xmlmeta[] = {
"&", "&", "&", "&",
"<", "&lt;", "<", "&lt;",
......
...@@ -145,7 +145,7 @@ int main(int argc, char** argv) ...@@ -145,7 +145,7 @@ int main(int argc, char** argv)
die("Could not open '%s'(errno=%d)",outfile,errno); die("Could not open '%s'(errno=%d)",outfile,errno);
get_pass(pw,sizeof(pw)-1); get_pass(pw,sizeof(pw)-1);
my_MD5Init(&context); my_MD5Init(&context);
my_MD5Update(&context,pw,sizeof(pw)-1); my_MD5Update(&context,(uchar*) pw,sizeof(pw)-1);
my_MD5Final(digest,&context); my_MD5Final(digest,&context);
fprintf(fp,"%s:",user); fprintf(fp,"%s:",user);
for (i=0;i<sizeof(digest);i++) for (i=0;i<sizeof(digest);i++)
......
...@@ -103,7 +103,7 @@ que_thr_add_update_info( ...@@ -103,7 +103,7 @@ que_thr_add_update_info(
mach_write_to_8(thr->msg_buf + SESS_SRV_MSG_N_DELETES, mach_write_to_8(thr->msg_buf + SESS_SRV_MSG_N_DELETES,
graph->n_deletes); graph->n_deletes);
} }
#endif #endif
/*************************************************************************** /***************************************************************************
Adds a query graph to the session's list of graphs. */ Adds a query graph to the session's list of graphs. */
......
...@@ -163,13 +163,14 @@ void _ftb_init_index_search(FT_INFO *ftb) ...@@ -163,13 +163,14 @@ void _ftb_init_index_search(FT_INFO *ftb)
{ {
ftbw=(FTB_WORD *)(ftb->queue.root[i]); ftbw=(FTB_WORD *)(ftb->queue.root[i]);
r=_mi_search(info, keyinfo, ftbw->word, ftbw->len, r=_mi_search(info, keyinfo, (uchar*) ftbw->word, ftbw->len,
SEARCH_FIND | SEARCH_PREFIX, keyroot); SEARCH_FIND | SEARCH_PREFIX, keyroot);
if (!r) if (!r)
{ {
r=_mi_compare_text(default_charset_info, r=_mi_compare_text(default_charset_info,
info->lastkey+ftbw->trunc,ftbw->len-ftbw->trunc, info->lastkey+ftbw->trunc,ftbw->len-ftbw->trunc,
ftbw->word+ftbw->trunc,ftbw->len-ftbw->trunc,0); (uchar*) ftbw->word+ftbw->trunc,ftbw->len-ftbw->trunc,
0);
} }
if (r) /* not found */ if (r) /* not found */
{ {
...@@ -306,13 +307,14 @@ int ft_boolean_read_next(FT_INFO *ftb, char *record) ...@@ -306,13 +307,14 @@ int ft_boolean_read_next(FT_INFO *ftb, char *record)
_ftb_climb_the_tree(ftbw, curdoc); _ftb_climb_the_tree(ftbw, curdoc);
/* update queue */ /* update queue */
r=_mi_search(info, keyinfo, ftbw->word, USE_WHOLE_KEY, r=_mi_search(info, keyinfo, (uchar*) ftbw->word, USE_WHOLE_KEY,
SEARCH_BIGGER , keyroot); SEARCH_BIGGER , keyroot);
if (!r) if (!r)
{ {
r=_mi_compare_text(default_charset_info, r=_mi_compare_text(default_charset_info,
info->lastkey+ftbw->trunc,ftbw->len-ftbw->trunc, info->lastkey+ftbw->trunc,ftbw->len-ftbw->trunc,
ftbw->word+ftbw->trunc,ftbw->len-ftbw->trunc,0); (uchar*) ftbw->word+ftbw->trunc,
ftbw->len-ftbw->trunc,0);
} }
if (r) /* not found */ if (r) /* not found */
{ {
......
...@@ -162,16 +162,16 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages, ...@@ -162,16 +162,16 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
printf(" - Merging %lu keys\n",records); /* purecov: tested */ printf(" - Merging %lu keys\n",records); /* purecov: tested */
if (merge_many_buff(info,keys,sort_keys, if (merge_many_buff(info,keys,sort_keys,
dynamic_element(&buffpek,0,BUFFPEK *),&maxbuffer,&tempfile)) dynamic_element(&buffpek,0,BUFFPEK *),&maxbuffer,&tempfile))
goto err; /* purecov: inspected */ goto err; /* purecov: inspected */
} }
if (flush_io_cache(&tempfile) || if (flush_io_cache(&tempfile) ||
reinit_io_cache(&tempfile,READ_CACHE,0L,0,0)) reinit_io_cache(&tempfile,READ_CACHE,0L,0,0))
goto err; /* purecov: inspected */ goto err; /* purecov: inspected */
if (!no_messages) if (!no_messages)
puts(" - Last merge and dumping keys"); /* purecov: tested */ puts(" - Last merge and dumping keys"); /* purecov: tested */
if (merge_index(info,keys,sort_keys,dynamic_element(&buffpek,0,BUFFPEK *), if (merge_index(info,keys,sort_keys,dynamic_element(&buffpek,0,BUFFPEK *),
maxbuffer,&tempfile)) maxbuffer,&tempfile))
goto err; /* purecov: inspected */ goto err; /* purecov: inspected */
} }
if (flush_pending_blocks(info->sort_info->param)) if (flush_pending_blocks(info->sort_info->param))
...@@ -187,10 +187,13 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages, ...@@ -187,10 +187,13 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
reinit_io_cache(&tempfile_for_exceptions,READ_CACHE,0L,0,0)) reinit_io_cache(&tempfile_for_exceptions,READ_CACHE,0L,0,0))
goto err; goto err;
while (!my_b_read(&tempfile_for_exceptions,(byte*)&key_length, sizeof(key_length)) while (!my_b_read(&tempfile_for_exceptions,(byte*)&key_length,
&& !my_b_read(&tempfile_for_exceptions,(byte*)sort_keys,(uint)key_length)) sizeof(key_length))
&& !my_b_read(&tempfile_for_exceptions,(byte*)sort_keys,
(uint) key_length))
{ {
if (_mi_ck_write(index,keyno,(byte*)sort_keys,key_length-ref_length)) goto err; if (_mi_ck_write(index,keyno,(uchar*) sort_keys,key_length-ref_length))
goto err;
} }
} }
...@@ -219,23 +222,24 @@ static ha_rows NEAR_F find_all_keys(MI_SORT_PARAM *info, uint keys, ...@@ -219,23 +222,24 @@ static ha_rows NEAR_F find_all_keys(MI_SORT_PARAM *info, uint keys,
DBUG_ENTER("find_all_keys"); DBUG_ENTER("find_all_keys");
idx=error=0; idx=error=0;
sort_keys[0]=(char*)(sort_keys+keys); sort_keys[0]=(uchar*) (sort_keys+keys);
while(!(error=(*info->key_read)(info->sort_info,sort_keys[idx]))) while(!(error=(*info->key_read)(info->sort_info,sort_keys[idx])))
{ {
if (info->sort_info->real_key_length > info->key_length) if (info->sort_info->real_key_length > info->key_length)
{ {
if (write_key(info,sort_keys[idx],tempfile_for_exceptions)) if (write_key(info,sort_keys[idx],tempfile_for_exceptions))
DBUG_RETURN(HA_POS_ERROR); /* purecov: inspected */ DBUG_RETURN(HA_POS_ERROR); /* purecov: inspected */
continue; continue;
} }
if (++idx == keys) if (++idx == keys)
{ {
if (write_keys(info,sort_keys,idx-1,(BUFFPEK *)alloc_dynamic(buffpek),tempfile)) if (write_keys(info,sort_keys,idx-1,(BUFFPEK *)alloc_dynamic(buffpek),
DBUG_RETURN(HA_POS_ERROR); /* purecov: inspected */ tempfile))
DBUG_RETURN(HA_POS_ERROR); /* purecov: inspected */
sort_keys[0]=(char*)(sort_keys+keys); sort_keys[0]=(uchar*) (sort_keys+keys);
memcpy(sort_keys[0],sort_keys[idx-1],(size_t) info->key_length); memcpy(sort_keys[0],sort_keys[idx-1],(size_t) info->key_length);
idx=1; idx=1;
} }
...@@ -246,7 +250,7 @@ static ha_rows NEAR_F find_all_keys(MI_SORT_PARAM *info, uint keys, ...@@ -246,7 +250,7 @@ static ha_rows NEAR_F find_all_keys(MI_SORT_PARAM *info, uint keys,
if (buffpek->elements) if (buffpek->elements)
{ {
if (write_keys(info,sort_keys,idx,(BUFFPEK *)alloc_dynamic(buffpek),tempfile)) if (write_keys(info,sort_keys,idx,(BUFFPEK *)alloc_dynamic(buffpek),tempfile))
DBUG_RETURN(HA_POS_ERROR); /* purecov: inspected */ DBUG_RETURN(HA_POS_ERROR); /* purecov: inspected */
*maxbuffer=buffpek->elements-1; *maxbuffer=buffpek->elements-1;
} }
else else
......
...@@ -170,14 +170,14 @@ void _downheap(register QUEUE *queue, uint idx) ...@@ -170,14 +170,14 @@ void _downheap(register QUEUE *queue, uint idx)
static int queue_fix_cmp(QUEUE *queue, void *a, void *b) static int queue_fix_cmp(QUEUE *queue, void *a, void *b)
{ {
return queue->compare(queue->first_cmp_arg, return queue->compare(queue->first_cmp_arg,
a+queue->offset_to_key, (char*) a+queue->offset_to_key,
b+queue->offset_to_key); (char*) b+queue->offset_to_key);
} }
/* Fix heap when every element was changed */ /* Fix heap when every element was changed */
void queue_fix(QUEUE *queue) void queue_fix(QUEUE *queue)
{ {
qsort2(queue->root+1,queue->elements, sizeof(void *), qsort2(queue->root+1,queue->elements, sizeof(void *),
(qsort2_cmp)queue_fix_cmp, queue); (qsort2_cmp)queue_fix_cmp, queue);
} }
...@@ -278,13 +278,14 @@ int my_strnxfrm_latin1_de(uchar * dest, const uchar * src, int len, int srclen) ...@@ -278,13 +278,14 @@ int my_strnxfrm_latin1_de(uchar * dest, const uchar * src, int len, int srclen)
int my_strcoll_latin1_de(const uchar * s1, const uchar * s2) int my_strcoll_latin1_de(const uchar * s1, const uchar * s2)
{ {
/* XXX QQ: This should be fixed to not call strlen */ /* XXX QQ: This should be fixed to not call strlen */
return my_strnncoll_latin1_de(s1, strlen(s1), s2, strlen(s2)); return my_strnncoll_latin1_de(s1, strlen((char*) s1),
s2, strlen((char*) s2));
} }
int my_strxfrm_latin1_de(uchar * dest, const uchar * src, int len) int my_strxfrm_latin1_de(uchar * dest, const uchar * src, int len)
{ {
/* XXX QQ: This should be fixed to not call strlen */ /* XXX QQ: This should be fixed to not call strlen */
return my_strnxfrm_latin1_de(dest, src, len, strlen(src)); return my_strnxfrm_latin1_de(dest, src, len, strlen((char*) src));
} }
/* /*
......
...@@ -978,7 +978,7 @@ static int authenticate(struct manager_thd* thd) ...@@ -978,7 +978,7 @@ static int authenticate(struct manager_thd* thd)
for (;isspace(*buf) && buf<buf_end;buf++) /* empty */; for (;isspace(*buf) && buf<buf_end;buf++) /* empty */;
my_MD5Init(&context); my_MD5Init(&context);
my_MD5Update(&context,buf,(uint)(buf_end-buf)); my_MD5Update(&context,(uchar*) buf,(uint)(buf_end-buf));
my_MD5Final(digest,&context); my_MD5Final(digest,&context);
if (memcmp(u->md5_pass,digest,MD5_LEN)) if (memcmp(u->md5_pass,digest,MD5_LEN))
return 1; return 1;
...@@ -1218,7 +1218,7 @@ struct manager_thd* manager_thd_new(Vio* vio) ...@@ -1218,7 +1218,7 @@ struct manager_thd* manager_thd_new(Vio* vio)
tmp->user[0]=0; tmp->user[0]=0;
tmp->priv_flags=0; tmp->priv_flags=0;
tmp->fatal=tmp->finished=0; tmp->fatal=tmp->finished=0;
tmp->cmd_buf=tmp->net.read_pos; tmp->cmd_buf= (char*) tmp->net.read_pos;
return tmp; return tmp;
} }
......
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