Below is the list of changes that have just been committed into a local
5.1 repository of kent. When kent does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-07-23 23:54:55+02:00, kent@stripped +6 -0
Many files:
Put back old code to check stack direction at configure time
config/ac-macros/misc.m4@stripped, 2007-07-23 23:19:22+02:00, kent@stripped +23 -0
Put back old code to check stack direction at configure time
configure.in@stripped, 2007-07-23 23:19:22+02:00, kent@stripped +2 -0
Put back old code to check stack direction at configure time
include/config-netware.h@stripped, 2007-07-23 23:19:22+02:00, kent@stripped +3 -0
Put back old code to check stack direction at configure time
include/config-win.h@stripped, 2007-07-23 23:19:22+02:00, kent@stripped +2 -0
Put back old code to check stack direction at configure time
include/my_global.h@stripped, 2007-07-23 23:19:22+02:00, kent@stripped +4 -0
Put back old code to check stack direction at configure time
sql/sql_parse.cc@stripped, 2007-07-23 23:19:22+02:00, kent@stripped +5 -1
Put back old code to check stack direction at configure time
diff -Nrup a/config/ac-macros/misc.m4 b/config/ac-macros/misc.m4
--- a/config/ac-macros/misc.m4 2007-05-27 23:16:58 +02:00
+++ b/config/ac-macros/misc.m4 2007-07-23 23:19:22 +02:00
@@ -450,6 +450,29 @@ AC_DEFINE([HAVE_BOOL], [1], [bool is not
fi
])dnl
+AC_DEFUN([MYSQL_STACK_DIRECTION],
+ [AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction,
+ [AC_TRY_RUN([#include <stdlib.h>
+ int find_stack_direction ()
+ {
+ static char *addr = 0;
+ auto char dummy;
+ if (addr == 0)
+ {
+ addr = &dummy;
+ return find_stack_direction ();
+ }
+ else
+ return (&dummy > addr) ? 1 : -1;
+ }
+ int main ()
+ {
+ exit (find_stack_direction() < 0);
+ }], ac_cv_c_stack_direction=1, ac_cv_c_stack_direction=-1,
+ ac_cv_c_stack_direction=)])
+ AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
+])dnl
+
AC_DEFUN([MYSQL_CHECK_LONGLONG_TO_FLOAT],
[
AC_MSG_CHECKING(if conversion of longlong to float works)
diff -Nrup a/configure.in b/configure.in
--- a/configure.in 2007-07-20 11:41:22 +02:00
+++ b/configure.in 2007-07-23 23:19:22 +02:00
@@ -1792,6 +1792,8 @@ MYSQL_TYPE_ACCEPT
#---END:
# Figure out what type of struct rlimit to use with setrlimit
MYSQL_TYPE_STRUCT_RLIMIT
+# Find where the stack goes
+MYSQL_STACK_DIRECTION
# We want to skip alloca on irix unconditionally. It may work on some version..
MYSQL_FUNC_ALLOCA
# Do struct timespec have members tv_sec or ts_sec
diff -Nrup a/include/config-netware.h b/include/config-netware.h
--- a/include/config-netware.h 2007-05-27 23:16:58 +02:00
+++ b/include/config-netware.h 2007-07-23 23:19:22 +02:00
@@ -112,6 +112,9 @@ extern "C" {
/* signal by closing the sockets */
#define SIGNAL_WITH_VIO_CLOSE 1
+/* On NetWare, stack grows towards lower address */
+#define STACK_DIRECTION -1
+
/* On NetWare, we need to set stack size for threads, otherwise default 16K is used */
#define NW_THD_STACKSIZE 65536
diff -Nrup a/include/config-win.h b/include/config-win.h
--- a/include/config-win.h 2007-06-04 11:24:36 +02:00
+++ b/include/config-win.h 2007-07-23 23:19:22 +02:00
@@ -250,6 +250,8 @@ inline double ulonglong2double(ulonglong
#endif
+#define STACK_DIRECTION -1
+
/* Optimized store functions for Intel x86 */
#ifndef _WIN64
diff -Nrup a/include/my_global.h b/include/my_global.h
--- a/include/my_global.h 2007-07-05 01:01:50 +02:00
+++ b/include/my_global.h 2007-07-23 23:19:22 +02:00
@@ -804,6 +804,10 @@ typedef SOCKET_SIZE_TYPE size_socket;
#define ulong_to_double(X) ((double) (ulong) (X))
#define SET_STACK_SIZE(X) /* Not needed on real machines */
+#ifndef STACK_DIRECTION
+#error "please add -DSTACK_DIRECTION=1 or -1 to your CPPFLAGS"
+#endif
+
#if !defined(HAVE_STRTOK_R)
#define strtok_r(A,B,C) strtok((A),(B))
#endif
diff -Nrup a/sql/sql_parse.cc b/sql/sql_parse.cc
--- a/sql/sql_parse.cc 2007-07-16 23:03:55 +02:00
+++ b/sql/sql_parse.cc 2007-07-23 23:19:22 +02:00
@@ -5042,7 +5042,11 @@ bool check_merge_table_access(THD *thd,
#ifndef EMBEDDED_LIBRARY
-#define used_stack(A,B) (long)(A > B ? A - B : B - A)
+#if STACK_DIRECTION < 0
+#define used_stack(A,B) (long) (A - B)
+#else
+#define used_stack(A,B) (long) (B - A)
+#endif
#ifndef DBUG_OFF
long max_stack_used;
| Thread |
|---|
| • bk commit into 5.1 tree (kent:1.2553) | kent | 23 Jul |