mariadb/storage/maria/ma_check_standalone.h
Michael Widenius d13c54351d Remove compiler warnings (Including some warnings from -Wstrict-aliasing)
Don't use static link by default (in compile-pentium) as some new systems doesn't have all static libraries available
Change type for functions in plugin.h:str_mysql_ftparser_param() to const unsigned char and string lengths to size_t.
One effect of the above change is that one needs to include mysql_global.h or define size_t before including plugin.h
This fixes a case where mysql_client_test failed with newer gcc that enables strict-aliasing by default


BUILD/compile-pentium:
  Don't use static link by default as some new systems doesn't have all static libraries available
client/mysql_upgrade.c:
  Remove not used variable
cmd-line-utils/readline/config_readline.h:
  Define some constants to get rid of compiler warnings on Linux
cmd-line-utils/readline/display.c:
  Get rid of compiler warnings
cmd-line-utils/readline/history.c:
  Got rid of compiler warnings:
  - Defining some strings as const
  - Added cast
cmd-line-utils/readline/rlmbutil.h:
  Added cast to get rid of compiler warnings
cmd-line-utils/readline/text.c:
  Remove not needed initialization to get rid of compiler warnings
cmd-line-utils/readline/xmalloc.c:
  Changed types to 'const char* to get rid of compiler warnings
configure.in:
  Ensure that we use MariaDB as suffix
include/mysql/plugin.h:
  Changed types to 'const unsigned char* to get rid of compiler warnings (in other parts of the code)
  Change length for not \0 terminated string to size_t
include/mysql/plugin.h.pp:
  Update related to plugin.h
libmysql/libmysql.c:
  Fixed bug that caused core dump with newer gcc when strict aliasing is not turned off
mysql-test/t/information_schema.test:
  Test is depending on innodb
mysql-test/t/not_partition.test:
  Fixed wrong directory name
  (Not noticed before as we don't ususally run this test)
mysys/lf_hash.c:
  Got rid of compiler warnings from -Wstrict-aliasing
mysys/my_redel.c:
  Removed not used variable
regex/engine.c:
  Changed types to 'const char* to get rid of compiler warnings
regex/engine.ih:
  Changed types to 'const char* to get rid of compiler warnings
sql/sp_head.cc:
  Got rid of compiler warning from -Wstrict-aliasing
sql/sql_base.cc:
  Got rid of compiler warnings from -Wstrict-aliasing
  (The original code was probably wrong as nj_col->table_field was
sql/sql_builtin.cc.in:
  plugin.h needs to have size_t defined
sql/sql_parse.cc:
  Remove used variable
sql/sql_select.cc:
  Got rid of compiler warnings from -Wstrict-aliasing
sql/sql_show.cc:
  Added #ifdef to get rid of compiler warning when not using partition engine
sql/table.cc:
  Got rid of compiler warning from -Wstrict-aliasing
storage/maria/ha_maria.cc:
  Got rid of compiler warnings from -Wstrict-aliasing:
  - Use the thd_killed() API function
storage/maria/lockman.c:
  Got rid of compiler warnings from -Wstrict-aliasing
storage/maria/ma_check.c:
  Got rid of compiler warnings from -Wstrict-aliasing
  Change to use new version of _ma_killed_ptr; Don't call it as often as before
storage/maria/ma_check_standalone.h:
  Update to compatible _ma_killed_ptr() from ha_maria.cc
storage/maria/ma_ft_boolean_search.c:
  Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts)
storage/maria/ma_ft_nlq_search.c:
  Got rid of compiler warnings from -Wstrict-aliasing
  Ensure that 'subkeys' is 32 bit
storage/maria/ma_ft_parser.c:
  Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts)
storage/maria/ma_ftdefs.h:
  Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts)
storage/maria/ma_sort.c:
  Change to use new version of _ma_killed_ptr; Don't call it as often as before
storage/maria/ma_state.c:
  Got rid of compiler warnings from -Wstrict-aliasing
storage/maria/maria_def.h:
  Redefine ma_killed_ptr()
storage/maria/maria_ftdump.c:
  Got rid of compiler warnings from -Wstrict-aliasing
storage/maria/trnman.c:
  Got rid of compiler warnings from -Wstrict-aliasing
storage/myisam/ft_boolean_search.c:
  Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts)
storage/myisam/ft_nlq_search.c:
  Got rid of compiler warnings from -Wstrict-aliasing
storage/myisam/ft_parser.c:
  Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts)
storage/myisam/ft_stopwords.c:
  Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts)
storage/myisam/ftdefs.h:
  Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts)
storage/myisam/ha_myisam.cc:
  Got rid of compiler warnings from -Wstrict-aliasing:
  - Use the thd_killed() API function
storage/myisam/mi_check.c:
  Use new killed_ptr() function
storage/myisam/myisam_ftdump.c:
  Got rid of compiler warnings from -Wstrict-aliasing
storage/myisam/myisamchk.c:
  Update to compatible killed_ptr() from ha_myisam.cc
storage/myisam/myisamdef.h:
  Redefine killed_ptr()
storage/myisam/myisamlog.c:
  Got rid of compiler warnings from -Wstrict-aliasing
storage/myisam/sort.c:
  Change to use new version of killed_ptr; Don't call it as often as before
storage/xtradb/fil/fil0fil.c:
  Fixedc ompiler warning
storage/xtradb/trx/trx0i_s.c:
  Include mysql_plugin.h later to ensure that size_t is defined
2009-11-30 01:08:56 +02:00

104 lines
3.1 KiB
C

/* Copyright (C) 2007 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/*
All standalone programs which need to use functions from ma_check.c
(like maria_repair()) must define their version of _ma_killed_ptr()
and _ma_check_print_info|warning|error(). Indeed, linking with ma_check.o
brings in the dependencies of ma_check.o which are definitions of the above
functions; if the program does not define them then the ones of
ha_maria.o are used i.e. ha_maria.o is linked into the program, and this
brings dependencies of ha_maria.o on mysqld.o into the program's linking
which thus fails, as the program is not linked with mysqld.o.
This file contains the versions of these functions used by maria_chk and
maria_read_log.
*/
/*
Check if check/repair operation was killed by a signal
*/
int _ma_killed_ptr(HA_CHECK *param __attribute__((unused)))
{
return 0;
}
/* print warnings and errors */
/* VARARGS */
void _ma_check_print_info(HA_CHECK *param __attribute__((unused)),
const char *fmt,...)
{
va_list args;
DBUG_ENTER("_ma_check_print_info");
DBUG_PRINT("enter", ("format: %s", fmt));
va_start(args,fmt);
VOID(vfprintf(stdout, fmt, args));
VOID(fputc('\n',stdout));
va_end(args);
DBUG_VOID_RETURN;
}
/* VARARGS */
void _ma_check_print_warning(HA_CHECK *param, const char *fmt,...)
{
va_list args;
DBUG_ENTER("_ma_check_print_warning");
DBUG_PRINT("enter", ("format: %s", fmt));
fflush(stdout);
if (!param->warning_printed && !param->error_printed)
{
if (param->testflag & T_SILENT)
fprintf(stderr,"%s: MARIA file %s\n",my_progname_short,
param->isam_file_name);
param->out_flag|= O_DATA_LOST;
}
param->warning_printed=1;
va_start(args,fmt);
fprintf(stderr,"%s: warning: ",my_progname_short);
VOID(vfprintf(stderr, fmt, args));
VOID(fputc('\n',stderr));
fflush(stderr);
va_end(args);
DBUG_VOID_RETURN;
}
/* VARARGS */
void _ma_check_print_error(HA_CHECK *param, const char *fmt,...)
{
va_list args;
DBUG_ENTER("_ma_check_print_error");
DBUG_PRINT("enter", ("format: %s", fmt));
fflush(stdout);
if (!param->warning_printed && !param->error_printed)
{
if (param->testflag & T_SILENT)
fprintf(stderr,"%s: MARIA file %s\n",my_progname_short,param->isam_file_name);
param->out_flag|= O_DATA_LOST;
}
param->error_printed|=1;
va_start(args,fmt);
fprintf(stderr,"%s: error: ",my_progname_short);
VOID(vfprintf(stderr, fmt, args));
VOID(fputc('\n',stderr));
fflush(stderr);
va_end(args);
DBUG_VOID_RETURN;
}