Commit 25e807f8 authored by Michael Widenius's avatar Michael Widenius

Fixed compiler and valgrind warnings

mysql-test/valgrind.supp:
  Added suppression for memory leak in dlsym() on work-amd64
plugin/auth/auth_socket.c:
  Fixed compiler warning (wrong macro usage)
storage/example/ha_example.cc:
  Fixed compiler warnings
storage/sphinx/ha_sphinx.cc:
  Fixed compiler warnings
parent 84b64fe6
...@@ -539,6 +539,15 @@ ...@@ -539,6 +539,15 @@
fun:_Unwind_ForcedUnwind fun:_Unwind_ForcedUnwind
} }
{
dlsym memory loss from plugin
Memcheck:Leak
fun:malloc
fun:_dl_signal_error
fun:_dl_signal_error
fun:_dl_lookup_symbol_x
}
# #
# Reading wrong addresses on SuSe Linux 10.3 32 bit # Reading wrong addresses on SuSe Linux 10.3 32 bit
# #
......
...@@ -115,5 +115,5 @@ maria_declare_plugin(socket_auth) ...@@ -115,5 +115,5 @@ maria_declare_plugin(socket_auth)
"1.0", "1.0",
MariaDB_PLUGIN_MATURITY_BETA MariaDB_PLUGIN_MATURITY_BETA
} }
mysql_declare_plugin_end; maria_declare_plugin_end;
...@@ -162,7 +162,9 @@ static LEX_STRING old_password_plugin_name= { ...@@ -162,7 +162,9 @@ static LEX_STRING old_password_plugin_name= {
LEX_STRING *default_auth_plugin_name= &native_password_plugin_name; LEX_STRING *default_auth_plugin_name= &native_password_plugin_name;
static plugin_ref native_password_plugin; static plugin_ref native_password_plugin;
#ifndef EMBEDDED_LIBRARY
static plugin_ref old_password_plugin; static plugin_ref old_password_plugin;
#endif
/* Classes */ /* Classes */
......
...@@ -367,8 +367,10 @@ int ha_example::open(const char *name, int mode, uint test_if_locked) ...@@ -367,8 +367,10 @@ int ha_example::open(const char *name, int mode, uint test_if_locked)
DBUG_RETURN(1); DBUG_RETURN(1);
thr_lock_data_init(&share->lock,&lock,NULL); thr_lock_data_init(&share->lock,&lock,NULL);
#ifndef DBUG_OFF
example_table_options_struct *options= example_table_options_struct *options=
(example_table_options_struct *)table->s->option_struct; (example_table_options_struct *)table->s->option_struct;
#endif
DBUG_ASSERT(options); DBUG_ASSERT(options);
DBUG_PRINT("info", ("strparam: '%-.64s' ullparam: %llu enumparam: %u "\ DBUG_PRINT("info", ("strparam: '%-.64s' ullparam: %llu enumparam: %u "\
...@@ -896,6 +898,7 @@ ha_rows ha_example::records_in_range(uint inx, key_range *min_key, ...@@ -896,6 +898,7 @@ ha_rows ha_example::records_in_range(uint inx, key_range *min_key,
int ha_example::create(const char *name, TABLE *table_arg, int ha_example::create(const char *name, TABLE *table_arg,
HA_CREATE_INFO *create_info) HA_CREATE_INFO *create_info)
{ {
#ifndef DBUG_OFF
example_table_options_struct *options= example_table_options_struct *options=
(example_table_options_struct *)table_arg->s->option_struct; (example_table_options_struct *)table_arg->s->option_struct;
DBUG_ENTER("ha_example::create"); DBUG_ENTER("ha_example::create");
...@@ -918,10 +921,10 @@ int ha_example::create(const char *name, TABLE *table_arg, ...@@ -918,10 +921,10 @@ int ha_example::create(const char *name, TABLE *table_arg,
(field_options->compex_param_to_parse_it_in_engine ? (field_options->compex_param_to_parse_it_in_engine ?
field_options->compex_param_to_parse_it_in_engine : field_options->compex_param_to_parse_it_in_engine :
"<NULL>"))); "<NULL>")));
} }
DBUG_RETURN(0); DBUG_RETURN(0);
#endif
} }
......
...@@ -972,8 +972,8 @@ static bool ParseUrl ( CSphSEShare * share, TABLE * table, bool bCreate ) ...@@ -972,8 +972,8 @@ static bool ParseUrl ( CSphSEShare * share, TABLE * table, bool bCreate )
} }
char * sScheme = NULL; char * sScheme = NULL;
char * sHost = SPHINXSE_DEFAULT_HOST; char * sHost = (char*) SPHINXSE_DEFAULT_HOST;
char * sIndex = SPHINXSE_DEFAULT_INDEX; char * sIndex = (char*) SPHINXSE_DEFAULT_INDEX;
int iPort = SPHINXSE_DEFAULT_PORT; int iPort = SPHINXSE_DEFAULT_PORT;
bool bOk = true; bool bOk = true;
...@@ -993,12 +993,12 @@ static bool ParseUrl ( CSphSEShare * share, TABLE * table, bool bCreate ) ...@@ -993,12 +993,12 @@ static bool ParseUrl ( CSphSEShare * share, TABLE * table, bool bCreate )
// unix-domain socket // unix-domain socket
iPort = 0; iPort = 0;
if (!( sIndex = strrchr ( sHost, ':' ) )) if (!( sIndex = strrchr ( sHost, ':' ) ))
sIndex = SPHINXSE_DEFAULT_INDEX; sIndex = (char*) SPHINXSE_DEFAULT_INDEX;
else else
{ {
*sIndex++ = '\0'; *sIndex++ = '\0';
if ( !*sIndex ) if ( !*sIndex )
sIndex = SPHINXSE_DEFAULT_INDEX; sIndex = (char*) SPHINXSE_DEFAULT_INDEX;
} }
bOk = true; bOk = true;
break; break;
...@@ -1018,11 +1018,11 @@ static bool ParseUrl ( CSphSEShare * share, TABLE * table, bool bCreate ) ...@@ -1018,11 +1018,11 @@ static bool ParseUrl ( CSphSEShare * share, TABLE * table, bool bCreate )
if ( sIndex ) if ( sIndex )
*sIndex++ = '\0'; *sIndex++ = '\0';
else else
sIndex = SPHINXSE_DEFAULT_INDEX; sIndex = (char*) SPHINXSE_DEFAULT_INDEX;
iPort = atoi(sPort); iPort = atoi(sPort);
if ( !iPort ) if ( !iPort )
iPort = SPHINXSE_DEFAULT_PORT; iPort = SPHINXSE_DEFAULT_PORT;
} }
} else } else
{ {
...@@ -1030,7 +1030,7 @@ static bool ParseUrl ( CSphSEShare * share, TABLE * table, bool bCreate ) ...@@ -1030,7 +1030,7 @@ static bool ParseUrl ( CSphSEShare * share, TABLE * table, bool bCreate )
if ( sIndex ) if ( sIndex )
*sIndex++ = '\0'; *sIndex++ = '\0';
else else
sIndex = SPHINXSE_DEFAULT_INDEX; sIndex = (char*) SPHINXSE_DEFAULT_INDEX;
} }
bOk = true; bOk = true;
...@@ -1150,37 +1150,37 @@ static handler * sphinx_create_handler ( handlerton * hton, TABLE_SHARE * table, ...@@ -1150,37 +1150,37 @@ static handler * sphinx_create_handler ( handlerton * hton, TABLE_SHARE * table,
CSphSEQuery::CSphSEQuery ( const char * sQuery, int iLength, const char * sIndex ) CSphSEQuery::CSphSEQuery ( const char * sQuery, int iLength, const char * sIndex )
: m_sHost ( "" ) : m_sHost ( "" )
, m_iPort ( 0 ) , m_iPort ( 0 )
, m_sIndex ( sIndex ? sIndex : "*" ) , m_sIndex ( sIndex ? sIndex : (char*) "*" )
, m_iOffset ( 0 ) , m_iOffset ( 0 )
, m_iLimit ( 20 ) , m_iLimit ( 20 )
, m_bQuery ( false ) , m_bQuery ( false )
, m_sQuery ( "" ) , m_sQuery ( (char*) "" )
, m_pWeights ( NULL ) , m_pWeights ( NULL )
, m_iWeights ( 0 ) , m_iWeights ( 0 )
, m_eMode ( SPH_MATCH_ALL ) , m_eMode ( SPH_MATCH_ALL )
, m_eRanker ( SPH_RANK_PROXIMITY_BM25 ) , m_eRanker ( SPH_RANK_PROXIMITY_BM25 )
, m_eSort ( SPH_SORT_RELEVANCE ) , m_eSort ( SPH_SORT_RELEVANCE )
, m_sSortBy ( "" ) , m_sSortBy ( (char*) "" )
, m_iMaxMatches ( 1000 ) , m_iMaxMatches ( 1000 )
, m_iMaxQueryTime ( 0 ) , m_iMaxQueryTime ( 0 )
, m_iMinID ( 0 ) , m_iMinID ( 0 )
, m_iMaxID ( 0 ) , m_iMaxID ( 0 )
, m_iFilters ( 0 ) , m_iFilters ( 0 )
, m_eGroupFunc ( SPH_GROUPBY_DAY ) , m_eGroupFunc ( SPH_GROUPBY_DAY )
, m_sGroupBy ( "" ) , m_sGroupBy ( (char*) "" )
, m_sGroupSortBy ( "@group desc" ) , m_sGroupSortBy ( (char*) "@group desc" )
, m_iCutoff ( 0 ) , m_iCutoff ( 0 )
, m_iRetryCount ( 0 ) , m_iRetryCount ( 0 )
, m_iRetryDelay ( 0 ) , m_iRetryDelay ( 0 )
, m_sGroupDistinct ( "" ) , m_sGroupDistinct ( (char*) "" )
, m_iIndexWeights ( 0 ) , m_iIndexWeights ( 0 )
, m_iFieldWeights ( 0 ) , m_iFieldWeights ( 0 )
, m_bGeoAnchor ( false ) , m_bGeoAnchor ( false )
, m_sGeoLatAttr ( "" ) , m_sGeoLatAttr ( (char*) "" )
, m_sGeoLongAttr ( "" ) , m_sGeoLongAttr ( (char*) "" )
, m_fGeoLatitude ( 0.0f ) , m_fGeoLatitude ( 0.0f )
, m_fGeoLongitude ( 0.0f ) , m_fGeoLongitude ( 0.0f )
, m_sComment ( "" ) , m_sComment ( (char*) "" )
, m_pBuf ( NULL ) , m_pBuf ( NULL )
, m_pCur ( NULL ) , m_pCur ( NULL )
...@@ -1622,7 +1622,7 @@ bool CSphSEQuery::ParseField ( char * sField ) ...@@ -1622,7 +1622,7 @@ bool CSphSEQuery::ParseField ( char * sField )
{ "float", SPH_ATTR_FLOAT }, { "float", SPH_ATTR_FLOAT },
{ "bigint", SPH_ATTR_BIGINT } { "bigint", SPH_ATTR_BIGINT }
}; };
for ( int i=0; i<sizeof(dAttrTypes)/sizeof(*dAttrTypes); i++ ) for ( uint i=0; i<sizeof(dAttrTypes)/sizeof(*dAttrTypes); i++ )
if ( !strncmp( sType, dAttrTypes[i].m_sName, sRest - sType ) ) if ( !strncmp( sType, dAttrTypes[i].m_sName, sRest - sType ) )
{ {
iType = dAttrTypes[i].m_iType; iType = dAttrTypes[i].m_iType;
......
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