summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsasha@mysql.sashanet.com <>2002-03-02 12:45:44 -0700
committersasha@mysql.sashanet.com <>2002-03-02 12:45:44 -0700
commitf59809c85a51bfd64f4397a44d11fb57817dff6e (patch)
tree99e834e2590a4246f2141adfa908a6f92809b04b
parentb305a27ac1465f2dff7ff2d20813e46342e4521a (diff)
downloadmariadb-git-f59809c85a51bfd64f4397a44d11fb57817dff6e.tar.gz
load local fix
overrun sentry in my_vsnprintf() test will not be pushed yet
-rw-r--r--BUILD/FINISH.sh1
-rw-r--r--BUILD/SETUP.sh4
-rwxr-xr-xBUILD/compile-pentium-debug-max2
-rw-r--r--configure.in7
-rw-r--r--mysys/my_vsnprintf.c11
5 files changed, 20 insertions, 5 deletions
diff --git a/BUILD/FINISH.sh b/BUILD/FINISH.sh
index fbeaf1e3c68..82f31a14dc4 100644
--- a/BUILD/FINISH.sh
+++ b/BUILD/FINISH.sh
@@ -1,5 +1,6 @@
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
diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh
index a69cdcb14fd..8c523fc4877 100644
--- a/BUILD/SETUP.sh
+++ b/BUILD/SETUP.sh
@@ -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"
diff --git a/BUILD/compile-pentium-debug-max b/BUILD/compile-pentium-debug-max
index d320f968c4e..1684686ce8c 100755
--- a/BUILD/compile-pentium-debug-max
+++ b/BUILD/compile-pentium-debug-max
@@ -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"
diff --git a/configure.in b/configure.in
index b93940c66ca..8c6249319fd 100644
--- a/configure.in
+++ b/configure.in
@@ -606,10 +606,13 @@ 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 ]
)
-
+
# Use Paul Eggerts macros from GNU tar to check for large file support.
MYSQL_SYS_LARGEFILE
diff --git a/mysys/my_vsnprintf.c b/mysys/my_vsnprintf.c
index 7b6d9672eb6..7490ab4a9f2 100644
--- a/mysys/my_vsnprintf.c
+++ b/mysys/my_vsnprintf.c
@@ -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);
}