[Commits] bzr commit into Mariadb 5.2, with Maria 2.0:maria/5.2 branch (monty:2828)

Michael Widenius michael.widenius at gmail.com
Mon Jul 19 21:53:36 EEST 2010


#At lp:maria/5.2 based on revid:monty at mysql.com-20100719180806-m2y051a5pusmxco6

 2828 Michael Widenius	2010-07-19
      Fixed compiler and valgrind warnings
      modified:
        mysql-test/valgrind.supp
        plugin/auth/auth_socket.c
        sql/sql_acl.cc
        storage/example/ha_example.cc
        storage/sphinx/ha_sphinx.cc

per-file messages:
  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
=== modified file 'mysql-test/valgrind.supp'
--- a/mysql-test/valgrind.supp	2010-02-19 08:12:25 +0000
+++ b/mysql-test/valgrind.supp	2010-07-19 18:53:28 +0000
@@ -539,6 +539,15 @@
    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
 #

=== modified file 'plugin/auth/auth_socket.c'
--- a/plugin/auth/auth_socket.c	2010-04-01 14:34:51 +0000
+++ b/plugin/auth/auth_socket.c	2010-07-19 18:53:28 +0000
@@ -115,5 +115,5 @@ maria_declare_plugin(socket_auth)
   "1.0",
   MariaDB_PLUGIN_MATURITY_BETA
 }
-mysql_declare_plugin_end;
+maria_declare_plugin_end;
 

=== modified file 'sql/sql_acl.cc'
--- a/sql/sql_acl.cc	2010-07-16 22:41:44 +0000
+++ b/sql/sql_acl.cc	2010-07-19 18:53:28 +0000
@@ -162,7 +162,9 @@ static LEX_STRING old_password_plugin_na
 LEX_STRING *default_auth_plugin_name= &native_password_plugin_name;
 
 static plugin_ref native_password_plugin;
+#ifndef EMBEDDED_LIBRARY
 static plugin_ref old_password_plugin;
+#endif
 
 /* Classes */
 

=== modified file 'storage/example/ha_example.cc'
--- a/storage/example/ha_example.cc	2010-07-16 22:41:44 +0000
+++ b/storage/example/ha_example.cc	2010-07-19 18:53:28 +0000
@@ -367,8 +367,10 @@ int ha_example::open(const char *name, i
     DBUG_RETURN(1);
   thr_lock_data_init(&share->lock,&lock,NULL);
 
+#ifndef DBUG_OFF
   example_table_options_struct *options=
     (example_table_options_struct *)table->s->option_struct;
+#endif
 
   DBUG_ASSERT(options);
   DBUG_PRINT("info", ("strparam: '%-.64s'  ullparam: %llu  enumparam: %u  "\
@@ -896,6 +898,7 @@ ha_rows ha_example::records_in_range(uin
 int ha_example::create(const char *name, TABLE *table_arg,
                        HA_CREATE_INFO *create_info)
 {
+#ifndef DBUG_OFF
   example_table_options_struct *options=
     (example_table_options_struct *)table_arg->s->option_struct;
   DBUG_ENTER("ha_example::create");
@@ -918,10 +921,10 @@ int ha_example::create(const char *name,
                          (field_options->compex_param_to_parse_it_in_engine ?
                           field_options->compex_param_to_parse_it_in_engine :
                           "<NULL>")));
-
   }
 
   DBUG_RETURN(0);
+#endif
 }
 
 

=== modified file 'storage/sphinx/ha_sphinx.cc'
--- a/storage/sphinx/ha_sphinx.cc	2010-07-09 12:03:09 +0000
+++ b/storage/sphinx/ha_sphinx.cc	2010-07-19 18:53:28 +0000
@@ -972,8 +972,8 @@ static bool ParseUrl ( CSphSEShare * sha
 	}
 
 	char * sScheme = NULL;
-	char * sHost = SPHINXSE_DEFAULT_HOST;
-	char * sIndex = SPHINXSE_DEFAULT_INDEX;
+	char * sHost = (char*) SPHINXSE_DEFAULT_HOST;
+	char * sIndex = (char*) SPHINXSE_DEFAULT_INDEX;
 	int iPort = SPHINXSE_DEFAULT_PORT;
 
 	bool bOk = true;
@@ -993,12 +993,12 @@ static bool ParseUrl ( CSphSEShare * sha
 			// unix-domain socket
 			iPort = 0;
 			if (!( sIndex = strrchr ( sHost, ':' ) ))
-				sIndex = SPHINXSE_DEFAULT_INDEX;
+                                sIndex = (char*) SPHINXSE_DEFAULT_INDEX;
 			else
 			{
 				*sIndex++ = '\0';
 				if ( !*sIndex )
-					sIndex = SPHINXSE_DEFAULT_INDEX;
+                                  	sIndex = (char*) SPHINXSE_DEFAULT_INDEX;
 			}
 			bOk = true;
 			break;
@@ -1018,11 +1018,11 @@ static bool ParseUrl ( CSphSEShare * sha
 				if ( sIndex )
 					*sIndex++ = '\0'; 
 				else
-					sIndex = SPHINXSE_DEFAULT_INDEX;
+                                  	sIndex = (char*) SPHINXSE_DEFAULT_INDEX;
 
 				iPort = atoi(sPort);
 				if ( !iPort )
-					iPort = SPHINXSE_DEFAULT_PORT;
+                                  	iPort = SPHINXSE_DEFAULT_PORT;
 			}
 		} else
 		{
@@ -1030,7 +1030,7 @@ static bool ParseUrl ( CSphSEShare * sha
 			if ( sIndex )
 				*sIndex++ = '\0';
 			else
-				sIndex = SPHINXSE_DEFAULT_INDEX;
+                          	sIndex = (char*) SPHINXSE_DEFAULT_INDEX;
 		}
 
 		bOk = true;
@@ -1150,37 +1150,37 @@ static handler * sphinx_create_handler (
 CSphSEQuery::CSphSEQuery ( const char * sQuery, int iLength, const char * sIndex )
 	: m_sHost ( "" )
 	, m_iPort ( 0 )
-	, m_sIndex ( sIndex ? sIndex : "*" )
+	, m_sIndex ( sIndex ? sIndex : (char*) "*" )
 	, m_iOffset ( 0 )
 	, m_iLimit ( 20 )
 	, m_bQuery ( false )
-	, m_sQuery ( "" )
+	, m_sQuery ( (char*) "" )
 	, m_pWeights ( NULL )
 	, m_iWeights ( 0 )
 	, m_eMode ( SPH_MATCH_ALL )
 	, m_eRanker ( SPH_RANK_PROXIMITY_BM25 )
 	, m_eSort ( SPH_SORT_RELEVANCE )
-	, m_sSortBy ( "" )
+	, m_sSortBy ( (char*) "" )
 	, m_iMaxMatches ( 1000 )
 	, m_iMaxQueryTime ( 0 )
 	, m_iMinID ( 0 )
 	, m_iMaxID ( 0 )
 	, m_iFilters ( 0 )
 	, m_eGroupFunc ( SPH_GROUPBY_DAY )
-	, m_sGroupBy ( "" )
-	, m_sGroupSortBy ( "@group desc" )
+	, m_sGroupBy ( (char*) "" )
+	, m_sGroupSortBy ( (char*) "@group desc" )
 	, m_iCutoff ( 0 )
 	, m_iRetryCount ( 0 )
 	, m_iRetryDelay ( 0 )
-	, m_sGroupDistinct ( "" )
+	, m_sGroupDistinct ( (char*) "" )
 	, m_iIndexWeights ( 0 )
 	, m_iFieldWeights ( 0 )
 	, m_bGeoAnchor ( false )
-	, m_sGeoLatAttr ( "" )
-	, m_sGeoLongAttr ( "" )
+	, m_sGeoLatAttr ( (char*) "" )
+	, m_sGeoLongAttr ( (char*) "" )
 	, m_fGeoLatitude ( 0.0f )
 	, m_fGeoLongitude ( 0.0f )
-	, m_sComment ( "" )
+	, m_sComment ( (char*) "" )
 
 	, m_pBuf ( NULL )
 	, m_pCur ( NULL )
@@ -1622,7 +1622,7 @@ bool CSphSEQuery::ParseField ( char * sF
 				{ "float",		SPH_ATTR_FLOAT },
 				{ "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 ) )
 			{
 				iType = dAttrTypes[i].m_iType;



More information about the commits mailing list