Commit 1a985a17 authored by Michael Widenius's avatar Michael Widenius

Merge with 5.1

Updated version number in configure
parents 33c26f78 a3e8ce27
...@@ -40,23 +40,44 @@ AC_DEFUN([MYSQL_CHECK_LIBEDIT_INTERFACE], [ ...@@ -40,23 +40,44 @@ AC_DEFUN([MYSQL_CHECK_LIBEDIT_INTERFACE], [
]) ])
AC_DEFUN([MYSQL_CHECK_NEW_RL_INTERFACE], [ AC_DEFUN([MYSQL_CHECK_NEW_RL_INTERFACE], [
AC_CACHE_CHECK([defined rl_compentry_func_t and rl_completion_func_t], mysql_cv_new_rl_interface, AC_CACHE_CHECK([for system libreadline], mysql_cv_new_rl_interface,
AC_TRY_COMPILE( AC_COMPILE_IFELSE(
[ [AC_LANG_SOURCE([
#include "stdio.h" #include "stdio.h"
#include "readline/readline.h" #include "readline/readline.h"
],
[
rl_completion_func_t *func1= (rl_completion_func_t*)0; rl_completion_func_t *func1= (rl_completion_func_t*)0;
rl_compentry_func_t *func2= (rl_compentry_func_t*)0; rl_compentry_func_t *func2= (rl_compentry_func_t*)0;
], ])],
[ [
AC_PREPROC_IFELSE(
[AC_LANG_SOURCE([
#include "stdio.h"
#include "readline/readline.h"
#if RL_VERSION_MAJOR > 5
#error
#endif
])], [ rl_v5=yes ], [ rl_v5=no ],
)
if [test "$rl_v5" = "yes"]
then
mysql_cv_new_rl_interface=yes mysql_cv_new_rl_interface=yes
AC_DEFINE_UNQUOTED([USE_NEW_READLINE_INTERFACE], [1], else
[used new readline interface (are rl_completion_func_t and rl_compentry_func_t defined)]) if [test "$enable_distribution" = "yes"]
then
mysql_cv_new_rl_interface=no
else
mysql_cv_new_rl_interface=yes
enable_distribution=warn
fi
fi
], ],
[mysql_cv_new_rl_interface=no] [mysql_cv_new_rl_interface=no]
) )
if [test "$mysql_cv_new_rl_interface" = yes]
then
AC_DEFINE_UNQUOTED([USE_NEW_READLINE_INTERFACE], [1],
[used new readline interface (are rl_completion_func_t and rl_compentry_func_t defined)])
fi
) )
]) ])
......
...@@ -13,7 +13,7 @@ dnl When changing the major version number please also check the switch ...@@ -13,7 +13,7 @@ dnl When changing the major version number please also check the switch
dnl statement in mysqlbinlog::check_master_version(). You may also need dnl statement in mysqlbinlog::check_master_version(). You may also need
dnl to update version.c in ndb. dnl to update version.c in ndb.
AC_INIT([MariaDB Server], [5.2.10-MariaDB], [], [mysql]) AC_INIT([MariaDB Server], [5.2.11-MariaDB], [], [mysql])
AC_CONFIG_SRCDIR([sql/mysqld.cc]) AC_CONFIG_SRCDIR([sql/mysqld.cc])
AC_CANONICAL_SYSTEM AC_CANONICAL_SYSTEM
...@@ -633,6 +633,14 @@ AC_ARG_WITH(other-libc, ...@@ -633,6 +633,14 @@ AC_ARG_WITH(other-libc,
) )
AC_SUBST(NOINST_LDFLAGS) AC_SUBST(NOINST_LDFLAGS)
AC_ARG_ENABLE(distribution,
AC_HELP_STRING(
[--disable-distribution],
[Allow linking with system GPLv3 libraries. It may result in a binary that can not be legally distributed.]),
[ enable_distribution=$enableval ],
[ enable_distribution=yes ]
)
# #
# Check if we are using Linux and a glibc compiled with static nss # Check if we are using Linux and a glibc compiled with static nss
# (this is true on the MySQL build machines to avoid NSS problems) # (this is true on the MySQL build machines to avoid NSS problems)
...@@ -1574,7 +1582,7 @@ fi ...@@ -1574,7 +1582,7 @@ fi
AC_MSG_CHECKING([for OpenSolaris Bug 6611808]) AC_MSG_CHECKING([for OpenSolaris Bug 6611808])
save_CFLAGS="$CFLAGS" save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Werror" CFLAGS="$CFLAGS -Werror"
AC_COMPILE_IFELSE([ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#include <pthread.h> #include <pthread.h>
void dummy() {} void dummy() {}
int main() int main()
...@@ -1583,7 +1591,7 @@ AC_COMPILE_IFELSE([ ...@@ -1583,7 +1591,7 @@ AC_COMPILE_IFELSE([
pthread_once(&once_control, dummy); pthread_once(&once_control, dummy);
return 0; return 0;
} }
], [ ])], [
AC_DEFINE([PTHREAD_ONCE_INITIALIZER], [{PTHREAD_ONCE_INIT}], AC_DEFINE([PTHREAD_ONCE_INITIALIZER], [{PTHREAD_ONCE_INIT}],
[See OpenSolaris Bug 6611808]) [See OpenSolaris Bug 6611808])
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
...@@ -2723,6 +2731,8 @@ case $SYSTEM_TYPE in ...@@ -2723,6 +2731,8 @@ case $SYSTEM_TYPE in
compile_libedit=yes compile_libedit=yes
AC_DEFINE_UNQUOTED(HAVE_HIST_ENTRY, 1) AC_DEFINE_UNQUOTED(HAVE_HIST_ENTRY, 1)
AC_DEFINE_UNQUOTED(USE_LIBEDIT_INTERFACE, 1) AC_DEFINE_UNQUOTED(USE_LIBEDIT_INTERFACE, 1)
AC_MSG_CHECKING([for libedit/readline])
AC_MSG_RESULT([libedit bundled])
elif test "$with_readline" = "yes" elif test "$with_readline" = "yes"
then then
readline_topdir="cmd-line-utils" readline_topdir="cmd-line-utils"
...@@ -2733,6 +2743,8 @@ case $SYSTEM_TYPE in ...@@ -2733,6 +2743,8 @@ case $SYSTEM_TYPE in
compile_readline=yes compile_readline=yes
want_to_use_readline="yes" want_to_use_readline="yes"
AC_DEFINE_UNQUOTED(USE_NEW_READLINE_INTERFACE, 1) AC_DEFINE_UNQUOTED(USE_NEW_READLINE_INTERFACE, 1)
AC_MSG_CHECKING([for libedit/readline])
AC_MSG_RESULT([readline bundled])
else else
# Use system readline library # Use system readline library
AC_LANG_SAVE AC_LANG_SAVE
...@@ -2747,12 +2759,16 @@ case $SYSTEM_TYPE in ...@@ -2747,12 +2759,16 @@ case $SYSTEM_TYPE in
# this way we avoid linking commercial source with GPL readline # this way we avoid linking commercial source with GPL readline
readline_link="-lreadline" readline_link="-lreadline"
want_to_use_readline="yes" want_to_use_readline="yes"
AC_MSG_CHECKING([for libedit/readline])
AC_MSG_RESULT([readline system])
elif [test "$mysql_cv_libedit_interface" = "yes"] elif [test "$mysql_cv_libedit_interface" = "yes"]
then then
# Use libedit # Use libedit
readline_link="-ledit" readline_link="-ledit"
AC_MSG_CHECKING([for libedit/readline])
AC_MSG_RESULT([libedit system])
else else
AC_MSG_ERROR([Could not find system readline or libedit libraries AC_MSG_ERROR([Could not find usable system readline or libedit libraries
Use --with-readline or --with-libedit to use the bundled Use --with-readline or --with-libedit to use the bundled
versions of libedit or readline]) versions of libedit or readline])
fi fi
...@@ -2997,6 +3013,13 @@ if test X"$with_plugin_ndbcluster" = Xyes ; then ...@@ -2997,6 +3013,13 @@ if test X"$with_plugin_ndbcluster" = Xyes ; then
echo for more details. echo for more details.
fi fi
if test "$enable_distribution" = "warn"
then
echo "You have linked MariaDB with GPLv3 libraries!"
echo "You may not distribute the resulting binary. If you do, you will "
echo "put yourself into a legal problem with Free Software Foundation."
fi
# The first line "Thank you ..." is checked in ./Do-compile to verify that configure # The first line "Thank you ..." is checked in ./Do-compile to verify that configure
# ended sucessfully - don't remove it. # ended sucessfully - don't remove it.
echo "" echo ""
......
...@@ -211,8 +211,6 @@ exit: ...@@ -211,8 +211,6 @@ exit:
} }
orig_table_list->derived_result= derived_result; orig_table_list->derived_result= derived_result;
orig_table_list->table= table; orig_table_list->table= table;
orig_table_list->table_name= table->s->table_name.str;
orig_table_list->table_name_length= table->s->table_name.length;
table->derived_select_number= first_select->select_number; table->derived_select_number= first_select->select_number;
table->s->tmp_table= NON_TRANSACTIONAL_TMP_TABLE; table->s->tmp_table= NON_TRANSACTIONAL_TMP_TABLE;
#ifndef NO_EMBEDDED_ACCESS_CHECKS #ifndef NO_EMBEDDED_ACCESS_CHECKS
......
...@@ -760,7 +760,6 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list) ...@@ -760,7 +760,6 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list)
Protocol *protocol= thd->protocol; Protocol *protocol= thd->protocol;
char buff[2048]; char buff[2048];
String buffer(buff, sizeof(buff), system_charset_info); String buffer(buff, sizeof(buff), system_charset_info);
char *save_db, *save_table_name;
bool retval= TRUE; // Assume error bool retval= TRUE; // Assume error
List<Item> field_list; List<Item> field_list;
DBUG_ENTER("mysqld_show_create"); DBUG_ENTER("mysqld_show_create");
...@@ -770,10 +769,6 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list) ...@@ -770,10 +769,6 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list)
/* We want to preserve the tree for views. */ /* We want to preserve the tree for views. */
thd->lex->context_analysis_only|= CONTEXT_ANALYSIS_ONLY_VIEW; thd->lex->context_analysis_only|= CONTEXT_ANALYSIS_ONLY_VIEW;
/* Store original names if called from SP */
save_db= table_list->db;
save_table_name= table_list->table_name;
{ {
Show_create_error_handler view_error_suppressor(thd, table_list); Show_create_error_handler view_error_suppressor(thd, table_list);
thd->push_internal_handler(&view_error_suppressor); thd->push_internal_handler(&view_error_suppressor);
...@@ -856,11 +851,7 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list) ...@@ -856,11 +851,7 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list)
retval= FALSE; // ok retval= FALSE; // ok
error: error:
/* Restore table list if called by stored procedure */
table_list->db= save_db;
table_list->table_name= save_table_name;
DBUG_RETURN(retval); DBUG_RETURN(retval);
} }
bool mysqld_show_create_db(THD *thd, char *dbname, bool mysqld_show_create_db(THD *thd, char *dbname,
......
...@@ -67,9 +67,9 @@ inline void xt_atomic_inc1(volatile xtWord1 *mptr) ...@@ -67,9 +67,9 @@ inline void xt_atomic_inc1(volatile xtWord1 *mptr)
#elif defined(XT_ATOMIC_GNUC_X86) #elif defined(XT_ATOMIC_GNUC_X86)
xtWord1 val; xtWord1 val;
asm volatile ("movb %1,%0" : "=r" (val) : "m" (*mptr) : "memory"); asm volatile ("movb %1,%0" : "=q" (val) : "m" (*mptr) : "memory");
val++; val++;
asm volatile ("xchgb %1,%0" : "=r" (val) : "m" (*mptr), "0" (val) : "memory"); asm volatile ("xchgb %1,%0" : "=q" (val) : "m" (*mptr), "0" (val) : "memory");
#elif defined(XT_ATOMIC_SOLARIS_LIB) #elif defined(XT_ATOMIC_SOLARIS_LIB)
atomic_inc_8(mptr); atomic_inc_8(mptr);
#else #else
...@@ -91,9 +91,9 @@ inline xtWord1 xt_atomic_dec1(volatile xtWord1 *mptr) ...@@ -91,9 +91,9 @@ inline xtWord1 xt_atomic_dec1(volatile xtWord1 *mptr)
#elif defined(XT_ATOMIC_GNUC_X86) #elif defined(XT_ATOMIC_GNUC_X86)
xtWord1 val2; xtWord1 val2;
asm volatile ("movb %1, %0" : "=r" (val) : "m" (*mptr) : "memory"); asm volatile ("movb %1, %0" : "=q" (val) : "m" (*mptr) : "memory");
val--; val--;
asm volatile ("xchgb %1,%0" : "=r" (val2) : "m" (*mptr), "0" (val) : "memory"); asm volatile ("xchgb %1,%0" : "=q" (val2) : "m" (*mptr), "0" (val) : "memory");
/* Should work, but compiler makes a mistake? /* Should work, but compiler makes a mistake?
* asm volatile ("xchgb %1, %0" : : "r" (val), "m" (*mptr) : "memory"); * asm volatile ("xchgb %1, %0" : : "r" (val), "m" (*mptr) : "memory");
*/ */
......
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