From 99b58a5aa9ae729d95b00650b8360820bafe3887 Mon Sep 17 00:00:00 2001 From: "monty@tik.mysql.fi" <> Date: Thu, 27 Sep 2001 21:35:35 +0300 Subject: [PATCH] Cleaned up udf_example.cc and mysql_fix_privilege_tables --- acinclude.m4 | 2 +- scripts/mysql_fix_privilege_tables.sh | 13 ++++++------- sql/udf_example.cc | 25 +++++++++++++++---------- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 86eed5e69c7..1eb95e1e9c9 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1106,7 +1106,7 @@ changequote([, ])dnl AC_DEFUN(AC_SYS_LARGEFILE, [AC_REQUIRE([AC_CANONICAL_HOST]) AC_ARG_ENABLE(largefile, - [ --disable-large-files Omit support for large files]) + [ --disable-largefile Omit support for large files]) if test "$enable_largefile" != no; then AC_CHECK_TOOL(GETCONF, getconf) AC_SYS_LARGEFILE_FLAGS(CFLAGS) diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index 8e9ef509d66..86312fdab52 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -3,8 +3,8 @@ echo "This scripts updates the mysql.user, mysql.db, mysql.host and the" echo "mysql.func table to MySQL 3.22.14 and above." echo "" -echo "This is needed if you want to use the new GRANT functions or" -echo "want to use the more secure passwords." +echo "This is needed if you want to use the new GRANT functions," +echo "CREATE AGGREAGATE FUNCTION or want to use the more secure passwords in 3.23" echo "" echo "If you get Access denied errors, you should run this script again" echo "and give the MySQL root user password as a argument!" @@ -15,13 +15,12 @@ host="localhost" # Fix old password format, add File_priv and func table echo "" echo "If your tables are already up to date or partially up to date you will" -echo "get some warnings about 'Duplicated column name' or" -echo "'Table 'func' already exists'. You can safely ignore these!" +echo "get some warnings about 'Duplicated column name'. You can safely ignore these!" @bindir@/mysql -f --user=root --password="$root_password" --host="$host" mysql <h_name) - result); return result; } +#endif // defined(HAVE_GETHOSTBYADDR_R) && defined(HAVE_SOLARIS_STYLE_GETHOST) /* ** Syntax for the new aggregate commands are: @@ -777,13 +790,6 @@ char *reverse_lookup(UDF_INIT *initid, UDF_ARGS *args, char *result, ** (this example is provided by Andreas F. Bobak ) */ -extern "C" { -my_bool avgcost_init( UDF_INIT* initid, UDF_ARGS* args, char* message ); -void avgcost_deinit( UDF_INIT* initid ); -void avgcost_reset( UDF_INIT* initid, UDF_ARGS* args, char* is_null, char *error ); -void avgcost_add( UDF_INIT* initid, UDF_ARGS* args, char* is_null, char *error ); -double avgcost( UDF_INIT* initid, UDF_ARGS* args, char* is_null, char *error ); -} struct avgcost_data { @@ -810,7 +816,7 @@ avgcost_init( UDF_INIT* initid, UDF_ARGS* args, char* message ) return 1; } - if ((args->arg_type[0] != INT_RESULT) && (args->arg_type[1] != REAL_RESULT) ) + if ((args->arg_type[0] != INT_RESULT) || (args->arg_type[1] != REAL_RESULT) ) { strcpy( message, @@ -917,5 +923,4 @@ avgcost( UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error ) return data->totalprice/double(data->totalquantity); } -#endif // defined(HAVE_GETHOSTBYADDR_R) && defined(HAVE_SOLARIS_STYLE_GETHOST) #endif /* HAVE_DLOPEN */