summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <kaa@polly.(none)>2007-10-12 14:03:51 +0400
committerunknown <kaa@polly.(none)>2007-10-12 14:03:51 +0400
commit65a32e834fe2f5cdf173c40a262c0e85d6fe90e5 (patch)
treeb1cb0bfa35ca45724b15697013ef95c4d6228d27
parentbc8d42f96dc4760bfa843affb343d6b446355296 (diff)
downloadmariadb-git-65a32e834fe2f5cdf173c40a262c0e85d6fe90e5.tar.gz
Fix for bug #31254: "Max_data_length" truncated / reported wrong
(compiler issue ?) Problem: Improper compile-time flags on AIX prevented use of files > 2 GB. This resulted in Max_data_length being truncated to 2 GB by MyISAM code. Solution: Reverted large-file changes from the fix for bug10776. We need to define _LARGE_FILES on AIX to have support for files > 2 GB. Since _LARGE_FILE_API is incompatible with _LARGE_FILES and may be automatically defined by including standards.h, we also need a workaround to avoid this conflict. config/ac-macros/large_file.m4: Reverted large-file changes from the fix for bug10776. We need to define _LARGE_FILES on AIX to have support for files > 2 GB. include/my_global.h: _LARGE_FILE_API is defined in standards.h that is automatically included by at least some C++ compilers on AIX. Since it is also incompatible with _LARGE_FILES which is required for POSIX IO calls to be largefile-safe, the only workaround is to explicitely #undef _LARGE_FILE_API.
-rw-r--r--config/ac-macros/large_file.m411
-rw-r--r--include/my_global.h5
2 files changed, 14 insertions, 2 deletions
diff --git a/config/ac-macros/large_file.m4 b/config/ac-macros/large_file.m4
index 2639cec5fb7..279ce6d60f1 100644
--- a/config/ac-macros/large_file.m4
+++ b/config/ac-macros/large_file.m4
@@ -128,8 +128,15 @@ AC_DEFUN([MYSQL_SYS_LARGEFILE],
ac_cv_sys_largefile_source=1 ;;
esac])
- # AIX 4.2 and later -- do nothing, include standards.h instead.
- # this goes for both GNU and IBM C and C++ compilers.
+ AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES,
+ ac_cv_sys_large_files,
+ [Large files support on AIX-style hosts.],
+ [case "$host_os" in
+ # Large file support on AIX is available starting from version 4.2
+ # Tested only on 5.2 and up
+ aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*)
+ ac_cv_sys_large_files=1 ;;
+ esac])
fi
])
diff --git a/include/my_global.h b/include/my_global.h
index 4457b88c33e..dd3bc39413d 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -100,6 +100,11 @@
#define NETWARE_SET_SCREEN_MODE(A)
#endif
+/* Workaround for _LARGE_FILES and _LARGE_FILE_API incompatibility on AIX */
+#if defined(_AIX) && defined(_LARGE_FILE_API)
+#undef _LARGE_FILE_API
+#endif
+
/*
The macros below are used to allow build of Universal/fat binaries of
MySQL and MySQL applications under darwin.