Commit 7e1edb01 authored by unknown's avatar unknown

load local fix

overrun sentry in my_vsnprintf() test
will not be pushed yet


BUILD/FINISH.sh:
  load local fix
BUILD/SETUP.sh:
  load local fix
BUILD/compile-pentium-debug-max:
  load local fix
configure.in:
  load local fix
mysys/my_vsnprintf.c:
  added overrun sentry to the test
parent 3eb9c0be
cflags="$c_warnings $extra_flags"
cxxflags="$cxx_warnings $base_cxxflags $extra_flags"
extra_configs="$extra_configs $local_infile_configs"
configure="./configure $base_configs $extra_configs"
for arg
do
......
......@@ -57,6 +57,10 @@ static_link="--with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static
alpha_configs="" # Not used yet
pentium_configs=""
sparc_configs=""
# we need local-infile in all binaries for rpl000001
# if you need to disable local-infile in the client, write a build script
# and unset local_infile_configs
local_infile_configs="--enable-local-infile"
debug_configs="--with-debug"
......
......@@ -8,6 +8,6 @@ c_warnings="$c_warnings $debug_extra_warnings"
cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$pentium_configs $debug_configs"
extra_configs="$extra_configs --with-berkeley-db --with-innodb --with-embedded-server --with-openssl --enable-local-infile"
extra_configs="$extra_configs --with-berkeley-db --with-innodb --with-embedded-server --with-openssl"
. "$path/FINISH.sh"
......@@ -606,7 +606,10 @@ AC_SUBST(MYSQLD_USER)
AC_ARG_ENABLE(local-infile,
[ --enable-local-infile
If LOAD DATA LOCAL INFILE is enabled by default.],
[ ENABLED_LOCAL_INFILE=$enablewal ],
[
ENABLED_LOCAL_INFILE=$enablewal
AC_DEFINE(ENABLED_LOCAL_INFILE)
],
[ ENABLED_LOCAL_INFILE=no ]
)
......
......@@ -80,15 +80,22 @@ int my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap)
}
#ifdef MAIN
#define OVERRUN_SENTRY 250
static void my_printf(const char * fmt, ...)
{
char buf[32];
char buf[33];
int n;
va_list ar;
va_start(ar, fmt);
n = my_vsnprintf(buf, sizeof(buf),fmt, ar);
buf[sizeof(buf)-1]=OVERRUN_SENTRY;
n = my_vsnprintf(buf, sizeof(buf)-1,fmt, ar);
printf(buf);
printf("n=%d, strlen=%d\n", n, strlen(buf));
if (buf[sizeof(buf)-1] != OVERRUN_SENTRY)
{
fprintf(stderr, "Buffer overrun\n");
abort();
}
va_end(ar);
}
......
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