MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Georgi Kodinov Date:May 25 2009 11:23am
Subject:bzr push into mysql-6.0-bugteam branch (joro:3321 to 3322)
View as plain text  
 3322 Georgi Kodinov	2009-05-25 [merge]
      merged 6.0-main to 6.0-bugteam

    removed:
      BUILD/compile-alpha-ccc
      BUILD/compile-alpha-cxx
      mysys/make-ccc
      regex/make-ccc
      storage/heap/make-ccc
      storage/maria/ma_ft_eval.c
      storage/maria/ma_ft_eval.h
      storage/maria/ma_ft_stem.c
      storage/maria/ma_ft_test1.c
      storage/maria/ma_ft_test1.h
      storage/myisam/ft_eval.c
      storage/myisam/ft_eval.h
      storage/myisam/ft_stem.c
      storage/myisam/ft_test1.c
      storage/myisam/ft_test1.h
      storage/myisam/make-ccc
      storage/myisammrg/make-ccc
      strings/make-ccc
    added:
      include/mysql/service_my_snprintf.h
      include/mysql/service_thd_alloc.h
      include/mysql/services.h
      include/service_versions.h
      libservices/
      libservices/CMakeLists.txt
      libservices/Makefile.am
      libservices/my_snprintf_service.c
      libservices/thd_alloc_service.c
      mysql-test/collections/mysql-6.0-maria.push
      mysql-test/collections/mysql-6.0-runtime.push
      mysql-test/r/drop_debug.result
      mysql-test/r/log_state_bug33693.result
      mysql-test/t/drop_debug.test
      mysql-test/t/log_state_bug33693-master.opt
      mysql-test/t/log_state_bug33693.test
      sql/sql_plugin_services.h
    modified:
      BUILD/Makefile.am
      CMakeLists.txt
      Makefile.am
      client/mysql.cc
      client/mysqltest.cc
      client/sql_string.cc
      configure.in
      include/Makefile.am
      include/config-win.h
      include/m_string.h
      include/maria.h
      include/my_bitmap.h
      include/my_global.h
      include/my_pthread.h
      include/myisam.h
      include/mysql/plugin.h
      include/mysql/plugin.h.pp
      libmysqld/Makefile.am
      mysql-test/r/log_state.result
      mysql-test/r/lowercase_table2.result
      mysql-test/r/mysqltest.result
      mysql-test/r/parser.result
      mysql-test/r/plugin.result
      mysql-test/suite/backup/r/backup_logs.result
      mysql-test/suite/backup/t/backup_logs.test
      mysql-test/t/log_state.test
      mysql-test/t/lowercase_table2.test
      mysql-test/t/myisam-system.test
      mysql-test/t/mysqltest.test
      mysql-test/t/parser.test
      mysql-test/t/plugin.test
      mysys/my_getopt.c
      mysys/my_getsystime.c
      mysys/my_pthread.c
      mysys/safemalloc.c
      mysys/typelib.c
      mysys/waiting_threads.c
      plugin/daemon_example/Makefile.am
      scripts/mysqld_safe.sh
      sql-common/my_time.c
      sql-common/pack.c
      sql/CMakeLists.txt
      sql/Makefile.am
      sql/field.cc
      sql/ha_partition.cc
      sql/handler.h
      sql/item.cc
      sql/item.h
      sql/item_cmpfunc.cc
      sql/item_func.cc
      sql/item_strfunc.cc
      sql/item_sum.cc
      sql/item_sum.h
      sql/item_timefunc.cc
      sql/log.cc
      sql/log_event.h
      sql/mysql_priv.h
      sql/mysqld.cc
      sql/replication.h
      sql/set_var.cc
      sql/sql_base.cc
      sql/sql_bitmap.h
      sql/sql_class.cc
      sql/sql_class.h
      sql/sql_connect.cc
      sql/sql_db.cc
      sql/sql_delete.cc
      sql/sql_lex.cc
      sql/sql_parse.cc
      sql/sql_partition.cc
      sql/sql_plugin.cc
      sql/sql_plugin.h
      sql/sql_prepare.cc
      sql/sql_repl.cc
      sql/sql_select.cc
      sql/sql_show.cc
      sql/sql_string.cc
      sql/sql_table.cc
      sql/sql_udf.h
      sql/sql_yacc.yy
      sql/thr_malloc.cc
      sql/time.cc
      sql/transaction.cc
      storage/archive/archive_performance.c
      storage/archive/archive_test.c
      storage/example/Makefile.am
      storage/example/ha_example.cc
      storage/falcon/ha_falcon.cpp
      storage/maria/Makefile.am
      storage/maria/ma_bitmap.c
      storage/maria/ma_blockrec.c
      storage/maria/ma_create.c
      storage/maria/ma_key.c
      storage/maria/ma_loghandler.c
      storage/maria/ma_loghandler_lsn.h
      storage/maria/ma_pagecache.c
      storage/maria/ma_recovery.c
      storage/maria/maria_backup_engine.cc
      storage/maria/maria_def.h
      storage/maria/maria_pack.c
      storage/maria/trnman.h
      storage/maria/unittest/lockman2-t.c
      storage/maria/unittest/ma_control_file-t.c
      storage/maria/unittest/trnman-t.c
      storage/myisam/CMakeLists.txt*
      storage/myisam/Makefile.am
      storage/myisam/mi_create.c
      storage/myisam/myisam_backup_engine.cc
      storage/myisam/myisampack.c
      storage/mysql_storage_engine.cmake
      storage/ndb/src/ndbapi/NdbRecAttr.cpp
      strings/ctype-ucs2.c
      strings/decimal.c
      strings/my_strtoll10.c
      strings/my_vsnprintf.c
      tests/mysql_client_test.c
 3321 Georgi Kodinov	2009-05-25 [merge]
      merge of bug 44399 to 6.0-bugteam

    modified:
      mysql-test/include/mix1.inc
      mysql-test/r/func_in.result
      mysql-test/r/innodb_mysql.result
      mysql-test/t/func_in.test
      sql/item.cc
      sql/item.h
      sql/item_cmpfunc.cc
      sql/sql_select.cc
=== modified file 'BUILD/Makefile.am'
--- a/BUILD/Makefile.am	2009-01-07 10:58:33 +0000
+++ b/BUILD/Makefile.am	2009-04-06 23:03:28 +0000
@@ -24,8 +24,6 @@ EXTRA_DIST =		FINISH.sh \
 			check-cpu \
 			cleanup \
 			compile-alpha \
-			compile-alpha-ccc \
-			compile-alpha-cxx \
 			compile-alpha-debug \
 			compile-amd64-debug-max \
 			compile-amd64-debug-max-no-ndb \

=== removed file 'BUILD/compile-alpha-ccc'
--- a/BUILD/compile-alpha-ccc	2009-04-03 23:38:18 +0000
+++ b/BUILD/compile-alpha-ccc	1970-01-01 00:00:00 +0000
@@ -1,41 +0,0 @@
-#! /bin/sh
-
-/bin/rm -f */.deps/*.P */*.o
-make -k maintainer-clean
-/bin/rm -f */.deps/*.P */*.o
-/bin/rm -f config.cache mysql-*.tar.gz
-
-path=`dirname $0`
-. "$path/autorun.sh"
-
-CC=ccc CFLAGS="-fast -O3 -fomit-frame-pointer" CXX=g++ CXXFLAGS="-O6 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti -mcpu=ev6 -Wa,-mev6" CXXLDFLAGS='/usr/lib/compaq/libots-2.2.7/libots.so /usr/lib/compaq/cpml-5.0.0/libcpml_ev6.a' ./configure --prefix=/usr/local/mysql --disable-shared --with-extra-charsets=complex --enable-thread-safe-client
-make
-rm */.deps/*
-make
-if [ $? = 0 ]
-then
-  rm */.deps/*
-  bin/mysqladmin shutdown
-  sur make install
-  if [ $? = 0 ]
-  then
-     scripts/make_binary_distribution
-  fi
-fi
-
-exit
-
-# This should give better performance by compiling many files at once, but
-# according to our benchmarks there isn't any real difference.
-
-pwd=`pwd`
-for i in */make-ccc
-do
-   cd `dirname $i`
-   make-ccc
-   cd $pwd
-done
-cd sql
-rm mysqld .deps/*.P
-make mysqld
-cd $pwd

=== removed file 'BUILD/compile-alpha-cxx'
--- a/BUILD/compile-alpha-cxx	2007-01-28 20:09:54 +0000
+++ b/BUILD/compile-alpha-cxx	1970-01-01 00:00:00 +0000
@@ -1,43 +0,0 @@
-#! /bin/sh
-
-/bin/rm -f */.deps/*.P */*.o
-make -k maintainer-clean
-/bin/rm -f */.deps/*.P */*.o
-/bin/rm -f */.deps/*.P config.cache storage/innobase/config.cache mysql-*.tar.gz
-
-path=`dirname $0`
-. "$path/autorun.sh"
-
-CC=ccc CFLAGS="-fast" CXX=cxx CXXFLAGS="-fast -noexceptions -nortti" ./configure --prefix=/usr/local/mysql --disable-shared --with-extra-charsets=complex --enable-thread-safe-client --with-mysqld-ldflags=-non_shared --with-client-ldflags=-non_shared --without-extra-tools --disable-dependency-tracking
-
-make -j2
-find . -name ".deps" | xargs rm -r 
-make
-if [ $? = 0 ]
-then
-  find . -name ".deps" | xargs rm -r 
-  bin/mysqladmin shutdown
-  sur make install
-  if [ $? = 0 ]
-  then
-     scripts/make_binary_distribution
-  fi
-  make test
-fi
-
-exit
-
-# This should give better performance by compiling many files at once, but
-# according to our benchmarks there isn't any real difference.
-
-pwd=`pwd`
-for i in */make-ccc
-do
-   cd `dirname $i`
-   make-ccc
-   cd $pwd
-done
-cd sql
-rm mysqld .deps/*.P
-make mysqld
-cd $pwd

=== modified file 'CMakeLists.txt'
--- a/CMakeLists.txt	2009-05-15 13:45:06 +0000
+++ b/CMakeLists.txt	2009-05-25 10:10:18 +0000
@@ -318,6 +318,7 @@ ADD_SUBDIRECTORY(extra)
 ADD_SUBDIRECTORY(client)
 ADD_SUBDIRECTORY(sql)
 ADD_SUBDIRECTORY(libmysql)
+ADD_SUBDIRECTORY(libservices)
 ADD_SUBDIRECTORY(tests)
 ADD_SUBDIRECTORY(unittest/mytap)
 ADD_SUBDIRECTORY(unittest/examples)

=== modified file 'Makefile.am'
--- a/Makefile.am	2009-05-15 13:45:06 +0000
+++ b/Makefile.am	2009-05-25 10:10:18 +0000
@@ -28,7 +28,7 @@ EXTRA_DIST =		INSTALL-SOURCE INSTALL-WIN
 
 SUBDIRS =		. include @docs_dirs@ @zlib_dir@ \
 			@readline_topdir@ sql-common scripts \
-			@pstack_dir@ \
+			@pstack_dir@ libservices \
 			@sql_union_dirs@ unittest storage plugin \
 			@sql_server@ @man_dirs@ tests \
 			netware @libmysqld_dirs@ \
@@ -37,7 +37,7 @@ SUBDIRS =		. include @docs_dirs@ @zlib_d
 
 DIST_SUBDIRS =		. include Docs zlib \
 			cmd-line-utils sql-common scripts \
-			pstack \
+			pstack libservices \
 			strings mysys dbug mysys/tests extra regex libmysql libmysql_r client unittest storage plugin \
 			vio sql man tests \
 			netware libmysqld \

=== modified file 'client/mysql.cc'
--- a/client/mysql.cc	2009-05-15 13:45:06 +0000
+++ b/client/mysql.cc	2009-05-25 10:10:18 +0000
@@ -55,7 +55,6 @@ static char *server_version= NULL;
 #define MAX_SERVER_ARGS               64
 
 void* sql_alloc(unsigned size);	     // Don't use mysqld alloc for these
-void sql_element_free(void *ptr);
 #include "sql_string.h"
 
 extern "C" {
@@ -4951,8 +4950,4 @@ void *sql_alloc(size_t Size)
   return my_malloc(Size,MYF(MY_WME));
 }
 
-void sql_element_free(void *ptr)
-{
-  my_free(ptr,MYF(0));
-}
 #endif /* EMBEDDED_LIBRARY */

=== modified file 'client/mysqltest.cc'
--- a/client/mysqltest.cc	2009-05-22 17:09:16 +0000
+++ b/client/mysqltest.cc	2009-05-25 10:10:18 +0000
@@ -282,6 +282,7 @@ enum enum_commands {
   Q_LIST_FILES_WRITE_FILE, Q_LIST_FILES_APPEND_FILE,
   Q_SEND_SHUTDOWN, Q_SHUTDOWN_SERVER,
   Q_RESULT_FORMAT_VERSION,
+  Q_MOVE_FILE,
 
   Q_UNKNOWN,			       /* Unknown command.   */
   Q_COMMENT,			       /* Comments, ignored. */
@@ -377,6 +378,7 @@ const char *command_names[]=
   "send_shutdown",
   "shutdown_server",
   "result_format",
+  "move_file",
 
   0
 };
@@ -1792,7 +1794,7 @@ void check_result()
           log_file.file_name(), reject_file, errno);
 
     show_diff(NULL, result_file_name, reject_file);
-    die(mess);
+    die("%s", mess);
     break;
   }
   default: /* impossible */
@@ -2943,6 +2945,42 @@ void do_copy_file(struct st_command *com
 
 /*
   SYNOPSIS
+  do_move_file
+  command	command handle
+
+  DESCRIPTION
+  move_file <from_file> <to_file>
+  Move <from_file> to <to_file>
+*/
+
+void do_move_file(struct st_command *command)
+{
+  int error;
+  static DYNAMIC_STRING ds_from_file;
+  static DYNAMIC_STRING ds_to_file;
+  const struct command_arg move_file_args[] = {
+    { "from_file", ARG_STRING, TRUE, &ds_from_file, "Filename to move from" },
+    { "to_file", ARG_STRING, TRUE, &ds_to_file, "Filename to move to" }
+  };
+  DBUG_ENTER("do_move_file");
+
+  check_command_args(command, command->first_argument,
+                     move_file_args,
+                     sizeof(move_file_args)/sizeof(struct command_arg),
+                     ' ');
+
+  DBUG_PRINT("info", ("Move %s to %s", ds_from_file.str, ds_to_file.str));
+  error= (my_rename(ds_from_file.str, ds_to_file.str,
+                    MYF(0)) != 0);
+  handle_command_error(command, error);
+  dynstr_free(&ds_from_file);
+  dynstr_free(&ds_to_file);
+  DBUG_VOID_RETURN;
+}
+
+
+/*
+  SYNOPSIS
   do_chmod_file
   command	command handle
 
@@ -7763,6 +7801,7 @@ int main(int argc, char **argv)
       case Q_CHANGE_USER: do_change_user(command); break;
       case Q_CAT_FILE: do_cat_file(command); break;
       case Q_COPY_FILE: do_copy_file(command); break;
+      case Q_MOVE_FILE: do_move_file(command); break;
       case Q_CHMOD_FILE: do_chmod_file(command); break;
       case Q_PERL: do_perl(command); break;
       case Q_RESULT_FORMAT_VERSION: do_result_format_version(command); break;

=== modified file 'client/sql_string.cc'
--- a/client/sql_string.cc	2009-03-24 14:24:44 +0000
+++ b/client/sql_string.cc	2009-04-24 10:04:14 +0000
@@ -34,7 +34,6 @@
 */
 
 extern void sql_alloc(size_t size);
-extern void sql_element_free(void *ptr);
 
 #include "sql_string.h"
 

=== modified file 'configure.in'
--- a/configure.in	2009-05-15 13:45:06 +0000
+++ b/configure.in	2009-05-25 10:10:18 +0000
@@ -2981,7 +2981,7 @@ AC_CONFIG_FILES(Makefile extra/Makefile 
  man/Makefile BUILD/Makefile vio/Makefile dnl
  libmysql/Makefile libmysql_r/Makefile client/Makefile dnl
  sql/Makefile sql/share/Makefile sql/backup/Makefile dnl
- sql/sql_builtin.cc sql-common/Makefile dnl
+ sql/sql_builtin.cc sql-common/Makefile libservices/Makefile dnl
  dbug/Makefile scripts/Makefile include/Makefile dnl
  tests/Makefile Docs/Makefile support-files/Makefile dnl
  support-files/MacOSX/Makefile support-files/RHEL4-SElinux/Makefile dnl

=== modified file 'include/Makefile.am'
--- a/include/Makefile.am	2009-03-20 15:58:14 +0000
+++ b/include/Makefile.am	2009-05-04 20:51:05 +0000
@@ -22,7 +22,8 @@ HEADERS_ABI =		mysql.h mysql_com.h mysql
 			my_list.h my_alloc.h typelib.h mysql/plugin.h \
 			mysql/plugin_audit.h mysql/plugin_ftparser.h
 pkginclude_HEADERS =	$(HEADERS_ABI) my_dbug.h m_string.h my_sys.h \
-			my_xml.h mysql_embed.h \
+			my_xml.h mysql_embed.h mysql/services.h \
+			mysql/service_my_snprintf.h mysql/service_thd_alloc.h \
 		  	my_pthread.h my_no_pthread.h \
 			decimal.h errmsg.h my_global.h my_net.h \
 			my_getopt.h sslopt-longopts.h my_dir.h \
@@ -36,7 +37,7 @@ noinst_HEADERS =	config-win.h config-net
 			my_nosys.h my_alarm.h queues.h rijndael.h sha1.h sha2.h \
 			my_aes.h my_tree.h my_trie.h hash.h thr_alarm.h \
 			thr_lock.h t_ctype.h violite.h my_md5.h base64.h \
-			my_handler.h my_time.h \
+			my_handler.h my_time.h service_versions.h \
 			my_vle.h my_user.h my_atomic.h atomic/nolock.h \
 			atomic/rwlock.h atomic/x86-gcc.h atomic/generic-msvc.h \
                         atomic/gcc_builtins.h my_libwrap.h my_stacktrace.h \

=== modified file 'include/config-win.h'
--- a/include/config-win.h	2009-05-15 13:45:06 +0000
+++ b/include/config-win.h	2009-05-25 10:10:18 +0000
@@ -132,17 +132,9 @@ typedef int mode_t; 
 #undef _REENTRANT			/* Crashes something for win32 */
 #undef SAFE_MUTEX			/* Can't be used on windows */
 
-#if defined(_MSC_VER) && _MSC_VER >= 1310
-#define LL(A)           A##ll
-#define ULL(A)          A##ull
-#else
-#define LL(A)           ((__int64) A)
-#define ULL(A)          ((unsigned __int64) A)
-#endif
-
-#define LONGLONG_MIN	LL(0x8000000000000000)
-#define LONGLONG_MAX	LL(0x7FFFFFFFFFFFFFFF)
-#define ULONGLONG_MAX	ULL(0xFFFFFFFFFFFFFFFF)
+#define LONGLONG_MIN	0x8000000000000000LL
+#define LONGLONG_MAX	0x7FFFFFFFFFFFFFFFLL
+#define ULONGLONG_MAX	0xFFFFFFFFFFFFFFFFULL
 
 /* Type information */
 
@@ -285,7 +277,7 @@ inline ulonglong double2ulonglong(double
 #define STACK_DIRECTION -1
 
 /* Difference between GetSystemTimeAsFileTime() and now() */
-#define OFFSET_TO_EPOCH ULL(116444736000000000)
+#define OFFSET_TO_EPOCH 116444736000000000ULL
 
 #define HAVE_PERROR
 #define HAVE_VFPRINT

=== modified file 'include/m_string.h'
--- a/include/m_string.h	2009-01-29 21:17:59 +0000
+++ b/include/m_string.h	2009-05-04 17:14:38 +0000
@@ -290,16 +290,10 @@ extern size_t my_snprintf(char *to, size
 
 /*
   LEX_STRING -- a pair of a C-string and its length.
+  (it's part of the plugin API as a MYSQL_LEX_STRING)
 */
 
-#ifndef _my_plugin_h
-/* This definition must match the one given in mysql/plugin.h */
-struct st_mysql_lex_string
-{
-  char *str;
-  size_t length;
-};
-#endif
+#include <mysql/plugin.h>
 typedef struct st_mysql_lex_string LEX_STRING;
 
 #define STRING_WITH_LEN(X) (X), ((size_t) (sizeof(X) - 1))

=== modified file 'include/maria.h'
--- a/include/maria.h	2009-04-23 21:17:43 +0000
+++ b/include/maria.h	2009-05-14 21:49:53 +0000
@@ -66,31 +66,31 @@ extern "C" {
   sets all high keys.
 */
 #define MARIA_KEYMAP_BITS      (8 * SIZEOF_LONG_LONG)
-#define MARIA_KEYMAP_HIGH_MASK (ULL(1) << (MARIA_KEYMAP_BITS - 1))
+#define MARIA_KEYMAP_HIGH_MASK (1ULL << (MARIA_KEYMAP_BITS - 1))
 #define maria_get_mask_all_keys_active(_keys_) \
                             (((_keys_) < MARIA_KEYMAP_BITS) ? \
-                             ((ULL(1) << (_keys_)) - ULL(1)) : \
-                             (~ ULL(0)))
+                             ((1ULL << (_keys_)) - 1ULL) : \
+                             (~ 0ULL))
 #if MARIA_MAX_KEY > MARIA_KEYMAP_BITS
 #define maria_is_key_active(_keymap_,_keyno_) \
                             (((_keyno_) < MARIA_KEYMAP_BITS) ? \
-                             test((_keymap_) & (ULL(1) << (_keyno_))) : \
+                             test((_keymap_) & (1ULL << (_keyno_))) : \
                              test((_keymap_) & MARIA_KEYMAP_HIGH_MASK))
 #define maria_set_key_active(_keymap_,_keyno_) \
                             (_keymap_)|= (((_keyno_) < MARIA_KEYMAP_BITS) ? \
-                                          (ULL(1) << (_keyno_)) : \
+                                          (1ULL << (_keyno_)) : \
                                           MARIA_KEYMAP_HIGH_MASK)
 #define maria_clear_key_active(_keymap_,_keyno_) \
                             (_keymap_)&= (((_keyno_) < MARIA_KEYMAP_BITS) ? \
-                                          (~ (ULL(1) << (_keyno_))) : \
-                                          (~ (ULL(0))) /*ignore*/ )
+                                          (~ (1ULL << (_keyno_))) : \
+                                          (~ (0ULL)) /*ignore*/ )
 #else
 #define maria_is_key_active(_keymap_,_keyno_) \
-                            test((_keymap_) & (ULL(1) << (_keyno_)))
+                            test((_keymap_) & (1ULL << (_keyno_)))
 #define maria_set_key_active(_keymap_,_keyno_) \
-                            (_keymap_)|= (ULL(1) << (_keyno_))
+                            (_keymap_)|= (1ULL << (_keyno_))
 #define maria_clear_key_active(_keymap_,_keyno_) \
-                            (_keymap_)&= (~ (ULL(1) << (_keyno_)))
+                            (_keymap_)&= (~ (1ULL << (_keyno_)))
 #endif
 #define maria_is_any_key_active(_keymap_) \
                             test((_keymap_))

=== modified file 'include/my_bitmap.h'
--- a/include/my_bitmap.h	2007-12-12 10:14:59 +0000
+++ b/include/my_bitmap.h	2009-05-14 21:49:53 +0000
@@ -169,11 +169,11 @@ static inline my_bool bitmap_cmp(const M
 */
 
 #define bit_is_set(I,B)   (sizeof(I) * CHAR_BIT > (B) ?                 \
-                           (((I) & (ULL(1) << (B))) == 0 ? 0 : 1) : -1)
+                           (((I) & (1ULL << (B))) == 0 ? 0 : 1) : -1)
 #define bit_do_set(I,B)   (sizeof(I) * CHAR_BIT > (B) ?         \
-                           ((I) |= (ULL(1) << (B)), 1) : -1)
+                           ((I) |= (1ULL << (B)), 1) : -1)
 #define bit_do_clear(I,B) (sizeof(I) * CHAR_BIT > (B) ?         \
-                           ((I) &= ~(ULL(1) << (B)), 0) : -1)
+                           ((I) &= ~(1ULL << (B)), 0) : -1)
 
 #ifdef	__cplusplus
 }

=== modified file 'include/my_global.h'
--- a/include/my_global.h	2009-05-15 13:45:06 +0000
+++ b/include/my_global.h	2009-05-25 10:10:18 +0000
@@ -1126,22 +1126,6 @@ typedef char		bool;	/* Ordinary boolean 
 #define INT32(v)	(int32) (v)
 #define MYF(v)		STATIC_CAST(myf)(v)
 
-#ifndef LL
-#ifdef HAVE_LONG_LONG
-#define LL(A) A ## LL
-#else
-#define LL(A) A ## L
-#endif
-#endif
-
-#ifndef ULL
-#ifdef HAVE_LONG_LONG
-#define ULL(A) A ## ULL
-#else
-#define ULL(A) A ## UL
-#endif
-#endif
-
 /*
   Defines to make it possible to prioritize register assignments. No
   longer that important with modern compilers.

=== modified file 'include/my_pthread.h'
--- a/include/my_pthread.h	2009-03-02 21:52:37 +0000
+++ b/include/my_pthread.h	2009-05-14 21:49:53 +0000
@@ -391,8 +391,8 @@ int my_pthread_mutex_trylock(pthread_mut
 #define set_timespec_time_nsec(ABSTIME,TIME,NSEC) do {                  \
   ulonglong nsec= (NSEC);                                               \
   ulonglong now= (TIME) + (nsec/100);                                   \
-  (ABSTIME).MY_tv_sec=  (now / ULL(10000000));                          \
-  (ABSTIME).MY_tv_nsec= (now % ULL(10000000) * 100 + (nsec % 100));     \
+  (ABSTIME).MY_tv_sec=  (now / 10000000ULL);                          \
+  (ABSTIME).MY_tv_nsec= (now % 10000000ULL * 100 + (nsec % 100));     \
 } while(0)
 #endif /* !set_timespec_time_nsec */
 
@@ -627,7 +627,6 @@ extern my_bool my_thread_init(void);
 extern void my_thread_end(void);
 extern const char *my_thread_name(void);
 extern my_thread_id my_thread_dbug_id(void);
-extern int pthread_no_free(void *);
 extern int pthread_dummy(int);
 
 /* All thread specific variables are in the following struct */

=== modified file 'include/myisam.h'
--- a/include/myisam.h	2009-02-13 16:30:54 +0000
+++ b/include/myisam.h	2009-05-14 21:49:53 +0000
@@ -76,35 +76,35 @@ extern "C" {
   sets all high keys.
 */
 #define MI_KEYMAP_BITS      (8 * SIZEOF_LONG_LONG)
-#define MI_KEYMAP_HIGH_MASK (ULL(1) << (MI_KEYMAP_BITS - 1))
+#define MI_KEYMAP_HIGH_MASK (1ULL << (MI_KEYMAP_BITS - 1))
 #define mi_get_mask_all_keys_active(_keys_) \
                             (((_keys_) < MI_KEYMAP_BITS) ? \
-                             ((ULL(1) << (_keys_)) - ULL(1)) : \
-                             (~ ULL(0)))
+                             ((1ULL << (_keys_)) - 1ULL) : \
+                             (~ 0ULL))
 
 #if MI_MAX_KEY > MI_KEYMAP_BITS
 
 #define mi_is_key_active(_keymap_,_keyno_) \
                             (((_keyno_) < MI_KEYMAP_BITS) ? \
-                             test((_keymap_) & (ULL(1) << (_keyno_))) : \
+                             test((_keymap_) & (1ULL << (_keyno_))) : \
                              test((_keymap_) & MI_KEYMAP_HIGH_MASK))
 #define mi_set_key_active(_keymap_,_keyno_) \
                             (_keymap_)|= (((_keyno_) < MI_KEYMAP_BITS) ? \
-                                          (ULL(1) << (_keyno_)) : \
+                                          (1ULL << (_keyno_)) : \
                                           MI_KEYMAP_HIGH_MASK)
 #define mi_clear_key_active(_keymap_,_keyno_) \
                             (_keymap_)&= (((_keyno_) < MI_KEYMAP_BITS) ? \
-                                          (~ (ULL(1) << (_keyno_))) : \
-                                          (~ (ULL(0))) /*ignore*/ )
+                                          (~ (1ULL << (_keyno_))) : \
+                                          (~ (0ULL)) /*ignore*/ )
 
 #else
 
 #define mi_is_key_active(_keymap_,_keyno_) \
-                            test((_keymap_) & (ULL(1) << (_keyno_)))
+                            test((_keymap_) & (1ULL << (_keyno_)))
 #define mi_set_key_active(_keymap_,_keyno_) \
-                            (_keymap_)|= (ULL(1) << (_keyno_))
+                            (_keymap_)|= (1ULL << (_keyno_))
 #define mi_clear_key_active(_keymap_,_keyno_) \
-                            (_keymap_)&= (~ (ULL(1) << (_keyno_)))
+                            (_keymap_)&= (~ (1ULL << (_keyno_)))
 
 #endif
 

=== modified file 'include/mysql/plugin.h'
--- a/include/mysql/plugin.h	2009-05-08 07:49:21 +0000
+++ b/include/mysql/plugin.h	2009-05-14 08:56:34 +0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 MySQL AB
+/* Copyright (C) 2005 MySQL AB, 2009 Sun Microsystems, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -16,12 +16,6 @@
 #ifndef _my_plugin_h
 #define _my_plugin_h
 
-/* size_t */
-#include <stdlib.h>
-
-typedef struct st_mysql MYSQL;
-
-
 /*
   On Windows, exports from DLL need to be declared
 */
@@ -39,15 +33,7 @@ class Item;
 #define MYSQL_THD void*
 #endif
 
-#ifndef _m_string_h
-/* This definition must match the one given in m_string.h */
-struct st_mysql_lex_string
-{
-  char *str;
-  unsigned int length;
-};
-#endif /* _m_string_h */
-typedef struct st_mysql_lex_string MYSQL_LEX_STRING;
+#include <mysql/services.h>
 
 #define MYSQL_XIDDATASIZE 128
 /**
@@ -127,7 +113,8 @@ enum enum_mysql_show_type
 {
   SHOW_UNDEF, SHOW_BOOL, SHOW_INT, SHOW_LONG,
   SHOW_LONGLONG, SHOW_CHAR, SHOW_CHAR_PTR,
-  SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE
+  SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE,
+  SHOW_always_last
 };
 
 struct st_mysql_show_var {
@@ -574,54 +561,6 @@ int thd_killed(const MYSQL_THD thd);
 */
 unsigned long thd_get_thread_id(const MYSQL_THD thd);
 
-
-/**
-  Allocate memory in the connection's local memory pool
-
-  @details
-  When properly used in place of @c my_malloc(), this can significantly
-  improve concurrency. Don't use this or related functions to allocate
-  large chunks of memory. Use for temporary storage only. The memory
-  will be freed automatically at the end of the statement; no explicit
-  code is required to prevent memory leaks.
-
-  @see alloc_root()
-*/
-void *thd_alloc(MYSQL_THD thd, unsigned int size);
-/**
-  @see thd_alloc()
-*/
-void *thd_calloc(MYSQL_THD thd, unsigned int size);
-/**
-  @see thd_alloc()
-*/
-char *thd_strdup(MYSQL_THD thd, const char *str);
-/**
-  @see thd_alloc()
-*/
-char *thd_strmake(MYSQL_THD thd, const char *str, unsigned int size);
-/**
-  @see thd_alloc()
-*/
-void *thd_memdup(MYSQL_THD thd, const void* str, unsigned int size);
-
-/**
-  Create a LEX_STRING in this connection's local memory pool
-
-  @param thd      user thread connection handle
-  @param lex_str  pointer to LEX_STRING object to be initialized
-  @param str      initializer to be copied into lex_str
-  @param size     length of str, in bytes
-  @param allocate_lex_string  flag: if TRUE, allocate new LEX_STRING object,
-                              instead of using lex_str value
-  @return  NULL on failure, or pointer to the LEX_STRING object
-
-  @see thd_alloc()
-*/
-MYSQL_LEX_STRING *thd_make_lex_string(MYSQL_THD thd, MYSQL_LEX_STRING *lex_str,
-                                      const char *str, unsigned int size,
-                                      int allocate_lex_string);
-
 /**
   Get the XID for this connection's transaction
 

=== modified file 'include/mysql/plugin.h.pp'
--- a/include/mysql/plugin.h.pp	2009-05-08 07:49:21 +0000
+++ b/include/mysql/plugin.h.pp	2009-05-14 08:56:34 +0000
@@ -1,11 +1,38 @@
+#include <mysql/services.h>
+#include <mysql/service_my_snprintf.h>
+#include <stdarg.h>
+#include <stdlib.h>
+extern struct my_snprintf_service_st {
+  size_t (*my_snprintf_type)(char*, size_t, const char*, ...);
+  size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list);
+} *my_snprintf_service;
+size_t my_snprintf(char* to, size_t n, const char* fmt, ...);
+size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap);
+#include <mysql/service_thd_alloc.h>
 #include <stdlib.h>
-typedef struct st_mysql MYSQL;
 struct st_mysql_lex_string
 {
   char *str;
-  unsigned int length;
+  size_t length;
 };
 typedef struct st_mysql_lex_string MYSQL_LEX_STRING;
+extern struct thd_alloc_service_st {
+  void *(*thd_alloc_func)(void*, unsigned int);
+  void *(*thd_calloc_func)(void*, unsigned int);
+  char *(*thd_strdup_func)(void*, const char *);
+  char *(*thd_strmake_func)(void*, const char *, unsigned int);
+  void *(*thd_memdup_func)(void*, const void*, unsigned int);
+  MYSQL_LEX_STRING *(*thd_make_lex_string_func)(void*, MYSQL_LEX_STRING *,
+                                        const char *, unsigned int, int);
+} *thd_alloc_service;
+void *thd_alloc(void* thd, unsigned int size);
+void *thd_calloc(void* thd, unsigned int size);
+char *thd_strdup(void* thd, const char *str);
+char *thd_strmake(void* thd, const char *str, unsigned int size);
+void *thd_memdup(void* thd, const void* str, unsigned int size);
+MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str,
+                                      const char *str, unsigned int size,
+                                      int allocate_lex_string);
 struct st_mysql_xid {
   long formatID;
   long gtrid_length;
@@ -17,7 +44,8 @@ enum enum_mysql_show_type
 {
   SHOW_UNDEF, SHOW_BOOL, SHOW_INT, SHOW_LONG,
   SHOW_LONGLONG, SHOW_CHAR, SHOW_CHAR_PTR,
-  SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE
+  SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE,
+  SHOW_always_last
 };
 struct st_mysql_show_var {
   const char *name;
@@ -133,14 +161,6 @@ const char *set_thd_proc_info(void*, con
 int mysql_tmpfile(const char *prefix);
 int thd_killed(const void* thd);
 unsigned long thd_get_thread_id(const void* thd);
-void *thd_alloc(void* thd, unsigned int size);
-void *thd_calloc(void* thd, unsigned int size);
-char *thd_strdup(void* thd, const char *str);
-char *thd_strmake(void* thd, const char *str, unsigned int size);
-void *thd_memdup(void* thd, const void* str, unsigned int size);
-MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str,
-                                      const char *str, unsigned int size,
-                                      int allocate_lex_string);
 void thd_get_xid(const void* thd, MYSQL_XID *xid);
 void mysql_query_cache_invalidate4(void* thd,
                                    const char *key, unsigned int key_length,

=== added file 'include/mysql/service_my_snprintf.h'
--- a/include/mysql/service_my_snprintf.h	1970-01-01 00:00:00 +0000
+++ b/include/mysql/service_my_snprintf.h	2009-05-04 17:14:38 +0000
@@ -0,0 +1,79 @@
+/* Copyright (C) 2009 Sun Microsystems, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; version 2 of the License.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+/**
+  @file
+  my_snprintf service
+
+  Portable and limited vsnprintf() implementation.
+
+  This is a portable, limited vsnprintf() implementation, with some
+  extra features. "Portable" means that it'll produce identical result
+  on all platforms (for example, on Windows and Linux %e formats the
+  exponent differently, on different systems %p either prints leading
+  0x or not, %s may accept null pointer or crash on it). "Limited"
+  means that it does not support all the C89 features. But it supports
+  few extensions, not in any standard.
+
+  my_vsnprintf(to, n, fmt, ap)
+
+  @param[out] to     A buffer to store the result in
+  @param[in]  n      Store up to n-1 characters, followed by an end 0
+  @param[in]  fmt    printf-like format string
+  @param[in]  ap     Arguments
+
+  @return a number of bytes written to a buffer
+
+  @post
+  The syntax of a format string is generally the same:
+  % <flag> <width> <precision> <length modifier> <format>
+  where everithing but the format is optional.
+
+  The only possible <flag> is '0'. It has the standard zero-padding semantics.
+  Both <width> and <precision> can be specified as numbers or '*'.
+
+  <length modifier> can be 'l', 'll', or 'z'.
+
+  Supported formats are 's' (null pointer is accepted, printed as
+  "(null)"), 'b' (extension, see below), 'c', 'f', 'g', 'd', 'u', 'x',
+  'X', 'p' (works as 0x%x).
+
+  Extensions:
+
+  Format 'b': binary buffer, prints exactly <precision> bytes from the
+  argument, without stopping at '\0'.
+
+  More to come (identifier quoting, escaping, see WL#751).
+*/
+
+#include <stdarg.h>
+#include <stdlib.h>
+extern struct my_snprintf_service_st {
+  size_t (*my_snprintf_type)(char*, size_t, const char*, ...);
+  size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list);
+} *my_snprintf_service;
+
+#ifdef MYSQL_DYNAMIC_PLUGIN
+
+#define my_vsnprintf my_snprintf_service->my_vsnprintf_type
+#define my_snprintf my_snprintf_service->my_snprintf_type
+
+#else
+
+size_t my_snprintf(char* to, size_t n, const char* fmt, ...);
+size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap);
+
+#endif
+

=== added file 'include/mysql/service_thd_alloc.h'
--- a/include/mysql/service_thd_alloc.h	1970-01-01 00:00:00 +0000
+++ b/include/mysql/service_thd_alloc.h	2009-05-04 17:14:38 +0000
@@ -0,0 +1,116 @@
+/* Copyright (C) 2009 Sun Microsystems, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; version 2 of the License.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+/**
+  @file
+  This service provdes functions to allocate memory in a connection local
+  memory pool. The memory allocated there will be automatically freed at the
+  end of the statement, don't use it for allocations that should live longer
+  than that. For short living allocations this is more efficient than
+  using my_malloc and friends, and automatic "garbage collection" allows not
+  to think about memory leaks.
+
+  The pool is best for small to medium objects, don't use it for large
+  allocations - they are better served with my_malloc.
+*/
+
+#include <stdlib.h>
+
+struct st_mysql_lex_string
+{
+  char *str;
+  size_t length;
+};
+typedef struct st_mysql_lex_string MYSQL_LEX_STRING;
+
+extern struct thd_alloc_service_st {
+  void *(*thd_alloc_func)(MYSQL_THD, unsigned int);
+  void *(*thd_calloc_func)(MYSQL_THD, unsigned int);
+  char *(*thd_strdup_func)(MYSQL_THD, const char *);
+  char *(*thd_strmake_func)(MYSQL_THD, const char *, unsigned int);
+  void *(*thd_memdup_func)(MYSQL_THD, const void*, unsigned int);
+  MYSQL_LEX_STRING *(*thd_make_lex_string_func)(MYSQL_THD, MYSQL_LEX_STRING *,
+                                        const char *, unsigned int, int);
+} *thd_alloc_service;
+
+#ifdef MYSQL_DYNAMIC_PLUGIN
+
+#define thd_alloc(thd,size) (thd_alloc_service->thd_alloc_func((thd), (size)))
+
+#define thd_calloc(thd,size) (thd_alloc_service->thd_calloc_func((thd), (size)))
+
+#define thd_strdup(thd,str) (thd_alloc_service->thd_strdup_func((thd), (str)))
+
+#define thd_strmake(thd,str,size) \
+  (thd_alloc_service->thd_strmake_func((thd), (str), (size)))
+
+#define thd_memdup(thd,str,size) \
+  (thd_alloc_service->thd_memdup_func((thd), (str), (size)))
+
+#define thd_make_lex_string(thd, lex_str, str, size, allocate_lex_string) \
+  (thd_alloc_service->thd_make_lex_string_func((thd), (lex_str), (str), \
+                                               (size), (allocate_lex_string)))
+
+#else
+
+/**
+  Allocate memory in the connection's local memory pool
+
+  @details
+  When properly used in place of @c my_malloc(), this can significantly
+  improve concurrency. Don't use this or related functions to allocate
+  large chunks of memory. Use for temporary storage only. The memory
+  will be freed automatically at the end of the statement; no explicit
+  code is required to prevent memory leaks.
+
+  @see alloc_root()
+*/
+void *thd_alloc(MYSQL_THD thd, unsigned int size);
+/**
+  @see thd_alloc()
+*/
+void *thd_calloc(MYSQL_THD thd, unsigned int size);
+/**
+  @see thd_alloc()
+*/
+char *thd_strdup(MYSQL_THD thd, const char *str);
+/**
+  @see thd_alloc()
+*/
+char *thd_strmake(MYSQL_THD thd, const char *str, unsigned int size);
+/**
+  @see thd_alloc()
+*/
+void *thd_memdup(MYSQL_THD thd, const void* str, unsigned int size);
+
+/**
+  Create a LEX_STRING in this connection's local memory pool
+
+  @param thd      user thread connection handle
+  @param lex_str  pointer to LEX_STRING object to be initialized
+  @param str      initializer to be copied into lex_str
+  @param size     length of str, in bytes
+  @param allocate_lex_string  flag: if TRUE, allocate new LEX_STRING object,
+                              instead of using lex_str value
+  @return  NULL on failure, or pointer to the LEX_STRING object
+
+  @see thd_alloc()
+*/
+MYSQL_LEX_STRING *thd_make_lex_string(MYSQL_THD thd, MYSQL_LEX_STRING *lex_str,
+                                      const char *str, unsigned int size,
+                                      int allocate_lex_string);
+
+#endif
+

=== added file 'include/mysql/services.h'
--- a/include/mysql/services.h	1970-01-01 00:00:00 +0000
+++ b/include/mysql/services.h	2009-04-30 16:22:40 +0000
@@ -0,0 +1,31 @@
+/* Copyright (C) 2009 Sun Microsystems, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; version 2 of the License.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+#ifndef MYSQL_SERVICES_INCLUDED
+#define MYSQL_SERVICES_INCLUDED
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <mysql/service_my_snprintf.h>
+#include <mysql/service_thd_alloc.h>
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+

=== added file 'include/service_versions.h'
--- a/include/service_versions.h	1970-01-01 00:00:00 +0000
+++ b/include/service_versions.h	2009-05-06 18:17:49 +0000
@@ -0,0 +1,24 @@
+/* Copyright (C) 2009 Sun Microsystems, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; version 2 of the License.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+#ifdef _WIN32
+#define SERVICE_VERSION __declspec(dllexport) void *
+#else
+#define SERVICE_VERSION void *
+#endif
+
+#define VERSION_my_snprintf     0x0100
+#define VERSION_thd_alloc       0x0100
+

=== modified file 'libmysqld/Makefile.am'
--- a/libmysqld/Makefile.am	2009-03-09 14:00:03 +0000
+++ b/libmysqld/Makefile.am	2009-05-04 15:51:55 +0000
@@ -1,242 +1,242 @@
-# Copyright (C) 2001-2006 MySQL AB
-# 
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public
-# License as published by the Free Software Foundation; version 2
-# of the License.
-# 
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Library General Public License for more details.
-# 
-# You should have received a copy of the GNU Library General Public
-# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
-#
-# This file is public domain and comes with NO WARRANTY of any kind
-
-MYSQLDATAdir =		$(localstatedir)
-MYSQLSHAREdir =		$(pkgdatadir)
-MYSQLBASEdir=		$(prefix)
-MYSQLLIBdir=            $(libdir)
-pkgplugindir =		$(pkglibdir)/plugin
-
-EXTRA_DIST =		libmysqld.def CMakeLists.txt
-DEFS =			-DEMBEDDED_LIBRARY -DMYSQL_SERVER \
-			-DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \
-			-DDATADIR="\"$(MYSQLDATAdir)\"" \
-			-DSHAREDIR="\"$(MYSQLSHAREdir)\"" \
-			@DEFS@ \
-			-DLIBDIR="\"$(MYSQLLIBdir)\"" \
-			-DPLUGINDIR="\"$(pkgplugindir)\""
-AM_CPPFLAGS =		-I$(top_srcdir)/include \
-			-I$(top_builddir)/sql -I$(top_srcdir)/sql \
-			-I$(top_srcdir)/sql/examples \
-			-I$(top_srcdir)/regex \
-			$(openssl_includes) @ZLIB_INCLUDES@ \
-			@condition_dependent_plugin_includes@
-
-noinst_LIBRARIES =	libmysqld_int.a
-pkglib_LIBRARIES =	libmysqld.a
-SUBDIRS =		. examples
-libmysqld_sources=	libmysqld.c lib_sql.cc emb_qcache.cc
-libmysqlsources =	errmsg.c get_password.c libmysql.c client.c pack.c \
-                        my_time.c
-
-noinst_HEADERS =	embedded_priv.h emb_qcache.h
-
-sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
-	     ha_ndbcluster.cc ha_ndbcluster_cond.cc \
-	ha_ndbcluster_connection.cc \
-	ha_ndbcluster_binlog.cc ha_partition.cc \
-	handler.cc sql_handler.cc \
-	hostname.cc init.cc password.c \
-	item.cc item_buff.cc item_cmpfunc.cc item_create.cc \
-	item_func.cc item_strfunc.cc item_sum.cc item_timefunc.cc \
-	item_geofunc.cc item_subselect.cc item_row.cc\
-	item_xmlfunc.cc \
-	sha2.cc des_key_file.cc \
-	key.cc lock.cc log.cc sql_state.c \
-	log_event.cc rpl_record.cc \
-	log_event_old.cc rpl_record_old.cc \
-	protocol.cc net_serv.cc opt_range.cc \
-	opt_sum.cc procedure.cc records.cc sql_acl.cc \
-	sql_load.cc discover.cc sql_locale.cc \
-	sql_profile.cc \
-	sql_analyse.cc sql_base.cc sql_cache.cc sql_class.cc \
-	sql_crypt.cc sql_db.cc sql_delete.cc sql_error.cc sql_insert.cc \
-        sql_join_cache.cc \
-	sql_lex.cc sql_list.cc sql_manager.cc sql_map.cc \
-	scheduler.cc sql_connect.cc sql_parse.cc \
-	sql_prepare.cc sql_derived.cc sql_rename.cc \
-	sql_select.cc sql_do.cc sql_show.cc set_var.cc \
-	sql_string.cc sql_table.cc sql_test.cc sql_udf.cc \
-	sql_update.cc sql_yacc.cc table.cc thr_malloc.cc time.cc \
-	unireg.cc uniques.cc sql_union.cc hash_filo.cc \
-	spatial.cc gstream.cc sql_help.cc tztime.cc sql_cursor.cc \
-	sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc sp_rcontext.cc \
-	parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \
-	rpl_filter.cc sql_partition.cc sql_builtin.cc sql_plugin.cc \
-	debug_sync.cc sql_tablespace.cc transaction.cc \
-	rpl_injector.cc my_user.c partition_info.cc \
-	sql_servers.cc bml.cc si_objects.cc sql_audit.cc \
-	event_parse_data.cc mdl.cc sql_signal.cc \
-        rpl_handler.cc
-
-libmysqld_int_a_SOURCES= $(libmysqld_sources)
-nodist_libmysqld_int_a_SOURCES= $(libmysqlsources) $(sqlsources)
-libmysqld_a_SOURCES=
-
-sqlstoragesources =	$(EXTRA_libmysqld_a_SOURCES)
-storagesources = @condition_dependent_plugin_modules@
-storageobjects = @condition_dependent_plugin_objects@
-storagesourceslinks = @condition_dependent_plugin_links@
-
-# automake misses these
-sql_yacc.cc sql_yacc.h: $(top_srcdir)/sql/sql_yacc.yy
-
-# The following libraries should be included in libmysqld.a
-INC_LIB=	$(top_builddir)/regex/libregex.a \
-		$(top_builddir)/mysys/.libs/libmysys.a \
-		$(top_builddir)/strings/.libs/libmystrings.a \
-		$(top_builddir)/dbug/.libs/libdbug.a \
-		$(top_builddir)/vio/libvio.a \
-                @NDB_SCI_LIBS@ \
-		@mysql_plugin_libs@ \
-		$(yassl_inc_libs)
-
-if HAVE_YASSL
-yassl_inc_libs=	$(top_builddir)/extra/yassl/src/.libs/libyassl.a \
-		$(top_builddir)/extra/yassl/taocrypt/src/.libs/libtaocrypt.a
-endif
-
-# Storage engine specific compilation options
-ha_ndbcluster.o:ha_ndbcluster.cc
-		$(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
-
-ha_ndbcluster_cond.o:ha_ndbcluster_cond.cc
-		$(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
-
-ha_ndbcluster_binlog.o: ha_ndbcluster_binlog.cc
-		$(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
-
-ha_ndbcluster_connection.o: ha_ndbcluster_connection.cc
-		$(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
-
-# Until we can remove dependency on ha_ndbcluster.h
-handler.o:	handler.cc
-		$(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
-
-# We need rules to compile these as no good way
-# found to append fileslists that collected by configure
-# to the sources list
-
-ha_federated.o:ha_federated.cc
-		$(CXXCOMPILE) $(LM_CFLAGS) -c $<
-
-ha_heap.o:ha_heap.cc
-		$(CXXCOMPILE) $(LM_CFLAGS) -c $<
-
-ha_innodb.o:ha_innodb.cc
-		$(CXXCOMPILE) $(LM_CFLAGS) -c $<
-
-ha_myisam.o:ha_myisam.cc
-		$(CXXCOMPILE) $(LM_CFLAGS) -c $<
-
-ha_myisammrg.o:ha_myisammrg.cc
-		$(CXXCOMPILE) $(LM_CFLAGS) -c $<
-
-#
-# To make it easy for the end user to use the embedded library we
-# generate a total libmysqld.a from all library files,
-
-# note - InnoDB libraries have circular dependencies, so in INC_LIB
-# few libraries are present two times. Metrowerks linker doesn't like
-# it at all. Traditional ar has no problems with it, but still there's no
-# need to add the same file twice to the library, so 'sort -u' save us
-# some time and spares unnecessary work.
-
-libmysqld.a:	libmysqld_int.a $(INC_LIB) $(libmysqld_a_DEPENDENCIES) $(storageobjects)
-if DARWIN_MWCC
-	mwld -lib -o $@ libmysqld_int.a `echo $(INC_LIB) | sort -u` $(storageobjects)
-else
-		-rm -f libmysqld.a
-		if test "$(host_os)" = "netware" ; \
-		then \
-		  $(libmysqld_a_AR) libmysqld.a $(INC_LIB) libmysqld_int.a $(storageobjects); \
-		else \
-		  current_dir=`pwd`; \
-		  rm -rf tmp; mkdir tmp; \
-		  (for arc in $(INC_LIB) ./libmysqld_int.a; do \
-		    arpath=`echo $$arc|sed 's|[^/]*$$||'|sed 's|\.libs/$$||'`; \
-		    artmp=`echo $$arc|sed 's|^.*/|tmp/lib-|'`; \
-		    for F in `$(AR) t $$arc | grep -v SYMDEF`; do \
-		      if test -e "$$arpath/$$F" ; then echo "$$arpath/$$F"; else \
-		      mkdir $$artmp; cd $$artmp > /dev/null; \
-		      $(AR) x ../../$$arc; \
-		      cd $$current_dir > /dev/null; \
-		      ls $$artmp/* | grep -v SYMDEF; \
-		      continue 2; fi; done; \
-		  done; echo $(libmysqld_a_DEPENDENCIES) ) | sort -u | xargs $(AR) cq libmysqld.a ; \
-		  $(AR) r libmysqld.a $(storageobjects); \
-		  $(RANLIB) libmysqld.a	; \
-		  rm -rf tmp; \
-		fi
-endif
-
-## XXX: any time the client interface changes, we'll need to bump
-## the version info for libmysqld; however, it's possible for the
-## libmysqld interface to change without affecting the standard
-## libmysqlclient interface.  Should we make a separate version
-## string for the two?
-#libmysqld_la_LDFLAGS = -version-info @SHARED_LIB_VERSION@
-#CLEANFILES =		$(libmysqld_la_LIBADD) libmysqld.la
-
-BUILT_SOURCES = link_sources
-
-CLEANFILES = $(BUILT_SOURCES)
-
-link_sources:
-	  for f in $(sqlsources); do \
-	    rm -f $$f; \
-	    if test -e $(top_srcdir)/sql/$$f ; \
-	    then \
-	      @LN_CP_F@ $(top_srcdir)/sql/$$f $$f; \
-	    else \
-	      @LN_CP_F@ $(top_builddir)/sql/$$f $$f; \
-	    fi ; \
-	  done; \
-	  for f in $(libmysqlsources); do \
-	    rm -f $$f; \
-	    if test -e $(top_srcdir)/libmysql/$$f ; \
-	    then \
-	      @LN_CP_F@ $(top_srcdir)/libmysql/$$f $$f; \
-	    else \
-	      @LN_CP_F@ $(top_builddir)/libmysql/$$f $$f; \
-	    fi ; \
-	  done; \
-	  if test -n "$(sqlstoragesources)" ; \
-	  then \
-	    for f in "$(sqlstoragesources)"; do \
-	      rm -f "$$f"; \
-	      @LN_CP_F@ `find $(srcdir)/../sql -name "$$f"` "$$f"; \
-	    done; \
-	  fi; \
-	  if test -n "$(storagesources)" ; \
-	  then \
-	    rm -f $(storagesources); \
-	    for f in $(storagesourceslinks); do \
-	      @LN_CP_F@ $(top_srcdir)/$$f . ; \
-	    done; \
-	  fi; \
-	  rm -f client_settings.h; \
-	  @LN_CP_F@ $(top_srcdir)/libmysql/client_settings.h \
-                                          client_settings.h; \
-	echo timestamp > link_sources
-
-
-clean-local:
-	rm -f `echo $(sqlsources) $(libmysqlsources) $(sqlstoragesources) $(storagesources) | sed "s;\.lo;.c;g"`; \
-	rm -f client_settings.h
+# Copyright (C) 2001-2006 MySQL AB
+# 
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; version 2
+# of the License.
+# 
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Library General Public License for more details.
+# 
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+#
+# This file is public domain and comes with NO WARRANTY of any kind
+
+MYSQLDATAdir =		$(localstatedir)
+MYSQLSHAREdir =		$(pkgdatadir)
+MYSQLBASEdir=		$(prefix)
+MYSQLLIBdir=            $(libdir)
+pkgplugindir =		$(pkglibdir)/plugin
+
+EXTRA_DIST =		libmysqld.def CMakeLists.txt
+DEFS =			-DEMBEDDED_LIBRARY -DMYSQL_SERVER \
+			-DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \
+			-DDATADIR="\"$(MYSQLDATAdir)\"" \
+			-DSHAREDIR="\"$(MYSQLSHAREdir)\"" \
+			@DEFS@ \
+			-DLIBDIR="\"$(MYSQLLIBdir)\"" \
+			-DPLUGINDIR="\"$(pkgplugindir)\""
+AM_CPPFLAGS =		-I$(top_srcdir)/include \
+			-I$(top_builddir)/sql -I$(top_srcdir)/sql \
+			-I$(top_srcdir)/sql/examples \
+			-I$(top_srcdir)/regex \
+			$(openssl_includes) @ZLIB_INCLUDES@ \
+			@condition_dependent_plugin_includes@
+
+noinst_LIBRARIES =	libmysqld_int.a
+pkglib_LIBRARIES =	libmysqld.a
+SUBDIRS =		. examples
+libmysqld_sources=	libmysqld.c lib_sql.cc emb_qcache.cc
+libmysqlsources =	errmsg.c get_password.c libmysql.c client.c pack.c \
+                        my_time.c
+
+noinst_HEADERS =	embedded_priv.h emb_qcache.h
+
+sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
+	     ha_ndbcluster.cc ha_ndbcluster_cond.cc \
+	ha_ndbcluster_connection.cc \
+	ha_ndbcluster_binlog.cc ha_partition.cc \
+	handler.cc sql_handler.cc \
+	hostname.cc init.cc password.c \
+	item.cc item_buff.cc item_cmpfunc.cc item_create.cc \
+	item_func.cc item_strfunc.cc item_sum.cc item_timefunc.cc \
+	item_geofunc.cc item_subselect.cc item_row.cc\
+	item_xmlfunc.cc \
+	sha2.cc des_key_file.cc \
+	key.cc lock.cc log.cc sql_state.c \
+	log_event.cc rpl_record.cc \
+	log_event_old.cc rpl_record_old.cc \
+	protocol.cc net_serv.cc opt_range.cc \
+	opt_sum.cc procedure.cc records.cc sql_acl.cc \
+	sql_load.cc discover.cc sql_locale.cc \
+	sql_profile.cc \
+	sql_analyse.cc sql_base.cc sql_cache.cc sql_class.cc \
+	sql_crypt.cc sql_db.cc sql_delete.cc sql_error.cc sql_insert.cc \
+        sql_join_cache.cc \
+	sql_lex.cc sql_list.cc sql_manager.cc sql_map.cc \
+	scheduler.cc sql_connect.cc sql_parse.cc \
+	sql_prepare.cc sql_derived.cc sql_rename.cc \
+	sql_select.cc sql_do.cc sql_show.cc set_var.cc \
+	sql_string.cc sql_table.cc sql_test.cc sql_udf.cc \
+	sql_update.cc sql_yacc.cc table.cc thr_malloc.cc time.cc \
+	unireg.cc uniques.cc sql_union.cc hash_filo.cc \
+	spatial.cc gstream.cc sql_help.cc tztime.cc sql_cursor.cc \
+	sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc sp_rcontext.cc \
+	parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \
+	rpl_filter.cc sql_partition.cc sql_builtin.cc sql_plugin.cc \
+	debug_sync.cc sql_tablespace.cc transaction.cc \
+	rpl_injector.cc my_user.c partition_info.cc \
+	sql_servers.cc bml.cc si_objects.cc sql_audit.cc \
+	event_parse_data.cc mdl.cc sql_signal.cc \
+        rpl_handler.cc
+
+libmysqld_int_a_SOURCES= $(libmysqld_sources)
+nodist_libmysqld_int_a_SOURCES= $(libmysqlsources) $(sqlsources)
+libmysqld_a_SOURCES=
+
+sqlstoragesources =	$(EXTRA_libmysqld_a_SOURCES)
+storagesources = @condition_dependent_plugin_modules@
+storageobjects = @condition_dependent_plugin_objects@
+storagesourceslinks = @condition_dependent_plugin_links@
+
+# automake misses these
+sql_yacc.cc sql_yacc.h: $(top_srcdir)/sql/sql_yacc.yy
+
+# The following libraries should be included in libmysqld.a
+INC_LIB=	$(top_builddir)/regex/libregex.a \
+		$(top_builddir)/mysys/.libs/libmysys.a \
+		$(top_builddir)/strings/.libs/libmystrings.a \
+		$(top_builddir)/dbug/.libs/libdbug.a \
+		$(top_builddir)/vio/libvio.a \
+                @NDB_SCI_LIBS@ \
+		@mysql_plugin_libs@ \
+		$(yassl_inc_libs)
+
+if HAVE_YASSL
+yassl_inc_libs=	$(top_builddir)/extra/yassl/src/.libs/libyassl.a \
+		$(top_builddir)/extra/yassl/taocrypt/src/.libs/libtaocrypt.a
+endif
+
+# Storage engine specific compilation options
+ha_ndbcluster.o:ha_ndbcluster.cc
+		$(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
+
+ha_ndbcluster_cond.o:ha_ndbcluster_cond.cc
+		$(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
+
+ha_ndbcluster_binlog.o: ha_ndbcluster_binlog.cc
+		$(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
+
+ha_ndbcluster_connection.o: ha_ndbcluster_connection.cc
+		$(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
+
+# Until we can remove dependency on ha_ndbcluster.h
+handler.o:	handler.cc
+		$(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
+
+# We need rules to compile these as no good way
+# found to append fileslists that collected by configure
+# to the sources list
+
+ha_federated.o:ha_federated.cc
+		$(CXXCOMPILE) $(LM_CFLAGS) -c $<
+
+ha_heap.o:ha_heap.cc
+		$(CXXCOMPILE) $(LM_CFLAGS) -c $<
+
+ha_innodb.o:ha_innodb.cc
+		$(CXXCOMPILE) $(LM_CFLAGS) -c $<
+
+ha_myisam.o:ha_myisam.cc
+		$(CXXCOMPILE) $(LM_CFLAGS) -c $<
+
+ha_myisammrg.o:ha_myisammrg.cc
+		$(CXXCOMPILE) $(LM_CFLAGS) -c $<
+
+#
+# To make it easy for the end user to use the embedded library we
+# generate a total libmysqld.a from all library files,
+
+# note - InnoDB libraries have circular dependencies, so in INC_LIB
+# few libraries are present two times. Metrowerks linker doesn't like
+# it at all. Traditional ar has no problems with it, but still there's no
+# need to add the same file twice to the library, so 'sort -u' save us
+# some time and spares unnecessary work.
+
+libmysqld.a:	libmysqld_int.a $(INC_LIB) $(libmysqld_a_DEPENDENCIES) $(storageobjects)
+if DARWIN_MWCC
+	mwld -lib -o $@ libmysqld_int.a `echo $(INC_LIB) | sort -u` $(storageobjects)
+else
+		-rm -f libmysqld.a
+		if test "$(host_os)" = "netware" ; \
+		then \
+		  $(libmysqld_a_AR) libmysqld.a $(INC_LIB) libmysqld_int.a $(storageobjects); \
+		else \
+		  current_dir=`pwd`; \
+		  rm -rf tmp; mkdir tmp; \
+		  (for arc in $(INC_LIB) ./libmysqld_int.a; do \
+		    arpath=`echo $$arc|sed 's|[^/]*$$||'|sed 's|\.libs/$$||'`; \
+		    artmp=`echo $$arc|sed 's|^.*/|tmp/lib-|'`; \
+		    for F in `$(AR) t $$arc | grep -v SYMDEF`; do \
+		      if test -e "$$arpath/$$F" ; then echo "$$arpath/$$F"; else \
+		      mkdir $$artmp; cd $$artmp > /dev/null; \
+		      $(AR) x ../../$$arc; \
+		      cd $$current_dir > /dev/null; \
+		      ls $$artmp/* | grep -v SYMDEF; \
+		      continue 2; fi; done; \
+		  done; echo $(libmysqld_a_DEPENDENCIES) ) | sort -u | xargs $(AR) cq libmysqld.a ; \
+		  $(AR) r libmysqld.a $(storageobjects); \
+		  $(RANLIB) libmysqld.a	; \
+		  rm -rf tmp; \
+		fi
+endif
+
+## XXX: any time the client interface changes, we'll need to bump
+## the version info for libmysqld; however, it's possible for the
+## libmysqld interface to change without affecting the standard
+## libmysqlclient interface.  Should we make a separate version
+## string for the two?
+#libmysqld_la_LDFLAGS = -version-info @SHARED_LIB_VERSION@
+#CLEANFILES =		$(libmysqld_la_LIBADD) libmysqld.la
+
+BUILT_SOURCES = link_sources
+
+CLEANFILES = $(BUILT_SOURCES)
+
+link_sources:
+	  for f in $(sqlsources); do \
+	    rm -f $$f; \
+	    if test -e $(top_srcdir)/sql/$$f ; \
+	    then \
+	      @LN_CP_F@ $(top_srcdir)/sql/$$f $$f; \
+	    else \
+	      @LN_CP_F@ $(top_builddir)/sql/$$f $$f; \
+	    fi ; \
+	  done; \
+	  for f in $(libmysqlsources); do \
+	    rm -f $$f; \
+	    if test -e $(top_srcdir)/libmysql/$$f ; \
+	    then \
+	      @LN_CP_F@ $(top_srcdir)/libmysql/$$f $$f; \
+	    else \
+	      @LN_CP_F@ $(top_builddir)/libmysql/$$f $$f; \
+	    fi ; \
+	  done; \
+	  if test -n "$(sqlstoragesources)" ; \
+	  then \
+	    for f in "$(sqlstoragesources)"; do \
+	      rm -f "$$f"; \
+	      @LN_CP_F@ `find $(srcdir)/../sql -name "$$f"` "$$f"; \
+	    done; \
+	  fi; \
+	  if test -n "$(storagesources)" ; \
+	  then \
+	    rm -f $(storagesources); \
+	    for f in $(storagesourceslinks); do \
+	      @LN_CP_F@ $(top_srcdir)/$$f . ; \
+	    done; \
+	  fi; \
+	  rm -f client_settings.h; \
+	  @LN_CP_F@ $(top_srcdir)/libmysql/client_settings.h \
+                                          client_settings.h; \
+	echo timestamp > link_sources
+
+
+clean-local:
+	rm -f `echo $(sqlsources) $(libmysqlsources) $(sqlstoragesources) $(storagesources) | sed "s;\.lo;.c;g"`; \
+	rm -f client_settings.h

=== added directory 'libservices'
=== added file 'libservices/CMakeLists.txt'
--- a/libservices/CMakeLists.txt	1970-01-01 00:00:00 +0000
+++ b/libservices/CMakeLists.txt	2009-05-05 18:58:20 +0000
@@ -0,0 +1,20 @@
+# Copyright (C) 2006 MySQL AB
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
+
+SET(LIBSERVICES_SOURCES my_snprintf_service.c thd_alloc_service.c)
+
+ADD_LIBRARY(libservices ${LIBSERVICES_SOURCES})

=== added file 'libservices/Makefile.am'
--- a/libservices/Makefile.am	1970-01-01 00:00:00 +0000
+++ b/libservices/Makefile.am	2009-05-06 10:55:56 +0000
@@ -0,0 +1,19 @@
+# Copyright 2009 Sun Microsystems, Inc.
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+AM_CPPFLAGS =		-I$(top_srcdir)/include
+pkglib_LIBRARIES =	libmysqlservices.a
+libmysqlservices_a_SOURCES =  my_snprintf_service.c thd_alloc_service.c
+EXTRA_DIST = CMakeLists.txt

=== added file 'libservices/my_snprintf_service.c'
--- a/libservices/my_snprintf_service.c	1970-01-01 00:00:00 +0000
+++ b/libservices/my_snprintf_service.c	2009-05-06 18:17:49 +0000
@@ -0,0 +1,17 @@
+/* Copyright (C) 2009 Sun Microsystems, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; version 2 of the License.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+#include <service_versions.h>
+SERVICE_VERSION my_snprintf_service= (void*)VERSION_my_snprintf;

=== added file 'libservices/thd_alloc_service.c'
--- a/libservices/thd_alloc_service.c	1970-01-01 00:00:00 +0000
+++ b/libservices/thd_alloc_service.c	2009-05-06 18:17:49 +0000
@@ -0,0 +1,17 @@
+/* Copyright (C) 2009 Sun Microsystems, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; version 2 of the License.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+#include <service_versions.h>
+SERVICE_VERSION thd_alloc_servicee= (void*)VERSION_thd_alloc;

=== added file 'mysql-test/collections/mysql-6.0-maria.push'
--- a/mysql-test/collections/mysql-6.0-maria.push	1970-01-01 00:00:00 +0000
+++ b/mysql-test/collections/mysql-6.0-maria.push	2009-04-28 06:27:19 +0000
@@ -0,0 +1,7 @@
+perl mysql-test-run.pl --comment=n_mix                            --mysqld=--binlog-format=mixed                                                --suite=main,backup,backup_engines,backup_ptr,binlog,federated,rpl,maria  --experimental=collections/default.experimental --timer --force 
+perl mysql-test-run.pl --comment=ps_row            --ps-protocol  --mysqld=--binlog-format=row                                                  --suite=main,backup,backup_engines,backup_ptr,binlog,federated,rpl,maria  --experimental=collections/default.experimental --timer --force 
+perl mysql-test-run.pl --comment=embedded          --embedded                                                                                   --suite=main,backup,backup_engines,backup_ptr,binlog,federated,rpl,maria  --experimental=collections/default.experimental --timer --force 
+perl mysql-test-run.pl --comment=rpl_binlog_row                   --mysqld=--binlog-format=row                                                  --suite=rpl,binlog                                                        --experimental=collections/default.experimental --timer --force 
+perl mysql-test-run.pl --comment=funcs_1                                                                                                        --suite=funcs_1                                                           --experimental=collections/default.experimental --timer --force 
+perl mysql-test-run.pl --comment=ps_stm_threadpool --ps-protocol  --mysqld=--binlog-format=statement --mysqld=--thread-handling=pool-of-threads --suite=main,backup,backup_engines,backup_ptr,binlog,federated,rpl,maria  --experimental=collections/default.experimental --timer --force 
+perl mysql-test-run.pl --comment=falcon                                                                                                         --suite=falcon                                                            --experimental=collections/default.experimental --timer --force 

=== added file 'mysql-test/collections/mysql-6.0-runtime.push'
--- a/mysql-test/collections/mysql-6.0-runtime.push	1970-01-01 00:00:00 +0000
+++ b/mysql-test/collections/mysql-6.0-runtime.push	2009-04-22 09:22:10 +0000
@@ -0,0 +1,8 @@
+perl mysql-test-run.pl --comment=n_mix                            --mysqld=--binlog-format=mixed                                                --suite=main,backup,backup_engines,backup_ptr,binlog,federated,rpl,maria  --experimental=collections/default.experimental --timer --force 
+perl mysql-test-run.pl --comment=ps_row            --ps-protocol  --mysqld=--binlog-format=row                                                  --suite=main,backup,backup_engines,backup_ptr,binlog,federated,rpl,maria  --experimental=collections/default.experimental --timer --force 
+perl mysql-test-run.pl --comment=embedded          --embedded                                                                                   --suite=main,backup,backup_engines,backup_ptr,binlog,federated,rpl,maria  --experimental=collections/default.experimental --timer --force 
+perl mysql-test-run.pl --comment=rpl_binlog_row                   --mysqld=--binlog-format=row                                                  --suite=rpl,binlog                                                        --experimental=collections/default.experimental --timer --force 
+perl mysql-test-run.pl --comment=funcs_1                                                                                                        --suite=funcs_1                                                           --experimental=collections/default.experimental --timer --force 
+perl mysql-test-run.pl --comment=ps_stm_threadpool --ps-protocol  --mysqld=--binlog-format=statement --mysqld=--thread-handling=pool-of-threads --suite=main,backup,backup_engines,backup_ptr,binlog,federated,rpl,maria  --experimental=collections/default.experimental --timer --force 
+perl mysql-test-run.pl --comment=falcon                                                                                                         --suite=falcon                                                            --experimental=collections/default.experimental --timer --force 
+

=== added file 'mysql-test/r/drop_debug.result'
--- a/mysql-test/r/drop_debug.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/drop_debug.result	2009-05-07 11:15:54 +0000
@@ -0,0 +1,25 @@
+
+# --
+# -- Bug#43138: DROP DATABASE failure does not clean up message list.
+# --
+
+DROP DATABASE IF EXISTS mysql_test;
+
+CREATE DATABASE mysql_test;
+CREATE TABLE mysql_test.t1(a INT);
+CREATE TABLE mysql_test.t2(b INT);
+CREATE TABLE mysql_test.t3(c INT);
+
+SET SESSION DEBUG = "+d,bug43138";
+
+DROP DATABASE mysql_test;
+Warnings:
+Error	1051	Unknown table 't1'
+Error	1051	Unknown table 't2'
+Error	1051	Unknown table 't3'
+
+SET SESSION DEBUG = "-d,bug43138";
+
+# --
+# -- End of Bug#43138.
+# --

=== modified file 'mysql-test/r/log_state.result'
--- a/mysql-test/r/log_state.result	2009-01-26 16:32:29 +0000
+++ b/mysql-test/r/log_state.result	2009-03-31 16:47:35 +0000
@@ -311,6 +311,30 @@ SET @@global.general_log_file = @old_gen
 SET @@global.slow_query_log = @old_slow_query_log;
 SET @@global.slow_query_log_file = @old_slow_query_log_file;
 End of 5.1 tests
+
+# --
+# -- Bug#38124: "general_log_file" variable silently unset when
+# --             using expression
+# --
+SET GLOBAL general_log_file = DEFAULT;
+SELECT @@general_log_file INTO @my_glf;
+SET GLOBAL general_log_file = 'BUG38124.LOG';
+SELECT @@general_log_file;
+@@general_log_file
+BUG38124.LOG
+SET GLOBAL general_log_file = concat('BUG38124-2.LOG');
+SELECT @@general_log_file;
+@@general_log_file
+BUG38124-2.LOG
+SET GLOBAL general_log_file = substr('BUG38124-2.LOG',3,6);
+SELECT @@general_log_file;
+@@general_log_file
+G38124
+SET GLOBAL general_log_file = DEFAULT;
+SELECT @@general_log_file = @my_glf;
+@@general_log_file = @my_glf
+1
+SET GLOBAL general_log_file = @old_general_log_file;
 # Close connection con1
 SET global general_log = @old_general_log;
 SET global general_log_file = @old_general_log_file;

=== added file 'mysql-test/r/log_state_bug33693.result'
--- a/mysql-test/r/log_state_bug33693.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/log_state_bug33693.result	2009-04-01 18:00:07 +0000
@@ -0,0 +1,3 @@
+SELECT INSTR(@@general_log_file, 'MYSQLTEST_VARDIR/run');;
+INSTR(@@general_log_file, 'MYSQLTEST_VARDIR/run')
+0

=== modified file 'mysql-test/r/lowercase_table2.result'
--- a/mysql-test/r/lowercase_table2.result	2006-06-14 05:54:56 +0000
+++ b/mysql-test/r/lowercase_table2.result	2009-05-15 08:00:35 +0000
@@ -174,3 +174,79 @@ TABLE_SCHEMA	TABLE_NAME
 mysqltest_LC2	myUC
 use test;
 drop database mysqltest_LC2;
+# End of 5.1 tests
+#
+# Test for bug #44738 "fill_schema_table_from_frm() opens tables without
+# lowercasing table name". Due to not properly normalizing table names
+# in lower_case_table_names modes in this function queries to I_S which
+# were executed through it left entries with incorrect key in table
+# definition cache. This issue combined with a similar problem in
+# CREATE TABLE (it also has peeked into table definition cache using
+# non-normalized key) led to spurious ER_TABLE_EXISTS_ERROR errors
+# when one tried to create table with the same name as a previously
+# existing but dropped table.
+#
+drop database if exists mysqltest_UPPERCASE;
+drop table if exists t_bug44738_UPPERCASE;
+create database mysqltest_UPPERCASE;
+use mysqltest_UPPERCASE;
+create table t_bug44738_UPPERCASE (i int);
+# Ensure that we don't have any leftovers in table definition
+# cache from previous tests.
+flush tables;
+# There should be no entries for our table in table definition cache
+show open tables like 't_bug44738_%';
+Database	Table	In_use	Name_locked
+select table_schema, table_name, table_comment from information_schema.tables
+where table_schema like 'mysqltest_%' and table_name like 't_bug44738_%';
+table_schema	table_name	table_comment
+mysqltest_UPPERCASE	t_bug44738_UPPERCASE	
+# Due to --lower-case-table-names > 0 mode database and table name for
+# TDC entry for our table should be 'normalized' (i.e. lowercased).
+show open tables like 't_bug44738_%';
+Database	Table	In_use	Name_locked
+mysqltest_uppercase	t_bug44738_uppercase	0	0
+drop table t_bug44738_UPPERCASE;
+# After DROP TABLE this entry should be removed.
+show open tables like 't_bug44738_%';
+Database	Table	In_use	Name_locked
+drop database mysqltest_UPPERCASE;
+use test;
+# Let us check that the original test case which led to discovery
+# of this problem also works.
+create table t_bug44738_UPPERCASE (i int);
+select table_schema, table_name, table_comment from information_schema.tables
+where table_schema = 'test' and table_name like 't_bug44738_%';
+table_schema	table_name	table_comment
+test	t_bug44738_UPPERCASE	
+drop table t_bug44738_UPPERCASE;
+# Check that after the above DROP TABLE there are no entries in TDC
+# which correspond to our table.
+show open tables like 't_bug44738_%';
+Database	Table	In_use	Name_locked
+# Therefore the below statement should succeed.
+create table t_bug44738_UPPERCASE (i int);
+drop table t_bug44738_UPPERCASE;
+# Finally, let us check that another issue which was exposed by
+# the original test case is solved. I.e. that fuse in CREATE TABLE
+# which ensures that table is not created if there is an entry for
+# it in TDC even though it was removed from disk uses normalized
+# version of the table name.
+create table t_bug44738_UPPERCASE (i int) engine = myisam;
+# Load table definition in TDC.
+select table_schema, table_name, table_comment from information_schema.tables
+where table_schema = 'test' and table_name like 't_bug44738_%';
+table_schema	table_name	table_comment
+test	t_bug44738_UPPERCASE	
+# Simulate manual removal of the table.
+# Check that still there is an entry for table in TDC.
+show open tables like 't_bug44738_%';
+Database	Table	In_use	Name_locked
+test	t_bug44738_uppercase	0	0
+# So attempt to create table with the same name should fail.
+create table t_bug44738_UPPERCASE (i int);
+ERROR 42S01: Table 't_bug44738_uppercase' already exists
+# And should succeed after FLUSH TABLES.
+flush tables;
+create table t_bug44738_UPPERCASE (i int);
+drop table t_bug44738_UPPERCASE;

=== modified file 'mysql-test/r/mysqltest.result'
--- a/mysql-test/r/mysqltest.result	2009-03-06 20:33:52 +0000
+++ b/mysql-test/r/mysqltest.result	2009-04-01 08:16:35 +0000
@@ -545,6 +545,8 @@ mysqltest: At line 1: Failed to open fil
 mysqltest: At line 1: Missing required argument 'filename' to command 'file_exists'
 mysqltest: At line 1: Missing required argument 'from_file' to command 'copy_file'
 mysqltest: At line 1: Missing required argument 'to_file' to command 'copy_file'
+mysqltest: At line 1: Missing required argument 'from_file' to command 'move_file'
+mysqltest: At line 1: Missing required argument 'to_file' to command 'move_file'
 mysqltest: At line 1: Missing required argument 'mode' to command 'chmod'
 mysqltest: At line 1: You must write a 4 digit octal number for mode
 mysqltest: At line 1: You must write a 4 digit octal number for mode

=== modified file 'mysql-test/r/parser.result'
--- a/mysql-test/r/parser.result	2009-04-17 20:33:59 +0000
+++ b/mysql-test/r/parser.result	2009-05-11 17:58:07 +0000
@@ -623,10 +623,43 @@ UPDATE t3 SET a4={d '1789-07-14'} WHERE 
 SELECT a1, a4 FROM t2 WHERE a4 LIKE {fn UCASE('1789-07-14')};
 a1	a4
 DROP TABLE t1, t2, t3;
+#
+# End of 5.1 tests
+#
 BACKUP DATABASE *, test to 'broken.bak';
 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' test to 'broken.bak'' at line 1
 BACKUP DATABASE *, db1, db2, db3 to 'broken.bak';
 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' db1, db2, db3 to 'broken.bak'' at line 1
-#
-# End of 5.1 tests
-#
+# Should use myisam
+create logfile group ndb_lg1 add undofile 'ndb_undo1' initial_size=32M;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+create logfile group ndb_lg1 add undofile 'ndb_undo1' engine=myisam;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+create logfile group ndb_lg1 add undofile 'ndb_undo1';
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+create tablespace ndb_ts1 add datafile 'ndb_ts1.dat' use logfile group ndb_lg1 engine=myisam initial_size=32M;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+create tablespace ndb_ts1 add datafile 'ndb_ts1.dat' use logfile group ndb_lg1 engine=myisam;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+create tablespace ndb_ts1 add datafile 'ndb_ts1.dat' use logfile group ndb_lg1;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+alter logfile group ndb_lg1 add undofile 'ndb_undo1' wait;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+alter logfile group ndb_lg1 add undofile 'ndb_undo1' engine=myisam;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+alter logfile group ndb_lg1 add undofile 'ndb_undo1';
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+alter tablespace ndb_ts1 add datafile 'ndb_ts1.dat' initial_size=32M;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+alter tablespace ndb_ts1 add datafile 'ndb_ts1.dat' engine=myisam;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+alter tablespace ndb_ts1 add datafile 'ndb_ts1.dat';
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+drop logfile group ndb_lg1 engine=myisam;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+drop logfile group ndb_lg1;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+drop tablespace ndb_ts1 engine=myisam;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+drop tablespace ndb_ts1;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'

=== modified file 'mysql-test/r/plugin.result'
--- a/mysql-test/r/plugin.result	2009-04-16 15:17:31 +0000
+++ b/mysql-test/r/plugin.result	2009-04-30 16:22:40 +0000
@@ -12,6 +12,15 @@ CREATE TABLE t1(a int) ENGINE=EXAMPLE;
 SELECT * FROM t1;
 a
 DROP TABLE t1;
+set global example_ulong_var=500;
+set global example_enum_var= e1;
+show status like 'example%';
+Variable_name	Value
+example_func_example	enum_var is 0, ulong_var is 500, really
+show variables like 'example%';
+Variable_name	Value
+example_enum_var	e1
+example_ulong_var	500
 UNINSTALL PLUGIN example;
 UNINSTALL PLUGIN EXAMPLE;
 ERROR 42000: PLUGIN EXAMPLE does not exist

=== modified file 'mysql-test/suite/backup/r/backup_logs.result'
--- a/mysql-test/suite/backup/r/backup_logs.result	2009-02-26 22:19:09 +0000
+++ b/mysql-test/suite/backup/r/backup_logs.result	2009-04-30 16:53:50 +0000
@@ -367,9 +367,9 @@ Attempt to set the backup log paths to a
 
 SET global max_allowed_packet=1024*100;
 
-Now attempt to set the backup_progress_log_file to 512 characters.
+Now attempt to set the backup_progress_log_file to 255 characters.
 
-SET @@global.backup_progress_log_file = repeat('a',512);
+SET @@global.backup_progress_log_file = repeat('a',255);
 
 Now attempt to set the backup_progress_log_file to 513 characters.
 
@@ -382,9 +382,9 @@ SET @@global.backup_progress_log_file = 
 ERROR HY000: The path specified for backup_progress_log_file is too long.
 SET @@global.backup_progress_log_file = DEFAULT;
 
-Now attempt to set the backup_history_log_file to 512 characters.
+Now attempt to set the backup_history_log_file to 255 characters.
 
-SET @@global.backup_history_log_file = repeat('a',512);
+SET @@global.backup_history_log_file = repeat('a',255);
 
 Now attempt to set the backup_history_log_file to 513 characters.
 

=== modified file 'mysql-test/suite/backup/t/backup_logs.test'
--- a/mysql-test/suite/backup/t/backup_logs.test	2009-03-09 14:00:03 +0000
+++ b/mysql-test/suite/backup/t/backup_logs.test	2009-04-30 16:53:50 +0000
@@ -479,9 +479,9 @@ BACKUP DATABASE backup_logs to 'backup_l
 SET global max_allowed_packet=1024*100;
 
 --echo
---echo Now attempt to set the backup_progress_log_file to 512 characters.
+--echo Now attempt to set the backup_progress_log_file to 255 characters.
 --echo
-SET @@global.backup_progress_log_file = repeat('a',512);
+SET @@global.backup_progress_log_file = repeat('a',255);
 
 --echo
 --echo Now attempt to set the backup_progress_log_file to 513 characters.
@@ -497,9 +497,9 @@ SET @@global.backup_progress_log_file = 
 SET @@global.backup_progress_log_file = DEFAULT;
 
 --echo
---echo Now attempt to set the backup_history_log_file to 512 characters.
+--echo Now attempt to set the backup_history_log_file to 255 characters.
 --echo
-SET @@global.backup_history_log_file = repeat('a',512);
+SET @@global.backup_history_log_file = repeat('a',255);
 
 --echo
 --echo Now attempt to set the backup_history_log_file to 513 characters.

=== added file 'mysql-test/t/drop_debug.test'
--- a/mysql-test/t/drop_debug.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/drop_debug.test	2009-05-07 11:15:54 +0000
@@ -0,0 +1,38 @@
+# 
+# DROP-related tests which execution requires debug server.
+#
+--source include/have_debug.inc
+
+###########################################################################
+--echo
+--echo # --
+--echo # -- Bug#43138: DROP DATABASE failure does not clean up message list.
+--echo # --
+--echo
+
+--disable_warnings
+DROP DATABASE IF EXISTS mysql_test;
+--enable_warnings
+
+--echo
+CREATE DATABASE mysql_test;
+CREATE TABLE mysql_test.t1(a INT);
+CREATE TABLE mysql_test.t2(b INT);
+CREATE TABLE mysql_test.t3(c INT);
+
+--echo
+SET SESSION DEBUG = "+d,bug43138";
+
+--echo
+--sorted_result
+DROP DATABASE mysql_test;
+
+--echo
+SET SESSION DEBUG = "-d,bug43138";
+
+--echo
+--echo # --
+--echo # -- End of Bug#43138.
+--echo # --
+
+###########################################################################

=== modified file 'mysql-test/t/log_state.test'
--- a/mysql-test/t/log_state.test	2009-01-26 16:32:29 +0000
+++ b/mysql-test/t/log_state.test	2009-04-01 18:00:07 +0000
@@ -1,16 +1,5 @@
 ### t/log_state.test ###
 #
-# This test suffers from server
-# Bug#38124 "general_log_file" variable silently unset when using expression
-# In short:
-#    SET GLOBAL general_log_file = @<whatever>
-#    SET GLOBAL slow_query_log = @<whatever>
-# cause that the value of these server system variables is set to default
-# instead of the assigned values. There comes no error message or warning.
-# If this bug is fixed please
-# 1. try this test with "let $fixed_bug38124 = 0;"
-# 2. remove all workarounds if 1. was successful.
-let $fixed_bug38124 = 0;
 
 --source include/not_embedded.inc
 --source include/have_csv.inc
@@ -166,16 +155,6 @@ SET @@global.general_log = @old_general_
 SET @@global.general_log_file = @old_general_log_file;
 SET @@global.slow_query_log = @old_slow_query_log;
 SET @@global.slow_query_log_file = @old_slow_query_log_file;
-if(!$fixed_bug38124)
-{
-   --disable_query_log
-   let $my_var = `SELECT @old_general_log_file`;
-   eval SET @@global.general_log_file = '$my_var';
-   let $my_var = `SELECT @old_slow_query_log_file`;
-   eval SET @@global.slow_query_log_file = '$my_var';
-   --enable_query_log
-}
-
 
 ###########################################################################
 
@@ -278,15 +257,6 @@ SET GLOBAL slow_query_log_file= NULL;
 # Reset to initial values in case a setting above was successful.
 SET GLOBAL general_log_file= @old_general_log_file;
 SET GLOBAL slow_query_log_file= @old_slow_query_log_file;
-if(!$fixed_bug38124)
-{
-   --disable_query_log
-   let $my_var = `SELECT @old_general_log_file`;
-   eval SET @@global.general_log_file = '$my_var';
-   let $my_var = `SELECT @old_slow_query_log_file`;
-   eval SET @@global.slow_query_log_file = '$my_var';
-   --enable_query_log
-}
 
 ###########################################################################
 
@@ -308,15 +278,6 @@ show variables like 'slow_query_log_file
 --echo
 SET GLOBAL general_log_file = @old_general_log_file;
 SET GLOBAL slow_query_log_file = @old_slow_query_log_file;
-if(!$fixed_bug38124)
-{
-   --disable_query_log
-   let $my_var = `SELECT @old_general_log_file`;
-   eval SET @@global.general_log_file = '$my_var';
-   let $my_var = `SELECT @old_slow_query_log_file`;
-   eval SET @@global.slow_query_log_file = '$my_var';
-   --enable_query_log
-}
 
 --echo
 --echo # -- End of Bug#32748.
@@ -352,19 +313,43 @@ SET @@global.general_log = @old_general_
 SET @@global.general_log_file = @old_general_log_file;
 SET @@global.slow_query_log = @old_slow_query_log;
 SET @@global.slow_query_log_file = @old_slow_query_log_file;
-if(!$fixed_bug38124)
-{
-   --disable_query_log
-   let $my_var = `SELECT @old_general_log_file`;
-   eval SET @@global.general_log_file = '$my_var';
-   let $my_var = `SELECT @old_slow_query_log_file`;
-   eval SET @@global.slow_query_log_file = '$my_var';
-   --enable_query_log
-}
-
 
 --echo End of 5.1 tests
 
+
+###########################################################################
+
+--echo
+--echo # --
+--echo # -- Bug#38124: "general_log_file" variable silently unset when
+--echo # --             using expression
+--echo # --
+
+# Store away the special DEFAULT value so we
+# can compare it later, then try to set the
+# general_log_file using different functions
+# and expressions.
+
+SET GLOBAL general_log_file = DEFAULT;
+SELECT @@general_log_file INTO @my_glf;
+
+SET GLOBAL general_log_file = 'BUG38124.LOG';
+SELECT @@general_log_file;
+
+SET GLOBAL general_log_file = concat('BUG38124-2.LOG');
+SELECT @@general_log_file;
+
+SET GLOBAL general_log_file = substr('BUG38124-2.LOG',3,6);
+SELECT @@general_log_file;
+
+SET GLOBAL general_log_file = DEFAULT;
+SELECT @@general_log_file = @my_glf;
+
+
+## Reset to initial values
+SET GLOBAL general_log_file = @old_general_log_file;
+
+
 --enable_ps_protocol
 
 #
@@ -381,17 +366,7 @@ SET global general_log = @old_general_lo
 SET global general_log_file = @old_general_log_file;
 SET global slow_query_log = @old_slow_query_log;
 SET global slow_query_log_file = @old_slow_query_log_file;
-if(!$fixed_bug38124)
-{
-   --disable_query_log
-   let $my_var = `SELECT @old_general_log_file`;
-   eval SET @@global.general_log_file = '$my_var';
-   let $my_var = `SELECT @old_slow_query_log_file`;
-   eval SET @@global.slow_query_log_file = '$my_var';
-   --enable_query_log
-}
 
-# Remove the log files that was created in the "default location"
+# Remove the log file that was created in the "default location"
 # i.e var/run
---remove_file $MYSQLTEST_VARDIR/run/mysqld.log
 --remove_file $MYSQLTEST_VARDIR/tmp/log.master

=== added file 'mysql-test/t/log_state_bug33693-master.opt'
--- a/mysql-test/t/log_state_bug33693-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/log_state_bug33693-master.opt	2009-04-01 18:00:07 +0000
@@ -0,0 +1 @@
+--pid-file=$MYSQLTEST_VARDIR/run/mysqld.1.pid --log=

=== added file 'mysql-test/t/log_state_bug33693.test'
--- a/mysql-test/t/log_state_bug33693.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/log_state_bug33693.test	2009-04-01 18:00:07 +0000
@@ -0,0 +1,18 @@
+### t/log_state_bug33693.test
+#
+# Regression test for bug #33693
+#   "general log name and location depend on PID 
+#    file, not on predefined values"
+#
+# The server is started with a hard-coded 
+# PID file in the $MYSQLTEST_VARDIR/run
+# directory, and an unspecified general log
+# file name.
+#
+# The correct result should show the log file to 
+# rest in the database directory. Unfixed, the 
+# log file will be in the same directory as the
+# PID.
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval SELECT INSTR(@@general_log_file, '$MYSQLTEST_VARDIR/run');

=== modified file 'mysql-test/t/lowercase_table2.test'
--- a/mysql-test/t/lowercase_table2.test	2006-06-06 06:25:31 +0000
+++ b/mysql-test/t/lowercase_table2.test	2009-05-15 08:00:35 +0000
@@ -150,3 +150,76 @@ select TABLE_SCHEMA,TABLE_NAME FROM info
 where TABLE_SCHEMA ='mysqltest_LC2';
 use test;
 drop database mysqltest_LC2;
+
+--echo # End of 5.1 tests
+
+--echo #
+--echo # Test for bug #44738 "fill_schema_table_from_frm() opens tables without
+--echo # lowercasing table name". Due to not properly normalizing table names
+--echo # in lower_case_table_names modes in this function queries to I_S which
+--echo # were executed through it left entries with incorrect key in table
+--echo # definition cache. This issue combined with a similar problem in
+--echo # CREATE TABLE (it also has peeked into table definition cache using
+--echo # non-normalized key) led to spurious ER_TABLE_EXISTS_ERROR errors
+--echo # when one tried to create table with the same name as a previously
+--echo # existing but dropped table.
+--echo #
+--disable_warnings
+drop database if exists mysqltest_UPPERCASE;
+drop table if exists t_bug44738_UPPERCASE;
+--enable_warnings
+create database mysqltest_UPPERCASE;
+use mysqltest_UPPERCASE;
+create table t_bug44738_UPPERCASE (i int);
+--echo # Ensure that we don't have any leftovers in table definition
+--echo # cache from previous tests.
+flush tables;
+--echo # There should be no entries for our table in table definition cache
+show open tables like 't_bug44738_%';
+select table_schema, table_name, table_comment from information_schema.tables
+  where table_schema like 'mysqltest_%' and table_name like 't_bug44738_%';
+--echo # Due to --lower-case-table-names > 0 mode database and table name for
+--echo # TDC entry for our table should be 'normalized' (i.e. lowercased).
+show open tables like 't_bug44738_%';
+drop table t_bug44738_UPPERCASE;
+--echo # After DROP TABLE this entry should be removed.
+show open tables like 't_bug44738_%';
+drop database mysqltest_UPPERCASE;
+use test;
+
+--echo # Let us check that the original test case which led to discovery
+--echo # of this problem also works.
+create table t_bug44738_UPPERCASE (i int);
+select table_schema, table_name, table_comment from information_schema.tables
+  where table_schema = 'test' and table_name like 't_bug44738_%';
+drop table t_bug44738_UPPERCASE;
+--echo # Check that after the above DROP TABLE there are no entries in TDC
+--echo # which correspond to our table.
+show open tables like 't_bug44738_%';
+--echo # Therefore the below statement should succeed.
+create table t_bug44738_UPPERCASE (i int);
+drop table t_bug44738_UPPERCASE;
+
+--echo # Finally, let us check that another issue which was exposed by
+--echo # the original test case is solved. I.e. that fuse in CREATE TABLE
+--echo # which ensures that table is not created if there is an entry for
+--echo # it in TDC even though it was removed from disk uses normalized
+--echo # version of the table name.
+create table t_bug44738_UPPERCASE (i int) engine = myisam;
+--echo # Load table definition in TDC.
+select table_schema, table_name, table_comment from information_schema.tables
+  where table_schema = 'test' and table_name like 't_bug44738_%';
+--echo # Simulate manual removal of the table.
+let $MYSQLD_DATADIR= `select @@datadir`;
+--remove_file $MYSQLD_DATADIR/test/t_bug44738_UPPERCASE.frm
+--remove_file $MYSQLD_DATADIR/test/t_bug44738_UPPERCASE.MYD
+--remove_file $MYSQLD_DATADIR/test/t_bug44738_UPPERCASE.MYI
+--echo # Check that still there is an entry for table in TDC.
+show open tables like 't_bug44738_%';
+--echo # So attempt to create table with the same name should fail.
+--error ER_TABLE_EXISTS_ERROR
+create table t_bug44738_UPPERCASE (i int);
+--echo # And should succeed after FLUSH TABLES.
+flush tables;
+create table t_bug44738_UPPERCASE (i int);
+drop table t_bug44738_UPPERCASE;

=== modified file 'mysql-test/t/myisam-system.test'
--- a/mysql-test/t/myisam-system.test	2007-12-12 17:19:24 +0000
+++ b/mysql-test/t/myisam-system.test	2009-04-30 15:31:30 +0000
@@ -12,11 +12,11 @@ let $MYSQLD_DATADIR= `select @@datadir`;
 drop table if exists t1;
 create table t1 (a int) engine=myisam;
 --remove_file $MYSQLD_DATADIR/test/t1.MYI
---error 1051,6
+--error ER_BAD_TABLE_ERROR,6
 drop table t1;
 create table t1 (a int) engine=myisam;
 --remove_file $MYSQLD_DATADIR/test/t1.MYD
---error 1105,6,29
+--error ER_BAD_TABLE_ERROR,6,29
 drop table t1;
---error 1051
+--error ER_BAD_TABLE_ERROR
 drop table t1;

=== modified file 'mysql-test/t/mysqltest.test'
--- a/mysql-test/t/mysqltest.test	2009-03-06 20:33:52 +0000
+++ b/mysql-test/t/mysqltest.test	2009-04-01 08:16:35 +0000
@@ -1780,6 +1780,56 @@ remove_file $MYSQLTEST_VARDIR/tmp/file2.
 --error 1
 --exec echo "copy_file from_file;" | $MYSQL_TEST 2>&1
 
+
+# ----------------------------------------------------------------------------
+# test for move_file
+# ----------------------------------------------------------------------------
+
+# - Check that if source file does not exist, nothing will be created.
+
+--error 1
+file_exists $MYSQLTEST_VARDIR/tmp/file1.tmp;
+--error 1
+file_exists $MYSQLTEST_VARDIR/tmp/file2.tmp;
+--error 1
+move_file $MYSQLTEST_VARDIR/tmp/file1.tmp $MYSQLTEST_VARDIR/tmp/file2.tmp;
+--error 1
+file_exists $MYSQLTEST_VARDIR/tmp/file1.tmp;
+--error 1
+file_exists $MYSQLTEST_VARDIR/tmp/file2.tmp;
+
+# - Check that if source file exists, everything works properly.
+
+--write_file $MYSQLTEST_VARDIR/tmp/file1.tmp
+file1
+EOF
+
+move_file $MYSQLTEST_VARDIR/tmp/file1.tmp $MYSQLTEST_VARDIR/tmp/file2.tmp;
+--error 1
+file_exists $MYSQLTEST_VARDIR/tmp/file1.tmp;
+file_exists $MYSQLTEST_VARDIR/tmp/file2.tmp;
+
+# - Check that if destination file exists, everything works properly.
+#   (file2.tmp exists from the previous check; file1.tmp needs to be created)
+
+--write_file $MYSQLTEST_VARDIR/tmp/file1.tmp
+file1
+EOF
+
+move_file $MYSQLTEST_VARDIR/tmp/file1.tmp $MYSQLTEST_VARDIR/tmp/file2.tmp;
+--error 1
+file_exists $MYSQLTEST_VARDIR/tmp/file1.tmp;
+file_exists $MYSQLTEST_VARDIR/tmp/file2.tmp;
+remove_file $MYSQLTEST_VARDIR/tmp/file2.tmp;
+
+# - Check usage.
+
+--error 1
+--exec echo "move_file ;" | $MYSQL_TEST 2>&1
+
+--error 1
+--exec echo "move_file from_file;" | $MYSQL_TEST 2>&1
+
 # ----------------------------------------------------------------------------
 # test for chmod
 # ----------------------------------------------------------------------------

=== modified file 'mysql-test/t/parser.test'
--- a/mysql-test/t/parser.test	2009-04-17 20:33:59 +0000
+++ b/mysql-test/t/parser.test	2009-05-11 17:58:07 +0000
@@ -754,6 +754,10 @@ UPDATE t3 SET a4={d '1789-07-14'} WHERE 
 SELECT a1, a4 FROM t2 WHERE a4 LIKE {fn UCASE('1789-07-14')};
 DROP TABLE t1, t2, t3;
 
+--echo #
+--echo # End of 5.1 tests
+--echo #
+
 #
 # Bug#31765 (BACKUP DATABASE broken syntax)
 #
@@ -764,6 +768,46 @@ BACKUP DATABASE *, test to 'broken.bak';
 --error ER_PARSE_ERROR
 BACKUP DATABASE *, db1, db2, db3 to 'broken.bak';
 
---echo #
---echo # End of 5.1 tests
---echo #
+#
+# Bug#31293 - Incorrect parser errors for create/alter/drop logfile group/tablespace
+#
+
+--echo # Should use myisam
+
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+create logfile group ndb_lg1 add undofile 'ndb_undo1' initial_size=32M; 
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+create logfile group ndb_lg1 add undofile 'ndb_undo1' engine=myisam;
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+create logfile group ndb_lg1 add undofile 'ndb_undo1';
+
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+create tablespace ndb_ts1 add datafile 'ndb_ts1.dat' use logfile group ndb_lg1 engine=myisam initial_size=32M;
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+create tablespace ndb_ts1 add datafile 'ndb_ts1.dat' use logfile group ndb_lg1 engine=myisam;
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+create tablespace ndb_ts1 add datafile 'ndb_ts1.dat' use logfile group ndb_lg1;
+
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+alter logfile group ndb_lg1 add undofile 'ndb_undo1' wait;
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+alter logfile group ndb_lg1 add undofile 'ndb_undo1' engine=myisam;
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+alter logfile group ndb_lg1 add undofile 'ndb_undo1';
+
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+alter tablespace ndb_ts1 add datafile 'ndb_ts1.dat' initial_size=32M;
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+alter tablespace ndb_ts1 add datafile 'ndb_ts1.dat' engine=myisam;
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+alter tablespace ndb_ts1 add datafile 'ndb_ts1.dat';
+
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+drop logfile group ndb_lg1 engine=myisam;
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+drop logfile group ndb_lg1;
+
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+drop tablespace ndb_ts1 engine=myisam;
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+drop tablespace ndb_ts1;

=== modified file 'mysql-test/t/plugin.test'
--- a/mysql-test/t/plugin.test	2009-04-22 22:12:25 +0000
+++ b/mysql-test/t/plugin.test	2009-05-04 15:49:30 +0000
@@ -21,6 +21,12 @@ SELECT * FROM t1;
 
 DROP TABLE t1;
 
+# a couple of tests for variables
+set global example_ulong_var=500;
+set global example_enum_var= e1;
+show status like 'example%';
+show variables like 'example%';
+
 UNINSTALL PLUGIN example;
 --error 1305
 UNINSTALL PLUGIN EXAMPLE;

=== removed file 'mysys/make-ccc'
--- a/mysys/make-ccc	2006-09-15 05:29:44 +0000
+++ b/mysys/make-ccc	1970-01-01 00:00:00 +0000
@@ -1,4 +0,0 @@
-rm -f .deps/* raid.o mf_iocache.o libmysys.a
-ccc -DDEFAULT_BASEDIR="\"/usr/local/mysql\"" -DDATADIR="\"/usr/local/mysql/var\"" -DHAVE_CONFIG_H -I./../include -I../include -I.. -DDBUG_OFF -fast -O3 -fomit-frame-pointer -c array.c checksum.c default.c errors.c getopt.c getopt1.c getvar.c hash.c list.c mf_brkhant.c mf_cache.c mf_casecnv.c mf_dirname.c mf_fn_ext.c mf_format.c mf_getdate.c mf_keycache.c mf_loadpath.c mf_pack.c mf_pack2.c mf_path.c mf_qsort.c mf_qsort2.c mf_radix.c mf_reccache.c mf_same.c mf_sort.c mf_soundex.c mf_stripp.c mf_unixpath.c mf_wcomp.c mf_wfile.c mulalloc.c my_alarm.c my_alloc.c my_append.c my_chsize.c my_clock.c my_compress.c my_copy.c my_create.c my_delete.c my_div.c my_error.c my_fopen.c my_fstream.c my_getwd.c my_init.c my_lib.c my_lockmem.c my_malloc.c my_messnc.c my_mkdir.c my_net.c my_once.c my_open.c my_pread.c my_pthread.c my_quick.c my_read.c my_realloc.c my_redel.c my_rename.c my_seek.c my_static.c my_tempnam.c my_thr_init.c my_write.c ptr_cmp.c queues.c safemalloc.c string.c thr_alar!
 m.c thr_lock.c thr_mutex.c thr_rwlock.c tree.c typelib.c
-make raid.o mf_iocache.o my_lock.o
-ar -cr libmysys.a array.o raid.o mf_iocache.o my_lock.o

=== modified file 'mysys/my_getopt.c'
--- a/mysys/my_getopt.c	2009-05-15 13:38:06 +0000
+++ b/mysys/my_getopt.c	2009-05-25 10:10:18 +0000
@@ -27,23 +27,15 @@ typedef void (*init_func_p)(const struct
 static void default_reporter(enum loglevel level, const char *format, ...);
 my_error_reporter my_getopt_error_reporter= &default_reporter;
 
-static int findopt(char *optpat, uint length,
-                   const struct my_option **opt_res,
-                   char **ffname);
-my_bool getopt_compare_strings(const char *s,
-                               const char *t,
-                               uint length);
-static longlong getopt_ll(char *arg, const struct my_option *optp, int *err);
-static ulonglong getopt_ull(char *arg, const struct my_option *optp,
-                            int *err);
-static double getopt_double(char *arg, const struct my_option *optp, int *err);
-static void init_variables(const struct my_option *options,
-                           init_func_p init_one_value);
-static void init_one_value(const struct my_option *opt, uchar* *, longlong);
-static void fini_one_value(const struct my_option *option, uchar* *variable,
-			   longlong value);
-static int setval(const struct my_option *opts, uchar **value, char *argument,
-                  my_bool set_maximum_value);
+static int findopt(char *, uint, const struct my_option **, char **);
+my_bool getopt_compare_strings(const char *, const char *, uint);
+static longlong getopt_ll(char *, const struct my_option *, int *);
+static ulonglong getopt_ull(char *, const struct my_option *, int *);
+static double getopt_double(char *, const struct my_option *, int *);
+static void init_variables(const struct my_option *, init_func_p);
+static void init_one_value(const struct my_option *opt, uchar **, longlong);
+static void fini_one_value(const struct my_option *, uchar **, longlong);
+static int setval(const struct my_option *, uchar **, char *, my_bool);
 static char *check_struct_option(char *cur_arg, char *key_name);
 
 /*

=== modified file 'mysys/my_getsystime.c'
--- a/mysys/my_getsystime.c	2008-05-29 15:44:11 +0000
+++ b/mysys/my_getsystime.c	2009-05-14 21:49:53 +0000
@@ -150,7 +150,7 @@ ulonglong my_micro_time()
     Value in microseconds from some undefined point in time
 */
 
-#define DELTA_FOR_SECONDS LL(500000000)  /* Half a second */
+#define DELTA_FOR_SECONDS 500000000LL  /* Half a second */
 
 ulonglong my_micro_time_and_time(time_t *time_arg)
 {

=== modified file 'mysys/my_pthread.c'
--- a/mysys/my_pthread.c	2008-12-04 21:02:09 +0000
+++ b/mysys/my_pthread.c	2009-04-06 18:36:46 +0000
@@ -494,11 +494,6 @@ int my_pthread_mutex_trylock(pthread_mut
 
 /* Some help functions */
 
-int pthread_no_free(void *not_used __attribute__((unused)))
-{
-  return 0;
-}
-
 int pthread_dummy(int ret)
 {
   return ret;

=== modified file 'mysys/safemalloc.c'
--- a/mysys/safemalloc.c	2009-05-15 13:45:06 +0000
+++ b/mysys/safemalloc.c	2009-05-25 10:10:18 +0000
@@ -186,7 +186,7 @@ void *_mymalloc(size_t size, const char 
   data[size + 3]= MAGICEND3;
   irem->filename= (char *) filename;
   irem->linenum= lineno;
-  irem->datasize= (uint32) size;
+  irem->datasize= size;
   irem->prev=	  NULL;
 
   /* Add this remember structure to the linked list */

=== modified file 'mysys/typelib.c'
--- a/mysys/typelib.c	2008-03-27 18:40:00 +0000
+++ b/mysys/typelib.c	2009-05-14 21:49:53 +0000
@@ -185,7 +185,7 @@ my_ulonglong find_typeset(char *x, TYPEL
     while (*x && *x != field_separator) x++;
     if ((find= find_type(i, lib, 2 | 8) - 1) < 0)
       DBUG_RETURN(0);
-    result|= (ULL(1) << find);
+    result|= (1ULL << find);
   }
   *err= 0;
   DBUG_RETURN(result);

=== modified file 'mysys/waiting_threads.c'
--- a/mysys/waiting_threads.c	2009-02-23 11:55:35 +0000
+++ b/mysys/waiting_threads.c	2009-05-14 21:49:53 +0000
@@ -1072,7 +1072,7 @@ int wt_thd_cond_timedwait(WT_THD *thd, p
     ret= WT_OK;
   rc_unlock(rc);
 
-  set_timespec_time_nsec(timeout, starttime, (*thd->timeout_short)*ULL(1000));
+  set_timespec_time_nsec(timeout, starttime, (*thd->timeout_short)*1000ULL);
   if (ret == WT_TIMEOUT && !thd->killed)
     ret= pthread_cond_timedwait(&rc->cond, mutex, &timeout);
   if (ret == WT_TIMEOUT && !thd->killed)
@@ -1084,7 +1084,7 @@ int wt_thd_cond_timedwait(WT_THD *thd, p
       ret= WT_DEADLOCK;
     else if (*thd->timeout_long > *thd->timeout_short)
     {
-      set_timespec_time_nsec(timeout, starttime, (*thd->timeout_long)*ULL(1000));
+      set_timespec_time_nsec(timeout, starttime, (*thd->timeout_long)*1000ULL);
       if (!thd->killed)
         ret= pthread_cond_timedwait(&rc->cond, mutex, &timeout);
     }

=== modified file 'plugin/daemon_example/Makefile.am'
--- a/plugin/daemon_example/Makefile.am	2009-01-07 10:58:33 +0000
+++ b/plugin/daemon_example/Makefile.am	2009-04-25 21:20:45 +0000
@@ -26,7 +26,7 @@ AM_CPPFLAGS =		-I$(top_srcdir)/include \
 
 EXTRA_LTLIBRARIES =	libdaemon_example.la
 pkgplugin_LTLIBRARIES =	@plugin_daemon_example_shared_target@
-libdaemon_example_la_LDFLAGS =	-module -rpath $(pkgplugindir)
+libdaemon_example_la_LDFLAGS =	-module -rpath $(pkgplugindir) -L$(top_builddir)/libservices -lmysqlservices
 libdaemon_example_la_CPPFLAGS=	$(AM_CPPFLAGS) -DMYSQL_DYNAMIC_PLUGIN
 libdaemon_example_la_SOURCES =	daemon_example.cc
 

=== removed file 'regex/make-ccc'
--- a/regex/make-ccc	2000-07-31 19:29:14 +0000
+++ b/regex/make-ccc	1970-01-01 00:00:00 +0000
@@ -1,3 +0,0 @@
-ccc -DHAVE_CONFIG_H -I. -I. -I.. -I./../include -I../include    -O -DDBUG_OFF -fast -O3 -c regerror.c regcomp.c regexec.c regfree.c reginit.c
-rm libregex.a
-ar -cr libregex.a regerror.o

=== modified file 'scripts/mysqld_safe.sh'
--- a/scripts/mysqld_safe.sh	2009-05-14 02:01:04 +0000
+++ b/scripts/mysqld_safe.sh	2009-05-25 10:10:18 +0000
@@ -155,7 +155,13 @@ parse_arguments() {
   fi
 
   for arg do
-    val=`echo "$arg" | sed -e "s;--[^=]*=;;"`
+    # the parameter after "=", or the whole $arg if no match
+    val=`echo "$arg" | sed -e 's;^--[^=]*=;;'`
+    # what's before "=", or the whole $arg if no match
+    optname=`echo "$arg" | sed -e 's/^\(--[^=]*\)=.*$/\1/'`
+    # replace "_" by "-" ; mysqld_safe must accept "_" like mysqld does.
+    optname_subst=`echo "$optname" | sed 's/_/-/g'`
+    arg=`echo $arg | sed "s/^$optname/$optname_subst/"`
     case "$arg" in
       # these get passed explicitly to mysqld
       --basedir=*) MY_BASEDIR_VERSION="$val" ;;

=== modified file 'sql-common/my_time.c'
--- a/sql-common/my_time.c	2009-02-13 18:07:03 +0000
+++ b/sql-common/my_time.c	2009-05-14 21:49:53 +0000
@@ -22,10 +22,10 @@
 ulonglong log_10_int[20]=
 {
   1, 10, 100, 1000, 10000UL, 100000UL, 1000000UL, 10000000UL,
-  ULL(100000000), ULL(1000000000), ULL(10000000000), ULL(100000000000),
-  ULL(1000000000000), ULL(10000000000000), ULL(100000000000000),
-  ULL(1000000000000000), ULL(10000000000000000), ULL(100000000000000000),
-  ULL(1000000000000000000), ULL(10000000000000000000)
+  100000000ULL, 1000000000ULL, 10000000000ULL, 100000000000ULL,
+  1000000000000ULL, 10000000000000ULL, 100000000000000ULL,
+  1000000000000000ULL, 10000000000000000ULL, 100000000000000000ULL,
+  1000000000000000000ULL, 10000000000000000000ULL
 };
 
 
@@ -1120,7 +1120,7 @@ longlong number_to_datetime(longlong nr,
   bzero((char*) time_res, sizeof(*time_res));
   time_res->time_type=MYSQL_TIMESTAMP_DATE;
 
-  if (nr == LL(0) || nr >= LL(10000101000000))
+  if (nr == 0LL || nr >= 10000101000000LL)
   {
     time_res->time_type=MYSQL_TIMESTAMP_DATETIME;
     goto ok;
@@ -1151,19 +1151,19 @@ longlong number_to_datetime(longlong nr,
 
   time_res->time_type=MYSQL_TIMESTAMP_DATETIME;
 
-  if (nr <= (YY_PART_YEAR-1)*LL(10000000000)+LL(1231235959))
+  if (nr <= (YY_PART_YEAR-1)*10000000000LL+1231235959LL)
   {
-    nr= nr+LL(20000000000000);                   /* YYMMDDHHMMSS, 2000-2069 */
+    nr= nr+20000000000000LL;                   /* YYMMDDHHMMSS, 2000-2069 */
     goto ok;
   }
-  if (nr <  YY_PART_YEAR*LL(10000000000)+ LL(101000000))
+  if (nr <  YY_PART_YEAR*10000000000LL+ 101000000LL)
     goto err;
-  if (nr <= LL(991231235959))
-    nr= nr+LL(19000000000000);		/* YYMMDDHHMMSS, 1970-1999 */
+  if (nr <= 991231235959LL)
+    nr= nr+19000000000000LL;		/* YYMMDDHHMMSS, 1970-1999 */
 
  ok:
-  part1=(long) (nr/LL(1000000));
-  part2=(long) (nr - (longlong) part1*LL(1000000));
+  part1=(long) (nr/1000000LL);
+  part2=(long) (nr - (longlong) part1*1000000LL);
   time_res->year=  (int) (part1/10000L);  part1%=10000L;
   time_res->month= (int) part1 / 100;
   time_res->day=   (int) part1 % 100;
@@ -1179,11 +1179,11 @@ longlong number_to_datetime(longlong nr,
 
   /* Don't want to have was_cut get set if NO_ZERO_DATE was violated. */
   if (!nr && (flags & TIME_NO_ZERO_DATE))
-    return LL(-1);
+    return -1LL;
 
  err:
   *was_cut= 1;
-  return LL(-1);
+  return -1LL;
 }
 
 
@@ -1193,7 +1193,7 @@ ulonglong TIME_to_ulonglong_datetime(con
 {
   return ((ulonglong) (my_time->year * 10000UL +
                        my_time->month * 100UL +
-                       my_time->day) * ULL(1000000) +
+                       my_time->day) * 1000000ULL +
           (ulonglong) (my_time->hour * 10000UL +
                        my_time->minute * 100UL +
                        my_time->second));
@@ -1254,7 +1254,7 @@ ulonglong TIME_to_ulonglong(const MYSQL_
     return TIME_to_ulonglong_time(my_time);
   case MYSQL_TIMESTAMP_NONE:
   case MYSQL_TIMESTAMP_ERROR:
-    return ULL(0);
+    return 0ULL;
   default:
     DBUG_ASSERT(0);
   }

=== modified file 'sql-common/pack.c'
--- a/sql-common/pack.c	2007-08-13 13:11:25 +0000
+++ b/sql-common/pack.c	2009-05-14 21:49:53 +0000
@@ -87,8 +87,6 @@ my_ulonglong net_field_length_ll(uchar *
 
   NOTES
     This is mostly used to store lengths of strings.
-    We have to cast the result for the LL() becasue of a bug in Forte CC
-    compiler.
 
   RETURN
    Position in 'pkg' after the packed length
@@ -96,19 +94,19 @@ my_ulonglong net_field_length_ll(uchar *
 
 uchar *net_store_length(uchar *packet, ulonglong length)
 {
-  if (length < (ulonglong) LL(251))
+  if (length < 251ULL)
   {
     *packet=(uchar) length;
     return packet+1;
   }
   /* 251 is reserved for NULL */
-  if (length < (ulonglong) LL(65536))
+  if (length < 65536ULL)
   {
     *packet++=252;
     int2store(packet,(uint) length);
     return packet+2;
   }
-  if (length < (ulonglong) LL(16777216))
+  if (length < 16777216ULL)
   {
     *packet++=253;
     int3store(packet,(ulong) length);

=== modified file 'sql/CMakeLists.txt'
--- a/sql/CMakeLists.txt	2009-05-15 13:45:06 +0000
+++ b/sql/CMakeLists.txt	2009-05-25 10:10:18 +0000
@@ -47,7 +47,7 @@ SET (SQL_SOURCE
                ../sql-common/client.c derror.cc des_key_file.cc
                discover.cc ../libmysql/errmsg.c field.cc field_conv.cc
                filesort.cc gstream.cc sha2.cc ha_partition.cc
-               handler.cc hash_filo.cc hash_filo.h 
+               handler.cc hash_filo.cc hash_filo.h sql_plugin_services.h
                hostname.cc init.cc item.cc item_buff.cc item_cmpfunc.cc 
                item_create.cc item_func.cc item_geofunc.cc item_row.cc 
                item_strfunc.cc item_subselect.cc item_sum.cc item_timefunc.cc 

=== modified file 'sql/Makefile.am'
--- a/sql/Makefile.am	2009-05-15 13:45:06 +0000
+++ b/sql/Makefile.am	2009-05-25 10:10:18 +0000
@@ -1,245 +1,245 @@
-# Copyright (C) 2000-2006 MySQL AB
-# 
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-# 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-# 
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-#called from the top level Makefile
-
-MYSQLDATAdir =		$(localstatedir)
-MYSQLSHAREdir =		$(pkgdatadir)
-MYSQLBASEdir=		$(prefix)
-MYSQLLIBdir=            $(pkglibdir)
-pkgplugindir =		$(pkglibdir)/plugin
-AM_CPPFLAGS =		@ZLIB_INCLUDES@ \
-			-I$(top_srcdir)/include \
-			-I$(top_srcdir)/regex $(openssl_includes) \
-			$(libevent_includes)
-WRAPLIBS=		@WRAPLIBS@
-SUBDIRS =		share backup
-libexec_PROGRAMS =	mysqld
-EXTRA_PROGRAMS =	gen_lex_hash
-bin_PROGRAMS =		mysql_tzinfo_to_sql
-DTRACE =                @DTRACE@
-DTRACEFLAGS =           @DTRACEFLAGS@
-DTRACEFILES =           filesort.o \
-			handler.o \
-			mysqld.o \
-			net_serv.o \
-			scheduler.o \
-			sp_head.o \
-			sql_cache.o \
-			sql_connect.o \
-			sql_cursor.o \
-			sql_delete.o \
-			sql_insert.o \
-			sql_parse.o \
-			sql_prepare.o \
-			sql_select.o \
-			sql_update.o
-
-noinst_LTLIBRARIES=	libndb.la \
-			udf_example.la
-
-SUPPORTING_LIBS =	$(top_builddir)/vio/libvio.a \
-			$(top_builddir)/mysys/libmysyswrap.la \
-			$(top_builddir)/mysys/libmysyslt.la \
-			$(top_builddir)/dbug/libdbuglt.la \
-			$(top_builddir)/regex/libregex.a \
-			$(top_builddir)/strings/libmystringsextra.la \
-			$(top_builddir)/strings/libmystringslt.la
-mysqld_DEPENDENCIES=	@mysql_plugin_libs@ $(SUPPORTING_LIBS) backup/libbackup.la libndb.la
-LDADD = $(SUPPORTING_LIBS) @ZLIB_LIBS@ @NDB_SCI_LIBS@
-mysqld_LDADD =		libndb.la \
-			@MYSQLD_EXTRA_LDFLAGS@ \
-			@pstack_libs@ $(libevent_libs) \
-			@mysql_plugin_libs@ \
-			$(LDADD)  $(CXXLDFLAGS) $(WRAPLIBS) @LIBDL@ \
-			$(yassl_libs) $(openssl_libs) @MYSQLD_EXTRA_LIBS@ \
-			backup/libbackup.la
-
-noinst_HEADERS =	item.h item_func.h item_sum.h item_cmpfunc.h \
-			item_strfunc.h item_timefunc.h \
-			item_xmlfunc.h \
-			item_create.h item_subselect.h item_row.h \
-			mysql_priv.h item_geofunc.h sql_bitmap.h \
-			procedure.h sql_class.h sql_lex.h sql_list.h \
-			sql_map.h sql_string.h unireg.h \
-			sql_error.h field.h handler.h mysqld_suffix.h \
-			sql_profile.h \
-			ha_ndbcluster.h ha_ndbcluster_cond.h \
-			ha_ndbcluster_binlog.h ha_ndbcluster_tables.h \
-			ha_ndbcluster_connection.h ha_ndbcluster_connection.h \
-			ha_ndbcluster_lock_ext.h \
-			ha_partition.h rpl_constants.h \
-			debug_sync.h \
-			opt_range.h protocol.h rpl_tblmap.h rpl_utility.h \
-			rpl_reporting.h \
-			log.h sql_show.h rpl_info.h \
-			rpl_rli.h rpl_rli_file.h rpl_mi.h rpl_mi_file.h \
-			sql_select.h structs.h table.h sql_udf.h hash_filo.h \
-			lex.h lex_symbol.h sql_acl.h sql_crypt.h  \
-			sql_repl.h slave.h rpl_filter.h rpl_injector.h \
-			log_event.h rpl_record.h \
-			log_event_old.h rpl_record_old.h \
-			sql_sort.h sql_cache.h set_var.h \
-			spatial.h gstream.h client_settings.h tzfile.h \
-			tztime.h my_decimal.h\
-			sp_head.h sp_pcontext.h sp_rcontext.h sp.h sp_cache.h \
-			parse_file.h sql_view.h	sql_trigger.h \
-			sql_array.h sql_cursor.h events.h scheduler.h \
-                        event_db_repository.h event_queue.h \
-			sql_plugin.h authors.h event_parse_data.h \
-			event_data_objects.h event_scheduler.h \
-			sql_partition.h partition_info.h partition_element.h \
-			probes.h sql_audit.h transaction.h \
-			contributors.h sql_servers.h bml.h \
-			si_objects.h si_logs.h sql_plist.h mdl.h records.h \
-			sql_signal.h \
-			rpl_handler.h replication.h sql_prepare.h debug_sync.h
-
-mysqld_SOURCES =	sql_lex.cc sql_handler.cc sql_partition.cc \
-			item.cc item_sum.cc item_buff.cc item_func.cc \
-			item_cmpfunc.cc item_strfunc.cc item_timefunc.cc \
-			thr_malloc.cc item_create.cc item_subselect.cc \
-			item_row.cc item_geofunc.cc item_xmlfunc.cc \
-			field.cc strfunc.cc key.cc sql_class.cc sql_list.cc \
-			net_serv.cc protocol.cc sql_state.c \
-			lock.cc my_lock.c \
-			sql_string.cc sql_manager.cc sql_map.cc \
-			mysqld.cc password.c hash_filo.cc hostname.cc \
-			sql_connect.cc scheduler.cc sql_parse.cc \
-			set_var.cc sql_yacc.yy \
-                        sql_join_cache.cc \
-			sql_base.cc table.cc sql_select.cc sql_insert.cc \
-			sql_profile.cc \
-			sql_prepare.cc sql_error.cc sql_locale.cc \
-			sql_update.cc sql_delete.cc uniques.cc sql_do.cc \
-			procedure.cc sql_test.cc \
-			log.cc init.cc derror.cc sql_acl.cc \
-			unireg.cc des_key_file.cc \
-			log_event.cc rpl_record.cc \
-			log_event_old.cc rpl_record_old.cc \
-			discover.cc time.cc opt_range.cc opt_sum.cc \
-		   	records.cc filesort.cc handler.cc \
-		        ha_partition.cc \
-			debug_sync.cc \
-			sql_db.cc sql_table.cc sql_rename.cc sql_crypt.cc \
-			sql_load.cc mf_iocache.cc field_conv.cc sql_show.cc \
-			sql_udf.cc sql_analyse.cc sql_analyse.h sql_cache.cc \
-			slave.cc sql_repl.cc rpl_filter.cc rpl_tblmap.cc \
-			rpl_utility.cc rpl_injector.cc rpl_rli.cc rpl_mi.cc \
-			rpl_info.cc rpl_rli_file.cc rpl_mi_file.cc \
-			rpl_reporting.cc \
-                        sql_union.cc sql_derived.cc \
-			sql_client.cc \
-			repl_failsafe.h repl_failsafe.cc \
-			sql_olap.cc sql_view.cc \
-			gstream.cc spatial.cc sql_help.cc sql_cursor.cc \
-			tztime.cc my_decimal.cc\
-			sp_head.cc sp_pcontext.cc  sp_rcontext.cc sp.cc \
-			sp_cache.cc parse_file.cc sql_trigger.cc \
-                        event_scheduler.cc event_data_objects.cc \
-                        event_queue.cc event_db_repository.cc events.cc \
-			sql_plugin.cc sql_binlog.cc \
-			sql_builtin.cc sql_tablespace.cc partition_info.cc \
-			sql_servers.cc sql_audit.cc sha2.cc \
-			bml.cc si_objects.cc si_logs.cc \
-			event_parse_data.cc mdl.cc transaction.cc \
-			sql_signal.cc \
-			rpl_handler.cc
-
-if HAVE_DTRACE
-  mysqld_SOURCES += probes.d
-endif
-
-nodist_mysqld_SOURCES =	mini_client_errors.c pack.c client.c my_time.c my_user.c 
-
-libndb_la_CPPFLAGS=	@ndbcluster_includes@ $(AM_CPPFLAGS)
-libndb_la_SOURCES=	ha_ndbcluster.cc \
-			ha_ndbcluster_binlog.cc \
-			ha_ndbcluster_connection.cc \
-			ha_ndbcluster_cond.cc
-
-gen_lex_hash_SOURCES =	gen_lex_hash.cc
-gen_lex_hash_LDFLAGS =  @NOINST_LDFLAGS@
-
-mysql_tzinfo_to_sql_SOURCES = tztime.cc
-mysql_tzinfo_to_sql_CXXFLAGS= -DTZINFO2SQL
-
-DEFS =			-DMYSQL_SERVER \
-			-DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \
-			-DDATADIR="\"$(MYSQLDATAdir)\"" \
-			-DSHAREDIR="\"$(MYSQLSHAREdir)\"" \
-			-DPLUGINDIR="\"$(pkgplugindir)\"" \
-			-DHAVE_EVENT_SCHEDULER \
-			@DEFS@
-
-BUILT_MAINT_SRC =	sql_yacc.cc sql_yacc.h
-BUILT_SOURCES =		$(BUILT_MAINT_SRC) lex_hash.h link_sources
-EXTRA_DIST =		udf_example.c udf_example.def $(BUILT_MAINT_SRC) \
-			nt_servc.cc nt_servc.h CMakeLists.txt \
-			probes.d \
-			message.mc  message.h message.rc MSG00001.bin \
-			nt_servc.cc nt_servc.h \
-			CMakeLists.txt
-
-CLEANFILES =        	lex_hash.h sql_yacc.output link_sources
-DISTCLEANFILES =        $(EXTRA_PROGRAMS)
-MAINTAINERCLEANFILES =  $(BUILT_MAINT_SRC)
-AM_YFLAGS =		-d --verbose
-
-# These are listed in 'nodist_mysqld_SOURCES'
-link_sources:
-	rm -f mini_client_errors.c
-	@LN_CP_F@ $(top_srcdir)/libmysql/errmsg.c mini_client_errors.c
-	rm -f pack.c
-	@LN_CP_F@ $(top_srcdir)/sql-common/pack.c pack.c
-	rm -f client.c
-	@LN_CP_F@ $(top_srcdir)/sql-common/client.c client.c
-	rm -f my_time.c
-	@LN_CP_F@ $(top_srcdir)/sql-common/my_time.c my_time.c
-	rm -f my_user.c
-	@LN_CP_F@ $(top_srcdir)/sql-common/my_user.c my_user.c
-	echo timestamp > link_sources
-
-# This generates lex_hash.h
-# NOTE Built sources should depend on their sources not the tool
-# this avoid the rebuild of the built files in a source dist
-lex_hash.h:	gen_lex_hash.cc lex.h
-		$(MAKE) $(AM_MAKEFLAGS) gen_lex_hash$(EXEEXT)
-		./gen_lex_hash$(EXEEXT) > $@-t
-		$(MV) $@-t $@
-
-# For testing of udf_example.so
-udf_example_la_SOURCES= udf_example.c
-udf_example_la_LDFLAGS= -module -rpath $(pkglibdir)
-
-probes.h: probes.d
-	$(DTRACE) $(DTRACEFLAGS) -h -s probes.d
-	mv probes.h probes.h.bak
-	sed "s/#include <unistd.h>//g" probes.h.bak > probes.h
-	rm probes.h.bak
-
-# We might have some stuff not built in this build, but that we want to install
-install-exec-hook:
-	$(mkinstalldirs) $(DESTDIR)$(libexecdir) $(DESTDIR)$(pkglibdir)
-	test ! -x mysqld-debug$(EXEEXT) || $(INSTALL_PROGRAM) mysqld-debug$(EXEEXT) $(DESTDIR)$(libexecdir)
-	test ! -f mysqld-debug.sym.gz   || $(INSTALL_DATA)    mysqld-debug.sym.gz   $(DESTDIR)$(pkglibdir)
-	test ! -f mysqld.sym.gz         || $(INSTALL_DATA)    mysqld.sym.gz         $(DESTDIR)$(pkglibdir)
-
-SUFFIXES : .d
-
-.d.o :
-	$(DTRACE) $(DTRACEFLAGS) -G -s $< $(DTRACEFILES)
-
-probes.o : $(DTRACEFILES)
+# Copyright (C) 2000-2006 MySQL AB
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+#called from the top level Makefile
+
+MYSQLDATAdir =		$(localstatedir)
+MYSQLSHAREdir =		$(pkgdatadir)
+MYSQLBASEdir=		$(prefix)
+MYSQLLIBdir=            $(pkglibdir)
+pkgplugindir =		$(pkglibdir)/plugin
+AM_CPPFLAGS =		@ZLIB_INCLUDES@ \
+			-I$(top_srcdir)/include \
+			-I$(top_srcdir)/regex $(openssl_includes) \
+			$(libevent_includes)
+WRAPLIBS=		@WRAPLIBS@
+SUBDIRS =		share backup
+libexec_PROGRAMS =	mysqld
+EXTRA_PROGRAMS =	gen_lex_hash
+bin_PROGRAMS =		mysql_tzinfo_to_sql
+DTRACE =                @DTRACE@
+DTRACEFLAGS =           @DTRACEFLAGS@
+DTRACEFILES =           filesort.o \
+			handler.o \
+			mysqld.o \
+			net_serv.o \
+			scheduler.o \
+			sp_head.o \
+			sql_cache.o \
+			sql_connect.o \
+			sql_cursor.o \
+			sql_delete.o \
+			sql_insert.o \
+			sql_parse.o \
+			sql_prepare.o \
+			sql_select.o \
+			sql_update.o
+
+noinst_LTLIBRARIES=	libndb.la \
+			udf_example.la
+
+SUPPORTING_LIBS =	$(top_builddir)/vio/libvio.a \
+			$(top_builddir)/mysys/libmysyswrap.la \
+			$(top_builddir)/mysys/libmysyslt.la \
+			$(top_builddir)/dbug/libdbuglt.la \
+			$(top_builddir)/regex/libregex.a \
+			$(top_builddir)/strings/libmystringsextra.la \
+			$(top_builddir)/strings/libmystringslt.la
+mysqld_DEPENDENCIES=	@mysql_plugin_libs@ $(SUPPORTING_LIBS) backup/libbackup.la libndb.la
+LDADD = $(SUPPORTING_LIBS) @ZLIB_LIBS@ @NDB_SCI_LIBS@
+mysqld_LDADD =		libndb.la \
+			@MYSQLD_EXTRA_LDFLAGS@ \
+			@pstack_libs@ $(libevent_libs) \
+			@mysql_plugin_libs@ \
+			$(LDADD)  $(CXXLDFLAGS) $(WRAPLIBS) @LIBDL@ \
+			$(yassl_libs) $(openssl_libs) @MYSQLD_EXTRA_LIBS@ \
+			backup/libbackup.la
+
+noinst_HEADERS =	item.h item_func.h item_sum.h item_cmpfunc.h \
+			item_strfunc.h item_timefunc.h \
+			item_xmlfunc.h sql_plugin_services.h \
+			item_create.h item_subselect.h item_row.h \
+			mysql_priv.h item_geofunc.h sql_bitmap.h \
+			procedure.h sql_class.h sql_lex.h sql_list.h \
+			sql_map.h sql_string.h unireg.h \
+			sql_error.h field.h handler.h mysqld_suffix.h \
+			sql_profile.h \
+			ha_ndbcluster.h ha_ndbcluster_cond.h \
+			ha_ndbcluster_binlog.h ha_ndbcluster_tables.h \
+			ha_ndbcluster_connection.h ha_ndbcluster_connection.h \
+			ha_ndbcluster_lock_ext.h \
+			ha_partition.h rpl_constants.h \
+			debug_sync.h \
+			opt_range.h protocol.h rpl_tblmap.h rpl_utility.h \
+			rpl_reporting.h \
+			log.h sql_show.h rpl_info.h \
+			rpl_rli.h rpl_rli_file.h rpl_mi.h rpl_mi_file.h \
+			sql_select.h structs.h table.h sql_udf.h hash_filo.h \
+			lex.h lex_symbol.h sql_acl.h sql_crypt.h  \
+			sql_repl.h slave.h rpl_filter.h rpl_injector.h \
+			log_event.h rpl_record.h \
+			log_event_old.h rpl_record_old.h \
+			sql_sort.h sql_cache.h set_var.h \
+			spatial.h gstream.h client_settings.h tzfile.h \
+			tztime.h my_decimal.h\
+			sp_head.h sp_pcontext.h sp_rcontext.h sp.h sp_cache.h \
+			parse_file.h sql_view.h	sql_trigger.h \
+			sql_array.h sql_cursor.h events.h scheduler.h \
+                        event_db_repository.h event_queue.h \
+			sql_plugin.h authors.h event_parse_data.h \
+			event_data_objects.h event_scheduler.h \
+			sql_partition.h partition_info.h partition_element.h \
+			probes.h sql_audit.h transaction.h \
+			contributors.h sql_servers.h bml.h \
+			si_objects.h si_logs.h sql_plist.h mdl.h records.h \
+			sql_signal.h \
+			rpl_handler.h replication.h sql_prepare.h debug_sync.h
+
+mysqld_SOURCES =	sql_lex.cc sql_handler.cc sql_partition.cc \
+			item.cc item_sum.cc item_buff.cc item_func.cc \
+			item_cmpfunc.cc item_strfunc.cc item_timefunc.cc \
+			thr_malloc.cc item_create.cc item_subselect.cc \
+			item_row.cc item_geofunc.cc item_xmlfunc.cc \
+			field.cc strfunc.cc key.cc sql_class.cc sql_list.cc \
+			net_serv.cc protocol.cc sql_state.c \
+			lock.cc my_lock.c \
+			sql_string.cc sql_manager.cc sql_map.cc \
+			mysqld.cc password.c hash_filo.cc hostname.cc \
+			sql_connect.cc scheduler.cc sql_parse.cc \
+			set_var.cc sql_yacc.yy \
+                        sql_join_cache.cc \
+			sql_base.cc table.cc sql_select.cc sql_insert.cc \
+			sql_profile.cc \
+			sql_prepare.cc sql_error.cc sql_locale.cc \
+			sql_update.cc sql_delete.cc uniques.cc sql_do.cc \
+			procedure.cc sql_test.cc \
+			log.cc init.cc derror.cc sql_acl.cc \
+			unireg.cc des_key_file.cc \
+			log_event.cc rpl_record.cc \
+			log_event_old.cc rpl_record_old.cc \
+			discover.cc time.cc opt_range.cc opt_sum.cc \
+		   	records.cc filesort.cc handler.cc \
+		        ha_partition.cc \
+			debug_sync.cc \
+			sql_db.cc sql_table.cc sql_rename.cc sql_crypt.cc \
+			sql_load.cc mf_iocache.cc field_conv.cc sql_show.cc \
+			sql_udf.cc sql_analyse.cc sql_analyse.h sql_cache.cc \
+			slave.cc sql_repl.cc rpl_filter.cc rpl_tblmap.cc \
+			rpl_utility.cc rpl_injector.cc rpl_rli.cc rpl_mi.cc \
+			rpl_info.cc rpl_rli_file.cc rpl_mi_file.cc \
+			rpl_reporting.cc \
+                        sql_union.cc sql_derived.cc \
+			sql_client.cc \
+			repl_failsafe.h repl_failsafe.cc \
+			sql_olap.cc sql_view.cc \
+			gstream.cc spatial.cc sql_help.cc sql_cursor.cc \
+			tztime.cc my_decimal.cc\
+			sp_head.cc sp_pcontext.cc  sp_rcontext.cc sp.cc \
+			sp_cache.cc parse_file.cc sql_trigger.cc \
+                        event_scheduler.cc event_data_objects.cc \
+                        event_queue.cc event_db_repository.cc events.cc \
+			sql_plugin.cc sql_binlog.cc \
+			sql_builtin.cc sql_tablespace.cc partition_info.cc \
+			sql_servers.cc sql_audit.cc sha2.cc \
+			bml.cc si_objects.cc si_logs.cc \
+			event_parse_data.cc mdl.cc transaction.cc \
+			sql_signal.cc \
+			rpl_handler.cc
+
+if HAVE_DTRACE
+  mysqld_SOURCES += probes.d
+endif
+
+nodist_mysqld_SOURCES =	mini_client_errors.c pack.c client.c my_time.c my_user.c 
+
+libndb_la_CPPFLAGS=	@ndbcluster_includes@ $(AM_CPPFLAGS)
+libndb_la_SOURCES=	ha_ndbcluster.cc \
+			ha_ndbcluster_binlog.cc \
+			ha_ndbcluster_connection.cc \
+			ha_ndbcluster_cond.cc
+
+gen_lex_hash_SOURCES =	gen_lex_hash.cc
+gen_lex_hash_LDFLAGS =  @NOINST_LDFLAGS@
+
+mysql_tzinfo_to_sql_SOURCES = tztime.cc
+mysql_tzinfo_to_sql_CXXFLAGS= -DTZINFO2SQL
+
+DEFS =			-DMYSQL_SERVER \
+			-DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \
+			-DDATADIR="\"$(MYSQLDATAdir)\"" \
+			-DSHAREDIR="\"$(MYSQLSHAREdir)\"" \
+			-DPLUGINDIR="\"$(pkgplugindir)\"" \
+			-DHAVE_EVENT_SCHEDULER \
+			@DEFS@
+
+BUILT_MAINT_SRC =	sql_yacc.cc sql_yacc.h
+BUILT_SOURCES =		$(BUILT_MAINT_SRC) lex_hash.h link_sources
+EXTRA_DIST =		udf_example.c udf_example.def $(BUILT_MAINT_SRC) \
+			nt_servc.cc nt_servc.h CMakeLists.txt \
+			probes.d \
+			message.mc  message.h message.rc MSG00001.bin \
+			nt_servc.cc nt_servc.h \
+			CMakeLists.txt
+
+CLEANFILES =        	lex_hash.h sql_yacc.output link_sources
+DISTCLEANFILES =        $(EXTRA_PROGRAMS)
+MAINTAINERCLEANFILES =  $(BUILT_MAINT_SRC)
+AM_YFLAGS =		-d --verbose
+
+# These are listed in 'nodist_mysqld_SOURCES'
+link_sources:
+	rm -f mini_client_errors.c
+	@LN_CP_F@ $(top_srcdir)/libmysql/errmsg.c mini_client_errors.c
+	rm -f pack.c
+	@LN_CP_F@ $(top_srcdir)/sql-common/pack.c pack.c
+	rm -f client.c
+	@LN_CP_F@ $(top_srcdir)/sql-common/client.c client.c
+	rm -f my_time.c
+	@LN_CP_F@ $(top_srcdir)/sql-common/my_time.c my_time.c
+	rm -f my_user.c
+	@LN_CP_F@ $(top_srcdir)/sql-common/my_user.c my_user.c
+	echo timestamp > link_sources
+
+# This generates lex_hash.h
+# NOTE Built sources should depend on their sources not the tool
+# this avoid the rebuild of the built files in a source dist
+lex_hash.h:	gen_lex_hash.cc lex.h
+		$(MAKE) $(AM_MAKEFLAGS) gen_lex_hash$(EXEEXT)
+		./gen_lex_hash$(EXEEXT) > $@-t
+		$(MV) $@-t $@
+
+# For testing of udf_example.so
+udf_example_la_SOURCES= udf_example.c
+udf_example_la_LDFLAGS= -module -rpath $(pkglibdir)
+
+probes.h: probes.d
+	$(DTRACE) $(DTRACEFLAGS) -h -s probes.d
+	mv probes.h probes.h.bak
+	sed "s/#include <unistd.h>//g" probes.h.bak > probes.h
+	rm probes.h.bak
+
+# We might have some stuff not built in this build, but that we want to install
+install-exec-hook:
+	$(mkinstalldirs) $(DESTDIR)$(libexecdir) $(DESTDIR)$(pkglibdir)
+	test ! -x mysqld-debug$(EXEEXT) || $(INSTALL_PROGRAM) mysqld-debug$(EXEEXT) $(DESTDIR)$(libexecdir)
+	test ! -f mysqld-debug.sym.gz   || $(INSTALL_DATA)    mysqld-debug.sym.gz   $(DESTDIR)$(pkglibdir)
+	test ! -f mysqld.sym.gz         || $(INSTALL_DATA)    mysqld.sym.gz         $(DESTDIR)$(pkglibdir)
+
+SUFFIXES : .d
+
+.d.o :
+	$(DTRACE) $(DTRACEFLAGS) -G -s $< $(DTRACEFILES)
+
+probes.o : $(DTRACEFILES)

=== modified file 'sql/field.cc'
--- a/sql/field.cc	2009-05-15 08:51:42 +0000
+++ b/sql/field.cc	2009-05-25 10:10:18 +0000
@@ -54,7 +54,7 @@ const char field_separator=',';
 #define LONGLONG_TO_STRING_CONVERSION_BUFFER_SIZE 128
 #define DECIMAL_TO_STRING_CONVERSION_BUFFER_SIZE 128
 #define BLOB_PACK_LENGTH_TO_MAX_LENGH(arg) \
-((ulong) ((LL(1) << min(arg, 4) * 8) - LL(1)))
+((ulong) ((1LL << min(arg, 4) * 8) - 1LL))
 
 #define ASSERT_COLUMN_MARKED_FOR_READ DBUG_ASSERT(!table || (!table->read_set || bitmap_is_set(table->read_set, field_index)))
 #define ASSERT_COLUMN_MARKED_FOR_WRITE DBUG_ASSERT(!table || (!table->write_set || bitmap_is_set(table->write_set, field_index)))
@@ -3637,7 +3637,7 @@ int Field_long::store(longlong nr, bool 
       res=0;
       error= 1;
     }
-    else if ((ulonglong) nr >= (LL(1) << 32))
+    else if ((ulonglong) nr >= (1LL << 32))
     {
       res=(int32) (uint32) ~0L;
       error= 1;
@@ -4775,7 +4775,7 @@ int Field_timestamp::store(longlong nr, 
   longlong tmp= number_to_datetime(nr, &l_time, (thd->variables.sql_mode &
                                                  MODE_NO_ZERO_DATE) |
                                    MODE_NO_ZERO_IN_DATE, &error);
-  if (tmp == LL(-1))
+  if (tmp == -1LL)
   {
     error= 2;
   }
@@ -4831,7 +4831,7 @@ longlong Field_timestamp::val_int(void)
   
   thd->variables.time_zone->gmt_sec_to_TIME(&time_tmp, (my_time_t)temp);
   
-  return time_tmp.year * LL(10000000000) + time_tmp.month * LL(100000000) +
+  return time_tmp.year * 10000000000LL + time_tmp.month * 100000000LL +
          time_tmp.day * 1000000L + time_tmp.hour * 10000L +
          time_tmp.minute * 100 + time_tmp.second;
 }
@@ -5434,7 +5434,7 @@ int Field_date::store(double nr)
     nr=floor(nr/1000000.0);			// Timestamp to date
   if (nr < 0.0 || nr > 99991231.0)
   {
-    tmp= LL(0);
+    tmp= 0LL;
     set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
                          ER_WARN_DATA_OUT_OF_RANGE,
                          nr, MYSQL_TIMESTAMP_DATE);
@@ -5460,7 +5460,7 @@ int Field_date::store(longlong nr, bool 
                                            MODE_NO_ZERO_DATE |
                                            MODE_INVALID_DATES))), &error);
 
-  if (nr == LL(-1))
+  if (nr == -1LL)
   {
     nr= 0;
     error= 2;
@@ -5687,7 +5687,7 @@ int Field_newdate::store(longlong nr, bo
                           (thd->variables.sql_mode &
                            (MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE |
                             MODE_INVALID_DATES))),
-                         &error) == LL(-1))
+                         &error) == -1LL)
   {
     tmp= 0L;
     error= 2;
@@ -5925,7 +5925,7 @@ int Field_datetime::store(longlong nr, b
                                            MODE_NO_ZERO_DATE |
                                            MODE_INVALID_DATES))), &error);
 
-  if (nr == LL(-1))
+  if (nr == -1LL)
   {
     nr= 0;
     error= 2;
@@ -5961,7 +5961,7 @@ int Field_datetime::store_time(MYSQL_TIM
   if (time_type == MYSQL_TIMESTAMP_DATE ||
       time_type == MYSQL_TIMESTAMP_DATETIME)
   {
-    tmp=((ltime->year*10000L+ltime->month*100+ltime->day)*LL(1000000)+
+    tmp=((ltime->year*10000L+ltime->month*100+ltime->day)*1000000LL+
 	 (ltime->hour*10000L+ltime->minute*100+ltime->second));
     if (check_date(ltime, tmp != 0,
                    (TIME_FUZZY_DATE |
@@ -6043,8 +6043,8 @@ String *Field_datetime::val_str(String *
     Avoid problem with slow longlong arithmetic and sprintf
   */
 
-  part1=(long) (tmp/LL(1000000));
-  part2=(long) (tmp - (ulonglong) part1*LL(1000000));
+  part1=(long) (tmp/1000000LL);
+  part2=(long) (tmp - (ulonglong) part1*1000000LL);
 
   pos=(char*) val_buffer->ptr() + MAX_DATETIME_WIDTH;
   *pos--=0;
@@ -6074,8 +6074,8 @@ bool Field_datetime::get_date(MYSQL_TIME
 {
   longlong tmp=Field_datetime::val_int();
   uint32 part1,part2;
-  part1=(uint32) (tmp/LL(1000000));
-  part2=(uint32) (tmp - (ulonglong) part1*LL(1000000));
+  part1=(uint32) (tmp/1000000LL);
+  part2=(uint32) (tmp - (ulonglong) part1*1000000LL);
 
   ltime->time_type=	MYSQL_TIMESTAMP_DATETIME;
   ltime->neg=		0;

=== modified file 'sql/ha_partition.cc'
--- a/sql/ha_partition.cc	2009-04-01 21:36:07 +0000
+++ b/sql/ha_partition.cc	2009-04-25 21:24:53 +0000
@@ -1174,7 +1174,7 @@ bool ha_partition::check_and_repair(THD 
  
 
 /**
-  @breif Check if the table can be automatically repaired
+  Check if the table can be automatically repaired
 
   @retval TRUE  Can be auto repaired
   @retval FALSE Cannot be auto repaired
@@ -1193,7 +1193,7 @@ bool ha_partition::auto_repair() const
 
 
 /**
-  @breif Check if the table is crashed
+  Check if the table is crashed
 
   @retval TRUE  Crashed
   @retval FALSE Not crashed

=== modified file 'sql/handler.h'
--- a/sql/handler.h	2009-05-05 09:52:10 +0000
+++ b/sql/handler.h	2009-05-25 10:10:18 +0000
@@ -168,21 +168,21 @@ typedef Bitmap<HA_MAX_ALTER_FLAGS> HA_AL
 #define HA_NO_VARCHAR	       (1 << 27)
 #define HA_CAN_BIT_FIELD       (1 << 28) /* supports bit fields */
 #define HA_ANY_INDEX_MAY_BE_UNIQUE (1 << 30)
-#define HA_NO_COPY_ON_ALTER    (LL(1) << 31)
-#define HA_HAS_RECORDS	       (LL(1) << 32) /* records() gives exact count*/
+#define HA_NO_COPY_ON_ALTER    (1LL << 31)
+#define HA_HAS_RECORDS	       (1LL << 32) /* records() gives exact count*/
 /* Has it's own method of binlog logging */
-#define HA_HAS_OWN_BINLOGGING  (LL(1) << 33)
+#define HA_HAS_OWN_BINLOGGING  (1LL << 33)
 /*
   Engine is capable of row-format and statement-format logging,
   respectively
 */
-#define HA_BINLOG_ROW_CAPABLE  (LL(1) << 35)
-#define HA_BINLOG_STMT_CAPABLE (LL(1) << 36)
+#define HA_BINLOG_ROW_CAPABLE  (1LL << 35)
+#define HA_BINLOG_STMT_CAPABLE (1LL << 36)
 
-#define HA_ONLINE_ALTER        (LL(1) << 37)
-#define HA_CAN_READ_ORDER_IF_LIMIT (LL(1) << 38)
+#define HA_ONLINE_ALTER        (1LL << 37)
+#define HA_CAN_READ_ORDER_IF_LIMIT (1LL << 38)
 /* Has automatic checksums and uses the new checksum format */
-#define HA_HAS_NEW_CHECKSUM    (LL(1) << 39)
+#define HA_HAS_NEW_CHECKSUM    (1LL << 39)
 
 /*
     When a multiple key conflict happens in a REPLACE command mysql
@@ -206,7 +206,7 @@ typedef Bitmap<HA_MAX_ALTER_FLAGS> HA_AL
     This flag helps the underlying SE to inform the server that the keys are not
     ordered.
  */
-#define HA_DUPLICATE_KEY_NOT_IN_ORDER    (LL(1) << 40)
+#define HA_DUPLICATE_KEY_NOT_IN_ORDER    (1LL << 40)
 
 /*
   Set of all binlog flags. Currently only contain the capabilities

=== modified file 'sql/item.cc'
--- a/sql/item.cc	2009-05-25 08:28:53 +0000
+++ b/sql/item.cc	2009-05-25 10:10:18 +0000
@@ -954,7 +954,7 @@ bool Item::get_date(MYSQL_TIME *ltime,ui
   {
     longlong value= val_int();
     int was_cut;
-    if (number_to_datetime(value, ltime, fuzzydate, &was_cut) == LL(-1))
+    if (number_to_datetime(value, ltime, fuzzydate, &was_cut) == -1LL)
     {
       char buff[22], *end;
       end= longlong10_to_str(value, buff, -10);
@@ -3501,7 +3501,7 @@ Item_copy *Item_copy::create (Item *item
     case DECIMAL_RESULT:
       return new Item_copy_decimal (item);
 
-    case ROW_RESULT:
+    default:
       DBUG_ASSERT (0);
   }
   /* should not happen */
@@ -3524,7 +3524,7 @@ double Item_copy_string::val_real()
 longlong Item_copy_string::val_int()
 {
   int err;
-  return null_value ? LL(0) : my_strntoll(str_value.charset(),str_value.ptr(),
+  return null_value ? 0LL : my_strntoll(str_value.charset(),str_value.ptr(),
                                           str_value.length(),10, (char**) 0,
                                           &err); 
 }
@@ -3696,7 +3696,7 @@ double Item_copy_decimal::val_real()
 longlong Item_copy_decimal::val_int()
 {
   if (null_value)
-    return LL(0);
+    return 0LL;
   else
   {
     longlong result;

=== modified file 'sql/item.h'
--- a/sql/item.h	2009-05-25 08:28:53 +0000
+++ b/sql/item.h	2009-05-25 10:10:18 +0000
@@ -2670,7 +2670,7 @@ public:
   }
   virtual longlong val_int()
   {
-    return null_value ? LL(0) : cached_value;
+    return null_value ? 0LL : cached_value;
   }
   virtual void copy();
 };

=== modified file 'sql/item_cmpfunc.cc'
--- a/sql/item_cmpfunc.cc	2009-05-25 08:28:53 +0000
+++ b/sql/item_cmpfunc.cc	2009-05-25 10:10:18 +0000
@@ -157,7 +157,7 @@ static int agg_cmp_type(Item_result *typ
   @brief Aggregates field types from the array of items.
 
   @param[in] items  array of items to aggregate the type from
-  @paran[in] nitems number of items in the array
+  @param[in] nitems number of items in the array
 
   @details This function aggregates field types from the array of items.
     Found type is supposed to be used later as the result field type

=== modified file 'sql/item_func.cc'
--- a/sql/item_func.cc	2009-05-22 17:09:16 +0000
+++ b/sql/item_func.cc	2009-05-25 10:10:18 +0000
@@ -1802,7 +1802,7 @@ longlong Item_func_shift_left::val_int()
     return 0;
   }
   null_value=0;
-  return (shift < sizeof(longlong)*8 ? (longlong) res : LL(0));
+  return (shift < sizeof(longlong)*8 ? (longlong) res : 0LL);
 }
 
 longlong Item_func_shift_right::val_int()
@@ -1817,7 +1817,7 @@ longlong Item_func_shift_right::val_int(
     return 0;
   }
   null_value=0;
-  return (shift < sizeof(longlong)*8 ? (longlong) res : LL(0));
+  return (shift < sizeof(longlong)*8 ? (longlong) res : 0LL);
 }
 
 
@@ -2743,7 +2743,7 @@ void Item_func_find_in_set::fix_length_a
 			      find->length(), 0);
 	enum_bit=0;
 	if (enum_value)
-	  enum_bit=LL(1) << (enum_value-1);
+	  enum_bit=1LL << (enum_value-1);
       }
     }
   }
@@ -2813,7 +2813,7 @@ longlong Item_func_find_in_set::val_int(
                wc == (my_wc_t) separator)
         return (longlong) ++position;
       else
-        return LL(0);
+        return 0LL;
     }
   }
   return 0;
@@ -3527,7 +3527,7 @@ void debug_sync_point(const char* lock_n
   @retval return value from pthread_cond_timedwait
 */
 
-#define INTERRUPT_INTERVAL (5 * ULL(1000000000))
+#define INTERRUPT_INTERVAL (5 * 1000000000ULL)
 
 static int interruptible_wait(THD *thd, pthread_cond_t *cond,
                               pthread_mutex_t *lock, double time)
@@ -4161,7 +4161,7 @@ double user_var_entry::val_real(my_bool 
 longlong user_var_entry::val_int(my_bool *null_value) const
 {
   if ((*null_value= (value == 0)))
-    return LL(0);
+    return 0LL;
 
   switch (type) {
   case REAL_RESULT:
@@ -4186,7 +4186,7 @@ longlong user_var_entry::val_int(my_bool
   default:
     break;
   }
-  return LL(0);					// Impossible
+  return 0LL;					// Impossible
 }
 
 
@@ -4673,7 +4673,7 @@ longlong Item_func_get_user_var::val_int
 {
   DBUG_ASSERT(fixed == 1);
   if (!var_entry)
-    return LL(0);				// No such variable
+    return 0LL;				// No such variable
   return (var_entry->val_int(&null_value));
 }
 

=== modified file 'sql/item_strfunc.cc'
--- a/sql/item_strfunc.cc	2009-05-22 08:59:50 +0000
+++ b/sql/item_strfunc.cc	2009-05-25 10:10:18 +0000
@@ -3295,7 +3295,7 @@ String* Item_func_inet_ntoa::val_str(Str
 
     Also return null if n > 255.255.255.255
   */
-  if ((null_value= (args[0]->null_value || n > (ulonglong) LL(4294967295))))
+  if ((null_value= (args[0]->null_value || n > 4294967295ULL)))
     return 0;					// Null value
 
   str->length(0);

=== modified file 'sql/item_sum.cc'
--- a/sql/item_sum.cc	2009-03-11 12:52:04 +0000
+++ b/sql/item_sum.cc	2009-05-14 21:49:53 +0000
@@ -2765,7 +2765,7 @@ longlong Item_sum_count_distinct::val_in
   int error;
   DBUG_ASSERT(fixed == 1);
   if (!table)					// Empty query
-    return LL(0);
+    return 0LL;
   if (tree)
   {
     if (is_evaluated)

=== modified file 'sql/item_sum.h'
--- a/sql/item_sum.h	2008-12-10 09:02:11 +0000
+++ b/sql/item_sum.h	2009-05-14 21:49:53 +0000
@@ -930,7 +930,7 @@ public:
 class Item_sum_or :public Item_sum_bit
 {
 public:
-  Item_sum_or(Item *item_par) :Item_sum_bit(item_par,LL(0)) {}
+  Item_sum_or(Item *item_par) :Item_sum_bit(item_par,0LL) {}
   Item_sum_or(THD *thd, Item_sum_or *item) :Item_sum_bit(thd, item) {}
   bool add();
   const char *func_name() const { return "bit_or("; }
@@ -951,7 +951,7 @@ class Item_sum_and :public Item_sum_bit
 class Item_sum_xor :public Item_sum_bit
 {
   public:
-  Item_sum_xor(Item *item_par) :Item_sum_bit(item_par,LL(0)) {}
+  Item_sum_xor(Item *item_par) :Item_sum_bit(item_par,0LL) {}
   Item_sum_xor(THD *thd, Item_sum_xor *item) :Item_sum_bit(thd, item) {}
   bool add();
   const char *func_name() const { return "bit_xor("; }

=== modified file 'sql/item_timefunc.cc'
--- a/sql/item_timefunc.cc	2009-04-14 21:36:40 +0000
+++ b/sql/item_timefunc.cc	2009-05-14 21:49:53 +0000
@@ -880,7 +880,7 @@ static bool get_interval_info(const char
     longlong value;
     const char *start= str;
     for (value=0; str != end && my_isdigit(cs,*str) ; str++)
-      value= value*LL(10) + (longlong) (*str - '0');
+      value= value*10LL + (longlong) (*str - '0');
     msec_length= 6 - (str - start);
     values[i]= value;
     while (str != end && !my_isdigit(cs,*str))

=== modified file 'sql/log.cc'
--- a/sql/log.cc	2009-05-12 08:58:44 +0000
+++ b/sql/log.cc	2009-05-14 08:56:34 +0000
@@ -148,9 +148,16 @@ sql_print_message_func sql_print_message
 };
 
 
+/**
+  Create the name of the default general log file
+  
+  @param[IN] buff    Location for building new string.
+  @param[IN] log_ext The extension for the file (e.g .log)
+  @returns Pointer to a new string containing the name
+*/
 char *make_default_log_name(char *buff,const char* log_ext)
 {
-  strmake(buff, pidfile_name, FN_REFLEN-5);
+  strmake(buff, default_logfile_name, FN_REFLEN-5);
   return fn_format(buff, buff, mysql_data_home, log_ext,
                    MYF(MY_UNPACK_FILENAME|MY_REPLACE_EXT));
 }

=== modified file 'sql/log_event.h'
--- a/sql/log_event.h	2009-05-07 11:44:40 +0000
+++ b/sql/log_event.h	2009-05-14 21:49:53 +0000
@@ -510,7 +510,7 @@ struct sql_ex_info
 
 /* Shouldn't be defined before */
 #define EXPECTED_OPTIONS \
-  ((ULL(1) << 14) | (ULL(1) << 26) | (ULL(1) << 27) | (ULL(1) << 19))
+  ((1ULL << 14) | (1ULL << 26) | (1ULL << 27) | (1ULL << 19))
 
 #if OPTIONS_WRITTEN_TO_BIN_LOG != EXPECTED_OPTIONS
 #error OPTIONS_WRITTEN_TO_BIN_LOG must NOT change their values!

=== modified file 'sql/mysql_priv.h'
--- a/sql/mysql_priv.h	2009-05-15 13:45:06 +0000
+++ b/sql/mysql_priv.h	2009-05-25 10:10:18 +0000
@@ -28,6 +28,16 @@
 
 #ifndef MYSQL_CLIENT
 
+/*
+  the following #define adds server-only members to enum_mysql_show_type,
+  that is defined in mysql/plugin.h
+  it has to be before mysql/plugin.h is included.
+*/
+#define SHOW_always_last SHOW_KEY_CACHE_LONG, \
+            SHOW_KEY_CACHE_LONGLONG, SHOW_LONG_STATUS, SHOW_DOUBLE_STATUS, \
+            SHOW_HAVE, SHOW_MY_BOOL, SHOW_HA_ROWS, SHOW_SYS, \
+            SHOW_LONG_NOFLUSH, SHOW_LONGLONG_STATUS
+
 #include <my_global.h>
 #include <mysql_version.h>
 #include <mysql_embed.h>
@@ -110,7 +120,6 @@ void *sql_calloc(size_t);
 char *sql_strdup(const char *str);
 char *sql_strmake(const char *str, size_t len);
 void *sql_memdup(const void * ptr, size_t size);
-void sql_element_free(void *ptr);
 char *sql_strmake_with_convert(const char *str, size_t arg_length,
 			       CHARSET_INFO *from_cs,
 			       size_t max_res_length,
@@ -118,12 +127,10 @@ char *sql_strmake_with_convert(const cha
 uint kill_one_thread(THD *thd, ulong id, bool only_kill_query);
 void sql_kill(THD *thd, ulong id, bool only_kill_query);
 bool net_request_file(NET* net, const char* fname);
-char* query_table_status(THD *thd,const char *db,const char *table_name);
 
 #define x_free(A)	{ my_free((uchar*) (A),MYF(MY_WME | MY_FAE | MY_ALLOW_ZERO_PTR)); }
 #define safeFree(x)	{ if(x) { my_free((uchar*) x,MYF(0)); x = NULL; } }
 #define PREV_BITS(type,A)	((type) (((type) 1 << (A)) -1))
-#define all_bits_set(A,B) ((A) & (B) != (B))
 
 /*
   Generates a warning that a feature is deprecated. After a specified version
@@ -345,7 +352,6 @@ enum open_table_mode
 #ifndef MYSQLD_NET_RETRY_COUNT
 #define MYSQLD_NET_RETRY_COUNT  10	///< Abort read after this many int.
 #endif
-#define TEMP_POOL_SIZE          128
 
 #define QUERY_ALLOC_BLOCK_SIZE		8192
 #define QUERY_ALLOC_PREALLOC_SIZE   	8192
@@ -355,11 +361,8 @@ enum open_table_mode
 #define ACL_ALLOC_BLOCK_SIZE		1024
 #define UDF_ALLOC_BLOCK_SIZE		1024
 #define TABLE_ALLOC_BLOCK_SIZE		1024
-#define BDB_LOG_ALLOC_BLOCK_SIZE	1024
 #define WARN_ALLOC_BLOCK_SIZE		2048
 #define WARN_ALLOC_PREALLOC_SIZE	1024
-#define PROFILE_ALLOC_BLOCK_SIZE  2048
-#define PROFILE_ALLOC_PREALLOC_SIZE 1024
 
 /*
   The following parameters is to decide when to use an extra cache to
@@ -482,58 +485,58 @@ enum open_table_mode
    TODO: separate three contexts above, move them to separate bitfields.
 */
 
-#define SELECT_DISTINCT         (ULL(1) << 0)     // SELECT, user
-#define SELECT_STRAIGHT_JOIN    (ULL(1) << 1)     // SELECT, user
-#define SELECT_DESCRIBE         (ULL(1) << 2)     // SELECT, user
-#define SELECT_SMALL_RESULT     (ULL(1) << 3)     // SELECT, user
-#define SELECT_BIG_RESULT       (ULL(1) << 4)     // SELECT, user
-#define OPTION_FOUND_ROWS       (ULL(1) << 5)     // SELECT, user
-#define OPTION_TO_QUERY_CACHE   (ULL(1) << 6)     // SELECT, user
-#define SELECT_NO_JOIN_CACHE    (ULL(1) << 7)     // intern
-#define OPTION_BIG_TABLES       (ULL(1) << 8)     // THD, user
-#define OPTION_BIG_SELECTS      (ULL(1) << 9)     // THD, user
-#define OPTION_LOG_OFF          (ULL(1) << 10)    // THD, user
-#define OPTION_QUOTE_SHOW_CREATE (ULL(1) << 11)   // THD, user, unused
-#define TMP_TABLE_ALL_COLUMNS   (ULL(1) << 12)    // SELECT, intern
-#define OPTION_WARNINGS         (ULL(1) << 13)    // THD, user
-#define OPTION_AUTO_IS_NULL     (ULL(1) << 14)    // THD, user, binlog
-#define OPTION_FOUND_COMMENT    (ULL(1) << 15)    // SELECT, intern, parser
-#define OPTION_SAFE_UPDATES     (ULL(1) << 16)    // THD, user
-#define OPTION_BUFFER_RESULT    (ULL(1) << 17)    // SELECT, user
-#define OPTION_BIN_LOG          (ULL(1) << 18)    // THD, user
-#define OPTION_NOT_AUTOCOMMIT   (ULL(1) << 19)    // THD, user
-#define OPTION_BEGIN            (ULL(1) << 20)    // THD, intern
-#define OPTION_TABLE_LOCK       (ULL(1) << 21)    // THD, intern
-#define OPTION_QUICK            (ULL(1) << 22)    // SELECT (for DELETE)
-#define OPTION_KEEP_LOG         (ULL(1) << 23)    // THD, user
+#define SELECT_DISTINCT         (1ULL << 0)     // SELECT, user
+#define SELECT_STRAIGHT_JOIN    (1ULL << 1)     // SELECT, user
+#define SELECT_DESCRIBE         (1ULL << 2)     // SELECT, user
+#define SELECT_SMALL_RESULT     (1ULL << 3)     // SELECT, user
+#define SELECT_BIG_RESULT       (1ULL << 4)     // SELECT, user
+#define OPTION_FOUND_ROWS       (1ULL << 5)     // SELECT, user
+#define OPTION_TO_QUERY_CACHE   (1ULL << 6)     // SELECT, user
+#define SELECT_NO_JOIN_CACHE    (1ULL << 7)     // intern
+#define OPTION_BIG_TABLES       (1ULL << 8)     // THD, user
+#define OPTION_BIG_SELECTS      (1ULL << 9)     // THD, user
+#define OPTION_LOG_OFF          (1ULL << 10)    // THD, user
+#define OPTION_QUOTE_SHOW_CREATE (1ULL << 11)   // THD, user, unused
+#define TMP_TABLE_ALL_COLUMNS   (1ULL << 12)    // SELECT, intern
+#define OPTION_WARNINGS         (1ULL << 13)    // THD, user
+#define OPTION_AUTO_IS_NULL     (1ULL << 14)    // THD, user, binlog
+#define OPTION_FOUND_COMMENT    (1ULL << 15)    // SELECT, intern, parser
+#define OPTION_SAFE_UPDATES     (1ULL << 16)    // THD, user
+#define OPTION_BUFFER_RESULT    (1ULL << 17)    // SELECT, user
+#define OPTION_BIN_LOG          (1ULL << 18)    // THD, user
+#define OPTION_NOT_AUTOCOMMIT   (1ULL << 19)    // THD, user
+#define OPTION_BEGIN            (1ULL << 20)    // THD, intern
+#define OPTION_TABLE_LOCK       (1ULL << 21)    // THD, intern
+#define OPTION_QUICK            (1ULL << 22)    // SELECT (for DELETE)
+#define OPTION_KEEP_LOG         (1ULL << 23)    // THD, user
 
 /* The following is used to detect a conflict with DISTINCT */
-#define SELECT_ALL              (ULL(1) << 24)    // SELECT, user, parser
+#define SELECT_ALL              (1ULL << 24)    // SELECT, user, parser
 
 /** The following can be set when importing tables in a 'wrong order'
    to suppress foreign key checks */
-#define OPTION_NO_FOREIGN_KEY_CHECKS    (ULL(1) << 26) // THD, user, binlog
+#define OPTION_NO_FOREIGN_KEY_CHECKS    (1ULL << 26) // THD, user, binlog
 /** The following speeds up inserts to InnoDB tables by suppressing unique
    key checks in some cases */
-#define OPTION_RELAXED_UNIQUE_CHECKS    (ULL(1) << 27) // THD, user, binlog
-#define SELECT_NO_UNLOCK                (ULL(1) << 28) // SELECT, intern
-#define OPTION_SCHEMA_TABLE             (ULL(1) << 29) // SELECT, intern
+#define OPTION_RELAXED_UNIQUE_CHECKS    (1ULL << 27) // THD, user, binlog
+#define SELECT_NO_UNLOCK                (1ULL << 28) // SELECT, intern
+#define OPTION_SCHEMA_TABLE             (1ULL << 29) // SELECT, intern
 /** Flag set if setup_tables already done */
-#define OPTION_SETUP_TABLES_DONE        (ULL(1) << 30) // intern
+#define OPTION_SETUP_TABLES_DONE        (1ULL << 30) // intern
 /** If not set then the thread will ignore all warnings with level notes. */
-#define OPTION_SQL_NOTES                (ULL(1) << 31) // THD, user
+#define OPTION_SQL_NOTES                (1ULL << 31) // THD, user
 /**
   Force the used temporary table to be a MyISAM table (because we will use
   fulltext functions when reading from it.
 */
-#define TMP_TABLE_FORCE_MYISAM          (ULL(1) << 32)
-#define OPTION_PROFILING                (ULL(1) << 33)
+#define TMP_TABLE_FORCE_MYISAM          (1ULL << 32)
+#define OPTION_PROFILING                (1ULL << 33)
 
 /*
   Dont report errors for individual rows,
   But just report error on commit (or read ofcourse)
 */
-#define OPTION_ALLOW_BATCH              (ULL(1) << 34) // THD, intern (slave)
+#define OPTION_ALLOW_BATCH              (1ULL << 34) // THD, intern (slave)
 
 /**
   Maximum length of time zone name that we support
@@ -576,7 +579,7 @@ enum open_table_mode
 #define MODE_NO_AUTO_CREATE_USER	(MODE_TRADITIONAL*2)
 #define MODE_HIGH_NOT_PRECEDENCE	(MODE_NO_AUTO_CREATE_USER*2)
 #define MODE_NO_ENGINE_SUBSTITUTION     (MODE_HIGH_NOT_PRECEDENCE*2)
-#define MODE_PAD_CHAR_TO_FULL_LENGTH    (ULL(1) << 31)
+#define MODE_PAD_CHAR_TO_FULL_LENGTH    (1ULL << 31)
 
 /* @@optimizer_switch flags. These must be in sync with optimizer_switch_typelib */
 #define OPTIMIZER_SWITCH_FIRSTMATCH 1
@@ -612,8 +615,6 @@ enum open_table_mode
 
 */
 
-#define RAID_BLOCK_SIZE 1024
-
 #define MY_CHARSET_BIN_MB_MAXLEN 1
 
 // uncachable cause
@@ -635,10 +636,6 @@ enum open_table_mode
 
 #define BINLOG_DUMP_NON_BLOCK   1
 
-/* sql_show.cc:show_log_files() */
-#define SHOW_LOG_STATUS_FREE "FREE"
-#define SHOW_LOG_STATUS_INUSE "IN USE"
-
 struct TABLE_LIST;
 class String;
 void view_store_options(THD *thd, TABLE_LIST *table, String *buff);
@@ -1968,6 +1965,7 @@ extern MYSQL_PLUGIN_IMPORT uint reg_ext_
 #ifdef MYSQL_SERVER
 extern char glob_hostname[FN_REFLEN], mysql_home[FN_REFLEN];
 extern char pidfile_name[FN_REFLEN], system_time_zone[30], *opt_init_file;
+extern char default_logfile_name[FN_REFLEN];
 extern char log_error_file[FN_REFLEN], *opt_tc_log_file;
 extern const double log_10[309];
 extern ulonglong log_10_int[20];
@@ -2202,8 +2200,6 @@ bool wait_if_global_read_lock(THD *thd, 
                               bool is_not_commit);
 void start_waiting_global_read_lock(THD *thd);
 bool make_global_read_lock_block_commit(THD *thd);
-bool set_protect_against_global_read_lock(void);
-void unset_protect_against_global_read_lock(void);
 void broadcast_refresh(void);
 int try_transactional_lock(THD *thd, TABLE_LIST *table_list);
 int check_transactional_lock(THD *thd, TABLE_LIST *table_list);

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2009-05-15 13:45:06 +0000
+++ b/sql/mysqld.cc	2009-05-25 10:10:18 +0000
@@ -643,6 +643,7 @@ const double log_10[] = {
 time_t server_start_time, flush_status_time;
 
 char mysql_home[FN_REFLEN], pidfile_name[FN_REFLEN], system_time_zone[30];
+char default_logfile_name[FN_REFLEN];
 char *default_tz_name;
 char log_error_file[FN_REFLEN], glob_hostname[FN_REFLEN];
 char mysql_real_data_home[FN_REFLEN],
@@ -3363,10 +3364,13 @@ static int init_common_variables(const c
     strmake(glob_hostname, STRING_WITH_LEN("localhost"));
     sql_print_warning("gethostname failed, using '%s' as hostname",
                       glob_hostname);
-    strmake(pidfile_name, STRING_WITH_LEN("mysql"));
+    strmake(default_logfile_name, STRING_WITH_LEN("mysql"));
   }
   else
-  strmake(pidfile_name, glob_hostname, sizeof(pidfile_name)-5);
+    strmake(default_logfile_name, glob_hostname, 
+	    sizeof(default_logfile_name)-5);
+
+  strmake(pidfile_name, default_logfile_name, sizeof(pidfile_name)-5);
   strmov(fn_ext(pidfile_name),".pid");		// Add proper extension
 
   /*

=== modified file 'sql/replication.h'
--- a/sql/replication.h	2009-05-08 07:49:21 +0000
+++ b/sql/replication.h	2009-05-14 08:56:34 +0000
@@ -132,6 +132,7 @@ typedef struct Binlog_storage_observer {
                      uint32 flags);
 } Binlog_storage_observer;
 
+#ifdef HAVE_REPLICATION
 /**
    Replication binlog transmitter (binlog dump) observer parameter.
 */
@@ -343,6 +344,7 @@ typedef struct Binlog_relay_IO_observer 
   */
   int (*after_reset_slave)(Binlog_relay_IO_param *param);
 } Binlog_relay_IO_observer;
+#endif
 
 
 /**
@@ -389,6 +391,7 @@ int register_binlog_storage_observer(Bin
 */
 int unregister_binlog_storage_observer(Binlog_storage_observer *observer, void *p);
 
+#ifdef HAVE_REPLICATION
 /**
    Register a binlog transmit observer
 
@@ -454,6 +457,7 @@ int unregister_binlog_relay_io_observer(
    @return address of MYSQL structure on success, NULL on failure
 */
 MYSQL *rpl_connect_master(MYSQL *mysql);
+#endif
 
 /**
    Set thread entering a condition

=== modified file 'sql/set_var.cc'
--- a/sql/set_var.cc	2009-05-22 17:09:16 +0000
+++ b/sql/set_var.cc	2009-05-25 10:10:18 +0000
@@ -1989,7 +1989,7 @@ bool sys_var::check_set(THD *thd, set_va
       For when the enum is made to contain 64 elements, as 1ULL<<64 is
       undefined, we guard with a "count<64" test.
     */
-    if (unlikely((tmp >= ((ULL(1)) << enum_names->count)) &&
+    if (unlikely((tmp >= ((1ULL) << enum_names->count)) &&
                  (enum_names->count < 64)))
     {
       llstr(tmp, buff);
@@ -2639,6 +2639,13 @@ static int  sys_check_log_path(THD *thd,
   /* Get dirname of the file path. */
   (void) dirname_part(path, log_file_str, &path_length);
 
+  /* Test if the file name itself is too long */
+  if (res->length()-path_length >= FN_LEN)
+  {
+      my_error(ER_PATH_LENGTH, MYF(0), var->var->name);
+      return 1;
+  }
+
   /* Dirname is empty if file path is relative. */
   if (!path_length)
     return 0;
@@ -2676,9 +2683,20 @@ bool update_sys_var_str_path(THD *thd, s
   MYSQL_QUERY_LOG *file_log= 0;
   MYSQL_BACKUP_LOG *backup_log= 0;
   char buff[FN_REFLEN];
-  char *res= 0, *old_value=(char *)(var ? var->value->str_value.ptr() : 0);
+  char *res= 0, *old_value= 0;
   bool result= 0;
-  uint str_length= (var ? var->value->str_value.length() : 0);
+  uint str_length= 0;
+
+  if (var) 
+  {
+    String str(buff, sizeof(buff), system_charset_info), *newval;
+
+    newval= var->value->val_str(&str);
+    old_value= newval->c_ptr_safe();
+    str_length= strlen(old_value);
+  } 
+  
+
 
   /*
     Added support for backup log types.

=== modified file 'sql/sql_base.cc'
--- a/sql/sql_base.cc	2009-05-15 13:45:06 +0000
+++ b/sql/sql_base.cc	2009-05-25 10:10:18 +0000
@@ -3044,7 +3044,7 @@ Locked_tables_list::unlock_locked_tables
                      the locked tables list. Passing a TABLE_LIST
                      instance that is not part of locked tables
                      list will lead to a crash.
-  @parma  remove_from_locked_tables
+  @param  remove_from_locked_tables
                       TRUE if the table is removed from the list
                       permanently.
 

=== modified file 'sql/sql_bitmap.h'
--- a/sql/sql_bitmap.h	2008-07-09 07:12:43 +0000
+++ b/sql/sql_bitmap.h	2009-05-14 21:49:53 +0000
@@ -58,7 +58,7 @@ public:
     intersect(map2buff);
     if (map.n_bits > sizeof(ulonglong) * 8)
       bitmap_set_above(&map, sizeof(ulonglong),
-                       test(map2buff & (LL(1) << (sizeof(ulonglong) * 8 - 1))));
+                       test(map2buff & (1LL << (sizeof(ulonglong) * 8 - 1))));
   }
   void subtract(Bitmap& map2) { bitmap_subtract(&map, &map2.map); }
   void merge(Bitmap& map2) { bitmap_union(&map, &map2.map); }

=== modified file 'sql/sql_class.cc'
--- a/sql/sql_class.cc	2009-05-22 17:09:16 +0000
+++ b/sql/sql_class.cc	2009-05-25 10:10:18 +0000
@@ -272,12 +272,7 @@ const char* thd_enter_cond(MYSQL_THD thd
   if (!thd)
     thd= current_thd;
 
-  const char* old_msg = thd->get_proc_info();
-  safe_mutex_assert_owner(mutex);
-  thd->mysys_var->current_mutex = mutex;
-  thd->mysys_var->current_cond = cond;
-  thd_proc_info(thd, msg);
-  return old_msg;
+  return thd->enter_cond(cond, mutex, msg);
 }
 
 extern "C"
@@ -286,19 +281,7 @@ void thd_exit_cond(MYSQL_THD thd, const 
   if (!thd)
     thd= current_thd;
 
-  /*
-    Putting the mutex unlock in thd_exit_cond() ensures that
-    mysys_var->current_mutex is always unlocked _before_ mysys_var->mutex is
-    locked (if that would not be the case, you'll get a deadlock if someone
-    does a THD::awake() on you).
-  */
-  pthread_mutex_unlock(thd->mysys_var->current_mutex);
-  pthread_mutex_lock(&thd->mysys_var->mutex);
-  thd->mysys_var->current_mutex = 0;
-  thd->mysys_var->current_cond = 0;
-  thd_proc_info(thd, old_msg);
-  pthread_mutex_unlock(&thd->mysys_var->mutex);
-  return;
+  thd->exit_cond(old_msg);
 }
 
 extern "C"
@@ -424,6 +407,33 @@ char *thd_security_context(THD *thd, cha
 }
 
 
+/**
+  Implementation of Internal_error_handler::handle_condition().
+  The reason in having this implementation is to silence technical low-level
+  warnings during DROP TABLE operation. Currently we don't want to expose
+  the following warnings during DROP TABLE:
+    - Some of table files are missed or invalid (the table is going to be
+      deleted anyway, so why bother that something was missed);
+    - A trigger associated with the table does not have DEFINER (One of the
+      MySQL specifics now is that triggers are loaded for the table being
+      dropped. So, we may have a warning that trigger does not have DEFINER
+      attribute during DROP TABLE operation).
+
+  @return TRUE if the condition is handled.
+*/
+bool Drop_table_error_handler::handle_condition(THD *thd,
+                                                uint sql_errno,
+                                                const char *sqlstate,
+                                                MYSQL_ERROR::enum_warning_level
+                                                level,
+                                                const char *msg,
+                                                MYSQL_ERROR **condition)
+{
+  return (sql_errno == EE_DELETE && my_errno == ENOENT)
+       || sql_errno == ER_TRG_NO_DEFINER;
+}
+
+
 THD::THD()
    :Statement(&main_lex, &main_mem_root, CONVENTIONAL_EXECUTION,
               /* statement id */ 0),
@@ -584,12 +594,15 @@ THD::THD()
 
 void THD::push_internal_handler(Internal_error_handler *handler)
 {
-  /*
-    TODO: The current implementation is limited to 1 handler at a time only.
-    THD and sp_rcontext need to be modified to use a common handler stack.
-  */
-  DBUG_ASSERT(m_internal_handler == NULL);
-  m_internal_handler= handler;
+  if (m_internal_handler)
+  {
+    handler->m_prev_internal_handler= m_internal_handler;
+    m_internal_handler= handler;
+  }
+  else
+  {
+    m_internal_handler= handler;
+  }
 }
 
 
@@ -599,17 +612,23 @@ bool THD::handle_condition(uint sql_errn
                            const char* msg,
                            MYSQL_ERROR ** cond_hdl)
 {
-  if (m_internal_handler)
+  if (!m_internal_handler)
   {
-    return m_internal_handler->handle_condition(this,
-                                                sql_errno,
-                                                sqlstate,
-                                                level,
-                                                msg,
-                                                cond_hdl);
+    *cond_hdl= NULL;
+    return FALSE;
+  }
+
+  for (Internal_error_handler *error_handler= m_internal_handler;
+       error_handler;
+       error_handler= m_internal_handler->m_prev_internal_handler)
+  {
+    if (error_handler-> handle_condition(this, sql_errno, sqlstate, level, msg,
+                                         cond_hdl))
+    {
+      return TRUE;
+    }
   }
 
-  *cond_hdl= NULL;
   return FALSE;
 }
 
@@ -617,7 +636,7 @@ bool THD::handle_condition(uint sql_errn
 void THD::pop_internal_handler()
 {
   DBUG_ASSERT(m_internal_handler != NULL);
-  m_internal_handler= NULL;
+  m_internal_handler= m_internal_handler->m_prev_internal_handler;
 }
 
 void THD::raise_error(uint sql_errno)

=== modified file 'sql/sql_class.h'
--- a/sql/sql_class.h	2009-05-22 17:09:16 +0000
+++ b/sql/sql_class.h	2009-05-25 10:10:18 +0000
@@ -24,7 +24,7 @@
 #include "log.h"
 #include "rpl_tblmap.h"
 #include "mdl.h"
-#include "replication.h"
+// #include "replication.h"
 
 #include <waiting_threads.h>
 
@@ -1110,7 +1110,10 @@ show_system_thread(enum_thread_type thre
 class Internal_error_handler
 {
 protected:
-  Internal_error_handler() {}
+  Internal_error_handler() :
+    m_prev_internal_handler(NULL)
+  { }
+
   virtual ~Internal_error_handler() {}
 
 public:
@@ -1145,6 +1148,36 @@ public:
                                 const char* msg,
                                 MYSQL_ERROR ** cond_hdl) = 0;
 
+private:
+  Internal_error_handler *m_prev_internal_handler;
+  friend class THD;
+};
+
+
+/**
+  This class is an internal error handler implementation for DROP DATABASE
+  and DROP TABLE statements. The thing is that there may be warnings during
+  execution of these statements, which should not be exposed to the user.
+  This class is intended to silence such warnings.
+*/
+
+class Drop_table_error_handler : public Internal_error_handler
+{
+public:
+  Drop_table_error_handler(Internal_error_handler *err_handler)
+    :m_err_handler(err_handler)
+  { }
+
+public:
+  virtual bool handle_condition(THD *thd,
+                                uint sql_errno,
+                                const char *sqlstate,
+                                MYSQL_ERROR::enum_warning_level level,
+                                const char *msg,
+                                MYSQL_ERROR **condition);
+
+private:
+  Internal_error_handler *m_err_handler;
 };
 
 /**
@@ -1954,11 +1987,27 @@ public:
   inline const char* enter_cond(pthread_cond_t *cond, pthread_mutex_t* mutex,
 			  const char* msg)
   {
-    return thd_enter_cond(this, cond, mutex, msg);
+    const char* old_msg = get_proc_info();
+    safe_mutex_assert_owner(mutex);
+    mysys_var->current_mutex = mutex;
+    mysys_var->current_cond = cond;
+    thd_proc_info(this, msg);
+    return old_msg;
   }
   inline void exit_cond(const char* old_msg)
   {
-    thd_exit_cond(this, old_msg);
+    /*
+      Putting the mutex unlock in thd_exit_cond() ensures that
+      mysys_var->current_mutex is always unlocked _before_ mysys_var->mutex is
+      locked (if that would not be the case, you'll get a deadlock if someone
+      does a THD::awake() on you).
+    */
+    pthread_mutex_unlock(mysys_var->current_mutex);
+    pthread_mutex_lock(&mysys_var->mutex);
+    mysys_var->current_mutex = 0;
+    mysys_var->current_cond = 0;
+    thd_proc_info(this, old_msg);
+    pthread_mutex_unlock(&mysys_var->mutex);
   }
   inline time_t query_start() { query_start_used=1; return start_time; }
   inline void set_time()
@@ -2269,6 +2318,9 @@ public:
   thd_scheduler scheduler;
 
 public:
+  inline Internal_error_handler *get_internal_handler()
+  { return m_internal_handler; }
+
   /**
     Add an internal error handler to the thread execution context.
     @param handler the exception handler to add

=== modified file 'sql/sql_connect.cc'
--- a/sql/sql_connect.cc	2009-03-17 20:26:16 +0000
+++ b/sql/sql_connect.cc	2009-05-14 21:49:53 +0000
@@ -218,7 +218,7 @@ void time_out_user_resource_limits(THD *
   DBUG_ENTER("time_out_user_resource_limits");
 
   /* If more than a hour since last check, reset resource checking */
-  if (check_time  - uc->reset_utime >= LL(3600000000))
+  if (check_time  - uc->reset_utime >= 3600000000LL)
   {
     uc->questions=1;
     uc->updates=0;

=== modified file 'sql/sql_db.cc'
--- a/sql/sql_db.cc	2009-05-15 13:45:06 +0000
+++ b/sql/sql_db.cc	2009-05-25 10:10:18 +0000
@@ -913,6 +913,9 @@ bool mysql_rm_db(THD *thd,char *db,bool 
   }
   else
   {
+    Drop_table_error_handler err_handler(thd->get_internal_handler());
+    thd->push_internal_handler(&err_handler);
+
     error= -1;
     /*
       We temporarily disable the binary log while dropping the objects
@@ -945,6 +948,8 @@ bool mysql_rm_db(THD *thd,char *db,bool 
       error = 0;
       reenable_binlog(thd);
     }
+
+    thd->pop_internal_handler();
   }
   if (!silent && deleted>=0)
   {

=== modified file 'sql/sql_delete.cc'
--- a/sql/sql_delete.cc	2009-05-15 13:45:06 +0000
+++ b/sql/sql_delete.cc	2009-05-25 10:10:18 +0000
@@ -1039,7 +1039,7 @@ static bool mysql_truncate_by_delete(THD
   mysql_init_select(thd->lex);
   thd->clear_current_stmt_binlog_row_based();
   /* Delete all rows from table */
-  error= mysql_delete(thd, table_list, NULL, NULL, HA_POS_ERROR, LL(0), TRUE);
+  error= mysql_delete(thd, table_list, NULL, NULL, HA_POS_ERROR, 0LL, TRUE);
   /*
     All effects of a TRUNCATE TABLE operation are rolled back if a row by row
     deletion fails. Otherwise, operation is automatically committed at the end.

=== modified file 'sql/sql_lex.cc'
--- a/sql/sql_lex.cc	2009-05-15 13:45:06 +0000
+++ b/sql/sql_lex.cc	2009-05-25 10:10:18 +0000
@@ -2131,7 +2131,7 @@ void st_select_lex::print_limit(THD *thd
                     ((Item_in_subselect*)item)->exec_method ==
                     Item_in_subselect::MATERIALIZATION) ?
                    TRUE :
-                   (select_limit->val_int() == LL(1)) &&
+                   (select_limit->val_int() == 1LL) &&
                    offset_limit == 0));
       return;
     }
@@ -2534,7 +2534,7 @@ void st_select_lex_unit::set_limit(st_se
   if (val != (ulonglong)select_limit_val)
     select_limit_val= HA_POS_ERROR;
 #endif
-  val= sl->offset_limit ? sl->offset_limit->val_uint() : ULL(0);
+  val= sl->offset_limit ? sl->offset_limit->val_uint() : 0ULL;
   offset_limit_cnt= (ha_rows)val;
 #ifndef BIG_TABLES
   /* Check for truncation. */

=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc	2009-05-18 10:54:30 +0000
+++ b/sql/sql_parse.cc	2009-05-25 10:10:18 +0000
@@ -210,8 +210,8 @@ void init_update_queries(void)
   sql_command_flags[SQLCOM_CREATE_VIEW]=    CF_CHANGES_DATA | CF_REEXECUTION_FRAGILE |
                                             CF_AUTO_COMMIT_TRANS;
   sql_command_flags[SQLCOM_DROP_VIEW]=      CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;
-  sql_command_flags[SQLCOM_CREATE_TRIGGER]= CF_AUTO_COMMIT_TRANS;
-  sql_command_flags[SQLCOM_DROP_TRIGGER]=   CF_AUTO_COMMIT_TRANS;
+  sql_command_flags[SQLCOM_CREATE_TRIGGER]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;
+  sql_command_flags[SQLCOM_DROP_TRIGGER]=   CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;
   sql_command_flags[SQLCOM_CREATE_EVENT]=   CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;
   sql_command_flags[SQLCOM_ALTER_EVENT]=    CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;
   sql_command_flags[SQLCOM_DROP_EVENT]=     CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;
@@ -233,8 +233,7 @@ void init_update_queries(void)
   sql_command_flags[SQLCOM_REPLACE_SELECT]= CF_CHANGES_DATA | CF_HAS_ROW_COUNT |
                                             CF_REEXECUTION_FRAGILE;
   sql_command_flags[SQLCOM_SELECT]=         CF_REEXECUTION_FRAGILE;
-  sql_command_flags[SQLCOM_SET_OPTION]=     CF_REEXECUTION_FRAGILE |
-                                            CF_AUTO_COMMIT_TRANS;
+  sql_command_flags[SQLCOM_SET_OPTION]=     CF_REEXECUTION_FRAGILE | CF_AUTO_COMMIT_TRANS;
   sql_command_flags[SQLCOM_DO]=             CF_REEXECUTION_FRAGILE;
 
   sql_command_flags[SQLCOM_SHOW_STATUS_PROC]= CF_STATUS_COMMAND | CF_REEXECUTION_FRAGILE;
@@ -249,34 +248,35 @@ void init_update_queries(void)
   sql_command_flags[SQLCOM_SHOW_VARIABLES]=   CF_STATUS_COMMAND | CF_REEXECUTION_FRAGILE;
   sql_command_flags[SQLCOM_SHOW_CHARSETS]=    CF_STATUS_COMMAND | CF_REEXECUTION_FRAGILE;
   sql_command_flags[SQLCOM_SHOW_COLLATIONS]=  CF_STATUS_COMMAND | CF_REEXECUTION_FRAGILE;
-  sql_command_flags[SQLCOM_SHOW_NEW_MASTER]= CF_STATUS_COMMAND;
-  sql_command_flags[SQLCOM_SHOW_BINLOGS]= CF_STATUS_COMMAND;
+  sql_command_flags[SQLCOM_SHOW_NEW_MASTER]=  CF_STATUS_COMMAND;
+  sql_command_flags[SQLCOM_SHOW_BINLOGS]=     CF_STATUS_COMMAND;
   sql_command_flags[SQLCOM_SHOW_SLAVE_HOSTS]= CF_STATUS_COMMAND;
   sql_command_flags[SQLCOM_SHOW_BINLOG_EVENTS]= CF_STATUS_COMMAND;
   sql_command_flags[SQLCOM_SHOW_STORAGE_ENGINES]= CF_STATUS_COMMAND;
-  sql_command_flags[SQLCOM_SHOW_AUTHORS]= CF_STATUS_COMMAND;
+  sql_command_flags[SQLCOM_SHOW_AUTHORS]=     CF_STATUS_COMMAND;
   sql_command_flags[SQLCOM_SHOW_CONTRIBUTORS]= CF_STATUS_COMMAND;
-  sql_command_flags[SQLCOM_SHOW_PRIVILEGES]= CF_STATUS_COMMAND;
-  sql_command_flags[SQLCOM_SHOW_WARNS]= CF_STATUS_COMMAND | CF_DIAGNOSTIC_STMT;
-  sql_command_flags[SQLCOM_SHOW_ERRORS]= CF_STATUS_COMMAND | CF_DIAGNOSTIC_STMT;
+  sql_command_flags[SQLCOM_SHOW_PRIVILEGES]=  CF_STATUS_COMMAND;
+  sql_command_flags[SQLCOM_SHOW_WARNS]=       CF_STATUS_COMMAND | CF_DIAGNOSTIC_STMT;
+  sql_command_flags[SQLCOM_SHOW_ERRORS]=      CF_STATUS_COMMAND | CF_DIAGNOSTIC_STMT;
   sql_command_flags[SQLCOM_SHOW_ENGINE_STATUS]= CF_STATUS_COMMAND;
   sql_command_flags[SQLCOM_SHOW_ENGINE_MUTEX]= CF_STATUS_COMMAND;
   sql_command_flags[SQLCOM_SHOW_ENGINE_LOGS]= CF_STATUS_COMMAND;
   sql_command_flags[SQLCOM_SHOW_PROCESSLIST]= CF_STATUS_COMMAND;
-  sql_command_flags[SQLCOM_SHOW_GRANTS]=  CF_STATUS_COMMAND;
-  sql_command_flags[SQLCOM_SHOW_CREATE_DB]=  CF_STATUS_COMMAND;
+  sql_command_flags[SQLCOM_SHOW_GRANTS]=      CF_STATUS_COMMAND;
+  sql_command_flags[SQLCOM_SHOW_CREATE_DB]=   CF_STATUS_COMMAND;
   sql_command_flags[SQLCOM_SHOW_CREATE]=  CF_STATUS_COMMAND;
-  sql_command_flags[SQLCOM_SHOW_MASTER_STAT]=  CF_STATUS_COMMAND;
+  sql_command_flags[SQLCOM_SHOW_MASTER_STAT]= CF_STATUS_COMMAND;
   sql_command_flags[SQLCOM_SHOW_SLAVE_STAT]=  CF_STATUS_COMMAND;
-  sql_command_flags[SQLCOM_SHOW_CREATE_PROC]=  CF_STATUS_COMMAND;
-  sql_command_flags[SQLCOM_SHOW_CREATE_FUNC]=  CF_STATUS_COMMAND;
+  sql_command_flags[SQLCOM_SHOW_CREATE_PROC]= CF_STATUS_COMMAND;
+  sql_command_flags[SQLCOM_SHOW_CREATE_FUNC]= CF_STATUS_COMMAND;
   sql_command_flags[SQLCOM_SHOW_CREATE_TRIGGER]=  CF_STATUS_COMMAND;
-  sql_command_flags[SQLCOM_SHOW_STATUS_FUNC]=  CF_STATUS_COMMAND | CF_REEXECUTION_FRAGILE;
-  sql_command_flags[SQLCOM_SHOW_PROC_CODE]=  CF_STATUS_COMMAND;
-  sql_command_flags[SQLCOM_SHOW_FUNC_CODE]=  CF_STATUS_COMMAND;
-  sql_command_flags[SQLCOM_SHOW_CREATE_EVENT]=  CF_STATUS_COMMAND;
-  sql_command_flags[SQLCOM_SHOW_PROFILES]= CF_STATUS_COMMAND;
-  sql_command_flags[SQLCOM_SHOW_PROFILE]= CF_STATUS_COMMAND;
+  sql_command_flags[SQLCOM_SHOW_STATUS_FUNC]= CF_STATUS_COMMAND | CF_REEXECUTION_FRAGILE;
+  sql_command_flags[SQLCOM_SHOW_PROC_CODE]=   CF_STATUS_COMMAND;
+  sql_command_flags[SQLCOM_SHOW_FUNC_CODE]=   CF_STATUS_COMMAND;
+  sql_command_flags[SQLCOM_SHOW_CREATE_EVENT]= CF_STATUS_COMMAND;
+  sql_command_flags[SQLCOM_SHOW_PROFILES]=    CF_STATUS_COMMAND;
+  sql_command_flags[SQLCOM_SHOW_PROFILE]=     CF_STATUS_COMMAND;
+  sql_command_flags[SQLCOM_BINLOG_BASE64_EVENT]= CF_STATUS_COMMAND;
 
    sql_command_flags[SQLCOM_SHOW_TABLES]=       (CF_STATUS_COMMAND |
                                                  CF_SHOW_TABLE_COMMAND |
@@ -285,37 +285,52 @@ void init_update_queries(void)
                                                 CF_SHOW_TABLE_COMMAND |
                                                 CF_REEXECUTION_FRAGILE);
 
+
+  sql_command_flags[SQLCOM_CREATE_USER]=       CF_CHANGES_DATA;
+  sql_command_flags[SQLCOM_RENAME_USER]=       CF_CHANGES_DATA;
+  sql_command_flags[SQLCOM_DROP_USER]=         CF_CHANGES_DATA;
+  sql_command_flags[SQLCOM_GRANT]=             CF_CHANGES_DATA;
+  sql_command_flags[SQLCOM_REVOKE]=            CF_CHANGES_DATA;
+  sql_command_flags[SQLCOM_ALTER_DB]=          CF_CHANGES_DATA;
+  sql_command_flags[SQLCOM_CREATE_FUNCTION]=   CF_CHANGES_DATA;
+  sql_command_flags[SQLCOM_DROP_FUNCTION]=     CF_CHANGES_DATA;
+  sql_command_flags[SQLCOM_OPTIMIZE]=          CF_CHANGES_DATA;
+  sql_command_flags[SQLCOM_CREATE_PROCEDURE]=  CF_CHANGES_DATA;
+  sql_command_flags[SQLCOM_CREATE_SPFUNCTION]= CF_CHANGES_DATA;
+  sql_command_flags[SQLCOM_DROP_PROCEDURE]=    CF_CHANGES_DATA;
+  sql_command_flags[SQLCOM_ALTER_PROCEDURE]=   CF_CHANGES_DATA;
+  sql_command_flags[SQLCOM_ALTER_FUNCTION]=    CF_CHANGES_DATA;
+  sql_command_flags[SQLCOM_INSTALL_PLUGIN]=    CF_CHANGES_DATA;
+  sql_command_flags[SQLCOM_UNINSTALL_PLUGIN]=  CF_CHANGES_DATA;
+
   /*
     The following is used to preserver CF_ROW_COUNT during the
     a CALL or EXECUTE statement, so the value generated by the
     last called (or executed) statement is preserved.
     See mysql_execute_command() for how CF_ROW_COUNT is used.
   */
-  sql_command_flags[SQLCOM_CALL]= 		CF_HAS_ROW_COUNT | CF_REEXECUTION_FRAGILE;
-  sql_command_flags[SQLCOM_EXECUTE]= 		CF_HAS_ROW_COUNT;
+  sql_command_flags[SQLCOM_CALL]=      CF_HAS_ROW_COUNT | CF_REEXECUTION_FRAGILE;
+  sql_command_flags[SQLCOM_EXECUTE]=   CF_HAS_ROW_COUNT;
 
   /*
     The following admin table operations are allowed
     on log tables.
   */
-  sql_command_flags[SQLCOM_REPAIR]=           CF_WRITE_LOGS_COMMAND |
-                                              CF_AUTO_COMMIT_TRANS;
-  sql_command_flags[SQLCOM_OPTIMIZE]=         CF_WRITE_LOGS_COMMAND |
-                                              CF_AUTO_COMMIT_TRANS;
-  sql_command_flags[SQLCOM_ANALYZE]=          CF_WRITE_LOGS_COMMAND |
-                                              CF_AUTO_COMMIT_TRANS;
-
-  sql_command_flags[SQLCOM_CREATE_USER]=      CF_AUTO_COMMIT_TRANS;
-  sql_command_flags[SQLCOM_DROP_USER]=        CF_AUTO_COMMIT_TRANS;
-  sql_command_flags[SQLCOM_RENAME_USER]=      CF_AUTO_COMMIT_TRANS;
-  sql_command_flags[SQLCOM_REVOKE_ALL]=       CF_AUTO_COMMIT_TRANS;
-  sql_command_flags[SQLCOM_REVOKE]=           CF_AUTO_COMMIT_TRANS;
-  sql_command_flags[SQLCOM_GRANT]=            CF_AUTO_COMMIT_TRANS;
-
-  sql_command_flags[SQLCOM_CREATE_PROCEDURE]=   CF_AUTO_COMMIT_TRANS;
-  sql_command_flags[SQLCOM_CREATE_SPFUNCTION]=  CF_AUTO_COMMIT_TRANS;
-  sql_command_flags[SQLCOM_ALTER_PROCEDURE]=    CF_AUTO_COMMIT_TRANS;
-  sql_command_flags[SQLCOM_ALTER_FUNCTION]=     CF_AUTO_COMMIT_TRANS;
+  sql_command_flags[SQLCOM_REPAIR]=    CF_WRITE_LOGS_COMMAND | CF_AUTO_COMMIT_TRANS;
+  sql_command_flags[SQLCOM_OPTIMIZE]|= CF_WRITE_LOGS_COMMAND | CF_AUTO_COMMIT_TRANS;
+  sql_command_flags[SQLCOM_ANALYZE]=   CF_WRITE_LOGS_COMMAND | CF_AUTO_COMMIT_TRANS;
+
+  sql_command_flags[SQLCOM_CREATE_USER]|=       CF_AUTO_COMMIT_TRANS;
+  sql_command_flags[SQLCOM_DROP_USER]|=         CF_AUTO_COMMIT_TRANS;
+  sql_command_flags[SQLCOM_RENAME_USER]|=       CF_AUTO_COMMIT_TRANS;
+  sql_command_flags[SQLCOM_REVOKE_ALL]=         CF_AUTO_COMMIT_TRANS;
+  sql_command_flags[SQLCOM_REVOKE]|=            CF_AUTO_COMMIT_TRANS;
+  sql_command_flags[SQLCOM_GRANT]|=             CF_AUTO_COMMIT_TRANS;
+
+  sql_command_flags[SQLCOM_CREATE_PROCEDURE]|=  CF_AUTO_COMMIT_TRANS;
+  sql_command_flags[SQLCOM_CREATE_SPFUNCTION]|= CF_AUTO_COMMIT_TRANS;
+  sql_command_flags[SQLCOM_ALTER_PROCEDURE]|=   CF_AUTO_COMMIT_TRANS;
+  sql_command_flags[SQLCOM_ALTER_FUNCTION]|=    CF_AUTO_COMMIT_TRANS;
   sql_command_flags[SQLCOM_ASSIGN_TO_KEYCACHE]= CF_AUTO_COMMIT_TRANS;
   sql_command_flags[SQLCOM_PRELOAD_KEYS]=       CF_AUTO_COMMIT_TRANS;
 
@@ -1328,7 +1343,7 @@ bool dispatch_command(enum enum_server_c
     if (!(uptime= (ulong) (thd->start_time - server_start_time)))
       queries_per_second1000= 0;
     else
-      queries_per_second1000= thd->query_id * LL(1000) / uptime;
+      queries_per_second1000= thd->query_id * 1000LL / uptime;
 
 #if defined(SAFEMALLOC) || !defined(EMBEDDED_LIBRARY)
     length=
@@ -6594,11 +6609,11 @@ void st_select_lex::set_lock_for_tables(
     operation and also for any single select union construct of the form
     @verbatim
     (SELECT ... ORDER BY order_list [LIMIT n]) ORDER BY ... 
-    @endvarbatim
+    @endverbatim
     or of the form
-    @varbatim
+    @verbatim
     (SELECT ... ORDER BY LIMIT n) ORDER BY ...
-    @endvarbatim
+    @endverbatim
   
   @param thd_arg		   thread handle
 

=== modified file 'sql/sql_partition.cc'
--- a/sql/sql_partition.cc	2009-04-01 09:15:50 +0000
+++ b/sql/sql_partition.cc	2009-05-14 21:49:53 +0000
@@ -4314,7 +4314,7 @@ uint prep_alter_part_table(THD *thd, TAB
       alt_part_info->part_type= tab_part_info->part_type;
       alt_part_info->subpart_type= tab_part_info->subpart_type;
       if (alt_part_info->set_up_defaults_for_partitioning(table->file,
-                                                          ULL(0), 
+                                                          0ULL, 
                                                           tab_part_info->no_parts))
       {
         DBUG_RETURN(TRUE);
@@ -4735,7 +4735,7 @@ state of p1.
       alt_part_info->no_subparts= tab_part_info->no_subparts;
       DBUG_ASSERT(!alt_part_info->use_default_partitions);
       if (alt_part_info->set_up_defaults_for_partitioning(table->file,
-                                                          ULL(0), 
+                                                          0ULL, 
                                                           0))
       {
         DBUG_RETURN(TRUE);
@@ -4876,7 +4876,7 @@ the generated partition syntax in a corr
         tab_part_info->use_default_no_subpartitions= FALSE;
       }
       if (tab_part_info->check_partition_info(thd, (handlerton**)NULL,
-                                              table->file, ULL(0), FALSE))
+                                              table->file, 0ULL, FALSE))
       {
         DBUG_RETURN(TRUE);
       }

=== modified file 'sql/sql_plugin.cc'
--- a/sql/sql_plugin.cc	2009-05-18 08:38:46 +0000
+++ b/sql/sql_plugin.cc	2009-05-25 10:10:18 +0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 MySQL AB
+/* Copyright (C) 2005 MySQL AB, 2009 Sun Microsystems, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -108,7 +108,9 @@ static int cur_plugin_info_interface_ver
   MYSQL_REPLICATION_INTERFACE_VERSION
 };
 
-static bool initialized= 0;
+/* support for Services */
+
+#include "sql_plugin_services.h"
 
 /*
   A mutex LOCK_plugin must be acquired before accessing the
@@ -122,6 +124,8 @@ static HASH plugin_hash[MYSQL_MAX_PLUGIN
 static bool reap_needed= false;
 static int plugin_array_version=0;
 
+static bool initialized= 0;
+
 /*
   write-lock on LOCK_system_variables_hash is required before modifying
   the following variables/structures
@@ -234,6 +238,22 @@ extern bool throw_bounds_warning(THD *th
 extern bool check_if_table_exists(THD *thd, TABLE_LIST *table, bool *exists);
 #endif /* EMBEDDED_LIBRARY */
 
+static void report_error(int where_to, uint error, ...)
+{
+  va_list args;
+  if (where_to & REPORT_TO_USER)
+  {
+    va_start(args, error);
+    my_printv_error(error, ER(error), MYF(0), args);
+    va_end(args);
+  }
+  if (where_to & REPORT_TO_LOG)
+  {
+    va_start(args, error);
+    error_log_print(ERROR_LEVEL, ER(error), args);
+    va_end(args);
+  }
+}
 
 /****************************************************************************
   Value type thunks, allows the C world to play in the C++ world
@@ -354,7 +374,7 @@ static st_plugin_dl *plugin_dl_add(const
 {
 #ifdef HAVE_DLOPEN
   char dlpath[FN_REFLEN];
-  uint plugin_dir_len, dummy_errors, dlpathlen;
+  uint plugin_dir_len, dummy_errors, dlpathlen, i;
   struct st_plugin_dl *tmp, plugin_dl;
   void *sym;
   DBUG_ENTER("plugin_dl_add");
@@ -369,10 +389,7 @@ static st_plugin_dl *plugin_dl_add(const
                                system_charset_info, 1) ||
       plugin_dir_len + dl->length + 1 >= FN_REFLEN)
   {
-    if (report & REPORT_TO_USER)
-      my_error(ER_UDF_NO_PATHS, MYF(0));
-    if (report & REPORT_TO_LOG)
-      sql_print_error(ER(ER_UDF_NO_PATHS));
+    report_error(report, ER_UDF_NO_PATHS);
     DBUG_RETURN(0);
   }
   /* If this dll is already loaded just increase ref_count. */
@@ -397,20 +414,14 @@ static st_plugin_dl *plugin_dl_add(const
       if (*errmsg == ':') errmsg++;
       if (*errmsg == ' ') errmsg++;
     }
-    if (report & REPORT_TO_USER)
-      my_error(ER_CANT_OPEN_LIBRARY, MYF(0), dlpath, errno, errmsg);
-    if (report & REPORT_TO_LOG)
-      sql_print_error(ER(ER_CANT_OPEN_LIBRARY), dlpath, errno, errmsg);
+    report_error(report, ER_CANT_OPEN_LIBRARY, dlpath, errno, errmsg);
     DBUG_RETURN(0);
   }
   /* Determine interface version */
   if (!(sym= dlsym(plugin_dl.handle, plugin_interface_version_sym)))
   {
     free_plugin_mem(&plugin_dl);
-    if (report & REPORT_TO_USER)
-      my_error(ER_CANT_FIND_DL_ENTRY, MYF(0), plugin_interface_version_sym);
-    if (report & REPORT_TO_LOG)
-      sql_print_error(ER(ER_CANT_FIND_DL_ENTRY), plugin_interface_version_sym);
+    report_error(report, ER_CANT_FIND_DL_ENTRY, plugin_interface_version_sym);
     DBUG_RETURN(0);
   }
   plugin_dl.version= *(int *)sym;
@@ -419,28 +430,38 @@ static st_plugin_dl *plugin_dl_add(const
       (plugin_dl.version >> 8) > (MYSQL_PLUGIN_INTERFACE_VERSION >> 8))
   {
     free_plugin_mem(&plugin_dl);
-    if (report & REPORT_TO_USER)
-      my_error(ER_CANT_OPEN_LIBRARY, MYF(0), dlpath, 0,
-               "plugin interface version mismatch");
-    if (report & REPORT_TO_LOG)
-      sql_print_error(ER(ER_CANT_OPEN_LIBRARY), dlpath, 0,
-                      "plugin interface version mismatch");
+    report_error(report, ER_CANT_OPEN_LIBRARY, dlpath, 0,
+                 "plugin interface version mismatch");
     DBUG_RETURN(0);
   }
+  for (i= 0; i < array_elements(list_of_services); i++)
+  {
+    if ((sym= dlsym(plugin_dl.handle, list_of_services[i].name)))
+    {
+      uint ver= (uint)(intptr)*(void**)sym;
+      if (ver > list_of_services[i].version ||
+        (ver >> 8) < (list_of_services[i].version >> 8))
+      {
+        char buf[MYSQL_ERRMSG_SIZE];
+        my_snprintf(buf, sizeof(buf),
+                    "service '%s' interface version mismatch",
+                    list_of_services[i].name);
+        report_error(report, ER_CANT_OPEN_LIBRARY, dlpath, 0, buf);
+        DBUG_RETURN(0);
+      }
+      *(void**)sym= list_of_services[i].service;
+    }
+  }
   /* Find plugin declarations */
   if (!(sym= dlsym(plugin_dl.handle, plugin_declarations_sym)))
   {
     free_plugin_mem(&plugin_dl);
-    if (report & REPORT_TO_USER)
-      my_error(ER_CANT_FIND_DL_ENTRY, MYF(0), plugin_declarations_sym);
-    if (report & REPORT_TO_LOG)
-      sql_print_error(ER(ER_CANT_FIND_DL_ENTRY), plugin_declarations_sym);
+    report_error(report, ER_CANT_FIND_DL_ENTRY, plugin_declarations_sym);
     DBUG_RETURN(0);
   }
 
   if (plugin_dl.version != MYSQL_PLUGIN_INTERFACE_VERSION)
   {
-    int i;
     uint sizeof_st_plugin;
     struct st_mysql_plugin *old, *cur;
     char *ptr= (char *)sym;
@@ -451,10 +472,7 @@ static st_plugin_dl *plugin_dl_add(const
     {
 #ifdef ERROR_ON_NO_SIZEOF_PLUGIN_SYMBOL
       free_plugin_mem(&plugin_dl);
-      if (report & REPORT_TO_USER)
-        my_error(ER_CANT_FIND_DL_ENTRY, MYF(0), sizeof_st_plugin_sym);
-      if (report & REPORT_TO_LOG)
-        sql_print_error(ER(ER_CANT_FIND_DL_ENTRY), sizeof_st_plugin_sym);
+      report_error(report, ER_CANT_FIND_DL_ENTRY, sizeof_st_plugin_sym);
       DBUG_RETURN(0);
 #else
       /*
@@ -476,10 +494,7 @@ static st_plugin_dl *plugin_dl_add(const
     if (!cur)
     {
       free_plugin_mem(&plugin_dl);
-      if (report & REPORT_TO_USER)
-        my_error(ER_OUTOFMEMORY, MYF(0), plugin_dl.dl.length);
-      if (report & REPORT_TO_LOG)
-        sql_print_error(ER(ER_OUTOFMEMORY), plugin_dl.dl.length);
+      report_error(report, ER_OUTOFMEMORY, plugin_dl.dl.length);
       DBUG_RETURN(0);
     }
     /*
@@ -501,10 +516,7 @@ static st_plugin_dl *plugin_dl_add(const
   if (! (plugin_dl.dl.str= (char*) my_malloc(plugin_dl.dl.length, MYF(0))))
   {
     free_plugin_mem(&plugin_dl);
-    if (report & REPORT_TO_USER)
-      my_error(ER_OUTOFMEMORY, MYF(0), plugin_dl.dl.length);
-    if (report & REPORT_TO_LOG)
-      sql_print_error(ER(ER_OUTOFMEMORY), plugin_dl.dl.length);
+    report_error(report, ER_OUTOFMEMORY, plugin_dl.dl.length);
     DBUG_RETURN(0);
   }
   plugin_dl.dl.length= copy_and_convert(plugin_dl.dl.str, plugin_dl.dl.length,
@@ -515,19 +527,13 @@ static st_plugin_dl *plugin_dl_add(const
   if (! (tmp= plugin_dl_insert_or_reuse(&plugin_dl)))
   {
     free_plugin_mem(&plugin_dl);
-    if (report & REPORT_TO_USER)
-      my_error(ER_OUTOFMEMORY, MYF(0), sizeof(struct st_plugin_dl));
-    if (report & REPORT_TO_LOG)
-      sql_print_error(ER(ER_OUTOFMEMORY), sizeof(struct st_plugin_dl));
+    report_error(report, ER_OUTOFMEMORY, sizeof(struct st_plugin_dl));
     DBUG_RETURN(0);
   }
   DBUG_RETURN(tmp);
 #else
   DBUG_ENTER("plugin_dl_add");
-  if (report & REPORT_TO_USER)
-    my_error(ER_FEATURE_DISABLED, MYF(0), "plugin", "HAVE_DLOPEN");
-  if (report & REPORT_TO_LOG)
-    sql_print_error(ER(ER_FEATURE_DISABLED), "plugin", "HAVE_DLOPEN");
+  report_error(report, ER_FEATURE_DISABLED, "plugin", "HAVE_DLOPEN");
   DBUG_RETURN(0);
 #endif
 }
@@ -644,7 +650,7 @@ static plugin_ref intern_plugin_lock(LEX
     /*
       For debugging, we do an additional malloc which allows the
       memory manager and/or valgrind to track locked references and
-      double unlocks to aid resolving reference counting.problems.
+      double unlocks to aid resolving reference counting problems.
     */
     if (!(plugin= (plugin_ref) my_malloc_ci(sizeof(pi), MYF(MY_WME))))
       DBUG_RETURN(NULL);
@@ -727,10 +733,7 @@ static bool plugin_add(MEM_ROOT *tmp_roo
   DBUG_ENTER("plugin_add");
   if (plugin_find_internal(name, MYSQL_ANY_PLUGIN))
   {
-    if (report & REPORT_TO_USER)
-      my_error(ER_UDF_EXISTS, MYF(0), name->str);
-    if (report & REPORT_TO_LOG)
-      sql_print_error(ER(ER_UDF_EXISTS), name->str);
+    report_error(report, ER_UDF_EXISTS, name->str);
     DBUG_RETURN(TRUE);
   }
   /* Clear the whole struct to catch future extensions. */
@@ -757,10 +760,7 @@ static bool plugin_add(MEM_ROOT *tmp_roo
         strxnmov(buf, sizeof(buf) - 1, "API version for ",
                  plugin_type_names[plugin->type].str,
                  " plugin is too different", NullS);
-        if (report & REPORT_TO_USER)
-          my_error(ER_CANT_OPEN_LIBRARY, MYF(0), dl->str, 0, buf);
-        if (report & REPORT_TO_LOG)
-          sql_print_error(ER(ER_CANT_OPEN_LIBRARY), dl->str, 0, buf);
+        report_error(report, ER_CANT_OPEN_LIBRARY, dl->str, 0, buf);
         goto err;
       }
       tmp.plugin= plugin;
@@ -789,10 +789,7 @@ static bool plugin_add(MEM_ROOT *tmp_roo
       DBUG_RETURN(FALSE);
     }
   }
-  if (report & REPORT_TO_USER)
-    my_error(ER_CANT_FIND_DL_ENTRY, MYF(0), name->str);
-  if (report & REPORT_TO_LOG)
-    sql_print_error(ER(ER_CANT_FIND_DL_ENTRY), name->str);
+  report_error(report, ER_CANT_FIND_DL_ENTRY, name->str);
 err:
   plugin_dl_del(dl);
   DBUG_RETURN(TRUE);
@@ -1014,7 +1011,9 @@ static int plugin_initialize(struct st_p
   DBUG_ENTER("plugin_initialize");
 
   safe_mutex_assert_owner(&LOCK_plugin);
-  DBUG_ASSERT(plugin->state == PLUGIN_IS_UNINITIALIZED);
+  uint state= plugin->state;
+  int ret= 1;
+  DBUG_ASSERT(state == PLUGIN_IS_UNINITIALIZED);
 
   pthread_mutex_unlock(&LOCK_plugin);
   if (plugin_type_initialize[plugin->plugin->type])
@@ -1035,10 +1034,7 @@ static int plugin_initialize(struct st_p
       goto err;
     }
   }
-
-  pthread_mutex_lock(&LOCK_plugin);
-
-  plugin->state= PLUGIN_IS_READY;
+  state= PLUGIN_IS_READY; // plugin->init() succeeded
 
   if (plugin->plugin->status_vars)
   {
@@ -1055,10 +1051,10 @@ static int plugin_initialize(struct st_p
       {0, 0, SHOW_UNDEF}
     };
     if (add_status_vars(array)) // add_status_vars makes a copy
-      goto err1;
+      goto err;
 #else
     if (add_status_vars(plugin->plugin->status_vars))
-      goto err1;
+      goto err;
 #endif /* FIX_LATER */
   }
 
@@ -1078,11 +1074,12 @@ static int plugin_initialize(struct st_p
     }
   }
 
-  DBUG_RETURN(0);
+  ret= 0;
+
 err:
   pthread_mutex_lock(&LOCK_plugin);
-err1:
-  DBUG_RETURN(1);
+  plugin->state= state;
+  DBUG_RETURN(ret);
 }
 
 
@@ -1762,7 +1759,16 @@ bool mysql_uninstall_plugin(THD *thd, co
     DBUG_RETURN(TRUE);
 
   pthread_mutex_lock(&LOCK_plugin);
-  if (!(plugin= plugin_find_internal(name, MYSQL_ANY_PLUGIN)))
+  /*
+    Note - it's important that UNINSTALL PLUGIN does not "see" plugins
+    in the intermediate states. To avoid deadlocks and improve concurrency
+    LOCK_plugin is often released when a work is done on a plugin in
+    the intermediate state (e.g. plugin initialization happens outside of
+    LOCK_plugin). Thus we should not allow a plugin to be dropped until
+    it reaches one of the final states.
+  */
+  if (!(plugin= plugin_find_internal(name, MYSQL_ANY_PLUGIN)) ||
+      !(plugin->state == PLUGIN_IS_READY || plugin->state == PLUGIN_IS_DISABLED))
   {
     my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "PLUGIN", name->str);
     goto err;
@@ -2113,7 +2119,7 @@ static int check_func_set(THD *thd, stru
   {
     if (value->val_int(value, (long long *)&result))
       goto err;
-    if (unlikely((result >= (ULL(1) << typelib->count)) &&
+    if (unlikely((result >= (1ULL << typelib->count)) &&
                  (typelib->count < sizeof(long)*8)))
     {
       llstr(result, buff);
@@ -2849,7 +2855,7 @@ static void plugin_opt_set_limits(struct
     options->typelib= ((sysvar_set_t*) opt)->typelib;
     options->def_value= ((sysvar_set_t*) opt)->def_val;
     options->min_value= options->block_size= 0;
-    options->max_value= (ULL(1) << options->typelib->count) - 1;
+    options->max_value= (1ULL << options->typelib->count) - 1;
     break;
   case PLUGIN_VAR_BOOL:
     options->var_type= GET_BOOL;
@@ -2891,7 +2897,7 @@ static void plugin_opt_set_limits(struct
     options->typelib= ((thdvar_set_t*) opt)->typelib;
     options->def_value= ((thdvar_set_t*) opt)->def_val;
     options->min_value= options->block_size= 0;
-    options->max_value= (ULL(1) << options->typelib->count) - 1;
+    options->max_value= (1ULL << options->typelib->count) - 1;
     break;
   case PLUGIN_VAR_BOOL | PLUGIN_VAR_THDLOCAL:
     options->var_type= GET_BOOL;

=== modified file 'sql/sql_plugin.h'
--- a/sql/sql_plugin.h	2009-05-15 09:18:07 +0000
+++ b/sql/sql_plugin.h	2009-05-25 10:10:18 +0000
@@ -35,16 +35,6 @@ class sys_var;
 
 #define INITIAL_LEX_PLUGIN_LIST_SIZE    16
 
-/*
-  the following #define adds server-only members to enum_mysql_show_type,
-  that is defined in plugin.h
-*/
-#define SHOW_FUNC    SHOW_FUNC, SHOW_KEY_CACHE_LONG, SHOW_KEY_CACHE_LONGLONG, \
-                     SHOW_LONG_STATUS, SHOW_DOUBLE_STATUS, SHOW_HAVE,   \
-                     SHOW_MY_BOOL, SHOW_HA_ROWS, SHOW_SYS, SHOW_LONG_NOFLUSH, \
-                     SHOW_LONGLONG_STATUS
-#include <mysql/plugin.h>
-#undef SHOW_FUNC
 typedef enum enum_mysql_show_type SHOW_TYPE;
 typedef struct st_mysql_show_var SHOW_VAR;
 

=== added file 'sql/sql_plugin_services.h'
--- a/sql/sql_plugin_services.h	1970-01-01 00:00:00 +0000
+++ b/sql/sql_plugin_services.h	2009-04-30 16:22:40 +0000
@@ -0,0 +1,44 @@
+/* Copyright (C) 2009 Sun Microsystems, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; version 2 of the License.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+/* support for Services */
+#include <service_versions.h>
+
+struct st_service_ref {
+  const char *name;
+  uint version;
+  void *service;
+};
+
+static struct my_snprintf_service_st my_snprintf_handler = {
+  my_snprintf,
+  my_vsnprintf
+};
+
+static struct thd_alloc_service_st thd_alloc_handler= {
+  thd_alloc,
+  thd_calloc,
+  thd_strdup,
+  thd_strmake,
+  thd_memdup,
+  thd_make_lex_string
+};
+
+static struct st_service_ref list_of_services[]=
+{
+  { "my_snprintf_service", VERSION_my_snprintf, &my_snprintf_handler },
+  { "thd_alloc_service",   VERSION_thd_alloc,   &thd_alloc_handler }
+};
+

=== modified file 'sql/sql_prepare.cc'
--- a/sql/sql_prepare.cc	2009-05-20 14:24:00 +0000
+++ b/sql/sql_prepare.cc	2009-05-25 10:10:18 +0000
@@ -2003,29 +2003,6 @@ static bool check_prepared_statement(Pre
       Note that we don't need to have cases in this list if they are
       marked with CF_STATUS_COMMAND in sql_command_flags
     */
-  case SQLCOM_SHOW_PROCESSLIST:
-  case SQLCOM_SHOW_STORAGE_ENGINES:
-  case SQLCOM_SHOW_PRIVILEGES:
-  case SQLCOM_SHOW_ENGINE_LOGS:
-  case SQLCOM_SHOW_ENGINE_STATUS:
-  case SQLCOM_SHOW_ENGINE_MUTEX:
-  case SQLCOM_SHOW_CREATE_DB:
-  case SQLCOM_SHOW_GRANTS:
-  case SQLCOM_SHOW_BINLOG_EVENTS:
-  case SQLCOM_SHOW_MASTER_STAT:
-  case SQLCOM_SHOW_SLAVE_STAT:
-  case SQLCOM_SHOW_CREATE_PROC:
-  case SQLCOM_SHOW_CREATE_FUNC:
-  case SQLCOM_SHOW_CREATE_EVENT:
-  case SQLCOM_SHOW_CREATE_TRIGGER:
-  case SQLCOM_SHOW_CREATE:
-  case SQLCOM_SHOW_PROC_CODE:
-  case SQLCOM_SHOW_FUNC_CODE:
-  case SQLCOM_SHOW_AUTHORS:
-  case SQLCOM_SHOW_CONTRIBUTORS:
-  case SQLCOM_SHOW_WARNS:
-  case SQLCOM_SHOW_ERRORS:
-  case SQLCOM_SHOW_BINLOGS:
   case SQLCOM_DROP_TABLE:
   case SQLCOM_RENAME_TABLE:
   case SQLCOM_ALTER_TABLE:

=== modified file 'sql/sql_repl.cc'
--- a/sql/sql_repl.cc	2009-05-15 13:45:06 +0000
+++ b/sql/sql_repl.cc	2009-05-25 10:10:18 +0000
@@ -458,7 +458,7 @@ void mysql_binlog_send(THD* thd, char* l
   struct event_coordinates coord_buf;
   struct timespec *heartbeat_ts= NULL;
   struct event_coordinates *coord= NULL;
-  if (heartbeat_period != LL(0))
+  if (heartbeat_period != 0LL)
   {
     heartbeat_ts= &heartbeat_buf;
     set_timespec_nsec(*heartbeat_ts, 0);
@@ -830,11 +830,11 @@ impossible position";
           {
             if (coord)
             {
-              DBUG_ASSERT(heartbeat_ts && heartbeat_period != LL(0));
+              DBUG_ASSERT(heartbeat_ts && heartbeat_period != 0LL);
               set_timespec_nsec(*heartbeat_ts, heartbeat_period);
             }
             ret= mysql_bin_log.wait_for_update_bin_log(thd, heartbeat_ts);
-            DBUG_ASSERT(ret == 0 || heartbeat_period != LL(0) && coord != NULL);
+            DBUG_ASSERT(ret == 0 || heartbeat_period != 0LL && coord != NULL);
             if (ret == ETIMEDOUT || ret == ETIME)
             {
 #ifndef DBUG_OFF
@@ -1446,7 +1446,7 @@ bool change_master(THD* thd, Master_info
   else
     mi->heartbeat_period= (float) min(SLAVE_MAX_HEARTBEAT_PERIOD,
                                       (slave_net_timeout/2.0));
-  mi->received_heartbeats= LL(0); // counter lives until master is CHANGEd
+  mi->received_heartbeats= 0LL; // counter lives until master is CHANGEd
   /*
     reset the last time server_id list if the current CHANGE MASTER 
     is mentioning IGNORE_SERVER_IDS= (...)

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2009-05-25 08:28:53 +0000
+++ b/sql/sql_select.cc	2009-05-25 10:10:18 +0000
@@ -2220,7 +2220,7 @@ JOIN::reinit()
 
   unit->offset_limit_cnt= (ha_rows)(select_lex->offset_limit ?
                                     select_lex->offset_limit->val_uint() :
-                                    ULL(0));
+                                    0ULL);
 
   first_record= 0;
 
@@ -8330,7 +8330,7 @@ inline void add_cond_and_fix(Item **e1, 
       @code
       SELECT A.f2 FROM t1 LEFT JOIN t2 A ON A.f2 = f1
       WHERE A.f3=(SELECT MIN(f3) FROM  t2 C WHERE A.f4 = C.f4) OR A.f3 IS NULL;
-      @endocde
+      @endcode
       Here condition A.f3 IS NOT NULL is going to be added to the WHERE
       condition of the embedding query.
       Another example:

=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc	2009-05-15 13:45:06 +0000
+++ b/sql/sql_show.cc	2009-05-25 10:10:18 +0000
@@ -1713,6 +1713,30 @@ public:
 template class I_List<thread_info>;
 #endif
 
+static const char *thread_state_info(THD *tmp)
+{
+#ifndef EMBEDDED_LIBRARY
+  if (tmp->net.reading_or_writing)
+  {
+    if (tmp->net.reading_or_writing == 2)
+      return "Writing to net";
+    else if (tmp->command == COM_SLEEP)
+      return NULL;
+    else
+      return "Reading from net";
+  }
+  else
+#endif
+  {
+    if (tmp->proc_info)
+      return tmp->proc_info;
+    else if (tmp->mysys_var && tmp->mysys_var->current_cond)
+      return "Waiting on cond";
+    else
+      return NULL;
+  }
+}
+
 void mysqld_list_processes(THD *thd,const char *user, bool verbose)
 {
   Item *field;
@@ -1775,19 +1799,7 @@ void mysqld_list_processes(THD *thd,cons
         if ((mysys_var= tmp->mysys_var))
           pthread_mutex_lock(&mysys_var->mutex);
         thd_info->proc_info= (char*) (tmp->killed == THD::KILL_CONNECTION? "Killed" : 0);
-#ifndef EMBEDDED_LIBRARY
-        thd_info->state_info= (char*) (tmp->net.reading_or_writing ?
-                                       (tmp->net.reading_or_writing == 2 ?
-                                        "Writing to net" :
-                                        thd_info->command == COM_SLEEP ? NullS :
-                                        "Reading from net") :
-                                       tmp->proc_info ? tmp->proc_info :
-                                       tmp->mysys_var &&
-                                       tmp->mysys_var->current_cond ?
-                                       "Waiting on cond" : NullS);
-#else
-        thd_info->state_info= (char*)"Writing to net";
-#endif
+        thd_info->state_info= thread_state_info(tmp);
         if (mysys_var)
           pthread_mutex_unlock(&mysys_var->mutex);
         pthread_mutex_unlock(&tmp->LOCK_delete);
@@ -1902,20 +1914,7 @@ int fill_schema_processlist(THD* thd, TA
       table->field[5]->store((longlong)(tmp->start_time ?
                                       now - tmp->start_time : 0), FALSE);
       /* STATE */
-#ifndef EMBEDDED_LIBRARY
-      val= (char*) (tmp->net.reading_or_writing ?
-                    (tmp->net.reading_or_writing == 2 ?
-                     "Writing to net" :
-                     tmp->command == COM_SLEEP ? NullS :
-                     "Reading from net") :
-                    tmp->proc_info ? tmp->proc_info :
-                    tmp->mysys_var &&
-                    tmp->mysys_var->current_cond ?
-                    "Waiting on cond" : NullS);
-#else
-      val= (char *) "Writing to net";
-#endif
-      if (val)
+      if ((val= thread_state_info(tmp)))
       {
         table->field[6]->store(val, strlen(val), cs);
         table->field[6]->set_notnull();
@@ -3166,13 +3165,31 @@ static int fill_schema_table_from_frm(TH
   int error;
   char key[MAX_DBKEY_LENGTH];
   uint key_length;
+  char db_name_buff[NAME_LEN + 1], table_name_buff[NAME_LEN + 1];
   MDL_request mdl_request;
 
   bzero((char*) &table_list, sizeof(TABLE_LIST));
   bzero((char*) &tbl, sizeof(TABLE));
 
-  table_list.table_name= table_name->str;
-  table_list.db= db_name->str;
+  if (lower_case_table_names)
+  {
+    /*
+      In lower_case_table_names > 0 metadata locking and table definition
+      cache subsystems require normalized (lowercased) database and table
+      names as input.
+    */
+    strmov(db_name_buff, db_name->str);
+    strmov(table_name_buff, table_name->str);
+    my_casedn_str(files_charset_info, db_name_buff);
+    my_casedn_str(files_charset_info, table_name_buff);
+    table_list.db= db_name_buff;
+    table_list.table_name= table_name_buff;
+  }
+  else
+  {
+    table_list.table_name= table_name->str;
+    table_list.db= db_name->str;
+  }
 
   /*
     TODO: investigate if in this particular situation we can get by

=== modified file 'sql/sql_string.cc'
--- a/sql/sql_string.cc	2009-05-21 10:07:43 +0000
+++ b/sql/sql_string.cc	2009-05-25 10:10:18 +0000
@@ -34,7 +34,6 @@
 */
 
 extern uchar* sql_alloc(unsigned size);
-extern void sql_element_free(void *ptr);
 
 #include "sql_string.h"
 

=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc	2009-05-19 04:47:24 +0000
+++ b/sql/sql_table.cc	2009-05-25 10:10:18 +0000
@@ -1498,6 +1498,8 @@ bool mysql_rm_table(THD *thd,TABLE_LIST 
                     my_bool drop_temporary)
 {
   bool error, need_start_waiting= FALSE;
+  Drop_table_error_handler err_handler(thd->get_internal_handler());
+
   DBUG_ENTER("mysql_rm_table");
 
   /* mark for close and remove all cached entries */
@@ -1509,7 +1511,9 @@ bool mysql_rm_table(THD *thd,TABLE_LIST 
       DBUG_RETURN(TRUE);
   }
 
+  thd->push_internal_handler(&err_handler);
   error= mysql_rm_table_part2(thd, tables, if_exists, drop_temporary, 0, 0);
+  thd->pop_internal_handler();
 
   if (need_start_waiting)
     start_waiting_global_read_lock(thd);
@@ -1649,9 +1653,6 @@ int mysql_rm_table_part2(THD *thd, TABLE
     }
   }
 
-  /* Don't give warnings for not found errors, as we already generate notes */
-  thd->no_warnings_for_error= 1;
-
   for (table= tables; table; table= table->next_local)
   {
     char *db=table->db;
@@ -1793,11 +1794,18 @@ int mysql_rm_table_part2(THD *thd, TABLE
         wrong_tables.append(',');
       wrong_tables.append(String(table->table_name,system_charset_info));
     }
+
+    DBUG_EXECUTE_IF("bug43138",
+                    my_printf_error(ER_BAD_TABLE_ERROR,
+                                    ER(ER_BAD_TABLE_ERROR), MYF(0),
+                                    table->table_name););
+
     DBUG_PRINT("table", ("table: %p  s: %p", table->table,
                          table->table ? table->table->s : (TABLE_SHARE *)-1));
   }
   thd->thread_specific_used|= tmp_table_deleted;
   error= 0;
+
   if (wrong_tables.length())
   {
     if (!foreign_key_error)
@@ -1890,7 +1898,6 @@ err:
   }
 
 end:
-  thd->no_warnings_for_error= 0;
   DBUG_RETURN(error);
 }
 
@@ -3593,7 +3600,7 @@ bool mysql_create_table_no_lock(THD *thd
       Then she could create the table. This case is pretty obscure and
       therefore we don't introduce a new error message only for it.
     */
-    if (get_cached_table_share(db, alias))
+    if (get_cached_table_share(db, table_name))
     {
       my_error(ER_TABLE_EXISTS_ERROR, MYF(0), table_name);
       goto unlock_and_end;

=== modified file 'sql/sql_udf.h'
--- a/sql/sql_udf.h	2007-07-06 12:18:49 +0000
+++ b/sql/sql_udf.h	2009-05-14 21:49:53 +0000
@@ -99,14 +99,14 @@ class udf_handler :public Sql_alloc
     if (get_arguments())
     {
       *null_value=1;
-      return LL(0);
+      return 0LL;
     }
     Udf_func_longlong func= (Udf_func_longlong) u_d->func;
     longlong tmp=func(&initid, &f_args, &is_null, &error);
     if (is_null || error)
     {
       *null_value=1;
-      return LL(0);
+      return 0LL;
     }
     *null_value=0;
     return tmp;

=== modified file 'sql/sql_yacc.yy'
--- a/sql/sql_yacc.yy	2009-05-15 13:45:06 +0000
+++ b/sql/sql_yacc.yy	2009-05-25 10:10:18 +0000
@@ -3736,7 +3736,8 @@ change_ts_option:
         ;
 
 tablespace_option_list:
-        tablespace_options
+          /* empty */ 
+        | tablespace_options
         ;
 
 tablespace_options:
@@ -3757,7 +3758,8 @@ tablespace_option:
         ;
 
 alter_tablespace_option_list:
-        alter_tablespace_options
+          /* empty */
+        | alter_tablespace_options
         ;
 
 alter_tablespace_options:
@@ -3775,7 +3777,8 @@ alter_tablespace_option:
         ;
 
 logfile_group_option_list:
-        logfile_group_options
+          /* empty */ 
+        | logfile_group_options
         ;
 
 logfile_group_options:
@@ -3795,7 +3798,8 @@ logfile_group_option:
         ;
 
 alter_logfile_group_option_list:
-          alter_logfile_group_options
+          /* empty */ 
+        | alter_logfile_group_options
         ;
 
 alter_logfile_group_options:
@@ -3965,11 +3969,6 @@ opt_ts_engine:
           }
         ;
 
-opt_ts_wait:
-          /* empty */
-        | ts_wait
-        ;
-
 ts_wait:
           WAIT_SYM
           {
@@ -10163,12 +10162,12 @@ drop:
             lex->drop_if_exists= $3;
             lex->spname= $4;
           }
-        | DROP TABLESPACE tablespace_name opt_ts_engine opt_ts_wait
+        | DROP TABLESPACE tablespace_name drop_ts_options_list
           {
             LEX *lex= Lex;
             lex->alter_tablespace_info->ts_cmd_type= DROP_TABLESPACE;
           }
-        | DROP LOGFILE_SYM GROUP_SYM logfile_group_name opt_ts_engine opt_ts_wait
+        | DROP LOGFILE_SYM GROUP_SYM logfile_group_name drop_ts_options_list
           {
             LEX *lex= Lex;
             lex->alter_tablespace_info->ts_cmd_type= DROP_LOGFILE_GROUP;
@@ -10219,6 +10218,21 @@ opt_temporary:
           /* empty */ { $$= 0; }
         | TEMPORARY { $$= 1; }
         ;
+
+drop_ts_options_list:
+          /* empty */
+        | drop_ts_options
+
+drop_ts_options:
+          drop_ts_option
+        | drop_ts_options drop_ts_option
+        | drop_ts_options_list ',' drop_ts_option
+        ;
+
+drop_ts_option:
+          opt_ts_engine
+      	| ts_wait
+
 /*
 ** Insert : add new data to table
 */

=== modified file 'sql/thr_malloc.cc'
--- a/sql/thr_malloc.cc	2009-02-04 20:48:02 +0000
+++ b/sql/thr_malloc.cc	2009-04-06 18:36:46 +0000
@@ -106,10 +106,6 @@ void* sql_memdup(const void *ptr, size_t
   return pos;
 }
 
-void sql_element_free(void *ptr __attribute__((unused)))
-{} /* purecov: deadcode */
-
-
 
 char *sql_strmake_with_convert(const char *str, size_t arg_length,
 			       CHARSET_INFO *from_cs,

=== modified file 'sql/time.cc'
--- a/sql/time.cc	2008-11-18 19:41:51 +0000
+++ b/sql/time.cc	2009-05-14 21:49:53 +0000
@@ -799,19 +799,19 @@ bool date_add_interval(MYSQL_TIME *ltime
     sec=((ltime->day-1)*3600*24L+ltime->hour*3600+ltime->minute*60+
 	 ltime->second +
 	 sign* (longlong) (interval.day*3600*24L +
-                           interval.hour*LL(3600)+interval.minute*LL(60)+
+                           interval.hour*3600LL+interval.minute*60LL+
                            interval.second))+ extra_sec;
     if (microseconds < 0)
     {
-      microseconds+= LL(1000000);
+      microseconds+= 1000000LL;
       sec--;
     }
-    days= sec/(3600*LL(24));
-    sec-= days*3600*LL(24);
+    days= sec/(3600*24LL);
+    sec-= days*3600*24LL;
     if (sec < 0)
     {
       days--;
-      sec+= 3600*LL(24);
+      sec+= 3600*24LL;
     }
     ltime->second_part= (uint) microseconds;
     ltime->second= (uint) (sec % 60);
@@ -929,13 +929,13 @@ calc_time_diff(MYSQL_TIME *l_time1, MYSQ
 			       (uint) l_time2->day);
   }
 
-  microseconds= ((longlong)days*LL(86400) +
+  microseconds= ((longlong)days*86400LL +
                  (longlong)(l_time1->hour*3600L +
                             l_time1->minute*60L +
                             l_time1->second) -
                  l_sign*(longlong)(l_time2->hour*3600L +
                                    l_time2->minute*60L +
-                                   l_time2->second)) * LL(1000000) +
+                                   l_time2->second)) * 1000000LL +
                 (longlong)l_time1->second_part -
                 l_sign*(longlong)l_time2->second_part;
 

=== modified file 'sql/transaction.cc'
--- a/sql/transaction.cc	2009-03-06 22:17:00 +0000
+++ b/sql/transaction.cc	2009-05-12 16:41:11 +0000
@@ -18,8 +18,8 @@
 #pragma implementation                         // gcc: Class implementation
 #endif
 
-#include "transaction.h"
 #include "mysql_priv.h"
+#include "transaction.h"
 #include "rpl_handler.h"
 
 #ifdef WITH_MARIA_STORAGE_ENGINE
@@ -100,11 +100,15 @@ bool trans_begin(THD *thd, uint flags)
 
   DBUG_ASSERT(!thd->locked_tables_mode);
 
-  thd->mdl_context.release_all_locks();
-
   if (trans_commit_implicit(thd))
     DBUG_RETURN(TRUE);
 
+  /*
+    Release transactional metadata locks only after the
+    transaction has been committed.
+  */
+  thd->mdl_context.release_all_locks();
+
   thd->options|= OPTION_BEGIN;
   thd->server_status|= SERVER_STATUS_IN_TRANS;
 

=== modified file 'storage/archive/archive_performance.c'
--- a/storage/archive/archive_performance.c	2007-10-21 21:19:52 +0000
+++ b/storage/archive/archive_performance.c	2009-05-14 21:49:53 +0000
@@ -37,7 +37,7 @@
 
 char test_string[BUFFER_LEN];
 
-#define ROWS_TO_TEST LL(2000000)
+#define ROWS_TO_TEST 2000000LL
 
 /* prototypes */
 long int timedif(struct timeval a, struct timeval b);

=== modified file 'storage/archive/archive_test.c'
--- a/storage/archive/archive_test.c	2007-10-21 21:57:05 +0000
+++ b/storage/archive/archive_test.c	2009-05-14 21:49:53 +0000
@@ -33,8 +33,8 @@
 
 char test_string[BUFFER_LEN];
 
-unsigned long long row_lengths[]= {LL(536870912), LL(2147483648), LL(4294967296), LL(8589934592)};
-unsigned long long row_numbers[]= {LL(524288), LL(2097152), LL(4194304), LL(8388608)};
+unsigned long long row_lengths[]= {536870912LL, 2147483648LL, 4294967296LL, 8589934592LL};
+unsigned long long row_numbers[]= {524288LL, 2097152LL, 4194304LL, 8388608LL};
 
 /* prototypes */
 int size_test(unsigned long long length, unsigned long long rows_to_test_for, az_method method);

=== modified file 'storage/example/Makefile.am'
--- a/storage/example/Makefile.am	2009-01-07 10:58:33 +0000
+++ b/storage/example/Makefile.am	2009-04-25 21:20:45 +0000
@@ -33,7 +33,7 @@ noinst_HEADERS =	ha_example.h
 
 EXTRA_LTLIBRARIES =	ha_example.la
 pkgplugin_LTLIBRARIES =	@plugin_example_shared_target@
-ha_example_la_LDFLAGS =	-module -rpath $(pkgplugindir)
+ha_example_la_LDFLAGS =	-module -rpath $(pkgplugindir) -L$(top_builddir)/libservices -lmysqlservices
 ha_example_la_CPPFLAGS=	$(AM_CPPFLAGS) -DMYSQL_DYNAMIC_PLUGIN
 ha_example_la_SOURCES =	ha_example.cc
 

=== modified file 'storage/example/ha_example.cc'
--- a/storage/example/ha_example.cc	2009-01-27 02:08:48 +0000
+++ b/storage/example/ha_example.cc	2009-04-25 21:20:45 +0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 MySQL AB
+/* Copyright (C) 2003 MySQL AB, 2009 Sun Microsystems, Inc.
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -890,6 +890,24 @@ static struct st_mysql_sys_var* example_
   NULL
 };
 
+// this is an example of SHOW_FUNC and of my_snprintf() service
+static int show_func_example(MYSQL_THD *thd, struct st_mysql_show_var *var,
+                             char *buf)
+{
+  var->type= SHOW_CHAR;
+  var->value= buf; // it's of SHOW_VAR_FUNC_BUFF_SIZE bytes
+  my_snprintf(buf, SHOW_VAR_FUNC_BUFF_SIZE,
+              "enum_var is %u, ulong_var is %lu, %.6b", // %b is MySQL extension
+              srv_enum_var, srv_ulong_var, "really");
+  return 0;
+}
+
+static struct st_mysql_show_var func_status[]=
+{
+  {"example_func_example",  (char *)show_func_example, SHOW_FUNC},
+  {0,0,SHOW_UNDEF}
+};
+
 mysql_declare_plugin(example)
 {
   MYSQL_STORAGE_ENGINE_PLUGIN,
@@ -901,7 +919,7 @@ mysql_declare_plugin(example)
   example_init_func,                            /* Plugin Init */
   example_done_func,                            /* Plugin Deinit */
   0x0001 /* 0.1 */,
-  NULL,                                         /* status variables */
+  func_status,                                  /* status variables */
   example_system_variables,                     /* system variables */
   NULL                                          /* config options */
 }

=== modified file 'storage/falcon/ha_falcon.cpp'
--- a/storage/falcon/ha_falcon.cpp	2009-03-31 18:19:17 +0000
+++ b/storage/falcon/ha_falcon.cpp	2009-05-14 21:49:53 +0000
@@ -102,7 +102,7 @@ FILE		*falcon_log_file;
 
 // Determine the largest memory address, assume 64-bits max
 
-static const ulonglong MSB = ULL(1) << ((sizeof(void *)*8 - 1) & 63);
+static const ulonglong MSB = 1ULL << ((sizeof(void *)*8 - 1) & 63);
 ulonglong max_memory_address = MSB | (MSB - 1);
 
 // These are the isolation levels we actually use.
@@ -3018,7 +3018,7 @@ void StorageInterface::encodeRecord(ucha
 					// encode it as a BigInt to support unsigned values 
 					// with the MSB set in the index
 
-					if (((Field_num*)field)->unsigned_flag && (temp & LL(0x8000000000000000)))
+					if (((Field_num*)field)->unsigned_flag && (temp & 0x8000000000000000ULL))
 						{
 						BigInt bigInt;
 						bigInt.set((uint64)temp);
@@ -4011,12 +4011,12 @@ static MYSQL_SYSVAR_STR(scavenge_schedul
 static MYSQL_SYSVAR_ULONGLONG(record_memory_max, falcon_record_memory_max,
   PLUGIN_VAR_RQCMDARG, // | PLUGIN_VAR_READONLY,
   "The maximum size of the record memory cache.",
-  NULL, StorageInterface::updateRecordMemoryMax, LL(250)<<20, 0, (ulonglong) max_memory_address, LL(1)<<20);
+  NULL, StorageInterface::updateRecordMemoryMax, 250LL<<20, 0, (ulonglong) max_memory_address, 1LL<<20);
 
 static MYSQL_SYSVAR_ULONGLONG(serial_log_file_size, falcon_serial_log_file_size,
   PLUGIN_VAR_RQCMDARG,
   "If serial log file grows larger than this value, it will be truncated when it is reused",
-  NULL, NULL , LL(10)<<20, LL(1)<<20,LL(0x7fffffffffffffff), LL(1)<<20);
+  NULL, NULL , 10LL<<20, 1LL<<20,0x7fffffffffffffffLL, 1LL<<20);
 
 /***
 static MYSQL_SYSVAR_UINT(allocation_extent, falcon_allocation_extent,
@@ -4028,7 +4028,7 @@ static MYSQL_SYSVAR_UINT(allocation_exte
 static MYSQL_SYSVAR_ULONGLONG(page_cache_size, falcon_page_cache_size,
   PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
   "The amount of memory to be used for the database page cache.",
-  NULL, NULL, LL(4)<<20, LL(2)<<20, (ulonglong) max_memory_address, LL(1)<<20);
+  NULL, NULL, 4LL<<20, 2LL<<20, (ulonglong) max_memory_address, 1LL<<20);
 
 static MYSQL_THDVAR_BOOL(consistent_read, PLUGIN_VAR_OPCMDARG,
    "Enable Consistent Read Mode for Repeatable Reads",

=== removed file 'storage/heap/make-ccc'
--- a/storage/heap/make-ccc	2005-04-27 01:19:54 +0000
+++ b/storage/heap/make-ccc	1970-01-01 00:00:00 +0000
@@ -1,4 +0,0 @@
-ccc -I./../include -I../include -DDBUG_OFF -fast -O3 -c _check.c _rectest.c hp_block.c hp_clear.c hp_close.c hp_create.c hp_delete.c hp_extra.c hp_hash.c hp_info.c hp_open.c hp_panic.c hp_rename.c hp_rfirst.c hp_rkey.c hp_rlast.c hp_rnext.c hp_rprev.c hp_rrnd.c hp_rsame.c hp_scan.c hp_static.c hp_update.c hp_write.c
-rm libheap.a
-ar -cr libheap.a _check.o
-

=== modified file 'storage/maria/Makefile.am'
--- a/storage/maria/Makefile.am	2009-02-16 21:18:45 +0000
+++ b/storage/maria/Makefile.am	2009-04-06 18:36:46 +0000
@@ -30,7 +30,7 @@ DEFS =                  @DEFS@
 SUBDIRS =		. unittest
 
 EXTRA_DIST =		ma_test_all.sh ma_test_all.res ma_test_big.sh \
-			ma_ft_stem.c CMakeLists.txt plug.in ma_test_recovery
+			CMakeLists.txt plug.in ma_test_recovery
 pkgdata_DATA =		ma_test_all ma_test_all.res ma_test_recovery
 pkglib_LIBRARIES =	libmaria.a
 bin_PROGRAMS =		maria_chk maria_pack maria_ftdump maria_read_log \
@@ -72,8 +72,8 @@ maria_dump_log_SOURCES= ma_loghandler.c 
 maria_dump_log_CPPFLAGS= $(AM_CPPFLAGS) -DMARIA_DUMP_LOG
 noinst_PROGRAMS =	ma_test1 ma_test2 ma_test3 ma_rt_test ma_sp_test
 noinst_HEADERS =	maria_def.h ma_rt_index.h ma_rt_key.h ma_rt_mbr.h \
-			ma_sp_defs.h ma_fulltext.h ma_ftdefs.h ma_ft_test1.h \
-			ma_ft_eval.h trnman.h lockman.h tablockman.h \
+			ma_sp_defs.h ma_fulltext.h ma_ftdefs.h \
+			trnman.h lockman.h tablockman.h \
 			ma_control_file.h ha_maria.h ma_blockrec.h \
 			ma_loghandler.h ma_loghandler_lsn.h ma_pagecache.h \
 			ma_checkpoint.h ma_recovery.h ma_commit.h ma_state.h \
@@ -97,8 +97,6 @@ ma_test3_LDADD=		@CLIENT_EXTRA_LDFLAGS@ 
 			$(top_builddir)/mysys/libmysyslt.la \
 			$(top_builddir)/dbug/libdbuglt.la \
 			$(top_builddir)/strings/libmystringslt.la @ZLIB_LIBS@
-#ma_ft_test1_DEPENDENCIES=	$(LIBRARIES)
-#ma_ft_eval_DEPENDENCIES=	$(LIBRARIES)
 maria_ftdump_DEPENDENCIES=	$(LIBRARIES)
 maria_ftdump_LDADD=		@CLIENT_EXTRA_LDFLAGS@ libmaria.a \
                         $(top_builddir)/storage/myisam/libmyisam.a \

=== modified file 'storage/maria/ma_bitmap.c'
--- a/storage/maria/ma_bitmap.c	2009-02-10 14:51:40 +0000
+++ b/storage/maria/ma_bitmap.c	2009-05-14 21:49:53 +0000
@@ -944,7 +944,7 @@ static my_bool allocate_head(MARIA_FILE_
       a full page or a tail page
     */
     if ((!bits && best_data) ||
-        ((bits & LL(04444444444444444)) == LL(04444444444444444)))
+        ((bits & 04444444444444444LL) == 04444444444444444LL))
       continue;
     for (i= 0; i < 16 ; i++, bits >>= 3)
     {
@@ -1029,8 +1029,8 @@ static my_bool allocate_tail(MARIA_FILE_
       quite common case if we have blobs.
     */
 
-    if ((!bits && best_data) || bits == LL(0xffffffffffff) ||
-        bits == LL(04444444444444444))
+    if ((!bits && best_data) || bits == 0xffffffffffffLL ||
+        bits == 04444444444444444LL)
       continue;
     for (i= 0; i < 16; i++, bits >>= 3)
     {
@@ -1160,14 +1160,14 @@ static ulong allocate_full_pages(MARIA_F
       bits= prefix_bits= uint6korr(data_start - 6);
       DBUG_ASSERT(bits != 0);
       /* 111 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 */
-      if (!(bits & LL(07000000000000000)))
+      if (!(bits & 07000000000000000LL))
       {
         data_start-= 6;
         do
         {
           prefix_area_size++;
           bits<<= 3;
-        } while (!(bits & LL(07000000000000000)));
+        } while (!(bits & 07000000000000000LL));
         area_size+= prefix_area_size;
         /* Calculate offset to page from data_start */
         prefix_area_size= 16 - prefix_area_size;
@@ -1217,11 +1217,11 @@ static ulong allocate_full_pages(MARIA_F
     best_prefix_area_size= 16 - best_prefix_area_size;
     if (best_area_size < best_prefix_area_size)
     {
-      tmp= (LL(1) << best_area_size*3) - 1;
+      tmp= (1LL << best_area_size*3) - 1;
       best_area_size= best_prefix_area_size;    /* for easy end test */
     }
     else
-      tmp= (LL(1) << best_prefix_area_size*3) - 1;
+      tmp= (1LL << best_prefix_area_size*3) - 1;
     tmp<<= (16 - best_prefix_area_size) * 3;
     DBUG_ASSERT((best_prefix_bits & tmp) == 0);
     best_prefix_bits|= tmp;

=== modified file 'storage/maria/ma_blockrec.c'
--- a/storage/maria/ma_blockrec.c	2009-02-05 22:38:30 +0000
+++ b/storage/maria/ma_blockrec.c	2009-05-14 21:49:53 +0000
@@ -5238,7 +5238,7 @@ restart_bitmap_scan:
       {
         bits= uint6korr(data);
         /* Skip not allocated pages and blob / full tail pages */
-        if (bits && bits != LL(07777777777777777))
+        if (bits && bits != 07777777777777777LL)
           break;
       }
       bit_pos= 0;
@@ -5296,8 +5296,6 @@ my_bool _ma_compare_block_record(MARIA_H
 
   NOTES
     This is mostly used to store field numbers and lengths of strings.
-    We have to cast the result for the LL() becasue of a bug in Forte CC
-    compiler.
 
     Packing used is:
     nr < 251 is stored as is (in 1 byte)

=== modified file 'storage/maria/ma_create.c'
--- a/storage/maria/ma_create.c	2009-02-13 16:30:54 +0000
+++ b/storage/maria/ma_create.c	2009-05-14 21:49:53 +0000
@@ -1214,19 +1214,19 @@ uint maria_get_pointer_length(ulonglong 
   if (file_length)				/* If not default */
   {
 #ifdef NOT_YET_READY_FOR_8_BYTE_POINTERS
-    if (file_length >= (ULL(1) << 56))
+    if (file_length >= (1ULL << 56))
       def=8;
     else
 #endif
-      if (file_length >= (ULL(1) << 48))
+      if (file_length >= (1ULL << 48))
       def=7;
-    else if (file_length >= (ULL(1) << 40))
+    else if (file_length >= (1ULL << 40))
       def=6;
-    else if (file_length >= (ULL(1) << 32))
+    else if (file_length >= (1ULL << 32))
       def=5;
-    else if (file_length >= (ULL(1) << 24))
+    else if (file_length >= (1ULL << 24))
       def=4;
-    else if (file_length >= (ULL(1) << 16))
+    else if (file_length >= (1ULL << 16))
       def=3;
     else
       def=2;

=== removed file 'storage/maria/ma_ft_eval.c'
--- a/storage/maria/ma_ft_eval.c	2008-05-29 15:44:11 +0000
+++ b/storage/maria/ma_ft_eval.c	1970-01-01 00:00:00 +0000
@@ -1,254 +0,0 @@
-/* Copyright (C) 2006 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; version 2 of the License.
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
-
-/* Written by Sergei A. Golubchik, who has a shared copyright to this code
-   added support for long options (my_getopt) 22.5.2002 by Jani Tolonen */
-
-#include "ma_ftdefs.h"
-#include "maria_ft_eval.h"
-#include <stdarg.h>
-#include <my_getopt.h>
-
-static void print_error(int exit_code, const char *fmt,...);
-static void get_options(int argc, char *argv[]);
-static int create_record(char *pos, FILE *file);
-static void usage();
-
-static struct my_option my_long_options[] =
-{
-  {"", 's', "", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"", 'q', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"", 'S', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"", '#', "", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"", 'V', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"", '?', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"", 'h', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
-};
-
-int main(int argc, char *argv[])
-{
-  MARIA_HA *file;
-  int i,j;
-
-  MY_INIT(argv[0]);
-  get_options(argc,argv);
-  bzero((char*)recinfo,sizeof(recinfo));
-
-  maria_init();
-  /* First define 2 columns */
-  recinfo[0].type=FIELD_SKIP_ENDSPACE;
-  recinfo[0].length=docid_length;
-  recinfo[1].type=FIELD_BLOB;
-  recinfo[1].length= 4+portable_sizeof_char_ptr;
-
-  /* Define a key over the first column */
-  keyinfo[0].seg=keyseg;
-  keyinfo[0].keysegs=1;
-  keyinfo[0].block_length= 0;                   /* Default block length */
-  keyinfo[0].seg[0].type= HA_KEYTYPE_TEXT;
-  keyinfo[0].seg[0].flag= HA_BLOB_PART;
-  keyinfo[0].seg[0].start=recinfo[0].length;
-  keyinfo[0].seg[0].length=key_length;
-  keyinfo[0].seg[0].null_bit=0;
-  keyinfo[0].seg[0].null_pos=0;
-  keyinfo[0].seg[0].bit_start=4;
-  keyinfo[0].seg[0].language=MY_CHARSET_CURRENT;
-  keyinfo[0].flag = HA_FULLTEXT;
-
-  if (!silent)
-    printf("- Creating isam-file\n");
-  if (maria_create(filename,1,keyinfo,2,recinfo,0,NULL,(MARIA_CREATE_INFO*) 0,0))
-    goto err;
-  if (!(file=maria_open(filename,2,0)))
-    goto err;
-  if (!silent)
-    printf("Initializing stopwords\n");
-  maria_ft_init_stopwords(stopwordlist);
-
-  if (!silent)
-    printf("- Writing key:s\n");
-
-  my_errno=0;
-  i=0;
-  while (create_record(record,df))
-  {
-    error=maria_write(file,record);
-    if (error)
-      printf("I= %2d  maria_write: %d  errno: %d\n",i,error,my_errno);
-    i++;
-  }
-  fclose(df);
-
-  if (maria_close(file)) goto err;
-  if (!silent)
-    printf("- Reopening file\n");
-  if (!(file=maria_open(filename,2,0))) goto err;
-  if (!silent)
-    printf("- Reading rows with key\n");
-  for (i=1;create_record(record,qf);i++)
-  {
-    FT_DOCLIST *result;
-    double w;
-    int t, err;
-
-    result=maria_ft_nlq_init_search(file,0,blob_record,(uint) strlen(blob_record),1);
-    if (!result)
-    {
-      printf("Query %d failed with errno %3d\n",i,my_errno);
-      goto err;
-    }
-    if (!silent)
-      printf("Query %d. Found: %d.\n",i,result->ndocs);
-    for (j=0;(err=maria_ft_nlq_read_next(result, read_record))==0;j++)
-    {
-      t=uint2korr(read_record);
-      w=maria_ft_nlq_get_relevance(result);
-      printf("%d %.*s %f\n",i,t,read_record+2,w);
-    }
-    if (err != HA_ERR_END_OF_FILE)
-    {
-      printf("maria_ft_read_next %d failed with errno %3d\n",j,my_errno);
-      goto err;
-    }
-    maria_ft_nlq_close_search(result);
-  }
-
-  if (maria_close(file)) goto err;
-  maria_end();
-  my_end(MY_CHECK_ERROR);
-
-  return (0);
-
- err:
-  printf("got error: %3d when using maria-database\n",my_errno);
-  return 1;			/* skip warning */
-
-}
-
-
-static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
-	       char *argument)
-{
-  switch (optid) {
-  case 's':
-    if (stopwordlist && stopwordlist != maria_ft_precompiled_stopwords)
-      break;
-    {
-      FILE *f; char s[HA_FT_MAXLEN]; int i=0,n=SWL_INIT;
-
-      if (!(stopwordlist=(const char**) malloc(n*sizeof(char *))))
-	print_error(1,"malloc(%d)",n*sizeof(char *));
-      if (!(f=fopen(argument,"r")))
-	print_error(1,"fopen(%s)",argument);
-      while (!feof(f))
-      {
-	if (!(fgets(s,HA_FT_MAXLEN,f)))
-	  print_error(1,"fgets(s,%d,%s)",HA_FT_MAXLEN,argument);
-	if (!(stopwordlist[i++]=strdup(s)))
-	  print_error(1,"strdup(%s)",s);
-	if (i >= n)
-	{
-	  n+=SWL_PLUS;
-	  if (!(stopwordlist=(const char**) realloc((char*) stopwordlist,
-						    n*sizeof(char *))))
-	    print_error(1,"realloc(%d)",n*sizeof(char *));
-	}
-      }
-      fclose(f);
-      stopwordlist[i]=NULL;
-      break;
-    }
-  case 'q': silent=1; break;
-  case 'S': if (stopwordlist==maria_ft_precompiled_stopwords) stopwordlist=NULL; break;
-  case '#':
-    DBUG_PUSH (argument);
-    break;
-  case 'V':
-  case '?':
-  case 'h':
-    usage();
-    exit(1);
-  }
-  return 0;
-}
-
-
-static void get_options(int argc, char *argv[])
-{
-  int ho_error;
-
-  if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
-    exit(ho_error);
-
-  if (!(d_file=argv[optind])) print_error(1,"No d_file");
-  if (!(df=fopen(d_file,"r")))
-    print_error(1,"fopen(%s)",d_file);
-  if (!(q_file=argv[optind+1])) print_error(1,"No q_file");
-  if (!(qf=fopen(q_file,"r")))
-    print_error(1,"fopen(%s)",q_file);
-  return;
-} /* get options */
-
-
-static int create_record(char *pos, FILE *file)
-{
-  uint tmp; char *ptr;
-
-  bzero((char *)pos,MAX_REC_LENGTH);
-
-  /* column 1 - VARCHAR */
-  if (!(fgets(pos+2,MAX_REC_LENGTH-32,file)))
-  {
-    if (feof(file))
-      return 0;
-    else
-      print_error(1,"fgets(docid) - 1");
-  }
-  tmp=(uint) strlen(pos+2)-1;
-  int2store(pos,tmp);
-  pos+=recinfo[0].length;
-
-  /* column 2 - BLOB */
-
-  if (!(fgets(blob_record,MAX_BLOB_LENGTH,file)))
-    print_error(1,"fgets(docid) - 2");
-  tmp=(uint) strlen(blob_record);
-  int4store(pos,tmp);
-  ptr=blob_record;
-  memcpy_fixed(pos+4,&ptr,sizeof(char*));
-  return 1;
-}
-
-/* VARARGS */
-
-static void print_error(int exit_code, const char *fmt,...)
-{
-  va_list args;
-
-  va_start(args,fmt);
-  fprintf(stderr,"%s: error: ",my_progname);
-  (void)(vfprintf(stderr, fmt, args));
-  (void)(fputc('\n',stderr));
-  fflush(stderr);
-  va_end(args);
-  exit(exit_code);
-}
-
-
-static void usage()
-{
-  printf("%s [options]\n", my_progname);
-  my_print_help(my_long_options);
-  my_print_variables(my_long_options);
-}

=== removed file 'storage/maria/ma_ft_eval.h'
--- a/storage/maria/ma_ft_eval.h	2007-03-02 10:20:23 +0000
+++ b/storage/maria/ma_ft_eval.h	1970-01-01 00:00:00 +0000
@@ -1,41 +0,0 @@
-/* Copyright (C) 2006 MySQL AB & Sergei A. Golubchik
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; version 2 of the License.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
-
-/* Written by Sergei A. Golubchik, who has a shared copyright to this code */
-
-const char **stopwordlist=maria_ft_precompiled_stopwords;
-
-#define MAX_REC_LENGTH 128
-#define MAX_BLOB_LENGTH 60000
-char record[MAX_REC_LENGTH], read_record[MAX_REC_LENGTH+MAX_BLOB_LENGTH];
-char blob_record[MAX_BLOB_LENGTH+20*20];
-
-char *filename= (char*) "EVAL";
-
-int silent=0, error=0;
-
-uint key_length=MAX_BLOB_LENGTH,docid_length=32;
-char *d_file, *q_file;
-FILE *df,*qf;
-
-MARIA_COLUMNDEF recinfo[3];
-MARIA_KEYDEF keyinfo[2];
-HA_KEYSEG keyseg[10];
-
-#define SWL_INIT 500
-#define SWL_PLUS 50
-
-#define MAX_LINE_LENGTH 128
-char line[MAX_LINE_LENGTH];

=== removed file 'storage/maria/ma_ft_stem.c'
--- a/storage/maria/ma_ft_stem.c	2007-03-02 10:20:23 +0000
+++ b/storage/maria/ma_ft_stem.c	1970-01-01 00:00:00 +0000
@@ -1,18 +0,0 @@
-/* Copyright (C) 2006 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; version 2 of the License.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
-
-/* Written by Sergei A. Golubchik, who has a shared copyright to this code */
-
-/* mulitingual stem */

=== removed file 'storage/maria/ma_ft_test1.c'
--- a/storage/maria/ma_ft_test1.c	2007-04-19 10:18:56 +0000
+++ b/storage/maria/ma_ft_test1.c	1970-01-01 00:00:00 +0000
@@ -1,317 +0,0 @@
-/* Copyright (C) 2006 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; version 2 of the License.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
-
-/* Written by Sergei A. Golubchik, who has a shared copyright to this code
-   added support for long options (my_getopt) 22.5.2002 by Jani Tolonen */
-
-#include "ma_ftdefs.h"
-#include "maria_ft_test1.h"
-#include <my_getopt.h>
-
-static int key_field=FIELD_VARCHAR,extra_field=FIELD_SKIP_ENDSPACE;
-static uint key_length=200,extra_length=50;
-static int key_type=HA_KEYTYPE_TEXT;
-static int verbose=0,silent=0,skip_update=0,
-	   no_keys=0,no_stopwords=0,no_search=0,no_fulltext=0;
-static int create_flag=0,error=0;
-
-#define MAX_REC_LENGTH 300
-static char record[MAX_REC_LENGTH],read_record[MAX_REC_LENGTH];
-
-static int run_test(const char *filename);
-static void get_options(int argc, char *argv[]);
-static void create_record(char *, int);
-static void usage();
-
-static struct my_option my_long_options[] =
-{
-  {"", 'v', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"", '?', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"", 'h', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"", 'V', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"", 'v', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"", 's', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"", 'N', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"", 'S', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"", 'K', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"", 'F', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"", 'U', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"", '#', "", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
-  { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
-};
-
-int main(int argc, char *argv[])
-{
-  MY_INIT(argv[0]);
-
-  get_options(argc,argv);
-  maria_init();
-
-  exit(run_test("FT1"));
-}
-
-static MARIA_COLUMNDEF recinfo[3];
-static MARIA_KEYDEF keyinfo[2];
-static HA_KEYSEG keyseg[10];
-
-static int run_test(const char *filename)
-{
-  MARIA_HA *file;
-  int i,j;
-  my_off_t pos;
-
-  bzero((char*) recinfo,sizeof(recinfo));
-
-  /* First define 2 columns */
-  recinfo[0].type=extra_field;
-  recinfo[0].length= (extra_field == FIELD_BLOB ? 4 + portable_sizeof_char_ptr :
-	      extra_length);
-  if (extra_field == FIELD_VARCHAR)
-    recinfo[0].length+= HA_VARCHAR_PACKLENGTH(extra_length);
-  recinfo[1].type=key_field;
-  recinfo[1].length= (key_field == FIELD_BLOB ? 4+portable_sizeof_char_ptr :
-		      key_length);
-  if (key_field == FIELD_VARCHAR)
-    recinfo[1].length+= HA_VARCHAR_PACKLENGTH(key_length);
-
-  /* Define a key over the first column */
-  keyinfo[0].seg=keyseg;
-  keyinfo[0].keysegs=1;
-  keyinfo[0].block_length= 0;                   /* Default block length */
-  keyinfo[0].seg[0].type= key_type;
-  keyinfo[0].seg[0].flag= (key_field == FIELD_BLOB) ? HA_BLOB_PART:
-			  (key_field == FIELD_VARCHAR) ? HA_VAR_LENGTH_PART:0;
-  keyinfo[0].seg[0].start=recinfo[0].length;
-  keyinfo[0].seg[0].length=key_length;
-  keyinfo[0].seg[0].null_bit= 0;
-  keyinfo[0].seg[0].null_pos=0;
-  keyinfo[0].seg[0].language= default_charset_info->number;
-  keyinfo[0].flag = (no_fulltext?HA_PACK_KEY:HA_FULLTEXT);
-
-  if (!silent)
-    printf("- Creating isam-file\n");
-  if (maria_create(filename,(no_keys?0:1),keyinfo,2,recinfo,0,NULL,
-		(MARIA_CREATE_INFO*) 0, create_flag))
-    goto err;
-  if (!(file=maria_open(filename,2,0)))
-    goto err;
-
-  if (!silent)
-    printf("- %s stopwords\n",no_stopwords?"Skipping":"Initializing");
-  maria_ft_init_stopwords(no_stopwords?NULL:maria_ft_precompiled_stopwords);
-
-  if (!silent)
-    printf("- Writing key:s\n");
-
-  my_errno=0;
-  for (i=NUPD ; i<NDATAS; i++ )
-  {
-    create_record(record,i);
-    error=maria_write(file,record);
-    if (verbose || error)
-      printf("I= %2d  maria_write: %d  errno: %d, record: %s\n",
-	i,error,my_errno,data[i].f0);
-  }
-
-  if (!skip_update)
-  {
-    if (!silent)
-      printf("- Updating rows\n");
-
-    /* Read through all rows and update them */
-    pos=(ha_rows) 0;
-    i=0;
-    while ((error=maria_rrnd(file,read_record,pos)) == 0)
-    {
-      create_record(record,NUPD-i-1);
-      if (maria_update(file,read_record,record))
-      {
-	printf("Can't update row: %.*s, error: %d\n",
-	       keyinfo[0].seg[0].length,record,my_errno);
-      }
-      if(++i == NUPD) break;
-      pos=HA_OFFSET_ERROR;
-    }
-    if (i != NUPD)
-      printf("Found %d of %d rows\n", i,NUPD);
-  }
-
-  if (maria_close(file)) goto err;
-  if(no_search) return 0;
-  if (!silent)
-    printf("- Reopening file\n");
-  if (!(file=maria_open(filename,2,0))) goto err;
-  if (!silent)
-    printf("- Reading rows with key\n");
-  for (i=0 ; i < NQUERIES ; i++)
-  {
-    FT_DOCLIST *result;
-    result=maria_ft_nlq_init_search(file,0,(char*) query[i],strlen(query[i]),1);
-    if(!result)
-    {
-      printf("Query %d: `%s' failed with errno %3d\n",i,query[i],my_errno);
-      continue;
-    }
-    printf("Query %d: `%s'. Found: %d. Top five documents:\n",
-           i,query[i],result->ndocs);
-    for (j=0;j<5;j++)
-    {
-      double w; int err;
-      err= maria_ft_nlq_read_next(result, read_record);
-      if (err==HA_ERR_END_OF_FILE)
-      {
-        printf("No more matches!\n");
-        break;
-      }
-      else if (err)
-      {
-        printf("maria_ft_read_next %d failed with errno %3d\n",j,my_errno);
-        break;
-      }
-      w=maria_ft_nlq_get_relevance(result);
-      if (key_field == FIELD_VARCHAR)
-      {
-        uint l;
-        char *p;
-        p=recinfo[0].length+read_record;
-        l=uint2korr(p);
-        printf("%10.7f: %.*s\n",w,(int) l,p+2);
-      }
-      else
-        printf("%10.7f: %.*s\n",w,recinfo[1].length,
-               recinfo[0].length+read_record);
-    }
-    maria_ft_nlq_close_search(result);
-  }
-
-  if (maria_close(file)) goto err;
-  maria_end();
-  my_end(MY_CHECK_ERROR);
-
-  return (0);
-err:
-  printf("got error: %3d when using maria-database\n",my_errno);
-  return 1;			/* skip warning */
-}
-
-static char blob_key[MAX_REC_LENGTH];
-/* static char blob_record[MAX_REC_LENGTH+20*20]; */
-
-void create_record(char *pos, int n)
-{
-  bzero((char*) pos,MAX_REC_LENGTH);
-  if (recinfo[0].type == FIELD_BLOB)
-  {
-    uint tmp;
-    char *ptr;
-    strnmov(blob_key,data[n].f0,keyinfo[0].seg[0].length);
-    tmp=strlen(blob_key);
-    int4store(pos,tmp);
-    ptr=blob_key;
-    memcpy_fixed(pos+4,&ptr,sizeof(char*));
-    pos+=recinfo[0].length;
-  }
-  else if (recinfo[0].type == FIELD_VARCHAR)
-  {
-    uint tmp;
-    /* -1 is here because pack_length is stored in seg->length */
-    uint pack_length= HA_VARCHAR_PACKLENGTH(keyinfo[0].seg[0].length-1);
-    strnmov(pos+pack_length,data[n].f0,keyinfo[0].seg[0].length);
-    tmp=strlen(pos+pack_length);
-    if (pack_length == 1)
-      *pos= (char) tmp;
-    else
-      int2store(pos,tmp);
-    pos+=recinfo[0].length;
-  }
-  else
-  {
-    strnmov(pos,data[n].f0,keyinfo[0].seg[0].length);
-    pos+=recinfo[0].length;
-  }
-  if (recinfo[1].type == FIELD_BLOB)
-  {
-    uint tmp;
-    char *ptr;
-    strnmov(blob_key,data[n].f2,keyinfo[0].seg[0].length);
-    tmp=strlen(blob_key);
-    int4store(pos,tmp);
-    ptr=blob_key;
-    memcpy_fixed(pos+4,&ptr,sizeof(char*));
-    pos+=recinfo[1].length;
-  }
-  else if (recinfo[1].type == FIELD_VARCHAR)
-  {
-    uint tmp;
-    /* -1 is here because pack_length is stored in seg->length */
-    uint pack_length= HA_VARCHAR_PACKLENGTH(keyinfo[0].seg[0].length-1);
-    strnmov(pos+pack_length,data[n].f2,keyinfo[0].seg[0].length);
-    tmp=strlen(pos+1);
-    if (pack_length == 1)
-      *pos= (char) tmp;
-    else
-      int2store(pos,tmp);
-    pos+=recinfo[1].length;
-  }
-  else
-  {
-    strnmov(pos,data[n].f2,keyinfo[0].seg[0].length);
-    pos+=recinfo[1].length;
-  }
-}
-
-
-static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
-	       char *argument)
-{
-  switch(optid) {
-  case 'v': verbose=1; break;
-  case 's': silent=1; break;
-  case 'F': no_fulltext=1; no_search=1;
-  case 'U': skip_update=1; break;
-  case 'K': no_keys=no_search=1; break;
-  case 'N': no_search=1; break;
-  case 'S': no_stopwords=1; break;
-  case '#':
-    DBUG_PUSH (argument);
-    break;
-  case 'V':
-  case '?':
-  case 'h':
-    usage();
-    exit(1);
-  }
-  return 0;
-}
-
-/* Read options */
-
-static void get_options(int argc,char *argv[])
-{
-  int ho_error;
-
-  if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
-    exit(ho_error);
-  return;
-} /* get options */
-
-
-static void usage()
-{
-  printf("%s [options]\n", my_progname);
-  my_print_help(my_long_options);
-  my_print_variables(my_long_options);
-}

=== removed file 'storage/maria/ma_ft_test1.h'
--- a/storage/maria/ma_ft_test1.h	2007-03-02 10:20:23 +0000
+++ b/storage/maria/ma_ft_test1.h	1970-01-01 00:00:00 +0000
@@ -1,420 +0,0 @@
-/* Copyright (C) 2006 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; version 2 of the License.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
-
-/* Written by Sergei A. Golubchik, who has a shared copyright to this code */
-
-#define NUPD            20
-#define NDATAS          389
-struct { const char *f0, *f2; } data[NDATAS] = {
-   {"1", "General Information about MySQL"},
-   {"1.1", "What is MySQL?"},
-   {"1.2", "About this manual"},
-   {"1.3", "History of MySQL"},
-   {"1.4", "The main features of MySQL"},
-   {"1.5", "General SQL information and tutorials"},
-   {"1.6", "Useful MySQL-related links"},
-   {"1.7", "What are stored procedures and triggers and so on?"},
-   {"2", "MySQL mailing lists and how to ask questions/give error (bug) reports"},
-   {"2.1", "Subscribing to/un-subscribing from the MySQL mailing list"},
-   {"2.2", "Asking questions or reporting bugs"},
-   {"2.3", "I think I have found a bug. What information do you need to help me?"},
-   {"2.3.1", "MySQL keeps crashing"},
-   {"2.4", "Guidelines for answering questions on the mailing list"},
-   {"3", "Licensing or When do I have/want to pay for MySQL?"},
-   {"3.1", "How much does MySQL cost?"},
-   {"3.2", "How do I get commercial support?"},
-   {"3.2.1", "Types of commercial support"},
-   {"3.2.1.1", "Basic email support"},
-   {"3.2.1.2", "Extended email support"},
-/*------------------------------- NUPD=20 -------------------------------*/
-   {"3.2.1.3", "Asking: Login support"},
-   {"3.2.1.4", "Extended login support"},
-   {"3.3", "How do I pay for licenses/support?"},
-   {"3.4", "Who do I contact when I want more information about licensing/support?"},
-   {"3.5", "What Copyright does MySQL use?"},
-   {"3.6", "When may I distribute MySQL commercially without a fee?"},
-   {"3.7", "I want to sell a product that can be configured to use MySQL"},
-   {"3.8", "I am running a commercial web server using MySQL"},
-   {"3.9", "Do I need a license to sell commercial Perl/tcl/PHP/Web+ etc applications?"},
-   {"3.10", "Possible future changes in the licensing"},
-   {"4", "Compiling and installing MySQL"},
-   {"4.1", "How do I get MySQL?"},
-   {"4.2", "Which MySQL version should I use?"},
-   {"4.3", "How/when will you release updates?"},
-   {"4.4", "What operating systems does MySQL support?"},
-   {"4.5", "Compiling MySQL from source code"},
-   {"4.5.1", "Quick installation overview"},
-   {"4.5.2", "Usual configure switches"},
-   {"4.5.3", "Applying a patch"},
-   {"4.6", "Problems compiling?"},
-   {"4.7", "General compilation notes"},
-   {"4.8", "MIT-pthreads notes (FreeBSD)"},
-   {"4.9", "Perl installation comments"},
-   {"4.10", "Special things to consider for some machine/OS combinations"},
-   {"4.10.1", "Solaris notes"},
-   {"4.10.2", "SunOS 4 notes"},
-   {"4.10.3", "Linux notes for all versions"},
-   {"4.10.3.1", "Linux-x86 notes"},
-   {"4.10.3.2", "RedHat 5.0"},
-   {"4.10.3.3", "RedHat 5.1"},
-   {"4.10.3.4", "Linux-Sparc notes"},
-   {"4.10.3.5", "Linux-Alpha notes"},
-   {"4.10.3.6", "MkLinux notes"},
-   {"4.10.4", "Alpha-DEC-Unix notes"},
-   {"4.10.5", "Alpha-DEC-OSF1 notes"},
-   {"4.10.6", "SGI-IRIX notes"},
-   {"4.10.7", "FreeBSD notes"},
-   {"4.10.7.1", "FreeBSD-3.0 notes"},
-   {"4.10.8", "BSD/OS 2.# notes"},
-   {"4.10.8.1", "BSD/OS 3.# notes"},
-   {"4.10.9", "SCO notes"},
-   {"4.10.10", "SCO Unixware 7.0 notes"},
-   {"4.10.11", "IBM-AIX notes"},
-   {"4.10.12", "HP-UX notes"},
-   {"4.11", "TcX binaries"},
-   {"4.12", "Win32 notes"},
-   {"4.13", "Installation instructions for MySQL binary releases"},
-   {"4.13.1", "How to get MySQL Perl support working"},
-   {"4.13.2", "Linux notes"},
-   {"4.13.3", "HP-UX notes"},
-   {"4.13.4", "Linking client libraries"},
-   {"4.14", "Problems running mysql_install_db"},
-   {"4.15", "Problems starting MySQL"},
-   {"4.16", "Automatic start/stop of MySQL"},
-   {"4.17", "Option files"},
-   {"5", "How standards-compatible is MySQL?"},
-   {"5.1", "What extensions has MySQL to ANSI SQL92?"},
-   {"5.2", "What functionality is missing in MySQL?"},
-   {"5.2.1", "Sub-selects"},
-   {"5.2.2", "SELECT INTO TABLE"},
-   {"5.2.3", "Transactions"},
-   {"5.2.4", "Triggers"},
-   {"5.2.5", "Foreign Keys"},
-   {"5.2.5.1", "Some reasons NOT to use FOREIGN KEYS"},
-   {"5.2.6", "Views"},
-   {"5.2.7", "-- as start of a comment"},
-   {"5.3", "What standards does MySQL follow?"},
-   {"5.4", "What functions exist only for compatibility?"},
-   {"5.5", "Limitations of BLOB and TEXT types"},
-   {"5.6", "How to cope without COMMIT-ROLLBACK"},
-   {"6", "The MySQL access privilege system"},
-   {"6.1", "What the privilege system does"},
-   {"6.2", "Connecting to the MySQL server"},
-   {"6.2.1", "Keeping your password secure"},
-   {"6.3", "Privileges provided by MySQL"},
-   {"6.4", "How the privilege system works"},
-   {"6.5", "The privilege tables"},
-   {"6.6", "Setting up the initial MySQL privileges"},
-   {"6.7", "Adding new user privileges to MySQL"},
-   {"6.8", "An example permission setup"},
-   {"6.9", "Causes of Access denied errors"},
-   {"6.10", "How to make MySQL secure against crackers"},
-   {"7", "MySQL language reference"},
-   {"7.1", "Literals: how to write strings and numbers"},
-   {"7.1.1", "Strings"},
-   {"7.1.2", "Numbers"},
-   {"7.1.3", "NULL values"},
-   {"7.1.4", "Database, table, index, column and alias names"},
-   {"7.1.4.1", "Case sensitivity in names"},
-   {"7.2", "Column types"},
-   {"7.2.1", "Column type storage requirements"},
-   {"7.2.5", "Numeric types"},
-   {"7.2.6", "Date and time types"},
-   {"7.2.6.1", "The DATE type"},
-   {"7.2.6.2", "The TIME type"},
-   {"7.2.6.3", "The DATETIME type"},
-   {"7.2.6.4", "The TIMESTAMP type"},
-   {"7.2.6.5", "The YEAR type"},
-   {"7.2.6.6", "Miscellaneous date and time properties"},
-   {"7.2.7", "String types"},
-   {"7.2.7.1", "The CHAR and VARCHAR types"},
-   {"7.2.7.2", "The BLOB and TEXT types"},
-   {"7.2.7.3", "The ENUM type"},
-   {"7.2.7.4", "The SET type"},
-   {"7.2.8", "Choosing the right type for a column"},
-   {"7.2.9", "Column indexes"},
-   {"7.2.10", "Multiple-column indexes"},
-   {"7.2.11", "Using column types from other database engines"},
-   {"7.3", "Functions for use in SELECT and WHERE clauses"},
-   {"7.3.1", "Grouping functions"},
-   {"7.3.2", "Normal arithmetic operations"},
-   {"7.3.3", "Bit functions"},
-   {"7.3.4", "Logical operations"},
-   {"7.3.5", "Comparison operators"},
-   {"7.3.6", "String comparison functions"},
-   {"7.3.7", "Control flow functions"},
-   {"7.3.8", "Mathematical functions"},
-   {"7.3.9", "String functions"},
-   {"7.3.10", "Date and time functions"},
-   {"7.3.11", "Miscellaneous functions"},
-   {"7.3.12", "Functions for use with GROUP BY clauses"},
-   {"7.4", "CREATE DATABASE syntax"},
-   {"7.5", "DROP DATABASE syntax"},
-   {"7.6", "CREATE TABLE syntax"},
-   {"7.7", "ALTER TABLE syntax"},
-   {"7.8", "OPTIMIZE TABLE syntax"},
-   {"7.9", "DROP TABLE syntax"},
-   {"7.10", "DELETE syntax"},
-   {"7.11", "SELECT syntax"},
-   {"7.12", "JOIN syntax"},
-   {"7.13", "INSERT syntax"},
-   {"7.14", "REPLACE syntax"},
-   {"7.15", "LOAD DATA INFILE syntax"},
-   {"7.16", "UPDATE syntax"},
-   {"7.17", "USE syntax"},
-   {"7.18", "SHOW syntax (Get information about tables, columns...)"},
-   {"7.19", "EXPLAIN syntax (Get information about a SELECT)"},
-   {"7.20", "DESCRIBE syntax (Get information about columns)"},
-   {"7.21", "LOCK TABLES/UNLOCK TABLES syntax"},
-   {"7.22", "SET OPTION syntax"},
-   {"7.23", "GRANT syntax (Compatibility function)"},
-   {"7.24", "CREATE INDEX syntax (Compatibility function)"},
-   {"7.25", "DROP INDEX syntax (Compatibility function)"},
-   {"7.26", "Comment syntax"},
-   {"7.27", "CREATE FUNCTION/DROP FUNCTION syntax"},
-   {"7.28", "Is MySQL picky about reserved words?"},
-   {"8", "Example SQL queries"},
-   {"8.1", "Queries from twin project"},
-   {"8.1.1", "Find all non-distributed twins"},
-   {"8.1.2", "Show a table on twin pair status"},
-   {"9", "How safe/stable is MySQL?"},
-   {"9.1", "How stable is MySQL?"},
-   {"9.2", "Why are there is so many releases of MySQL?"},
-   {"9.3", "Checking a table for errors"},
-   {"9.4", "How to repair tables"},
-   {"9.5", "Is there anything special to do when upgrading/downgrading MySQL?"},
-   {"9.5.1", "Upgrading from a 3.21 version to 3.22"},
-   {"9.5.2", "Upgrading from a 3.20 version to 3.21"},
-   {"9.5.3", "Upgrading to another architecture"},
-   {"9.6", "Year 2000 compliance"},
-   {"10", "MySQL Server functions"},
-   {"10.1", "What languages are supported by MySQL?"},
-   {"10.1.1", "Character set used for data &#38; sorting"},
-   {"10.2", "The update log"},
-   {"10.3", "How big can MySQL tables be?"},
-   {"11", "Getting maximum performance from MySQL"},
-   {"11.1", "How does one change the size of MySQL buffers?"},
-   {"11.2", "How compiling and linking affects the speed of MySQL"},
-   {"11.3", "How does MySQL use memory?"},
-   {"11.4", "How does MySQL use indexes?"},
-   {"11.5", "What optimizations are done on WHERE clauses?"},
-   {"11.6", "How does MySQL open &#38; close tables?"},
-   {"11.6.0.1", "What are the drawbacks of creating possibly thousands of tables in a database?"},
-   {"11.7", "How does MySQL lock tables?"},
-   {"11.8", "How should I arrange my table to be as fast/small as possible?"},
-   {"11.9", "What affects the speed of INSERT statements?"},
-   {"11.10", "What affects the speed DELETE statements?"},
-   {"11.11", "How do I get MySQL to run at full speed?"},
-   {"11.12", "What are the different row formats? Or, when should VARCHAR/CHAR be used?"},
-   {"11.13", "Why so many open tables?"},
-   {"12", "MySQL benchmark suite"},
-   {"13", "MySQL Utilites"},
-   {"13.1", "Overview of the different MySQL programs"},
-   {"13.2", "The MySQL table check, optimize and repair program"},
-   {"13.2.1", "isamchk memory use"},
-   {"13.2.2", "Getting low-level table information"},
-   {"13.3", "The MySQL compressed read-only table generator"},
-   {"14", "Adding new functions to MySQL"},
-   {"15", "MySQL ODBC Support"},
-   {"15.1", "Operating systems supported by MyODBC"},
-   {"15.2", "How to report problems with MyODBC"},
-   {"15.3", "Programs known to work with MyODBC"},
-   {"15.4", "How to fill in the various fields in the ODBC administrator program"},
-   {"15.5", "How to get the value of an AUTO_INCREMENT column in ODBC"},
-   {"16", "Problems and common errors"},
-   {"16.1", "Some common errors when using MySQL"},
-   {"16.1.1", "MySQL server has gone away error"},
-   {"16.1.2", "Can't connect to local MySQL server error"},
-   {"16.1.3", "Out of memory error"},
-   {"16.1.4", "Packet too large error"},
-   {"16.1.5", "The table is full error"},
-   {"16.1.6", "Commands out of sync error in client"},
-   {"16.1.7", "Removing user error"},
-   {"16.2", "How MySQL handles a full disk"},
-   {"16.3", "How to run SQL commands from a text file"},
-   {"16.4", "Where MySQL stores temporary files"},
-   {"16.5", "Access denied error"},
-   {"16.6", "How to run MySQL as a normal user"},
-   {"16.7", "Problems with file permissions"},
-   {"16.8", "File not found"},
-   {"16.9", "Problems using DATE columns"},
-   {"16.10", "Case sensitivity in searches"},
-   {"16.11", "Problems with NULL values"},
-   {"17", "Solving some common problems with MySQL"},
-   {"17.1", "Database replication"},
-   {"17.2", "Database backups"},
-   {"18", "MySQL client tools and API's"},
-   {"18.1", "MySQL C API"},
-   {"18.2", "C API datatypes"},
-   {"18.3", "C API function overview"},
-   {"18.4", "C API function descriptions"},
-   {"18.4.1", "mysql_affected_rows()"},
-   {"18.4.2", "mysql_close()"},
-   {"18.4.3", "mysql_connect()"},
-   {"18.4.4", "mysql_create_db()"},
-   {"18.4.5", "mysql_data_seek()"},
-   {"18.4.6", "mysql_debug()"},
-   {"18.4.7", "mysql_drop_db()"},
-   {"18.4.8", "mysql_dump_debug_info()"},
-   {"18.4.9", "mysql_eof()"},
-   {"18.4.10", "mysql_errno()"},
-   {"18.4.11", "mysql_error()"},
-   {"18.4.12", "mysql_escape_string()"},
-   {"18.4.13", "mysql_fetch_field()"},
-   {"18.4.14", "mysql_fetch_fields()"},
-   {"18.4.15", "mysql_fetch_field_direct()"},
-   {"18.4.16", "mysql_fetch_lengths()"},
-   {"18.4.17", "mysql_fetch_row()"},
-   {"18.4.18", "mysql_field_seek()"},
-   {"18.4.19", "mysql_field_tell()"},
-   {"18.4.20", "mysql_free_result()"},
-   {"18.4.21", "mysql_get_client_info()"},
-   {"18.4.22", "mysql_get_host_info()"},
-   {"18.4.23", "mysql_get_proto_info()"},
-   {"18.4.24", "mysql_get_server_info()"},
-   {"18.4.25", "mysql_info()"},
-   {"18.4.26", "mysql_init()"},
-   {"18.4.27", "mysql_insert_id()"},
-   {"18.4.28", "mysql_kill()"},
-   {"18.4.29", "mysql_list_dbs()"},
-   {"18.4.30", "mysql_list_fields()"},
-   {"18.4.31", "mysql_list_processes()"},
-   {"18.4.32", "mysql_list_tables()"},
-   {"18.4.33", "mysql_num_fields()"},
-   {"18.4.34", "mysql_num_rows()"},
-   {"18.4.35", "mysql_query()"},
-   {"18.4.36", "mysql_real_connect()"},
-   {"18.4.37", "mysql_real_query()"},
-   {"18.4.38", "mysql_reload()"},
-   {"18.4.39", "mysql_row_tell()"},
-   {"18.4.40", "mysql_select_db()"},
-   {"18.4.41", "mysql_shutdown()"},
-   {"18.4.42", "mysql_stat()"},
-   {"18.4.43", "mysql_store_result()"},
-   {"18.4.44", "mysql_thread_id()"},
-   {"18.4.45", "mysql_use_result()"},
-   {"18.4.46", "Why is it that after mysql_query() returns success, mysql_store_result() sometimes returns NULL?"},
-   {"18.4.47", "What results can I get from a query?"},
-   {"18.4.48", "How can I get the unique ID for the last inserted row?"},
-   {"18.4.49", "Problems linking with the C API"},
-   {"18.4.50", "How to make a thread-safe client"},
-   {"18.5", "MySQL Perl API's"},
-   {"18.5.1", "DBI with DBD::mysql"},
-   {"18.5.1.1", "The DBI interface"},
-   {"18.5.1.2", "More DBI/DBD information"},
-   {"18.6", "MySQL Java connectivity (JDBC)"},
-   {"18.7", "MySQL PHP API's"},
-   {"18.8", "MySQL C++ API's"},
-   {"18.9", "MySQL Python API's"},
-   {"18.10", "MySQL TCL API's"},
-   {"19", "How MySQL compares to other databases"},
-   {"19.1", "How MySQL compares to mSQL"},
-   {"19.1.1", "How to convert mSQL tools for MySQL"},
-   {"19.1.2", "How mSQL and MySQL client/server communications protocols differ"},
-   {"19.1.3", "How mSQL 2.0 SQL syntax differs from MySQL"},
-   {"19.2", "How MySQL compares to PostgreSQL"},
-   {"A", "Some users of MySQL"},
-   {"B", "Contributed programs"},
-   {"C", "Contributors to MySQL"},
-   {"D", "MySQL change history"},
-   {"19.3", "Changes in release 3.22.x (Alpha version)"},
-   {"19.3.1", "Changes in release 3.22.7"},
-   {"19.3.2", "Changes in release 3.22.6"},
-   {"19.3.3", "Changes in release 3.22.5"},
-   {"19.3.4", "Changes in release 3.22.4"},
-   {"19.3.5", "Changes in release 3.22.3"},
-   {"19.3.6", "Changes in release 3.22.2"},
-   {"19.3.7", "Changes in release 3.22.1"},
-   {"19.3.8", "Changes in release 3.22.0"},
-   {"19.4", "Changes in release 3.21.x"},
-   {"19.4.1", "Changes in release 3.21.33"},
-   {"19.4.2", "Changes in release 3.21.32"},
-   {"19.4.3", "Changes in release 3.21.31"},
-   {"19.4.4", "Changes in release 3.21.30"},
-   {"19.4.5", "Changes in release 3.21.29"},
-   {"19.4.6", "Changes in release 3.21.28"},
-   {"19.4.7", "Changes in release 3.21.27"},
-   {"19.4.8", "Changes in release 3.21.26"},
-   {"19.4.9", "Changes in release 3.21.25"},
-   {"19.4.10", "Changes in release 3.21.24"},
-   {"19.4.11", "Changes in release 3.21.23"},
-   {"19.4.12", "Changes in release 3.21.22"},
-   {"19.4.13", "Changes in release 3.21.21a"},
-   {"19.4.14", "Changes in release 3.21.21"},
-   {"19.4.15", "Changes in release 3.21.20"},
-   {"19.4.16", "Changes in release 3.21.19"},
-   {"19.4.17", "Changes in release 3.21.18"},
-   {"19.4.18", "Changes in release 3.21.17"},
-   {"19.4.19", "Changes in release 3.21.16"},
-   {"19.4.20", "Changes in release 3.21.15"},
-   {"19.4.21", "Changes in release 3.21.14b"},
-   {"19.4.22", "Changes in release 3.21.14a"},
-   {"19.4.23", "Changes in release 3.21.13"},
-   {"19.4.24", "Changes in release 3.21.12"},
-   {"19.4.25", "Changes in release 3.21.11"},
-   {"19.4.26", "Changes in release 3.21.10"},
-   {"19.4.27", "Changes in release 3.21.9"},
-   {"19.4.28", "Changes in release 3.21.8"},
-   {"19.4.29", "Changes in release 3.21.7"},
-   {"19.4.30", "Changes in release 3.21.6"},
-   {"19.4.31", "Changes in release 3.21.5"},
-   {"19.4.32", "Changes in release 3.21.4"},
-   {"19.4.33", "Changes in release 3.21.3"},
-   {"19.4.34", "Changes in release 3.21.2"},
-   {"19.4.35", "Changes in release 3.21.0"},
-   {"19.5", "Changes in release 3.20.x"},
-   {"19.5.1", "Changes in release 3.20.18"},
-   {"19.5.2", "Changes in release 3.20.17"},
-   {"19.5.3", "Changes in release 3.20.16"},
-   {"19.5.4", "Changes in release 3.20.15"},
-   {"19.5.5", "Changes in release 3.20.14"},
-   {"19.5.6", "Changes in release 3.20.13"},
-   {"19.5.7", "Changes in release 3.20.11"},
-   {"19.5.8", "Changes in release 3.20.10"},
-   {"19.5.9", "Changes in release 3.20.9"},
-   {"19.5.10", "Changes in release 3.20.8"},
-   {"19.5.11", "Changes in release 3.20.7"},
-   {"19.5.12", "Changes in release 3.20.6"},
-   {"19.5.13", "Changes in release 3.20.3"},
-   {"19.5.14", "Changes in release 3.20.0"},
-   {"19.6", "Changes in release 3.19.x"},
-   {"19.6.1", "Changes in release 3.19.5"},
-   {"19.6.2", "Changes in release 3.19.4"},
-   {"19.6.3", "Changes in release 3.19.3"},
-   {"E", "Known errors and design deficiencies in MySQL"},
-   {"F", "List of things we want to add to MySQL in the future (The TODO)"},
-   {"19.7", "Things that must done in the real near future"},
-   {"19.8", "Things that have to be done sometime"},
-   {"19.9", "Some things we don't have any plans to do"},
-   {"G", "Comments on porting to other systems"},
-   {"19.10", "Debugging MySQL"},
-   {"19.11", "Comments about RTS threads"},
-   {"19.12", "What is the difference between different thread packages?"},
-   {"H", "Description of MySQL regular expression syntax"},
-   {"I", "What is Unireg?"},
-   {"J", "The MySQL server license"},
-   {"K", "The MySQL license for Microsoft operating systems"},
-   {"*", "SQL command, type and function index"},
-   {"*", "Concept Index"}
-};
-
-#define NQUERIES 5
-const char *query[NQUERIES]={
-   "mysql information and manual",
-   "upgrading from previous version",
-   "column indexes",
-   "against about after more right the with/without", /* stopwords test */
-   "mysql license and copyright"
-};

=== modified file 'storage/maria/ma_key.c'
--- a/storage/maria/ma_key.c	2009-03-13 14:10:43 +0000
+++ b/storage/maria/ma_key.c	2009-05-14 21:49:53 +0000
@@ -99,7 +99,7 @@ uint transid_store_packed(MARIA_HA *info
   uchar *start;
   uint length;
   uchar buff[8];
-  DBUG_ASSERT(trid < (LL(1) << (MARIA_MAX_PACK_TRANSID_SIZE*8)));
+  DBUG_ASSERT(trid < (1LL << (MARIA_MAX_PACK_TRANSID_SIZE*8)));
   DBUG_ASSERT(trid >= info->s->state.create_trid);
 
   trid= (trid - info->s->state.create_trid) << 1;

=== modified file 'storage/maria/ma_loghandler.c'
--- a/storage/maria/ma_loghandler.c	2009-03-05 21:42:16 +0000
+++ b/storage/maria/ma_loghandler.c	2009-05-14 21:49:53 +0000
@@ -3175,7 +3175,7 @@ static my_bool translog_get_last_page_ad
   DBUG_PRINT("info", ("File size: %s", llstr(file_size, buff)));
   if (file_size == MY_FILEPOS_ERROR)
     DBUG_RETURN(1);
-  DBUG_ASSERT(file_size < ULL(0xffffffff));
+  DBUG_ASSERT(file_size < 0xffffffffULL);
   if (((uint32)file_size) > TRANSLOG_PAGE_SIZE)
   {
     rec_offset= (((((uint32)file_size) / TRANSLOG_PAGE_SIZE) - 1) *
@@ -3670,12 +3670,12 @@ my_bool translog_init_with_table(const c
         TRANSLOG_FILE *file= (TRANSLOG_FILE *)my_malloc(sizeof(TRANSLOG_FILE),
                                                         MYF(0));
 
-        compile_time_assert(MY_FILEPOS_ERROR > ULL(0xffffffff));
+        compile_time_assert(MY_FILEPOS_ERROR > 0xffffffffULL);
         if (file == NULL ||
             (file->handler.file=
              open_logfile_by_number_no_cache(i)) < 0 ||
             my_seek(file->handler.file, 0, SEEK_END, MYF(0)) >=
-            ULL(0xffffffff))
+            0xffffffffULL)
         {
           int j;
           for (j= i - log_descriptor.min_file - 1; j > 0; j--)
@@ -5124,7 +5124,7 @@ static uchar *translog_put_LSN_diff(LSN 
     dst[0]= (uchar)(0x80 | (diff >> 24));
     int3store(dst + 1, diff & 0xFFFFFFL);
   }
-  else if (diff <= LL(0x3FFFFFFFFF))
+  else if (diff <= 0x3FFFFFFFFFLL)
 
   {
     dst-= 5;
@@ -5221,7 +5221,7 @@ static uchar *translog_get_LSN_from_diff
     {
       /* take 1 from file offset */
       first_byte++;
-      base_offset+= LL(0x100000000);
+      base_offset+= 0x100000000LL;
     }
     file_no= LSN_FILE_NO(base_lsn) - first_byte;
     DBUG_ASSERT(base_offset - diff <= UINT_MAX);

=== modified file 'storage/maria/ma_loghandler_lsn.h'
--- a/storage/maria/ma_loghandler_lsn.h	2008-07-09 09:02:27 +0000
+++ b/storage/maria/ma_loghandler_lsn.h	2009-05-14 21:49:53 +0000
@@ -83,8 +83,8 @@ typedef TRANSLOG_ADDRESS LSN;
   other bytes are a LSN.
 */
 typedef LSN LSN_WITH_FLAGS;
-#define LSN_WITH_FLAGS_TO_LSN(x)   (x & ULL(0x00FFFFFFFFFFFFFF))
-#define LSN_WITH_FLAGS_TO_FLAGS(x) (x & ULL(0xFF00000000000000))
+#define LSN_WITH_FLAGS_TO_LSN(x)   (x & 0x00FFFFFFFFFFFFFFULL)
+#define LSN_WITH_FLAGS_TO_FLAGS(x) (x & 0xFF00000000000000ULL)
 
 #define FILENO_IMPOSSIBLE     0 /**< log file's numbering starts at 1 */
 #define LOG_OFFSET_IMPOSSIBLE 0 /**< log always has a header */
@@ -106,6 +106,6 @@ typedef LSN LSN_WITH_FLAGS;
    Unlike ULONGLONG_MAX, it can be safely used in comparison with valid LSNs
    (ULONGLONG_MAX is too big for correctness of cmp_translog_addr()).
 */
-#define LSN_MAX (LSN)ULL(0x00FFFFFFFFFFFFFF)
+#define LSN_MAX (LSN)0x00FFFFFFFFFFFFFFULL
 
 #endif

=== modified file 'storage/maria/ma_pagecache.c'
--- a/storage/maria/ma_pagecache.c	2009-02-13 16:30:54 +0000
+++ b/storage/maria/ma_pagecache.c	2009-05-14 21:49:53 +0000
@@ -1567,7 +1567,7 @@ static void unlink_hash(PAGECACHE *pagec
     struct st_my_thread_var *thread;
 
     hash_link->file= first_page->file;
-    DBUG_ASSERT(first_page->pageno < ((ULL(1)) << 40));
+    DBUG_ASSERT(first_page->pageno < ((1ULL) << 40));
     hash_link->pageno= first_page->pageno;
     do
     {
@@ -1729,7 +1729,7 @@ restart:
       goto restart;
     }
     hash_link->file= *file;
-    DBUG_ASSERT(pageno < ((ULL(1)) << 40));
+    DBUG_ASSERT(pageno < ((1ULL) << 40));
     hash_link->pageno= pageno;
     link_hash(start, hash_link);
     /* Register the request for the page */
@@ -3281,7 +3281,7 @@ uchar *pagecache_read(PAGECACHE *pagecac
                        page_cache_page_pin_str[unlock_pin]));
   DBUG_ASSERT(buff != 0 || (buff == 0 && (unlock_pin == PAGECACHE_PIN ||
                                           unlock_pin == PAGECACHE_PIN_LEFT_PINNED)));
-  DBUG_ASSERT(pageno < ((ULL(1)) << 40));
+  DBUG_ASSERT(pageno < ((1ULL) << 40));
 #endif
 
   if (!page_link)
@@ -3654,7 +3654,7 @@ my_bool pagecache_delete(PAGECACHE *page
               pin == PAGECACHE_PIN_LEFT_PINNED);
 restart:
 
-  DBUG_ASSERT(pageno < ((ULL(1)) << 40));
+  DBUG_ASSERT(pageno < ((1ULL) << 40));
   if (pagecache->can_be_used)
   {
     /* Key cache is used */
@@ -3833,7 +3833,7 @@ my_bool pagecache_write_part(PAGECACHE *
   DBUG_ASSERT(lock != PAGECACHE_LOCK_LEFT_READLOCKED);
   DBUG_ASSERT(lock != PAGECACHE_LOCK_READ_UNLOCK);
   DBUG_ASSERT(offset + size <= pagecache->block_size);
-  DBUG_ASSERT(pageno < ((ULL(1)) << 40));
+  DBUG_ASSERT(pageno < ((1ULL) << 40));
 #endif
 
   if (!page_link)
@@ -4824,7 +4824,7 @@ my_bool pagecache_collect_changed_blocks
       ptr+= 2;
       ptr[0]= (share->kfile.file == block->hash_link->file.file);
       ptr++;
-      DBUG_ASSERT(block->hash_link->pageno < ((ULL(1)) << 40));
+      DBUG_ASSERT(block->hash_link->pageno < ((1ULL) << 40));
       page_store(ptr, block->hash_link->pageno);
       ptr+= PAGE_STORE_SIZE;
       lsn_store(ptr, block->rec_lsn);

=== modified file 'storage/maria/ma_recovery.c'
--- a/storage/maria/ma_recovery.c	2009-03-05 21:42:16 +0000
+++ b/storage/maria/ma_recovery.c	2009-05-14 21:49:53 +0000
@@ -3437,7 +3437,7 @@ static void print_redo_phase_progress(TR
      end_offset);
   if (initial_remainder == (ulonglong)(-1))
     initial_remainder= local_remainder;
-  percentage_done= (uint) ((initial_remainder - local_remainder) * ULL(100) /
+  percentage_done= (uint) ((initial_remainder - local_remainder) * 100ULL /
                            initial_remainder);
   if ((percentage_done - percentage_printed) >= 10)
   {

=== modified file 'storage/maria/maria_backup_engine.cc'
--- a/storage/maria/maria_backup_engine.cc	2009-02-13 18:16:54 +0000
+++ b/storage/maria/maria_backup_engine.cc	2009-05-14 21:49:53 +0000
@@ -985,7 +985,7 @@ Log_backup::Log_backup(const char *log_n
     except that it allows us to verify that what restore sends us is really a
     log.
   */
-  log_file_backup.init(fd, ~(ULL(0)), LOG_FILE_CODE);
+  log_file_backup.init(fd, ~(0ULL), LOG_FILE_CODE);
   state= OK;
   DBUG_VOID_RETURN;
 }
@@ -1977,7 +1977,7 @@ result_t Table_restore::post_restore()
         old and empty.
       */
       pthread_mutex_lock(&share->bitmap.bitmap_lock);
-      share->bitmap.page= ~(ULL(0)); /* to force a read below */
+      share->bitmap.page= ~0ULL; /* to force a read below */
       (void)_ma_bitmap_get_page_bits(mi_info, &share->bitmap, 1);
       pthread_mutex_unlock(&share->bitmap.bitmap_lock);
     }

=== modified file 'storage/maria/maria_def.h'
--- a/storage/maria/maria_def.h	2009-02-23 11:55:35 +0000
+++ b/storage/maria/maria_def.h	2009-05-14 21:49:53 +0000
@@ -790,7 +790,7 @@ struct st_maria_handler
 #define MARIA_MAX_KEYPTR_SIZE	5	/* For calculating block lengths */
 
 /* Marker for impossible delete link */
-#define IMPOSSIBLE_PAGE_NO LL(0xFFFFFFFFFF)
+#define IMPOSSIBLE_PAGE_NO 0xFFFFFFFFFFLL
 
 /* The UNIQUE check is done with a hashed long key */
 

=== modified file 'storage/maria/maria_pack.c'
--- a/storage/maria/maria_pack.c	2009-02-13 16:30:54 +0000
+++ b/storage/maria/maria_pack.c	2009-05-14 21:49:53 +0000
@@ -1920,7 +1920,7 @@ static int make_huff_decode_table(HUFF_T
 	return 1;
       huff_tree->code_len=(uchar*) (huff_tree->code+elements);
       make_traverse_code_tree(huff_tree, huff_tree->root,
-                              8 * sizeof(ulonglong), LL(0));
+                              8 * sizeof(ulonglong), 0LL);
     }
   }
   return 0;

=== modified file 'storage/maria/trnman.h'
--- a/storage/maria/trnman.h	2009-01-16 16:18:17 +0000
+++ b/storage/maria/trnman.h	2009-05-14 21:49:53 +0000
@@ -56,7 +56,7 @@ struct st_ma_transaction
   uint16               flags;         /**< Various flags */
 };
 
-#define TRANSACTION_LOGGED_LONG_ID ULL(0x8000000000000000)
+#define TRANSACTION_LOGGED_LONG_ID 0x8000000000000000ULL
 #define MAX_TRID (~(TrID)0)
 
 extern WT_RESOURCE_TYPE ma_rc_dup_unique;

=== modified file 'storage/maria/unittest/lockman2-t.c'
--- a/storage/maria/unittest/lockman2-t.c	2008-03-04 11:58:21 +0000
+++ b/storage/maria/unittest/lockman2-t.c	2009-05-14 21:49:53 +0000
@@ -219,7 +219,7 @@ pthread_handler_t test_lockman(void *arg
   for (x= ((int)(intptr)(&m)); m > 0; m--)
   {
     /* three prime numbers */
-    x= (uint) ((x*LL(3628273133) + LL(1500450271)) % LL(9576890767));
+    x= (uint) ((x*3628273133LL + 1500450271LL) % 9576890767LL);
     row=  x % Nrows + Ntables;
     table= row % Ntables;
     locklevel= (x/Nrows) & 3;

=== modified file 'storage/maria/unittest/ma_control_file-t.c'
--- a/storage/maria/unittest/ma_control_file-t.c	2008-06-05 16:11:22 +0000
+++ b/storage/maria/unittest/ma_control_file-t.c	2009-05-14 21:49:53 +0000
@@ -248,7 +248,7 @@ static int test_five_logs_and_max_trid(v
 
   RET_ERR_UNLESS(open_file() == CONTROL_FILE_OK);
   expect_logno= 100;
-  expect_max_trid= ULL(14111978111);
+  expect_max_trid= 14111978111ULL;
   for (i= 0; i<5; i++)
   {
     expect_logno*= 3;

=== modified file 'storage/maria/unittest/trnman-t.c'
--- a/storage/maria/unittest/trnman-t.c	2009-02-13 16:30:54 +0000
+++ b/storage/maria/unittest/trnman-t.c	2009-05-14 21:49:53 +0000
@@ -45,7 +45,7 @@ pthread_handler_t test_trnman(void *arg)
 
   for (x= ((int)(intptr)(&m)); m > 0; )
   {
-    y= x= (x*LL(3628273133) + LL(1500450271)) % LL(9576890767); /* three prime numbers */
+    y= x= (x*3628273133LL + 1500450271LL) % 9576890767LL; /* three prime numbers */
     m-= n= x % MAX_ITER;
     for (i= 0; i < n; i++)
     {

=== modified file 'storage/myisam/CMakeLists.txt' (properties changed: +x to -x)
--- a/storage/myisam/CMakeLists.txt	2009-05-15 13:45:06 +0000
+++ b/storage/myisam/CMakeLists.txt	2009-05-25 10:10:18 +0000
@@ -15,9 +15,8 @@
 INCLUDE("${PROJECT_SOURCE_DIR}/storage/mysql_storage_engine.cmake")
 INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
 
-SET(MYISAM_SOURCES  ft_boolean_search.c ft_nlq_search.c ft_parser.c ft_static.c ft_stem.c
-                                ha_myisam.cc
-				ft_myisam.c 
+SET(MYISAM_SOURCES  ft_boolean_search.c ft_nlq_search.c ft_parser.c ft_static.c
+                                ha_myisam.cc ft_myisam.c
 				ft_stopwords.c ft_update.c mi_cache.c mi_changed.c mi_check.c
 				mi_checksum.c mi_close.c mi_create.c mi_dbug.c mi_delete.c 
 				mi_delete_all.c mi_delete_table.c mi_dynrec.c mi_extra.c mi_info.c
@@ -26,7 +25,7 @@ SET(MYISAM_SOURCES  ft_boolean_search.c 
 				mi_rfirst.c mi_rlast.c mi_rnext.c mi_rnext_same.c mi_rprev.c mi_rrnd.c
 				mi_rsame.c mi_rsamepos.c mi_scan.c mi_search.c mi_static.c mi_statrec.c
 				mi_unique.c mi_update.c mi_write.c rt_index.c rt_key.c rt_mbr.c
-				rt_split.c sort.c sp_key.c ft_eval.h mi_extrafunc.h myisamdef.h
+				rt_split.c sort.c sp_key.c mi_extrafunc.h myisamdef.h
 				rt_index.h mi_rkey.c mi_examine_log.c myisam_backup_engine.cc)
 
 MYSQL_STORAGE_ENGINE(MYISAM)

=== modified file 'storage/myisam/Makefile.am'
--- a/storage/myisam/Makefile.am	2009-01-07 10:58:33 +0000
+++ b/storage/myisam/Makefile.am	2009-04-06 18:36:46 +0000
@@ -26,7 +26,7 @@ LDADD =
 
 DEFS =                  @DEFS@
 
-EXTRA_DIST =		mi_test_all.sh mi_test_all.res ft_stem.c CMakeLists.txt plug.in
+EXTRA_DIST =		mi_test_all.sh mi_test_all.res CMakeLists.txt plug.in
 pkgdata_DATA =		mi_test_all mi_test_all.res
 
 pkglib_LIBRARIES =	libmyisam.a
@@ -46,10 +46,9 @@ myisampack_LDADD=		@CLIENT_EXTRA_LDFLAGS
 			$(top_builddir)/mysys/libmysyslt.la \
 			$(top_builddir)/dbug/libdbuglt.la \
 			$(top_builddir)/strings/libmystringslt.la @ZLIB_LIBS@
-noinst_PROGRAMS =	mi_test1 mi_test2 mi_test3 rt_test sp_test #ft_test1 ft_eval
+noinst_PROGRAMS =	mi_test1 mi_test2 mi_test3 rt_test sp_test
 noinst_HEADERS =	myisamdef.h rt_index.h rt_key.h rt_mbr.h sp_defs.h \
-			fulltext.h ftdefs.h ft_test1.h ft_eval.h \
-			ha_myisam.h mi_extrafunc.h
+			fulltext.h ftdefs.h ha_myisam.h mi_extrafunc.h
 mi_test1_DEPENDENCIES=	$(LIBRARIES)
 mi_test1_LDADD=		@CLIENT_EXTRA_LDFLAGS@ libmyisam.a \
 			$(top_builddir)/mysys/libmysyslt.la \
@@ -65,8 +64,6 @@ mi_test3_LDADD=		@CLIENT_EXTRA_LDFLAGS@ 
 			$(top_builddir)/mysys/libmysyslt.la \
 			$(top_builddir)/dbug/libdbuglt.la \
 			$(top_builddir)/strings/libmystringslt.la @ZLIB_LIBS@
-#ft_test1_DEPENDENCIES=	$(LIBRARIES)
-#ft_eval_DEPENDENCIES=	$(LIBRARIES)
 myisam_ftdump_DEPENDENCIES=	$(LIBRARIES)
 myisam_ftdump_LDADD =			@CLIENT_EXTRA_LDFLAGS@ libmyisam.a \
 			$(top_builddir)/mysys/libmysyslt.la \

=== removed file 'storage/myisam/ft_eval.c'
--- a/storage/myisam/ft_eval.c	2008-05-29 15:44:11 +0000
+++ b/storage/myisam/ft_eval.c	1970-01-01 00:00:00 +0000
@@ -1,252 +0,0 @@
-/* Copyright (C) 2000-2002 MySQL AB
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; version 2 of the License.
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
-
-/* Written by Sergei A. Golubchik, who has a shared copyright to this code
-   added support for long options (my_getopt) 22.5.2002 by Jani Tolonen */
-
-#include "ftdefs.h"
-#include "ft_eval.h"
-#include <stdarg.h>
-#include <my_getopt.h>
-
-static void print_error(int exit_code, const char *fmt,...);
-static void get_options(int argc, char *argv[]);
-static int create_record(char *pos, FILE *file);
-static void usage();
-
-static struct my_option my_long_options[] =
-{
-  {"", 's', "", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"", 'q', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"", 'S', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"", '#', "", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"", 'V', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"", '?', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"", 'h', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
-};
-
-int main(int argc, char *argv[])
-{
-  MI_INFO *file;
-  int i,j;
-
-  MY_INIT(argv[0]);
-  get_options(argc,argv);
-  bzero((char*)recinfo,sizeof(recinfo));
-
-  /* First define 2 columns */
-  recinfo[0].type=FIELD_SKIP_ENDSPACE;
-  recinfo[0].length=docid_length;
-  recinfo[1].type=FIELD_BLOB;
-  recinfo[1].length= 4+portable_sizeof_char_ptr;
-
-  /* Define a key over the first column */
-  keyinfo[0].seg=keyseg;
-  keyinfo[0].keysegs=1;
-  keyinfo[0].block_length= 0;                   /* Default block length */
-  keyinfo[0].seg[0].type= HA_KEYTYPE_TEXT;
-  keyinfo[0].seg[0].flag= HA_BLOB_PART;
-  keyinfo[0].seg[0].start=recinfo[0].length;
-  keyinfo[0].seg[0].length=key_length;
-  keyinfo[0].seg[0].null_bit=0;
-  keyinfo[0].seg[0].null_pos=0;
-  keyinfo[0].seg[0].bit_start=4;
-  keyinfo[0].seg[0].language=MY_CHARSET_CURRENT;
-  keyinfo[0].flag = HA_FULLTEXT;
-
-  if (!silent)
-    printf("- Creating isam-file\n");
-  if (mi_create(filename,1,keyinfo,2,recinfo,0,NULL,(MI_CREATE_INFO*) 0,0))
-    goto err;
-  if (!(file=mi_open(filename,2,0)))
-    goto err;
-  if (!silent)
-    printf("Initializing stopwords\n");
-  ft_init_stopwords(stopwordlist);
-
-  if (!silent)
-    printf("- Writing key:s\n");
-
-  my_errno=0;
-  i=0;
-  while (create_record(record,df))
-  {
-    error=mi_write(file,record);
-    if (error)
-      printf("I= %2d  mi_write: %d  errno: %d\n",i,error,my_errno);
-    i++;
-  }
-  fclose(df);
-
-  if (mi_close(file)) goto err;
-  if (!silent)
-    printf("- Reopening file\n");
-  if (!(file=mi_open(filename,2,0))) goto err;
-  if (!silent)
-    printf("- Reading rows with key\n");
-  for (i=1;create_record(record,qf);i++)
-  {
-    FT_DOCLIST *result;
-    double w;
-    int t, err;
-
-    result=ft_nlq_init_search(file,0,blob_record,(uint) strlen(blob_record),1);
-    if (!result)
-    {
-      printf("Query %d failed with errno %3d\n",i,my_errno);
-      goto err;
-    }
-    if (!silent)
-      printf("Query %d. Found: %d.\n",i,result->ndocs);
-    for (j=0;(err=ft_nlq_read_next(result, read_record))==0;j++)
-    {
-      t=uint2korr(read_record);
-      w=ft_nlq_get_relevance(result);
-      printf("%d %.*s %f\n",i,t,read_record+2,w);
-    }
-    if (err != HA_ERR_END_OF_FILE)
-    {
-      printf("ft_read_next %d failed with errno %3d\n",j,my_errno);
-      goto err;
-    }
-    ft_nlq_close_search(result);
-  }
-
-  if (mi_close(file)) goto err;
-  my_end(MY_CHECK_ERROR);
-
-  return (0);
-
- err:
-  printf("got error: %3d when using myisam-database\n",my_errno);
-  return 1;			/* skip warning */
-
-}
-
-
-static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
-	       char *argument)
-{
-  switch (optid) {
-  case 's':
-    if (stopwordlist && stopwordlist != ft_precompiled_stopwords)
-      break;
-    {
-      FILE *f; char s[HA_FT_MAXLEN]; int i=0,n=SWL_INIT;
-
-      if (!(stopwordlist=(const char**) malloc(n*sizeof(char *))))
-	print_error(1,"malloc(%d)",n*sizeof(char *));
-      if (!(f=fopen(argument,"r")))
-	print_error(1,"fopen(%s)",argument);
-      while (!feof(f))
-      {
-	if (!(fgets(s,HA_FT_MAXLEN,f)))
-	  print_error(1,"fgets(s,%d,%s)",HA_FT_MAXLEN,argument);
-	if (!(stopwordlist[i++]=strdup(s)))
-	  print_error(1,"strdup(%s)",s);
-	if (i >= n)
-	{
-	  n+=SWL_PLUS;
-	  if (!(stopwordlist=(const char**) realloc((char*) stopwordlist,
-						    n*sizeof(char *))))
-	    print_error(1,"realloc(%d)",n*sizeof(char *));
-	}
-      }
-      fclose(f);
-      stopwordlist[i]=NULL;
-      break;
-    }
-  case 'q': silent=1; break;
-  case 'S': if (stopwordlist==ft_precompiled_stopwords) stopwordlist=NULL; break;
-  case '#':
-    DBUG_PUSH (argument);
-    break;
-  case 'V':
-  case '?':
-  case 'h':
-    usage();
-    exit(1);
-  }
-  return 0;
-}
-
-
-static void get_options(int argc, char *argv[])
-{
-  int ho_error;
-
-  if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
-    exit(ho_error);
-
-  if (!(d_file=argv[optind])) print_error(1,"No d_file");
-  if (!(df=fopen(d_file,"r")))
-    print_error(1,"fopen(%s)",d_file);
-  if (!(q_file=argv[optind+1])) print_error(1,"No q_file");
-  if (!(qf=fopen(q_file,"r")))
-    print_error(1,"fopen(%s)",q_file);
-  return;
-} /* get options */
-
-
-static int create_record(char *pos, FILE *file)
-{
-  uint tmp; char *ptr;
-
-  bzero((char *)pos,MAX_REC_LENGTH);
-
-  /* column 1 - VARCHAR */
-  if (!(fgets(pos+2,MAX_REC_LENGTH-32,file)))
-  {
-    if (feof(file))
-      return 0;
-    else
-      print_error(1,"fgets(docid) - 1");
-  }
-  tmp=(uint) strlen(pos+2)-1;
-  int2store(pos,tmp);
-  pos+=recinfo[0].length;
-
-  /* column 2 - BLOB */
-
-  if (!(fgets(blob_record,MAX_BLOB_LENGTH,file)))
-    print_error(1,"fgets(docid) - 2");
-  tmp=(uint) strlen(blob_record);
-  int4store(pos,tmp);
-  ptr=blob_record;
-  memcpy_fixed(pos+4,&ptr,sizeof(char*));
-  return 1;
-}
-
-/* VARARGS */
-
-static void print_error(int exit_code, const char *fmt,...)
-{
-  va_list args;
-
-  va_start(args,fmt);
-  fprintf(stderr,"%s: error: ",my_progname);
-  (void) vfprintf(stderr, fmt, args);
-  (void) fputc('\n',stderr);
-  fflush(stderr);
-  va_end(args);
-  exit(exit_code);
-}
-
-
-static void usage()
-{
-  printf("%s [options]\n", my_progname);
-  my_print_help(my_long_options);
-  my_print_variables(my_long_options);
-}

=== removed file 'storage/myisam/ft_eval.h'
--- a/storage/myisam/ft_eval.h	2006-12-23 19:20:40 +0000
+++ b/storage/myisam/ft_eval.h	1970-01-01 00:00:00 +0000
@@ -1,41 +0,0 @@
-/* Copyright (C) 2000 MySQL AB & Sergei A. Golubchik
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; version 2 of the License.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
-
-/* Written by Sergei A. Golubchik, who has a shared copyright to this code */
-
-const char **stopwordlist=ft_precompiled_stopwords;
-
-#define MAX_REC_LENGTH 128
-#define MAX_BLOB_LENGTH 60000
-char record[MAX_REC_LENGTH], read_record[MAX_REC_LENGTH+MAX_BLOB_LENGTH];
-char blob_record[MAX_BLOB_LENGTH+20*20];
-
-char *filename= (char*) "EVAL";
-
-int silent=0, error=0;
-
-uint key_length=MAX_BLOB_LENGTH,docid_length=32;
-char *d_file, *q_file;
-FILE *df,*qf;
-
-MI_COLUMNDEF recinfo[3];
-MI_KEYDEF keyinfo[2];
-HA_KEYSEG keyseg[10];
-
-#define SWL_INIT 500
-#define SWL_PLUS 50
-
-#define MAX_LINE_LENGTH 128
-char line[MAX_LINE_LENGTH];

=== removed file 'storage/myisam/ft_stem.c'
--- a/storage/myisam/ft_stem.c	2006-12-31 00:32:21 +0000
+++ b/storage/myisam/ft_stem.c	1970-01-01 00:00:00 +0000
@@ -1,18 +0,0 @@
-/* Copyright (C) 2000 MySQL AB
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; version 2 of the License.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
-
-/* Written by Sergei A. Golubchik, who has a shared copyright to this code */
-
-/* mulitingual stem */

=== removed file 'storage/myisam/ft_test1.c'
--- a/storage/myisam/ft_test1.c	2008-04-28 16:24:05 +0000
+++ b/storage/myisam/ft_test1.c	1970-01-01 00:00:00 +0000
@@ -1,315 +0,0 @@
-/* Copyright (C) 2000-2002, 2004 MySQL AB
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; version 2 of the License.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
-
-/* Written by Sergei A. Golubchik, who has a shared copyright to this code
-   added support for long options (my_getopt) 22.5.2002 by Jani Tolonen */
-
-#include "ftdefs.h"
-#include "ft_test1.h"
-#include <my_getopt.h>
-
-static int key_field=FIELD_VARCHAR,extra_field=FIELD_SKIP_ENDSPACE;
-static uint key_length=200,extra_length=50;
-static int key_type=HA_KEYTYPE_TEXT;
-static int verbose=0,silent=0,skip_update=0,
-	   no_keys=0,no_stopwords=0,no_search=0,no_fulltext=0;
-static int create_flag=0,error=0;
-
-#define MAX_REC_LENGTH 300
-static char record[MAX_REC_LENGTH],read_record[MAX_REC_LENGTH];
-
-static int run_test(const char *filename);
-static void get_options(int argc, char *argv[]);
-static void create_record(char *, int);
-static void usage();
-
-static struct my_option my_long_options[] =
-{
-  {"", 'v', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"", '?', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"", 'h', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"", 'V', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"", 'v', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"", 's', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"", 'N', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"", 'S', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"", 'K', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"", 'F', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"", 'U', "", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"", '#', "", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
-  { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
-};
-
-int main(int argc, char *argv[])
-{
-  MY_INIT(argv[0]);
-
-  get_options(argc,argv);
-
-  exit(run_test("FT1"));
-}
-
-static MI_COLUMNDEF recinfo[3];
-static MI_KEYDEF keyinfo[2];
-static HA_KEYSEG keyseg[10];
-
-static int run_test(const char *filename)
-{
-  MI_INFO *file;
-  int i,j;
-  my_off_t pos;
-
-  bzero((char*) recinfo,sizeof(recinfo));
-
-  /* First define 2 columns */
-  recinfo[0].type=extra_field;
-  recinfo[0].length= (extra_field == FIELD_BLOB ? 4 + portable_sizeof_char_ptr :
-	      extra_length);
-  if (extra_field == FIELD_VARCHAR)
-    recinfo[0].length+= HA_VARCHAR_PACKLENGTH(extra_length);
-  recinfo[1].type=key_field;
-  recinfo[1].length= (key_field == FIELD_BLOB ? 4+portable_sizeof_char_ptr :
-		      key_length);
-  if (key_field == FIELD_VARCHAR)
-    recinfo[1].length+= HA_VARCHAR_PACKLENGTH(key_length);
-
-  /* Define a key over the first column */
-  keyinfo[0].seg=keyseg;
-  keyinfo[0].keysegs=1;
-  keyinfo[0].block_length= 0;                   /* Default block length */
-  keyinfo[0].seg[0].type= key_type;
-  keyinfo[0].seg[0].flag= (key_field == FIELD_BLOB) ? HA_BLOB_PART:
-			  (key_field == FIELD_VARCHAR) ? HA_VAR_LENGTH_PART:0;
-  keyinfo[0].seg[0].start=recinfo[0].length;
-  keyinfo[0].seg[0].length=key_length;
-  keyinfo[0].seg[0].null_bit= 0;
-  keyinfo[0].seg[0].null_pos=0;
-  keyinfo[0].seg[0].language= default_charset_info->number;
-  keyinfo[0].flag = (no_fulltext?HA_PACK_KEY:HA_FULLTEXT);
-
-  if (!silent)
-    printf("- Creating isam-file\n");
-  if (mi_create(filename,(no_keys?0:1),keyinfo,2,recinfo,0,NULL,
-		(MI_CREATE_INFO*) 0, create_flag))
-    goto err;
-  if (!(file=mi_open(filename,2,0)))
-    goto err;
-
-  if (!silent)
-    printf("- %s stopwords\n",no_stopwords?"Skipping":"Initializing");
-  ft_init_stopwords(no_stopwords?NULL:ft_precompiled_stopwords);
-
-  if (!silent)
-    printf("- Writing key:s\n");
-
-  my_errno=0;
-  for (i=NUPD ; i<NDATAS; i++ )
-  {
-    create_record(record,i);
-    error=mi_write(file,record);
-    if (verbose || error)
-      printf("I= %2d  mi_write: %d  errno: %d, record: %s\n",
-	i,error,my_errno,data[i].f0);
-  }
-
-  if (!skip_update)
-  {
-    if (!silent)
-      printf("- Updating rows\n");
-
-    /* Read through all rows and update them */
-    pos=(ha_rows) 0;
-    i=0;
-    while ((error=mi_rrnd(file,read_record,pos)) == 0)
-    {
-      create_record(record,NUPD-i-1);
-      if (mi_update(file,read_record,record))
-      {
-	printf("Can't update row: %.*s, error: %d\n",
-	       keyinfo[0].seg[0].length,record,my_errno);
-      }
-      if(++i == NUPD) break;
-      pos=HA_OFFSET_ERROR;
-    }
-    if (i != NUPD)
-      printf("Found %d of %d rows\n", i,NUPD);
-  }
-
-  if (mi_close(file)) goto err;
-  if(no_search) return 0;
-  if (!silent)
-    printf("- Reopening file\n");
-  if (!(file=mi_open(filename,2,0))) goto err;
-  if (!silent)
-    printf("- Reading rows with key\n");
-  for (i=0 ; i < NQUERIES ; i++)
-  {
-    FT_DOCLIST *result;
-    result=ft_nlq_init_search(file,0,(char*) query[i],strlen(query[i]),1);
-    if(!result)
-    {
-      printf("Query %d: `%s' failed with errno %3d\n",i,query[i],my_errno);
-      continue;
-    }
-    printf("Query %d: `%s'. Found: %d. Top five documents:\n",
-           i,query[i],result->ndocs);
-    for (j=0;j<5;j++)
-    {
-      double w; int err;
-      err= ft_nlq_read_next(result, read_record);
-      if (err==HA_ERR_END_OF_FILE)
-      {
-        printf("No more matches!\n");
-        break;
-      }
-      else if (err)
-      {
-        printf("ft_read_next %d failed with errno %3d\n",j,my_errno);
-        break;
-      }
-      w=ft_nlq_get_relevance(result);
-      if (key_field == FIELD_VARCHAR)
-      {
-        uint l;
-        char *p;
-        p=recinfo[0].length+read_record;
-        l=uint2korr(p);
-        printf("%10.7f: %.*s\n",w,(int) l,p+2);
-      }
-      else
-        printf("%10.7f: %.*s\n",w,recinfo[1].length,
-               recinfo[0].length+read_record);
-    }
-    ft_nlq_close_search(result);
-  }
-
-  if (mi_close(file)) goto err;
-  my_end(MY_CHECK_ERROR);
-
-  return (0);
-err:
-  printf("got error: %3d when using myisam-database\n",my_errno);
-  return 1;			/* skip warning */
-}
-
-static char blob_key[MAX_REC_LENGTH];
-/* static char blob_record[MAX_REC_LENGTH+20*20]; */
-
-void create_record(char *pos, int n)
-{
-  bzero((char*) pos,MAX_REC_LENGTH);
-  if (recinfo[0].type == FIELD_BLOB)
-  {
-    uint tmp;
-    char *ptr;
-    strnmov(blob_key,data[n].f0,keyinfo[0].seg[0].length);
-    tmp=strlen(blob_key);
-    int4store(pos,tmp);
-    ptr=blob_key;
-    memcpy_fixed(pos+4,&ptr,sizeof(char*));
-    pos+=recinfo[0].length;
-  }
-  else if (recinfo[0].type == FIELD_VARCHAR)
-  {
-    uint tmp;
-    /* -1 is here because pack_length is stored in seg->length */
-    uint pack_length= HA_VARCHAR_PACKLENGTH(keyinfo[0].seg[0].length-1);
-    strnmov(pos+pack_length,data[n].f0,keyinfo[0].seg[0].length);
-    tmp=strlen(pos+pack_length);
-    if (pack_length == 1)
-      *pos= (char) tmp;
-    else
-      int2store(pos,tmp);
-    pos+=recinfo[0].length;
-  }
-  else
-  {
-    strnmov(pos,data[n].f0,keyinfo[0].seg[0].length);
-    pos+=recinfo[0].length;
-  }
-  if (recinfo[1].type == FIELD_BLOB)
-  {
-    uint tmp;
-    char *ptr;
-    strnmov(blob_key,data[n].f2,keyinfo[0].seg[0].length);
-    tmp=strlen(blob_key);
-    int4store(pos,tmp);
-    ptr=blob_key;
-    memcpy_fixed(pos+4,&ptr,sizeof(char*));
-    pos+=recinfo[1].length;
-  }
-  else if (recinfo[1].type == FIELD_VARCHAR)
-  {
-    uint tmp;
-    /* -1 is here because pack_length is stored in seg->length */
-    uint pack_length= HA_VARCHAR_PACKLENGTH(keyinfo[0].seg[0].length-1);
-    strnmov(pos+pack_length,data[n].f2,keyinfo[0].seg[0].length);
-    tmp=strlen(pos+1);
-    if (pack_length == 1)
-      *pos= (char) tmp;
-    else
-      int2store(pos,tmp);
-    pos+=recinfo[1].length;
-  }
-  else
-  {
-    strnmov(pos,data[n].f2,keyinfo[0].seg[0].length);
-    pos+=recinfo[1].length;
-  }
-}
-
-
-static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
-	       char *argument)
-{
-  switch(optid) {
-  case 'v': verbose=1; break;
-  case 's': silent=1; break;
-  case 'F': no_fulltext=1; no_search=1;
-  case 'U': skip_update=1; break;
-  case 'K': no_keys=no_search=1; break;
-  case 'N': no_search=1; break;
-  case 'S': no_stopwords=1; break;
-  case '#':
-    DBUG_PUSH (argument);
-    break;
-  case 'V':
-  case '?':
-  case 'h':
-    usage();
-    exit(1);
-  }
-  return 0;
-}
-
-/* Read options */
-
-static void get_options(int argc,char *argv[])
-{
-  int ho_error;
-
-  if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
-    exit(ho_error);
-  return;
-} /* get options */
-
-
-static void usage()
-{
-  printf("%s [options]\n", my_progname);
-  my_print_help(my_long_options);
-  my_print_variables(my_long_options);
-}

=== removed file 'storage/myisam/ft_test1.h'
--- a/storage/myisam/ft_test1.h	2006-12-31 00:32:21 +0000
+++ b/storage/myisam/ft_test1.h	1970-01-01 00:00:00 +0000
@@ -1,420 +0,0 @@
-/* Copyright (C) 2000-2001 MySQL AB
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; version 2 of the License.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
-
-/* Written by Sergei A. Golubchik, who has a shared copyright to this code */
-
-#define NUPD            20
-#define NDATAS          389
-struct { const char *f0, *f2; } data[NDATAS] = {
-   {"1", "General Information about MySQL"},
-   {"1.1", "What is MySQL?"},
-   {"1.2", "About this manual"},
-   {"1.3", "History of MySQL"},
-   {"1.4", "The main features of MySQL"},
-   {"1.5", "General SQL information and tutorials"},
-   {"1.6", "Useful MySQL-related links"},
-   {"1.7", "What are stored procedures and triggers and so on?"},
-   {"2", "MySQL mailing lists and how to ask questions/give error (bug) reports"},
-   {"2.1", "Subscribing to/un-subscribing from the MySQL mailing list"},
-   {"2.2", "Asking questions or reporting bugs"},
-   {"2.3", "I think I have found a bug. What information do you need to help me?"},
-   {"2.3.1", "MySQL keeps crashing"},
-   {"2.4", "Guidelines for answering questions on the mailing list"},
-   {"3", "Licensing or When do I have/want to pay for MySQL?"},
-   {"3.1", "How much does MySQL cost?"},
-   {"3.2", "How do I get commercial support?"},
-   {"3.2.1", "Types of commercial support"},
-   {"3.2.1.1", "Basic email support"},
-   {"3.2.1.2", "Extended email support"},
-/*------------------------------- NUPD=20 -------------------------------*/
-   {"3.2.1.3", "Asking: Login support"},
-   {"3.2.1.4", "Extended login support"},
-   {"3.3", "How do I pay for licenses/support?"},
-   {"3.4", "Who do I contact when I want more information about licensing/support?"},
-   {"3.5", "What Copyright does MySQL use?"},
-   {"3.6", "When may I distribute MySQL commercially without a fee?"},
-   {"3.7", "I want to sell a product that can be configured to use MySQL"},
-   {"3.8", "I am running a commercial web server using MySQL"},
-   {"3.9", "Do I need a license to sell commercial Perl/tcl/PHP/Web+ etc applications?"},
-   {"3.10", "Possible future changes in the licensing"},
-   {"4", "Compiling and installing MySQL"},
-   {"4.1", "How do I get MySQL?"},
-   {"4.2", "Which MySQL version should I use?"},
-   {"4.3", "How/when will you release updates?"},
-   {"4.4", "What operating systems does MySQL support?"},
-   {"4.5", "Compiling MySQL from source code"},
-   {"4.5.1", "Quick installation overview"},
-   {"4.5.2", "Usual configure switches"},
-   {"4.5.3", "Applying a patch"},
-   {"4.6", "Problems compiling?"},
-   {"4.7", "General compilation notes"},
-   {"4.8", "MIT-pthreads notes (FreeBSD)"},
-   {"4.9", "Perl installation comments"},
-   {"4.10", "Special things to consider for some machine/OS combinations"},
-   {"4.10.1", "Solaris notes"},
-   {"4.10.2", "SunOS 4 notes"},
-   {"4.10.3", "Linux notes for all versions"},
-   {"4.10.3.1", "Linux-x86 notes"},
-   {"4.10.3.2", "RedHat 5.0"},
-   {"4.10.3.3", "RedHat 5.1"},
-   {"4.10.3.4", "Linux-Sparc notes"},
-   {"4.10.3.5", "Linux-Alpha notes"},
-   {"4.10.3.6", "MkLinux notes"},
-   {"4.10.4", "Alpha-DEC-Unix notes"},
-   {"4.10.5", "Alpha-DEC-OSF1 notes"},
-   {"4.10.6", "SGI-IRIX notes"},
-   {"4.10.7", "FreeBSD notes"},
-   {"4.10.7.1", "FreeBSD-3.0 notes"},
-   {"4.10.8", "BSD/OS 2.# notes"},
-   {"4.10.8.1", "BSD/OS 3.# notes"},
-   {"4.10.9", "SCO notes"},
-   {"4.10.10", "SCO Unixware 7.0 notes"},
-   {"4.10.11", "IBM-AIX notes"},
-   {"4.10.12", "HP-UX notes"},
-   {"4.11", "TcX binaries"},
-   {"4.12", "Win32 notes"},
-   {"4.13", "Installation instructions for MySQL binary releases"},
-   {"4.13.1", "How to get MySQL Perl support working"},
-   {"4.13.2", "Linux notes"},
-   {"4.13.3", "HP-UX notes"},
-   {"4.13.4", "Linking client libraries"},
-   {"4.14", "Problems running mysql_install_db"},
-   {"4.15", "Problems starting MySQL"},
-   {"4.16", "Automatic start/stop of MySQL"},
-   {"4.17", "Option files"},
-   {"5", "How standards-compatible is MySQL?"},
-   {"5.1", "What extensions has MySQL to ANSI SQL92?"},
-   {"5.2", "What functionality is missing in MySQL?"},
-   {"5.2.1", "Sub-selects"},
-   {"5.2.2", "SELECT INTO TABLE"},
-   {"5.2.3", "Transactions"},
-   {"5.2.4", "Triggers"},
-   {"5.2.5", "Foreign Keys"},
-   {"5.2.5.1", "Some reasons NOT to use FOREIGN KEYS"},
-   {"5.2.6", "Views"},
-   {"5.2.7", "-- as start of a comment"},
-   {"5.3", "What standards does MySQL follow?"},
-   {"5.4", "What functions exist only for compatibility?"},
-   {"5.5", "Limitations of BLOB and TEXT types"},
-   {"5.6", "How to cope without COMMIT-ROLLBACK"},
-   {"6", "The MySQL access privilege system"},
-   {"6.1", "What the privilege system does"},
-   {"6.2", "Connecting to the MySQL server"},
-   {"6.2.1", "Keeping your password secure"},
-   {"6.3", "Privileges provided by MySQL"},
-   {"6.4", "How the privilege system works"},
-   {"6.5", "The privilege tables"},
-   {"6.6", "Setting up the initial MySQL privileges"},
-   {"6.7", "Adding new user privileges to MySQL"},
-   {"6.8", "An example permission setup"},
-   {"6.9", "Causes of Access denied errors"},
-   {"6.10", "How to make MySQL secure against crackers"},
-   {"7", "MySQL language reference"},
-   {"7.1", "Literals: how to write strings and numbers"},
-   {"7.1.1", "Strings"},
-   {"7.1.2", "Numbers"},
-   {"7.1.3", "NULL values"},
-   {"7.1.4", "Database, table, index, column and alias names"},
-   {"7.1.4.1", "Case sensitivity in names"},
-   {"7.2", "Column types"},
-   {"7.2.1", "Column type storage requirements"},
-   {"7.2.5", "Numeric types"},
-   {"7.2.6", "Date and time types"},
-   {"7.2.6.1", "The DATE type"},
-   {"7.2.6.2", "The TIME type"},
-   {"7.2.6.3", "The DATETIME type"},
-   {"7.2.6.4", "The TIMESTAMP type"},
-   {"7.2.6.5", "The YEAR type"},
-   {"7.2.6.6", "Miscellaneous date and time properties"},
-   {"7.2.7", "String types"},
-   {"7.2.7.1", "The CHAR and VARCHAR types"},
-   {"7.2.7.2", "The BLOB and TEXT types"},
-   {"7.2.7.3", "The ENUM type"},
-   {"7.2.7.4", "The SET type"},
-   {"7.2.8", "Choosing the right type for a column"},
-   {"7.2.9", "Column indexes"},
-   {"7.2.10", "Multiple-column indexes"},
-   {"7.2.11", "Using column types from other database engines"},
-   {"7.3", "Functions for use in SELECT and WHERE clauses"},
-   {"7.3.1", "Grouping functions"},
-   {"7.3.2", "Normal arithmetic operations"},
-   {"7.3.3", "Bit functions"},
-   {"7.3.4", "Logical operations"},
-   {"7.3.5", "Comparison operators"},
-   {"7.3.6", "String comparison functions"},
-   {"7.3.7", "Control flow functions"},
-   {"7.3.8", "Mathematical functions"},
-   {"7.3.9", "String functions"},
-   {"7.3.10", "Date and time functions"},
-   {"7.3.11", "Miscellaneous functions"},
-   {"7.3.12", "Functions for use with GROUP BY clauses"},
-   {"7.4", "CREATE DATABASE syntax"},
-   {"7.5", "DROP DATABASE syntax"},
-   {"7.6", "CREATE TABLE syntax"},
-   {"7.7", "ALTER TABLE syntax"},
-   {"7.8", "OPTIMIZE TABLE syntax"},
-   {"7.9", "DROP TABLE syntax"},
-   {"7.10", "DELETE syntax"},
-   {"7.11", "SELECT syntax"},
-   {"7.12", "JOIN syntax"},
-   {"7.13", "INSERT syntax"},
-   {"7.14", "REPLACE syntax"},
-   {"7.15", "LOAD DATA INFILE syntax"},
-   {"7.16", "UPDATE syntax"},
-   {"7.17", "USE syntax"},
-   {"7.18", "SHOW syntax (Get information about tables, columns...)"},
-   {"7.19", "EXPLAIN syntax (Get information about a SELECT)"},
-   {"7.20", "DESCRIBE syntax (Get information about columns)"},
-   {"7.21", "LOCK TABLES/UNLOCK TABLES syntax"},
-   {"7.22", "SET OPTION syntax"},
-   {"7.23", "GRANT syntax (Compatibility function)"},
-   {"7.24", "CREATE INDEX syntax (Compatibility function)"},
-   {"7.25", "DROP INDEX syntax (Compatibility function)"},
-   {"7.26", "Comment syntax"},
-   {"7.27", "CREATE FUNCTION/DROP FUNCTION syntax"},
-   {"7.28", "Is MySQL picky about reserved words?"},
-   {"8", "Example SQL queries"},
-   {"8.1", "Queries from twin project"},
-   {"8.1.1", "Find all non-distributed twins"},
-   {"8.1.2", "Show a table on twin pair status"},
-   {"9", "How safe/stable is MySQL?"},
-   {"9.1", "How stable is MySQL?"},
-   {"9.2", "Why are there is so many releases of MySQL?"},
-   {"9.3", "Checking a table for errors"},
-   {"9.4", "How to repair tables"},
-   {"9.5", "Is there anything special to do when upgrading/downgrading MySQL?"},
-   {"9.5.1", "Upgrading from a 3.21 version to 3.22"},
-   {"9.5.2", "Upgrading from a 3.20 version to 3.21"},
-   {"9.5.3", "Upgrading to another architecture"},
-   {"9.6", "Year 2000 compliance"},
-   {"10", "MySQL Server functions"},
-   {"10.1", "What languages are supported by MySQL?"},
-   {"10.1.1", "Character set used for data &#38; sorting"},
-   {"10.2", "The update log"},
-   {"10.3", "How big can MySQL tables be?"},
-   {"11", "Getting maximum performance from MySQL"},
-   {"11.1", "How does one change the size of MySQL buffers?"},
-   {"11.2", "How compiling and linking affects the speed of MySQL"},
-   {"11.3", "How does MySQL use memory?"},
-   {"11.4", "How does MySQL use indexes?"},
-   {"11.5", "What optimizations are done on WHERE clauses?"},
-   {"11.6", "How does MySQL open &#38; close tables?"},
-   {"11.6.0.1", "What are the drawbacks of creating possibly thousands of tables in a database?"},
-   {"11.7", "How does MySQL lock tables?"},
-   {"11.8", "How should I arrange my table to be as fast/small as possible?"},
-   {"11.9", "What affects the speed of INSERT statements?"},
-   {"11.10", "What affects the speed DELETE statements?"},
-   {"11.11", "How do I get MySQL to run at full speed?"},
-   {"11.12", "What are the different row formats? Or, when should VARCHAR/CHAR be used?"},
-   {"11.13", "Why so many open tables?"},
-   {"12", "MySQL benchmark suite"},
-   {"13", "MySQL Utilites"},
-   {"13.1", "Overview of the different MySQL programs"},
-   {"13.2", "The MySQL table check, optimize and repair program"},
-   {"13.2.1", "isamchk memory use"},
-   {"13.2.2", "Getting low-level table information"},
-   {"13.3", "The MySQL compressed read-only table generator"},
-   {"14", "Adding new functions to MySQL"},
-   {"15", "MySQL ODBC Support"},
-   {"15.1", "Operating systems supported by MyODBC"},
-   {"15.2", "How to report problems with MyODBC"},
-   {"15.3", "Programs known to work with MyODBC"},
-   {"15.4", "How to fill in the various fields in the ODBC administrator program"},
-   {"15.5", "How to get the value of an AUTO_INCREMENT column in ODBC"},
-   {"16", "Problems and common errors"},
-   {"16.1", "Some common errors when using MySQL"},
-   {"16.1.1", "MySQL server has gone away error"},
-   {"16.1.2", "Can't connect to local MySQL server error"},
-   {"16.1.3", "Out of memory error"},
-   {"16.1.4", "Packet too large error"},
-   {"16.1.5", "The table is full error"},
-   {"16.1.6", "Commands out of sync error in client"},
-   {"16.1.7", "Removing user error"},
-   {"16.2", "How MySQL handles a full disk"},
-   {"16.3", "How to run SQL commands from a text file"},
-   {"16.4", "Where MySQL stores temporary files"},
-   {"16.5", "Access denied error"},
-   {"16.6", "How to run MySQL as a normal user"},
-   {"16.7", "Problems with file permissions"},
-   {"16.8", "File not found"},
-   {"16.9", "Problems using DATE columns"},
-   {"16.10", "Case sensitivity in searches"},
-   {"16.11", "Problems with NULL values"},
-   {"17", "Solving some common problems with MySQL"},
-   {"17.1", "Database replication"},
-   {"17.2", "Database backups"},
-   {"18", "MySQL client tools and API's"},
-   {"18.1", "MySQL C API"},
-   {"18.2", "C API datatypes"},
-   {"18.3", "C API function overview"},
-   {"18.4", "C API function descriptions"},
-   {"18.4.1", "mysql_affected_rows()"},
-   {"18.4.2", "mysql_close()"},
-   {"18.4.3", "mysql_connect()"},
-   {"18.4.4", "mysql_create_db()"},
-   {"18.4.5", "mysql_data_seek()"},
-   {"18.4.6", "mysql_debug()"},
-   {"18.4.7", "mysql_drop_db()"},
-   {"18.4.8", "mysql_dump_debug_info()"},
-   {"18.4.9", "mysql_eof()"},
-   {"18.4.10", "mysql_errno()"},
-   {"18.4.11", "mysql_error()"},
-   {"18.4.12", "mysql_escape_string()"},
-   {"18.4.13", "mysql_fetch_field()"},
-   {"18.4.14", "mysql_fetch_fields()"},
-   {"18.4.15", "mysql_fetch_field_direct()"},
-   {"18.4.16", "mysql_fetch_lengths()"},
-   {"18.4.17", "mysql_fetch_row()"},
-   {"18.4.18", "mysql_field_seek()"},
-   {"18.4.19", "mysql_field_tell()"},
-   {"18.4.20", "mysql_free_result()"},
-   {"18.4.21", "mysql_get_client_info()"},
-   {"18.4.22", "mysql_get_host_info()"},
-   {"18.4.23", "mysql_get_proto_info()"},
-   {"18.4.24", "mysql_get_server_info()"},
-   {"18.4.25", "mysql_info()"},
-   {"18.4.26", "mysql_init()"},
-   {"18.4.27", "mysql_insert_id()"},
-   {"18.4.28", "mysql_kill()"},
-   {"18.4.29", "mysql_list_dbs()"},
-   {"18.4.30", "mysql_list_fields()"},
-   {"18.4.31", "mysql_list_processes()"},
-   {"18.4.32", "mysql_list_tables()"},
-   {"18.4.33", "mysql_num_fields()"},
-   {"18.4.34", "mysql_num_rows()"},
-   {"18.4.35", "mysql_query()"},
-   {"18.4.36", "mysql_real_connect()"},
-   {"18.4.37", "mysql_real_query()"},
-   {"18.4.38", "mysql_reload()"},
-   {"18.4.39", "mysql_row_tell()"},
-   {"18.4.40", "mysql_select_db()"},
-   {"18.4.41", "mysql_shutdown()"},
-   {"18.4.42", "mysql_stat()"},
-   {"18.4.43", "mysql_store_result()"},
-   {"18.4.44", "mysql_thread_id()"},
-   {"18.4.45", "mysql_use_result()"},
-   {"18.4.46", "Why is it that after mysql_query() returns success, mysql_store_result() sometimes returns NULL?"},
-   {"18.4.47", "What results can I get from a query?"},
-   {"18.4.48", "How can I get the unique ID for the last inserted row?"},
-   {"18.4.49", "Problems linking with the C API"},
-   {"18.4.50", "How to make a thread-safe client"},
-   {"18.5", "MySQL Perl API's"},
-   {"18.5.1", "DBI with DBD::mysql"},
-   {"18.5.1.1", "The DBI interface"},
-   {"18.5.1.2", "More DBI/DBD information"},
-   {"18.6", "MySQL Java connectivity (JDBC)"},
-   {"18.7", "MySQL PHP API's"},
-   {"18.8", "MySQL C++ API's"},
-   {"18.9", "MySQL Python API's"},
-   {"18.10", "MySQL TCL API's"},
-   {"19", "How MySQL compares to other databases"},
-   {"19.1", "How MySQL compares to mSQL"},
-   {"19.1.1", "How to convert mSQL tools for MySQL"},
-   {"19.1.2", "How mSQL and MySQL client/server communications protocols differ"},
-   {"19.1.3", "How mSQL 2.0 SQL syntax differs from MySQL"},
-   {"19.2", "How MySQL compares to PostgreSQL"},
-   {"A", "Some users of MySQL"},
-   {"B", "Contributed programs"},
-   {"C", "Contributors to MySQL"},
-   {"D", "MySQL change history"},
-   {"19.3", "Changes in release 3.22.x (Alpha version)"},
-   {"19.3.1", "Changes in release 3.22.7"},
-   {"19.3.2", "Changes in release 3.22.6"},
-   {"19.3.3", "Changes in release 3.22.5"},
-   {"19.3.4", "Changes in release 3.22.4"},
-   {"19.3.5", "Changes in release 3.22.3"},
-   {"19.3.6", "Changes in release 3.22.2"},
-   {"19.3.7", "Changes in release 3.22.1"},
-   {"19.3.8", "Changes in release 3.22.0"},
-   {"19.4", "Changes in release 3.21.x"},
-   {"19.4.1", "Changes in release 3.21.33"},
-   {"19.4.2", "Changes in release 3.21.32"},
-   {"19.4.3", "Changes in release 3.21.31"},
-   {"19.4.4", "Changes in release 3.21.30"},
-   {"19.4.5", "Changes in release 3.21.29"},
-   {"19.4.6", "Changes in release 3.21.28"},
-   {"19.4.7", "Changes in release 3.21.27"},
-   {"19.4.8", "Changes in release 3.21.26"},
-   {"19.4.9", "Changes in release 3.21.25"},
-   {"19.4.10", "Changes in release 3.21.24"},
-   {"19.4.11", "Changes in release 3.21.23"},
-   {"19.4.12", "Changes in release 3.21.22"},
-   {"19.4.13", "Changes in release 3.21.21a"},
-   {"19.4.14", "Changes in release 3.21.21"},
-   {"19.4.15", "Changes in release 3.21.20"},
-   {"19.4.16", "Changes in release 3.21.19"},
-   {"19.4.17", "Changes in release 3.21.18"},
-   {"19.4.18", "Changes in release 3.21.17"},
-   {"19.4.19", "Changes in release 3.21.16"},
-   {"19.4.20", "Changes in release 3.21.15"},
-   {"19.4.21", "Changes in release 3.21.14b"},
-   {"19.4.22", "Changes in release 3.21.14a"},
-   {"19.4.23", "Changes in release 3.21.13"},
-   {"19.4.24", "Changes in release 3.21.12"},
-   {"19.4.25", "Changes in release 3.21.11"},
-   {"19.4.26", "Changes in release 3.21.10"},
-   {"19.4.27", "Changes in release 3.21.9"},
-   {"19.4.28", "Changes in release 3.21.8"},
-   {"19.4.29", "Changes in release 3.21.7"},
-   {"19.4.30", "Changes in release 3.21.6"},
-   {"19.4.31", "Changes in release 3.21.5"},
-   {"19.4.32", "Changes in release 3.21.4"},
-   {"19.4.33", "Changes in release 3.21.3"},
-   {"19.4.34", "Changes in release 3.21.2"},
-   {"19.4.35", "Changes in release 3.21.0"},
-   {"19.5", "Changes in release 3.20.x"},
-   {"19.5.1", "Changes in release 3.20.18"},
-   {"19.5.2", "Changes in release 3.20.17"},
-   {"19.5.3", "Changes in release 3.20.16"},
-   {"19.5.4", "Changes in release 3.20.15"},
-   {"19.5.5", "Changes in release 3.20.14"},
-   {"19.5.6", "Changes in release 3.20.13"},
-   {"19.5.7", "Changes in release 3.20.11"},
-   {"19.5.8", "Changes in release 3.20.10"},
-   {"19.5.9", "Changes in release 3.20.9"},
-   {"19.5.10", "Changes in release 3.20.8"},
-   {"19.5.11", "Changes in release 3.20.7"},
-   {"19.5.12", "Changes in release 3.20.6"},
-   {"19.5.13", "Changes in release 3.20.3"},
-   {"19.5.14", "Changes in release 3.20.0"},
-   {"19.6", "Changes in release 3.19.x"},
-   {"19.6.1", "Changes in release 3.19.5"},
-   {"19.6.2", "Changes in release 3.19.4"},
-   {"19.6.3", "Changes in release 3.19.3"},
-   {"E", "Known errors and design deficiencies in MySQL"},
-   {"F", "List of things we want to add to MySQL in the future (The TODO)"},
-   {"19.7", "Things that must done in the real near future"},
-   {"19.8", "Things that have to be done sometime"},
-   {"19.9", "Some things we don't have any plans to do"},
-   {"G", "Comments on porting to other systems"},
-   {"19.10", "Debugging MySQL"},
-   {"19.11", "Comments about RTS threads"},
-   {"19.12", "What is the difference between different thread packages?"},
-   {"H", "Description of MySQL regular expression syntax"},
-   {"I", "What is Unireg?"},
-   {"J", "The MySQL server license"},
-   {"K", "The MySQL license for Microsoft operating systems"},
-   {"*", "SQL command, type and function index"},
-   {"*", "Concept Index"}
-};
-
-#define NQUERIES 5
-const char *query[NQUERIES]={
-   "mysql information and manual",
-   "upgrading from previous version",
-   "column indexes",
-   "against about after more right the with/without", /* stopwords test */
-   "mysql license and copyright"
-};

=== removed file 'storage/myisam/make-ccc'
--- a/storage/myisam/make-ccc	2005-04-27 01:19:54 +0000
+++ b/storage/myisam/make-ccc	1970-01-01 00:00:00 +0000
@@ -1,5 +0,0 @@
-rm -f .deps/*.P
-ccc -DMAP_TO_USE_RAID -I./../include -I../include -DDBUG_OFF -fast -O3 -c mi_cache.c mi_changed.c mi_checksum.c mi_close.c mi_create.c mi_dbug.c mi_delete.c mi_delete_all.c mi_delete_table.c mi_dynrec.c mi_extra.c mi_info.c mi_key.c mi_locking.c mi_log.c mi_open.c mi_packrec.c mi_page.c mi_panic.c mi_range.c mi_rename.c mi_rfirst.c mi_rkey.c mi_rlast.c mi_rnext.c mi_rnext_same.c mi_rprev.c mi_rrnd.c mi_rsame.c mi_rsamepos.c mi_scan.c mi_search.c mi_static.c mi_statrec.c mi_unique.c mi_update.c mi_write.c ft_update.c ft_search.o ft_stem.o ft_stopwords.c ft_parser.c
-make sort.o mi_check.o
-rm libmyisam.a
-ar -cr libmyisam.a mi_cache.o sort.o mi_check.o

=== modified file 'storage/myisam/mi_create.c'
--- a/storage/myisam/mi_create.c	2009-02-13 16:30:54 +0000
+++ b/storage/myisam/mi_create.c	2009-05-14 21:49:53 +0000
@@ -892,19 +892,19 @@ uint mi_get_pointer_length(ulonglong fil
   if (file_length)				/* If not default */
   {
 #ifdef NOT_YET_READY_FOR_8_BYTE_POINTERS
-    if (file_length >= ULL(1) << 56)
+    if (file_length >= 1ULL << 56)
       def=8;
     else
 #endif
-    if (file_length >= ULL(1) << 48)
+    if (file_length >= 1ULL << 48)
       def=7;
-    else if (file_length >= ULL(1) << 40)
+    else if (file_length >= 1ULL << 40)
       def=6;
-    else if (file_length >= ULL(1) << 32)
+    else if (file_length >= 1ULL << 32)
       def=5;
-    else if (file_length >= ULL(1) << 24)
+    else if (file_length >= 1ULL << 24)
       def=4;
-    else if (file_length >= ULL(1) << 16)
+    else if (file_length >= 1ULL << 16)
       def=3;
     else
       def=2;

=== modified file 'storage/myisam/myisam_backup_engine.cc'
--- a/storage/myisam/myisam_backup_engine.cc	2009-02-13 12:40:13 +0000
+++ b/storage/myisam/myisam_backup_engine.cc	2009-05-14 21:49:53 +0000
@@ -974,7 +974,7 @@ Log_backup::Log_backup(const char *log_n
     except that it allows us to verify that what restore sends us is really a
     log.
   */
-  log_file_backup.init(fd, ~(ULL(0)), LOG_FILE_CODE);
+  log_file_backup.init(fd, ~(0ULL), LOG_FILE_CODE);
   state= OK;
   DBUG_VOID_RETURN;
 }

=== modified file 'storage/myisam/myisampack.c'
--- a/storage/myisam/myisampack.c	2009-02-16 21:18:45 +0000
+++ b/storage/myisam/myisampack.c	2009-05-14 21:49:53 +0000
@@ -1958,7 +1958,7 @@ static int make_huff_decode_table(HUFF_T
 	return 1;
       huff_tree->code_len=(uchar*) (huff_tree->code+elements);
       make_traverse_code_tree(huff_tree, huff_tree->root,
-                              8 * sizeof(ulonglong), LL(0));
+                              8 * sizeof(ulonglong), 0LL);
     }
   }
   return 0;

=== removed file 'storage/myisammrg/make-ccc'
--- a/storage/myisammrg/make-ccc	2005-04-27 01:19:54 +0000
+++ b/storage/myisammrg/make-ccc	1970-01-01 00:00:00 +0000
@@ -1,3 +0,0 @@
-ccc -I./../include -I../include -DDBUG_OFF -fast -O3 -c myrg_close.c myrg_create.c myrg_delete.c myrg_extra.c myrg_info.c myrg_locking.c myrg_open.c myrg_panic.c myrg_rrnd.c myrg_rsame.c myrg_static.c myrg_update.c
-rm libmyisammrg.a
-ar -cr libmyisammrg.a myrg_close.o

=== modified file 'storage/mysql_storage_engine.cmake'
--- a/storage/mysql_storage_engine.cmake	2009-03-28 00:27:25 +0000
+++ b/storage/mysql_storage_engine.cmake	2009-05-05 18:58:20 +0000
@@ -29,7 +29,7 @@ IF(NOT SOURCE_SUBLIBS)
     #The dll is linked to the mysqld executable
     SET(dyn_libname ha_${libname})
     ADD_LIBRARY(${dyn_libname} SHARED ${${engine}_SOURCES})
-    TARGET_LINK_LIBRARIES (${dyn_libname}  mysqld)
+    TARGET_LINK_LIBRARIES (${dyn_libname} libservices mysqld)
     MESSAGE("build ${engine} as DLL")
   ENDIF(${ENGINE_BUILD_TYPE} STREQUAL "STATIC")
 ENDIF(NOT SOURCE_SUBLIBS)

=== modified file 'storage/ndb/src/ndbapi/NdbRecAttr.cpp'
--- a/storage/ndb/src/ndbapi/NdbRecAttr.cpp	2008-11-11 11:40:42 +0000
+++ b/storage/ndb/src/ndbapi/NdbRecAttr.cpp	2009-05-14 21:49:53 +0000
@@ -392,8 +392,8 @@ ndbrecattr_print_formatted(NdbOut& out, 
     {
       ulonglong tmp=r.u_64_value();
       long part1,part2,part3;
-      part1=(long) (tmp/LL(1000000));
-      part2=(long) (tmp - (ulonglong) part1*LL(1000000));
+      part1=(long) (tmp/1000000LL);
+      part2=(long) (tmp - (ulonglong) part1*1000000LL);
       char buf[40];
       char* pos=(char*) buf+19;
       *pos--=0;

=== modified file 'strings/ctype-ucs2.c'
--- a/strings/ctype-ucs2.c	2009-03-17 20:07:27 +0000
+++ b/strings/ctype-ucs2.c	2009-05-14 21:49:53 +0000
@@ -30,12 +30,12 @@
 #endif
 
 #undef  ULONGLONG_MAX
-#define ULONGLONG_MAX                (~(ulonglong) 0)
-#define MAX_NEGATIVE_NUMBER        ((ulonglong) LL(0x8000000000000000))
+#define ULONGLONG_MAX              ~0ULL
+#define MAX_NEGATIVE_NUMBER        0x8000000000000000ULL
 #define INIT_CNT  9
-#define LFACTOR   ULL(1000000000)
-#define LFACTOR1  ULL(10000000000)
-#define LFACTOR2  ULL(100000000000)
+#define LFACTOR   1000000000ULL
+#define LFACTOR1  10000000000ULL
+#define LFACTOR2  100000000000ULL
 
 static unsigned long lfactor[9]=
 {

=== modified file 'strings/decimal.c'
--- a/strings/decimal.c	2008-08-15 20:00:40 +0000
+++ b/strings/decimal.c	2009-05-14 21:49:53 +0000
@@ -1033,7 +1033,7 @@ int decimal2ulonglong(decimal_t *from, u
 
   if (from->sign)
   {
-      *to=ULL(0);
+      *to=0ULL;
       return E_DEC_OVERFLOW;
   }
 
@@ -2825,9 +2825,9 @@ int main()
   test_f2d(1234500009876.5, 0);
 
   printf("==== ulonglong2decimal ====\n");
-  test_ull2d(ULL(12345), "12345", 0);
-  test_ull2d(ULL(0), "0", 0);
-  test_ull2d(ULL(18446744073709551615), "18446744073709551615", 0);
+  test_ull2d(12345ULL, "12345", 0);
+  test_ull2d(0ULL, "0", 0);
+  test_ull2d(18446744073709551615ULL, "18446744073709551615", 0);
 
   printf("==== decimal2ulonglong ====\n");
   test_d2ull("12345", "12345", 0);
@@ -2839,10 +2839,10 @@ int main()
   test_d2ull("9999999999999999999999999.000", "9999999999999999", 2);
 
   printf("==== longlong2decimal ====\n");
-  test_ll2d(LL(-12345), "-12345", 0);
-  test_ll2d(LL(-1), "-1", 0);
-  test_ll2d(LL(-9223372036854775807), "-9223372036854775807", 0);
-  test_ll2d(ULL(9223372036854775808), "-9223372036854775808", 0);
+  test_ll2d(-12345LL, "-12345", 0);
+  test_ll2d(-1LL, "-1", 0);
+  test_ll2d(-9223372036854775807LL, "-9223372036854775807", 0);
+  test_ll2d(9223372036854775808ULL, "-9223372036854775808", 0);
 
   printf("==== decimal2longlong ====\n");
   test_d2ll("18446744073709551615", "18446744073", 2);

=== removed file 'strings/make-ccc'
--- a/strings/make-ccc	2000-07-31 19:29:14 +0000
+++ b/strings/make-ccc	1970-01-01 00:00:00 +0000
@@ -1,3 +0,0 @@
-ccc -DHAVE_CONFIG_H -I. -I. -I.. -I./../include -I../include -O -DDBUG_OFF -fast -O3 -fomit-frame-pointer -c atof.c bchange.c bcmp.c bfill.c bmove.c bmove512.c bmove_upp.c ct_init.c ctype-latin1.c int2str.c is_prefix.c llstr.c longlong2str.c r_strinstr.c str2int.c strappend.c strcend.c strcont.c strend.c strfill.c strinstr.c strmake.c strmov.c strnmov.c strstr.c strtol.c strtoll.c strtoul.c strtoull.c strxmov.c strxnmov.c
-rm libmystrings.a
-ar -cr libmystrings.a atof.o

=== modified file 'strings/my_strtoll10.c'
--- a/strings/my_strtoll10.c	2007-05-10 09:59:39 +0000
+++ b/strings/my_strtoll10.c	2009-05-14 21:49:53 +0000
@@ -28,11 +28,11 @@ static ulonglong ulonglong_max= ~(ulongl
 #else
 #define ULONGLONG_MAX		(~(ulonglong) 0)
 #endif /* __NETWARE__ && __MWERKS__ */
-#define MAX_NEGATIVE_NUMBER	((ulonglong) LL(0x8000000000000000))
+#define MAX_NEGATIVE_NUMBER	((ulonglong) 0x8000000000000000LL)
 #define INIT_CNT  9
-#define LFACTOR   ULL(1000000000)
-#define LFACTOR1  ULL(10000000000)
-#define LFACTOR2  ULL(100000000000)
+#define LFACTOR   1000000000ULL
+#define LFACTOR1  10000000000ULL
+#define LFACTOR2  100000000000ULL
 
 static unsigned long lfactor[9]=
 {

=== modified file 'strings/my_vsnprintf.c'
--- a/strings/my_vsnprintf.c	2009-03-17 20:07:27 +0000
+++ b/strings/my_vsnprintf.c	2009-04-25 21:20:45 +0000
@@ -21,28 +21,8 @@
 /*
   Limited snprintf() implementations
 
-  SYNOPSIS
-    my_vsnprintf()
-    to		Store result here
-    n		Store up to n-1 characters, followed by an end 0
-    fmt		printf format
-    ap		Arguments
-
-  IMPLEMENTATION:
-    Supports following formats:
-    %#[l][l]d
-    %#[l][l]u
-    %#[l][l]x
-    %p
-    %zd
-    %zx
-    %f
-    %g
-    %#.#b 	Local format; note first # is ignored and second is REQUIRED
-    %#.#s	Note first # is ignored
-    
-  RETURN
-    length of result string
+  exported to plugins as a service, see the detailed documentation
+  around my_snprintf_service_st
 */
 
 size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap)

=== modified file 'tests/mysql_client_test.c'
--- a/tests/mysql_client_test.c	2009-05-23 13:24:28 +0000
+++ b/tests/mysql_client_test.c	2009-05-25 10:10:18 +0000
@@ -10885,11 +10885,11 @@ static void test_bug3035()
   const uint32 uint32_max= 4294967295U;
 
   /* it might not work okay everyplace */
-  const longlong int64_max= LL(9223372036854775807);
+  const longlong int64_max= 9223372036854775807LL;
   const longlong int64_min= -int64_max - 1;
 
   const ulonglong uint64_min= 0U;
-  const ulonglong uint64_max= ULL(18446744073709551615);
+  const ulonglong uint64_max= 18446744073709551615ULL;
 
   const char *stmt_text;
 
@@ -13552,7 +13552,7 @@ static void test_truncation()
 
   /* double -> longlong, negative fp number to signed integer: no loss */
   DIE_UNLESS(my_bind++ < bind_array + bind_count);
-  DIE_UNLESS(! *my_bind->error && * (longlong*) my_bind->buffer == LL(-12345678910));
+  DIE_UNLESS(! *my_bind->error && * (longlong*) my_bind->buffer == -12345678910LL);
 
   /* big numeric string -> number */
   DIE_UNLESS(my_bind++ < bind_array + bind_count);
@@ -15500,7 +15500,7 @@ static void test_bug12925()
 {
   myheader("test_bug12925");
   if (opt_getopt_ll_test)
-    DIE_UNLESS(opt_getopt_ll_test == LL(25600*1024*1024));
+    DIE_UNLESS(opt_getopt_ll_test == 25600LL*1024LL*1024LL);
 }
 
 


Attachment: [text/bzr-bundle] bzr/joro@sun.com-20090525101018-g9ki6ice242je5os.bundle
Thread
bzr push into mysql-6.0-bugteam branch (joro:3321 to 3322) Georgi Kodinov25 May