Merge bk-internal:/home/bk/mysql-5.1-new

into  neptunus.(none):/home/msvensson/mysql/mysql-5.1
This commit is contained in:
msvensson@neptunus.(none) 2006-05-09 09:44:47 +02:00
commit af47f9092c
229 changed files with 5185 additions and 2463 deletions

View file

@ -322,6 +322,7 @@ cmd-line-utils/libedit/makelist
comon.h
comp_err/*.ds?
comp_err/*.vcproj
compile
config.cache
config.guess
config.h
@ -553,6 +554,7 @@ libmysqld/spatial.cc
libmysqld/sql_acl.cc
libmysqld/sql_analyse.cc
libmysqld/sql_base.cc
libmysqld/sql_builtin.cc
libmysqld/sql_cache.cc
libmysqld/sql_class.cc
libmysqld/sql_command
@ -1179,6 +1181,7 @@ sql/share/gmon.out
sql/share/mysql
sql/share/norwegian-ny/errmsg.sys
sql/share/norwegian/errmsg.sys
sql/sql_builtin.cc
sql/sql_select.cc.orig
sql/sql_yacc.cc
sql/sql_yacc.h

View file

@ -147,18 +147,9 @@ static_link="$static_link --with-client-ldflags=-all-static"
local_infile_configs="--enable-local-infile"
max_configs="--with-innodb --with-berkeley-db"
max_configs="$max_configs --with-archive-storage-engine"
max_configs="$max_configs --with-big-tables"
max_configs="$max_configs --with-blackhole-storage-engine"
max_configs="$max_configs --with-federated-storage-engine"
max_configs="$max_configs --with-csv-storage-engine"
max_configs="$max_configs --with-example-storage-engine"
max_configs="$max_configs --with-partition $SSL_LIBRARY"
max_no_embedded_configs="$max_configs --with-ndbcluster"
max_no_ndb_configs="$max_configs --without-ndbcluster --with-embedded-server"
max_configs="$max_configs --with-ndbcluster --with-embedded-server"
max_no_embedded_configs="$SSL_LIBRARY --with-plugins=max"
max_no_ndb_configs="$SSL_LIBRARY --with-plugins=max-no-ndb --with-embedded-server"
max_configs="$SSL_LIBRARY --with-plugins=max --with-embedded-server"
#
# CPU and platform specific compilation flags.

View file

@ -3,6 +3,11 @@
die() { echo "$@"; exit 1; }
(cd storage/bdb/dist && sh s_all)
(cd storage/innobase && aclocal && autoheader && \
libtoolize --automake --force --copy && \
automake --force --add-missing --copy && autoconf)
aclocal || die "Can't execute aclocal"
autoheader || die "Can't execute autoheader"
# --force means overwrite ltmain.sh script if it already exists
@ -17,5 +22,3 @@ fi
# and --force to overwrite them if they already exist
automake --add-missing --force || die "Can't execute automake"
autoconf || die "Can't execute autoconf"
(cd storage/bdb/dist && sh s_all)
(cd storage/innobase && aclocal && autoheader && aclocal && automake && autoconf)

View file

@ -7,13 +7,15 @@
# package" that is used as the basis for all other binary builds.
#
make distclean
(cd storage/bdb/dist && sh s_all)
(cd storage/innobase && aclocal && autoheader && \
libtoolize --automake --force --copy && \
automake --force --add-missing --copy && autoconf)
aclocal
autoheader
libtoolize --automake --force --copy
automake --force --add-missing --copy
autoconf
(cd storage/bdb/dist && sh s_all)
(cd storage/innobase && aclocal && autoheader && aclocal && automake && autoconf)
# Default to gcc for CC and CXX
if test -z "$CXX" ; then

View file

@ -24,12 +24,11 @@ EXTRA_DIST = INSTALL-SOURCE INSTALL-WIN-SOURCE \
SUBDIRS = . include @docs_dirs@ @zlib_dir@ \
@readline_topdir@ sql-common \
@thread_dirs@ pstack \
@sql_union_dirs@ storage \
@sql_union_dirs@ storage plugin \
@sql_server@ scripts @man_dirs@ tests \
@mysql_se_plugins@ \
netware @libmysqld_dirs@ \
mysql-test support-files @tools_dirs@ \
plugin unittest win
unittest win
DIST_SUBDIRS = $(SUBDIRS) BUILD

View file

@ -363,6 +363,10 @@ SOURCE=..\mysys\my_getopt.c
SOURCE=..\sql-common\my_time.c
# End Source File
# Begin Source File
SOURCE=..\sql-common\my_user.c
# End Source File
# Begin Source File
SOURCE=..\sql\net_serv.cpp
# End Source File

View file

@ -338,6 +338,10 @@ SOURCE="..\sql-common\my_time.c"
# End Source File
# Begin Source File
SOURCE="..\sql-common\my_user.c"
# End Source File
# Begin Source File
SOURCE=..\sql\net_serv.cpp
# End Source File
# Begin Source File

View file

@ -257,6 +257,7 @@ EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysql_client_test", "tests\mysql_client_test.vcproj", "{DA224DAB-5006-42BE-BB77-16E8BE5326D5}"
ProjectSection(ProjectDependencies) = postProject
{26383276-4843-494B-8BE0-8936ED3EBAAB} = {26383276-4843-494B-8BE0-8936ED3EBAAB}
{44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqlmanager", "server-tools\instance-manager\mysqlmanager.vcproj", "{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}"

View file

@ -3232,6 +3232,49 @@
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="my_memmem.c">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Max|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="TLS_DEBUG|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="TLS|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="my_messnc.c">
<FileConfiguration

View file

@ -136,7 +136,7 @@ static my_bool info_flag=0,ignore_errors=0,wait_flag=0,quick=0,
tty_password= 0, opt_nobeep=0, opt_reconnect=1,
default_charset_used= 0, opt_secure_auth= 0,
default_pager_set= 0, opt_sigint_ignore= 0,
show_warnings = 0;
show_warnings= 0, executing_query= 0, interrupted_query= 0;
static ulong opt_max_allowed_packet, opt_net_buffer_length;
static uint verbose=0,opt_silent=0,opt_mysql_port=0, opt_local_infile=0;
static my_string opt_mysql_unix_port=0;
@ -338,7 +338,7 @@ static void end_timer(ulong start_time,char *buff);
static void mysql_end_timer(ulong start_time,char *buff);
static void nice_time(double sec,char *buff,bool part_second);
static sig_handler mysql_end(int sig);
static sig_handler handle_sigint(int sig);
int main(int argc,char *argv[])
{
@ -420,7 +420,7 @@ int main(int argc,char *argv[])
if (opt_sigint_ignore)
signal(SIGINT, SIG_IGN);
else
signal(SIGINT, mysql_end); // Catch SIGINT to clean up
signal(SIGINT, handle_sigint); // Catch SIGINT to clean up
signal(SIGQUIT, mysql_end); // Catch SIGQUIT to clean up
/*
@ -523,6 +523,35 @@ sig_handler mysql_end(int sig)
}
/*
This function handles sigint calls
If query is in process, kill query
no query in process, terminate like previous behavior
*/
sig_handler handle_sigint(int sig)
{
char kill_buffer[40];
MYSQL *kill_mysql= NULL;
/* terminate if no query being executed, or we already tried interrupting */
if (!executing_query || interrupted_query)
mysql_end(sig);
kill_mysql= mysql_init(kill_mysql);
if (!mysql_real_connect(kill_mysql,current_host, current_user, opt_password,
"", opt_mysql_port, opt_mysql_unix_port,0))
mysql_end(sig);
/* kill_buffer is always big enough because max length of %lu is 15 */
sprintf(kill_buffer, "KILL /*!50000 QUERY */ %lu", mysql_thread_id(&mysql));
mysql_real_query(kill_mysql, kill_buffer, strlen(kill_buffer));
mysql_close(kill_mysql);
tee_fprintf(stdout, "Query aborted by Ctrl+C\n");
interrupted_query= 1;
}
static struct my_option my_long_options[] =
{
{"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0,
@ -1932,6 +1961,7 @@ com_go(String *buffer,char *line __attribute__((unused)))
uint error= 0;
int err= 0;
interrupted_query= 0;
if (!status.batch)
{
old_buffer= *buffer; // Save for edit command
@ -1967,7 +1997,7 @@ com_go(String *buffer,char *line __attribute__((unused)))
}
timer=start_timer();
executing_query= 1;
error= mysql_real_query_for_lazy(buffer->ptr(),buffer->length());
#ifdef HAVE_READLINE
@ -1981,6 +2011,7 @@ com_go(String *buffer,char *line __attribute__((unused)))
if (error)
{
executing_query= 0;
buffer->length(0); // Remove query on error
return error;
}
@ -1992,13 +2023,19 @@ com_go(String *buffer,char *line __attribute__((unused)))
if (quick)
{
if (!(result=mysql_use_result(&mysql)) && mysql_field_count(&mysql))
return put_error(&mysql);
{
executing_query= 0;
return put_error(&mysql);
}
}
else
{
error= mysql_store_result_for_lazy(&result);
if (error)
return error;
{
executing_query= 0;
return error;
}
}
if (verbose >= 3 || !opt_silent)
@ -2073,6 +2110,7 @@ com_go(String *buffer,char *line __attribute__((unused)))
(mysql.server_status & SERVER_STATUS_DB_DROPPED))
get_current_db();
executing_query= 0;
return error; /* New command follows */
}
@ -2286,6 +2324,8 @@ print_table_data(MYSQL_RES *result)
while ((cur= mysql_fetch_row(result)))
{
if (interrupted_query)
break;
ulong *lengths= mysql_fetch_lengths(result);
(void) tee_fputs("| ", PAGER);
mysql_field_seek(result, 0);
@ -2393,6 +2433,8 @@ print_table_data_html(MYSQL_RES *result)
}
while ((cur = mysql_fetch_row(result)))
{
if (interrupted_query)
break;
ulong *lengths=mysql_fetch_lengths(result);
(void) tee_fputs("<TR>", PAGER);
for (uint i=0; i < mysql_num_fields(result); i++)
@ -2422,6 +2464,8 @@ print_table_data_xml(MYSQL_RES *result)
fields = mysql_fetch_fields(result);
while ((cur = mysql_fetch_row(result)))
{
if (interrupted_query)
break;
ulong *lengths=mysql_fetch_lengths(result);
(void) tee_fputs("\n <row>\n", PAGER);
for (uint i=0; i < mysql_num_fields(result); i++)
@ -2456,6 +2500,8 @@ print_table_data_vertically(MYSQL_RES *result)
mysql_field_seek(result,0);
for (uint row_count=1; (cur= mysql_fetch_row(result)); row_count++)
{
if (interrupted_query)
break;
mysql_field_seek(result,0);
tee_fprintf(PAGER,
"*************************** %d. row ***************************\n", row_count);

View file

@ -307,7 +307,7 @@ int main(int argc, char **argv)
b_read= my_read(check_file, chf_buffer, sizeof(chf_buffer)-1, MYF(0));
chf_buffer[b_read]= 0;
my_close(check_file, MYF(0));
if (!strcmp(chf_buffer, VERSION))
if (!strcmp(chf_buffer, MYSQL_SERVER_VERSION))
{
if (opt_verbose)
puts("mysql_upgrade already done for this version");

View file

@ -688,10 +688,11 @@ static void die(const char *fmt, ...)
/* Note that we will get some memory leaks when calling this! */
static void abort_not_supported_test()
static void abort_not_supported_test(const char *fname)
{
DBUG_ENTER("abort_not_supported_test");
fprintf(stderr, "This test is not supported by this installation\n");
fprintf(stderr, "The test '%s' is not supported by this installation\n",
fname);
if (!silent)
printf("skipped\n");
free_used_memory();
@ -814,7 +815,7 @@ static void check_result(DYNAMIC_STRING* ds, const char *fname,
DBUG_ENTER("check_result");
if (res && require_option)
abort_not_supported_test();
abort_not_supported_test(fname);
switch (res) {
case RESULT_OK:
break; /* ok */
@ -1036,7 +1037,7 @@ int do_wait_for_slave_to_stop(struct st_query *q __attribute__((unused)))
int do_require_manager(struct st_query *query __attribute__((unused)) )
{
if (!manager)
abort_not_supported_test();
abort_not_supported_test("manager");
return 0;
}
@ -1305,7 +1306,9 @@ int var_query_set(VAR* var, const char *query, const char** query_end)
uint i;
ulong *lengths;
char *end;
#ifdef NOT_YET
MYSQL_FIELD *fields= mysql_fetch_fields(res);
#endif
init_dynamic_string(&result, "", 16384, 65536);
lengths= mysql_fetch_lengths(res);
@ -1920,7 +1923,7 @@ static void set_charset(struct st_query *q)
q->last_argument= p;
charset_info= get_charset_by_csname(charset_name,MY_CS_PRIMARY,MYF(MY_WME));
if (!charset_info)
abort_not_supported_test();
abort_not_supported_test(charset_name);
}
static uint get_errcodes(match_err *to,struct st_query *q)
@ -1963,7 +1966,7 @@ static uint get_errcodes(match_err *to,struct st_query *q)
(as in ER_WRONG_VALUE vs. ER_WRONG_VALUE_COUNT).
*/
if (!strncmp(start, e->name, (int) (p - start)) &&
strlen(e->name) == (p - start))
(uint) strlen(e->name) == (uint) (p - start))
{
to[count].code.errnum= (uint) e->code;
to[count].type= ERR_ERRNO;
@ -4329,7 +4332,7 @@ static void handle_error(const char *query, struct st_query *q,
if (err_errno == CR_SERVER_LOST ||
err_errno == CR_SERVER_GONE_ERROR)
die("require query '%s' failed: %d: %s", query, err_errno, err_error);
abort_not_supported_test();
abort_not_supported_test("failed_query");
}
if (q->abort_on_error)
@ -5101,7 +5104,7 @@ static void init_var_hash(MYSQL *mysql)
DBUG_VOID_RETURN;
}
static void mark_progress(int line)
static void mark_progress(int line __attribute__((unused)))
{
#ifdef NOT_YET
static FILE* fp = NULL;

View file

@ -9,56 +9,53 @@ SET(WITH_CSV_STORAGE_ENGINE TRUE)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/mysql_version.h.in
${CMAKE_SOURCE_DIR}/include/mysql_version.h @ONLY)
SET(WITH_HEAP_STORAGE_ENGINE TRUE)
ADD_DEFINITIONS(-D WITH_HEAP_STORAGE_ENGINE)
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_heap_plugin")
SET(WITH_MYISAM_STORAGE_ENGINE TRUE)
ADD_DEFINITIONS(-D WITH_MYISAM_STORAGE_ENGINE)
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_myisam_plugin")
SET(WITH_MYISAMMRG_STORAGE_ENGINE TRUE)
ADD_DEFINITIONS(-D WITH_MYISAMMRG_STORAGE_ENGINE)
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_myisammrg_plugin")
IF(WITH_ARCHIVE_STORAGE_ENGINE)
ADD_DEFINITIONS(-D WITH_ARCHIVE_STORAGE_ENGINE)
SET (mysql_se_htons "${mysql_se_htons}, &archive_hton")
SET (mysql_se_decls "${mysql_se_decls}, archive_hton")
SET (mysql_se_ha_src ${mysql_se_ha_src} "../sql/ha_archive.cc")
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_archive_plugin")
ENDIF(WITH_ARCHIVE_STORAGE_ENGINE)
IF(WITH_BLACKHOLE_STORAGE_ENGINE)
ADD_DEFINITIONS(-D WITH_BLACKHOLE_STORAGE_ENGINE)
SET (mysql_se_htons "${mysql_se_htons}, &blackhole_hton")
SET (mysql_se_decls "${mysql_se_decls}, blackhole_hton")
SET (mysql_se_ha_src ${mysql_se_ha_src} "../sql/ha_blackhole.cc")
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_blackhole_plugin")
ENDIF(WITH_BLACKHOLE_STORAGE_ENGINE)
IF(WITH_CSV_STORAGE_ENGINE)
ADD_DEFINITIONS(-D WITH_CSV_STORAGE_ENGINE)
SET (mysql_se_htons "${mysql_se_htons}, &tina_hton")
SET (mysql_se_decls "${mysql_se_decls}, tina_hton")
SET (mysql_se_ha_src ${mysql_se_ha_src} "../storage/csv/ha_tina.cc")
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_csv_plugin")
ENDIF(WITH_CSV_STORAGE_ENGINE)
IF(WITH_EXAMPLE_STORAGE_ENGINE)
ADD_DEFINITIONS(-D WITH_EXAMPLE_STORAGE_ENGINE)
SET (mysql_se_htons "${mysql_se_htons}, &example_hton")
SET (mysql_se_decls "${mysql_se_decls}, example_hton")
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_example_plugin")
ENDIF(WITH_EXAMPLE_STORAGE_ENGINE)
IF(WITH_INNOBASE_STORAGE_ENGINE)
ADD_DEFINITIONS(-D WITH_INNOBASE_STORAGE_ENGINE)
SET (mysql_se_htons "${mysql_se_htons}, &innobase_hton")
SET (mysql_se_decls "${mysql_se_decls}, innobase_hton")
SET (mysql_se_ha_src ${mysql_se_ha_src} "../sql/ha_innodb.cc")
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_innobase_plugin")
ENDIF(WITH_INNOBASE_STORAGE_ENGINE)
IF(WITH_PARTITION_STORAGE_ENGINE)
ADD_DEFINITIONS(-D WITH_PARTITION_STORAGE_ENGINE)
SET (mysql_se_htons "${mysql_se_htons}, &partition_hton")
SET (mysql_se_decls "${mysql_se_decls}, partition_hton")
SET (mysql_se_ha_src ${mysql_se_ha_src} "../sql/ha_partition.cc")
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_partition_plugin")
ENDIF(WITH_PARTITION_STORAGE_ENGINE)
IF(WITH_FEDERATED_STORAGE_ENGINE)
ADD_DEFINITIONS(-D WITH_FEDERATED_STORAGE_ENGINE)
SET (mysql_se_htons "${mysql_se_htons}, &federated_hton")
SET (mysql_se_decls "${mysql_se_decls}, federated_hton")
SET (mysql_se_ha_src ${mysql_se_ha_src} "../sql/ha_federated.cc")
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_federated_plugin")
ENDIF(WITH_FEDERATED_STORAGE_ENGINE)
IF(WITH_BERKELEY_STORAGE_ENGINE)
ADD_DEFINITIONS(-D WITH_BERKELEY_STORAGE_ENGINE)
SET (mysql_se_htons "${mysql_se_htons}, &berkeley_hton")
SET (mysql_se_decls "${mysql_se_decls}, berkeley_hton")
SET (mysql_se_ha_src ${mysql_se_ha_src} "../sql/ha_berkeley.cc")
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_berkeley_plugin")
ENDIF(WITH_BERKELEY_STORAGE_ENGINE)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/sql/handlerton.cc.in
${CMAKE_SOURCE_DIR}/sql/handlerton.cc @ONLY)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc.in
${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc @ONLY)
SET(localstatedir "C:\\mysql\\data")
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/support-files/my-huge.cnf.sh
@ -137,6 +134,12 @@ ENDIF(WITH_ARCHIVE_STORAGE_ENGINE)
IF(WITH_BERKELEY_STORAGE_ENGINE)
ADD_SUBDIRECTORY(storage/bdb)
ENDIF(WITH_BERKELEY_STORAGE_ENGINE)
IF(WITH_BLACKHOLE_STORAGE_ENGINE)
ADD_SUBDIRECTORY(storage/blackhole)
ENDIF(WITH_BLACKHOLE_STORAGE_ENGINE)
IF(WITH_CSV_STORAGE_ENGINE)
ADD_SUBDIRECTORY(storage/csv)
ENDIF(WITH_CSV_STORAGE_ENGINE)
IF(WITH_EXAMPLE_STORAGE_ENGINE)
ADD_SUBDIRECTORY(storage/example)
ENDIF(WITH_EXAMPLE_STORAGE_ENGINE)

View file

@ -1,29 +0,0 @@
dnl ---------------------------------------------------------------------------
dnl Macro: MYSQL_CHECK_ARCHIVEDB
dnl Sets HAVE_ARCHIVE_DB if --with-archive-storage-engine is used
dnl ---------------------------------------------------------------------------
AC_DEFUN([MYSQL_CHECK_ARCHIVEDB], [
AC_ARG_WITH([archive-storage-engine],
[
--with-archive-storage-engine
Enable the Archive Storage Engine],
[archivedb="$withval"],
[archivedb=no])
AC_MSG_CHECKING([for archive storage engine])
case "$archivedb" in
yes )
AC_DEFINE([HAVE_ARCHIVE_DB], [1], [Builds Archive Storage Engine])
AC_MSG_RESULT([yes])
[archivedb=yes]
;;
* )
AC_MSG_RESULT([no])
[archivedb=no]
;;
esac
])
dnl ---------------------------------------------------------------------------
dnl END OF MYSQL_CHECK_ARCHIVE SECTION
dnl ---------------------------------------------------------------------------

View file

@ -8,23 +8,20 @@ dnl ---------------------------------------------------------------------------
AC_DEFUN([MYSQL_SETUP_BERKELEY_DB], [
AC_ARG_WITH([berkeley-db],
[
--with-berkeley-db[=DIR]
Use BerkeleyDB located in DIR],
AS_HELP_STRING([--with-berkeley-db[[[[[=DIR]]]]]],
[Use BerkeleyDB located in DIR]),
[bdb="$withval"],
[bdb=yes])
AC_ARG_WITH([berkeley-db-includes],
[
--with-berkeley-db-includes=DIR
Find Berkeley DB headers in DIR],
AS_HELP_STRING([--with-berkeley-db-includes=DIR],
[Find Berkeley DB headers in DIR]),
[bdb_includes="$withval"],
[bdb_includes=default])
AC_ARG_WITH([berkeley-db-libs],
[
--with-berkeley-db-libs=DIR
Find Berkeley DB libraries in DIR],
AS_HELP_STRING([--with-berkeley-db-libs=DIR],
[Find Berkeley DB libraries in DIR]),
[bdb_libs="$withval"],
[bdb_libs=default])
@ -120,12 +117,9 @@ AC_DEFUN([MYSQL_SETUP_BERKELEY_DB], [
sh $rel_srcdir/$bdb/dist/configure $bdb_conf_flags) || \
AC_MSG_ERROR([could not configure Berkeley DB])
mysql_se_libs="$mysql_se_libs $bdb_libs_with_path"
AC_SUBST(bdb_includes)
AC_SUBST(bdb_libs)
AC_SUBST(bdb_libs_with_path)
AC_CONFIG_FILES(storage/bdb/Makefile)
])
AC_DEFUN([MYSQL_CHECK_INSTALLED_BDB], [

View file

@ -1,29 +0,0 @@
dnl ---------------------------------------------------------------------------
dnl Macro: MYSQL_CHECK_BLACKHOLEDB
dnl Sets HAVE_BLACKHOLE_DB if --with-blackhole-storage-engine is used
dnl ---------------------------------------------------------------------------
AC_DEFUN([MYSQL_CHECK_BLACKHOLEDB], [
AC_ARG_WITH([blackhole-storage-engine],
[
--with-blackhole-storage-engine
Enable the Blackhole Storage Engine],
[blackholedb="$withval"],
[blackholedb=no])
AC_MSG_CHECKING([for blackhole storage engine])
case "$blackholedb" in
yes )
AC_DEFINE([HAVE_BLACKHOLE_DB], [1], [Builds Blackhole Storage Engine])
AC_MSG_RESULT([yes])
[blackholedb=yes]
;;
* )
AC_MSG_RESULT([no])
[blackholedb=no]
;;
esac
])
dnl ---------------------------------------------------------------------------
dnl END OF MYSQL_CHECK_BLACKHOLE SECTION
dnl ---------------------------------------------------------------------------

View file

@ -1,30 +0,0 @@
dnl ---------------------------------------------------------------------------
dnl Macro: MYSQL_CHECK_EXAMPLEDB
dnl Sets HAVE_EXAMPLE_DB if --with-example-storage-engine is used
dnl ---------------------------------------------------------------------------
AC_DEFUN([MYSQL_CHECK_EXAMPLEDB], [
AC_ARG_WITH([example-storage-engine],
[
--with-example-storage-engine
Enable the Example Storage Engine],
[exampledb="$withval"],
[exampledb=no])
AC_MSG_CHECKING([for example storage engine])
case "$exampledb" in
yes )
AC_DEFINE([HAVE_EXAMPLE_DB], [1], [Builds Example DB])
AC_MSG_RESULT([yes])
[exampledb=yes]
;;
* )
AC_MSG_RESULT([no])
[exampledb=no]
;;
esac
])
dnl ---------------------------------------------------------------------------
dnl END OF MYSQL_CHECK_EXAMPLE SECTION
dnl ---------------------------------------------------------------------------

View file

@ -1,29 +0,0 @@
dnl ---------------------------------------------------------------------------
dnl Macro: MYSQL_CHECK_FEDERATED
dnl Sets HAVE_FEDERATED if --with-federated-storage-engine is used
dnl ---------------------------------------------------------------------------
AC_DEFUN([MYSQL_CHECK_FEDERATED], [
AC_ARG_WITH([federated-storage-engine],
[
--with-federated-storage-engine
Enable the MySQL Federated Storage Engine],
[federateddb="$withval"],
[federateddb=no])
AC_MSG_CHECKING([for MySQL federated storage engine])
case "$federateddb" in
yes )
AC_DEFINE([HAVE_FEDERATED_DB], [1], [Define to enable Federated Handler])
AC_MSG_RESULT([yes])
[federateddb=yes]
;;
* )
AC_MSG_RESULT([no])
[federateddb=no]
;;
esac
])
dnl ---------------------------------------------------------------------------
dnl END OF MYSQL_CHECK_FEDERATED SECTION
dnl ---------------------------------------------------------------------------

View file

@ -1,77 +0,0 @@
dnl ---------------------------------------------------------------------------
dnl Macro: MYSQL_CHECK_INNODB
dnl Sets HAVE_INNOBASE_DB if --with-innodb is used
dnl ---------------------------------------------------------------------------
AC_DEFUN([MYSQL_CHECK_INNODB], [
AC_ARG_WITH([innodb],
[
--without-innodb Do not include the InnoDB table handler],
[innodb="$withval"],
[innodb=yes])
AC_MSG_CHECKING([for Innodb])
have_innodb=no
innodb_includes=
innodb_libs=
case "$innodb" in
yes )
AC_MSG_RESULT([Using Innodb])
AC_DEFINE([HAVE_INNOBASE_DB], [1], [Using Innobase DB])
have_innodb="yes"
innodb_includes="-I\$(top_builddir)/innobase/include"
innodb_system_libs=""
dnl Some libs are listed several times, in order for gcc to sort out
dnl circular references.
innodb_libs="\
\$(top_builddir)/storage/innobase/usr/libusr.a\
\$(top_builddir)/storage/innobase/srv/libsrv.a\
\$(top_builddir)/storage/innobase/dict/libdict.a\
\$(top_builddir)/storage/innobase/que/libque.a\
\$(top_builddir)/storage/innobase/srv/libsrv.a\
\$(top_builddir)/storage/innobase/ibuf/libibuf.a\
\$(top_builddir)/storage/innobase/row/librow.a\
\$(top_builddir)/storage/innobase/pars/libpars.a\
\$(top_builddir)/storage/innobase/btr/libbtr.a\
\$(top_builddir)/storage/innobase/trx/libtrx.a\
\$(top_builddir)/storage/innobase/read/libread.a\
\$(top_builddir)/storage/innobase/usr/libusr.a\
\$(top_builddir)/storage/innobase/buf/libbuf.a\
\$(top_builddir)/storage/innobase/ibuf/libibuf.a\
\$(top_builddir)/storage/innobase/eval/libeval.a\
\$(top_builddir)/storage/innobase/log/liblog.a\
\$(top_builddir)/storage/innobase/fsp/libfsp.a\
\$(top_builddir)/storage/innobase/fut/libfut.a\
\$(top_builddir)/storage/innobase/fil/libfil.a\
\$(top_builddir)/storage/innobase/lock/liblock.a\
\$(top_builddir)/storage/innobase/mtr/libmtr.a\
\$(top_builddir)/storage/innobase/page/libpage.a\
\$(top_builddir)/storage/innobase/rem/librem.a\
\$(top_builddir)/storage/innobase/thr/libthr.a\
\$(top_builddir)/storage/innobase/sync/libsync.a\
\$(top_builddir)/storage/innobase/data/libdata.a\
\$(top_builddir)/storage/innobase/mach/libmach.a\
\$(top_builddir)/storage/innobase/ha/libha.a\
\$(top_builddir)/storage/innobase/dyn/libdyn.a\
\$(top_builddir)/storage/innobase/mem/libmem.a\
\$(top_builddir)/storage/innobase/sync/libsync.a\
\$(top_builddir)/storage/innobase/ut/libut.a\
\$(top_builddir)/storage/innobase/os/libos.a\
\$(top_builddir)/storage/innobase/ut/libut.a"
AC_CHECK_LIB(rt, aio_read, [innodb_system_libs="-lrt"])
;;
* )
AC_MSG_RESULT([Not using Innodb])
;;
esac
AC_SUBST(innodb_includes)
AC_SUBST(innodb_libs)
AC_SUBST(innodb_system_libs)
])
dnl ---------------------------------------------------------------------------
dnl END OF MYSQL_CHECK_INNODB SECTION
dnl ---------------------------------------------------------------------------

View file

@ -191,7 +191,6 @@ AC_DEFUN([MYSQL_SETUP_NDBCLUSTER], [
ndbcluster_libs="\$(top_builddir)/storage/ndb/src/.libs/libndbclient.a"
ndbcluster_system_libs=""
ndb_mgmclient_libs="\$(top_builddir)/storage/ndb/src/mgmclient/libndbmgmclient.la"
mysql_se_objs="$mysql_se_objs ha_ndbcluster_binlog.o"
MYSQL_CHECK_NDB_OPTIONS
NDBCLUSTER_WORKAROUNDS
@ -282,9 +281,6 @@ AC_DEFUN([MYSQL_SETUP_NDBCLUSTER], [
ndb_bin_am_ldflags=""
fi
mysql_se_libs="$mysql_se_libs $ndbcluster_libs $ndbcluster_system_libs"
mysql_se_libs="$mysql_se_libs $NDB_SCI_LIBS"
AC_SUBST(NDB_VERSION_MAJOR)
AC_SUBST(NDB_VERSION_MINOR)
AC_SUBST(NDB_VERSION_BUILD)
@ -302,6 +298,7 @@ AC_DEFUN([MYSQL_SETUP_NDBCLUSTER], [
AC_SUBST(ndbcluster_libs)
AC_SUBST(ndbcluster_system_libs)
AC_SUBST(ndb_mgmclient_libs)
AC_SUBST(NDB_SCI_LIBS)
AC_SUBST(ndb_transporter_opt_objs)
AC_SUBST(ndb_port)
@ -311,7 +308,7 @@ AC_DEFUN([MYSQL_SETUP_NDBCLUSTER], [
AC_SUBST(NDB_DEFS)
AC_SUBST(ndb_cxxflags_fix)
AC_CONFIG_FILES(storage/ndb/Makefile storage/ndb/include/Makefile dnl
AC_CONFIG_FILES(storage/ndb/include/Makefile dnl
storage/ndb/src/Makefile storage/ndb/src/common/Makefile dnl
storage/ndb/docs/Makefile dnl
storage/ndb/tools/Makefile dnl

View file

@ -1,33 +0,0 @@
dnl ---------------------------------------------------------------------------
dnl Macro: MYSQL_CHECK_PARTITIONDB
dnl Sets HAVE_PARTITION_DB if --with-partition is used
dnl ---------------------------------------------------------------------------
AC_DEFUN([MYSQL_CHECK_PARTITIONDB], [
AC_ARG_WITH([partition],
[
--with-partition
Enable the Partition Storage Engine],
[partitiondb="$withval"],
[partitiondb=no])
AC_MSG_CHECKING([for partition])
dnl case "$partitiondb" in
dnl yes )
dnl AC_DEFINE([HAVE_PARTITION_DB], [1], [Builds Partition DB])
dnl AC_MSG_RESULT([yes])
dnl [partitiondb=yes]
dnl ;;
dnl * )
dnl AC_MSG_RESULT([no])
dnl [partitiondb=no]
dnl ;;
dnl esac
AC_DEFINE([HAVE_PARTITION_DB], [1], [Builds Partition DB])
AC_MSG_RESULT([yes])
[partitiondb=yes]
])
dnl ---------------------------------------------------------------------------
dnl END OF MYSQL_CHECK_PARTITION SECTION
dnl ---------------------------------------------------------------------------

View file

@ -1,29 +0,0 @@
dnl ---------------------------------------------------------------------------
dnl Macro: MYSQL_CHECK_CSVDB
dnl Sets HAVE_CSV_DB if --with-csv-storage-engine is used
dnl ---------------------------------------------------------------------------
AC_DEFUN([MYSQL_CHECK_CSVDB], [
AC_ARG_WITH([csv-storage-engine],
[
--with-csv-storage-engine
Enable the CSV Storage Engine],
[csvdb="$withval"],
[csvdb=no])
AC_MSG_CHECKING([for csv storage engine])
case "$csvdb" in
yes )
AC_DEFINE([HAVE_CSV_DB], [1], [Builds the CSV Storage Engine])
AC_MSG_RESULT([yes])
[csvdb=yes]
;;
* )
AC_MSG_RESULT([no])
[csvdb=no]
;;
esac
])
dnl ---------------------------------------------------------------------------
dnl END OF MYSQL_CHECK_CSV SECTION
dnl ---------------------------------------------------------------------------

View file

@ -675,8 +675,8 @@ dnl Sets BIG_TABLES if --with-big-tables is used
dnl ---------------------------------------------------------------------------
AC_DEFUN([MYSQL_CHECK_BIG_TABLES], [
AC_ARG_WITH([big-tables],
[
--with-big-tables Support tables with more than 4 G rows even on 32 bit platforms],
AS_HELP_STRING([--with-big-tables],
[Support tables with more than 4 G rows even on 32 bit platforms]),
[bigtables="$withval"],
[bigtables=no])
AC_MSG_CHECKING([for big tables support])
@ -703,8 +703,8 @@ dnl Sets MAX_INDEXES
dnl ---------------------------------------------------------------------------
AC_DEFUN([MYSQL_CHECK_MAX_INDEXES], [
AC_ARG_WITH([max-indexes],
[
--with-max-indexes=\# Sets the maximum number of indexes per table, default 64],
AS_HELP_STRING([--with-max-indexes=N],
[Sets the maximum number of indexes per table, default 64]),
[max_indexes="$withval"],
[max_indexes=64])
AC_MSG_CHECKING([max indexes per table])

759
config/ac-macros/plugins.m4 Normal file
View file

@ -0,0 +1,759 @@
dnl ===========================================================================
dnl Support for mysql server plugins
dnl ===========================================================================
dnl
dnl WorkLog#3201
dnl
dnl Framework for pluggable static and dynamic plugins for mysql
dnl
dnl ---------------------------------------------------------------------------
dnl Macro: MYSQL_PLUGIN
dnl
dnl SYNOPSIS
dnl MYSQL_PLUGIN([name],[Plugin name],
dnl [Plugin description],
dnl [group,group...])
dnl
dnl DESCRIPTION
dnl First declaration for a plugin (mandatory).
dnl Adds plugin as member to configuration groups (if specified)
dnl
dnl ---------------------------------------------------------------------------
AC_DEFUN([MYSQL_PLUGIN],[
_MYSQL_PLUGIN(
[$1],
[__MYSQL_PLUGIN_]AS_TR_CPP([$1])[__],
m4_default([$2], [$1 plugin]),
m4_default([$3], [plugin for $1]),
m4_default([$4], []),
)
])
AC_DEFUN([_MYSQL_PLUGIN],[
m4_ifdef([$2], [
AC_FATAL([Duplicate MYSQL_PLUGIN declaration for $3])
],[
m4_define([$2], [$1])
_MYSQL_PLUGAPPEND([__mysql_plugin_list__],[$1])
m4_define([MYSQL_PLUGIN_NAME_]AS_TR_CPP([$1]), [$3])
m4_define([MYSQL_PLUGIN_DESC_]AS_TR_CPP([$1]), [$4])
_MYSQL_PLUGAPPEND_META([$1], $5)
ifelse(m4_bregexp(__mysql_include__,[/plug\.in$]),-1,[],[
MYSQL_PLUGIN_DIRECTORY([$1],
m4_bregexp(__mysql_include__,[^\(.*\)/plug\.in$],[\1]))
])
])
])
dnl ---------------------------------------------------------------------------
dnl Macro: MYSQL_STORAGE_ENGINE
dnl
dnl SYNOPSIS
dnl MYSQL_STORAGE_ENGINE([name],[legacy-option],[Storage engine name],
dnl [Storage engine description],[group,group...])
dnl
dnl DESCRIPTION
dnl Short cut for storage engine declarations
dnl
dnl ---------------------------------------------------------------------------
AC_DEFUN([MYSQL_STORAGE_ENGINE],[
MYSQL_PLUGIN([$1], [$3], [$4], [[$5]])
MYSQL_PLUGIN_DEFINE([$1], [WITH_]AS_TR_CPP([$1])[_STORAGE_ENGINE])
ifelse([$2],[no],[],[
_MYSQL_LEGACY_STORAGE_ENGINE(
m4_bpatsubst([$1], -, _),
m4_bpatsubst(m4_default([$2], [$1-storage-engine]), -, _))
])
])
AC_DEFUN([_MYSQL_LEGACY_STORAGE_ENGINE],[
if test "[${with_]$2[+set}]" = set; then
[with_plugin_]$1="[$with_]$2"
fi
])
dnl ---------------------------------------------------------------------------
dnl Macro: MYSQL_PLUGIN_DEFINE
dnl
dnl SYNOPSIS
dnl MYSQL_PLUGIN_DEFINE([name],[MYSQL_CPP_DEFINE])
dnl
dnl DESCRIPTION
dnl When a plugin is to be statically linked, define the C macro
dnl
dnl ---------------------------------------------------------------------------
AC_DEFUN([MYSQL_PLUGIN_DEFINE],[
MYSQL_REQUIRE_PLUGIN([$1])
m4_define([MYSQL_PLUGIN_DEFINE_]AS_TR_CPP([$1]), [$2])
])
dnl ---------------------------------------------------------------------------
dnl Macro: MYSQL_PLUGIN_DIRECTORY
dnl
dnl SYNOPSIS
dnl MYSQL_PLUGIN_DIRECTORY([name],[plugin/dir])
dnl
dnl DESCRIPTION
dnl Adds a directory to the build process
dnl if it contains 'configure' it will be picked up automatically
dnl
dnl ---------------------------------------------------------------------------
AC_DEFUN([MYSQL_PLUGIN_DIRECTORY],[
MYSQL_REQUIRE_PLUGIN([$1])
m4_define([MYSQL_PLUGIN_DIRECTORY_]AS_TR_CPP([$1]), [$2])
])
dnl ---------------------------------------------------------------------------
dnl Macro: MYSQL_PLUGIN_STATIC
dnl
dnl SYNOPSIS
dnl MYSQL_PLUGIN_STATIC([name],[libmyplugin.a])
dnl
dnl DESCRIPTION
dnl Declare the name for the static library
dnl
dnl ---------------------------------------------------------------------------
AC_DEFUN([MYSQL_PLUGIN_STATIC],[
MYSQL_REQUIRE_PLUGIN([$1])
m4_define([MYSQL_PLUGIN_STATIC_]AS_TR_CPP([$1]), [$2])
])
dnl ---------------------------------------------------------------------------
dnl Macro: MYSQL_PLUGIN_DYNAMIC
dnl
dnl SYNOPSIS
dnl MYSQL_PLUGIN_DYNAMIC([name],[myplugin.la])
dnl
dnl DESCRIPTION
dnl Declare the name for the shared library
dnl
dnl ---------------------------------------------------------------------------
AC_DEFUN([MYSQL_PLUGIN_DYNAMIC],[
MYSQL_REQUIRE_PLUGIN([$1])
m4_define([MYSQL_PLUGIN_DYNAMIC_]AS_TR_CPP([$1]), [$2])
])
dnl ---------------------------------------------------------------------------
dnl Macro: MYSQL_PLUGIN_MANDATORY
dnl
dnl SYNOPSIS
dnl MYSQL_PLUGIN_MANDATORY([name])
dnl
dnl DESCRIPTION
dnl Marks the specified plugin as a mandatory plugin
dnl
dnl ---------------------------------------------------------------------------
AC_DEFUN([MYSQL_PLUGIN_MANDATORY],[
MYSQL_REQUIRE_PLUGIN([$1])
_MYSQL_PLUGIN_MANDATORY([$1],
[MYSQL_PLUGIN_MANDATORY_]AS_TR_CPP([$1]),
[MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1])
)
])
AC_DEFUN([_MYSQL_PLUGIN_MANDATORY],[
m4_define([$2], [yes])
m4_ifdef([$3], [
AC_FATAL([mandatory plugin $1 has been disabled])
m4_undefine([$2])
])
])
dnl ---------------------------------------------------------------------------
dnl Macro: MYSQL_PLUGIN_DISABLED
dnl
dnl SYNOPSIS
dnl MYSQL_PLUGIN_DISABLED([name])
dnl
dnl DESCRIPTION
dnl Marks the specified plugin as a disabled plugin
dnl
dnl ---------------------------------------------------------------------------
AC_DEFUN([MYSQL_PLUGIN_DISABLED],[
MYSQL_REQUIRE_PLUGIN([$1])
_MYSQL_PLUGIN_DISABLED([$1],
[MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1]),
[MYSQL_PLUGIN_MANDATORY_]AS_TR_CPP([$1])
)
])
AC_DEFUN([_MYSQL_PLUGIN_DISABLED],[
m4_define([$2], [yes])
m4_ifdef([$3], [
AC_FATAL([attempt to disable mandatory plugin $1])
m4_undefine([$2])
])
])
dnl ---------------------------------------------------------------------------
dnl Macro: MYSQL_PLUGIN_DEPENDS
dnl
dnl SYNOPSIS
dnl MYSQL_PLUGIN_DEPENDS([name],[prereq,prereq...])
dnl
dnl DESCRIPTION
dnl Enables other plugins neccessary for the named plugin
dnl Dependency checking is not recursive so if any
dnl required plugin requires further plugins, list them
dnl here too!
dnl
dnl ---------------------------------------------------------------------------
AC_DEFUN([MYSQL_PLUGIN_DEPENDS],[
MYSQL_REQUIRE_PLUGIN([$1])
ifelse($#, 2, [
_MYSQL_PLUGIN_DEPEND([$1], $2)
], [
AC_FATAL([bad number of arguments])
])
])
AC_DEFUN([_MYSQL_PLUGIN_DEPEND],[
ifelse($#, 1, [], [$#:$2], [2:], [], [
MYSQL_REQUIRE_PLUGIN([$2])
_MYSQL_PLUGAPPEND([__mysql_plugdepends_$1__],[$2])
_MYSQL_PLUGIN_DEPEND([$1], m4_shift(m4_shift($@)))
])
])
dnl ---------------------------------------------------------------------------
dnl Macro: MYSQL_PLUGIN_ACTIONS
dnl
dnl SYNOPSIS
dnl MYSQL_PLUGIN_ACTIONS([name],[PLUGIN_CONFIGURE_STUFF])
dnl
dnl DESCRIPTION
dnl Declares additional autoconf actions required to configure the plugin
dnl
dnl ---------------------------------------------------------------------------
AC_DEFUN([MYSQL_PLUGIN_ACTIONS],[
MYSQL_REQUIRE_PLUGIN([$1])
m4_ifdef([$2],[
m4_define([MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1]),m4_defn([$2]))
],[
m4_define([MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1]), [$2])
])
])
dnl ---------------------------------------------------------------------------
dnl Macro: MYSQL_CONFIGURE_PLUGINS
dnl
dnl SYNOPSIS
dnl MYSQL_PLUGIN_DEPENDS([name,name...])
dnl
dnl DESCRIPTION
dnl Used last, emits all required shell code to configure the plugins
dnl Argument is a list of default plugins or meta-plugin
dnl
dnl ---------------------------------------------------------------------------
AC_DEFUN([MYSQL_CONFIGURE_PLUGINS],[
m4_ifdef([__mysql_plugin_configured__],[
AC_FATAL([cannot use [MYSQL_CONFIGURE_PLUGINS] multiple times])
],[
m4_define([__mysql_plugin_configured__],[done])
_MYSQL_INCLUDE_LIST(
m4_bpatsubst(m4_esyscmd([ls plugin/*/plug.in storage/*/plug.in 2>/dev/null]),
[[
]],[,]))
m4_ifdef([__mysql_plugin_list__],[
_MYSQL_CHECK_PLUGIN_ARGS([$1])
_MYSQL_CONFIGURE_PLUGINS(m4_bpatsubst(__mysql_plugin_list__, :, [,]))
_MYSQL_EMIT_PLUGIN_ACTIONS(m4_bpatsubst(__mysql_plugin_list__, :, [,]))
AC_SUBST([mysql_se_dirs])
AC_SUBST([mysql_pg_dirs])
])
])
])
AC_DEFUN([_MYSQL_CONFIGURE_PLUGINS],[
ifelse($#, 0, [], $#, 1, [
_MYSQL_EMIT_CHECK_PLUGIN([$1])
],[
_MYSQL_EMIT_CHECK_PLUGIN([$1])
_MYSQL_CONFIGURE_PLUGINS(m4_shift($@))
])
])
AC_DEFUN([_MYSQL_EMIT_CHECK_PLUGIN],[
__MYSQL_EMIT_CHECK_PLUGIN(
[$1],
m4_bpatsubst([$1], -, _),
[MYSQL_PLUGIN_NAME_]AS_TR_CPP([$1]),
[MYSQL_PLUGIN_DESC_]AS_TR_CPP([$1]),
[MYSQL_PLUGIN_DEFINE_]AS_TR_CPP([$1]),
[MYSQL_PLUGIN_DIRECTORY_]AS_TR_CPP([$1]),
[MYSQL_PLUGIN_STATIC_]AS_TR_CPP([$1]),
[MYSQL_PLUGIN_DYNAMIC_]AS_TR_CPP([$1]),
[MYSQL_PLUGIN_MANDATORY_]AS_TR_CPP([$1]),
[MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1]),
[MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1])
)
])
AC_DEFUN([__MYSQL_EMIT_CHECK_PLUGIN],[
m4_ifdef([$5],[
AH_TEMPLATE($5, [Include ]$4[ into mysqld])
])
AC_MSG_CHECKING([whether to use ]$3)
mysql_use_plugin_dir=""
m4_ifdef([$10],[
if test "X[$mysql_plugin_]$2" = Xyes -a \
"X[$with_plugin_]$2" != Xno -o \
"X[$with_plugin_]$2" = Xyes; then
AC_MSG_RESULT([error])
AC_MSG_ERROR([disabled])
fi
AC_MSG_RESULT([no])
],[
m4_ifdef([$9],[
if test "X[$with_plugin_]$2" = Xno; then
AC_MSG_RESULT([error])
AC_MSG_ERROR([cannot disable mandatory plugin])
fi
[mysql_plugin_]$2=yes
])
if test "X[$with_plugin_]$2" = Xno; then
AC_MSG_RESULT([no])
else
m4_ifdef([$8],m4_ifdef([$7],[],[[with_plugin_]$2='']))
if test "X[$mysql_plugin_]$2" != Xyes -a \
"X[$with_plugin_]$2" != Xyes; then
m4_ifdef([$8],[
m4_ifdef([$6],[
if test -d "$srcdir/$6" ; then
mysql_use_plugin_dir="$6"
])
AC_SUBST([plugin_]$2[_shared_target], "$8")
AC_SUBST([plugin_]$2[_static_target], [""])
[with_plugin_]$2=yes
AC_MSG_RESULT([plugin])
m4_ifdef([$6],[
else
[mysql_plugin_]$2=no
AC_MSG_RESULT([no])
fi
])
],[
[with_plugin_]$2=no
AC_MSG_RESULT([no])
])
else
m4_ifdef([$7],[
ifelse(m4_bregexp($7, [^lib[^.]+\.a$]), -2, [
dnl change above "-2" to "0" to enable this section
dnl Although this is "pretty", it breaks libmysqld build
m4_ifdef([$6],[
mysql_use_plugin_dir="$6"
mysql_plugin_libs="$mysql_plugin_libs -L[\$(top_builddir)]/$6"
])
mysql_plugin_libs="$mysql_plugin_libs dnl
[-l]m4_bregexp($7, [^lib\([^.]+\)], [\1])"
], m4_bregexp($7, [^\\\$]), 0, [
m4_ifdef([$6],[
mysql_use_plugin_dir="$6"
])
mysql_plugin_libs="$mysql_plugin_libs $7"
], [
m4_ifdef([$6],[
mysql_use_plugin_dir="$6"
mysql_plugin_libs="$mysql_plugin_libs \$(top_builddir)/$6/$7"
],[
mysql_plugin_libs="$mysql_plugin_libs $7"
])
])
m4_ifdef([$5],[
AC_DEFINE($5)
])
AC_SUBST([plugin_]$2[_static_target], "$7")
AC_SUBST([plugin_]$2[_shared_target], [""])
],[
m4_ifdef([$6],[
AC_MSG_RESULT([error])
AC_MSG_ERROR([Plugin $1 does not support static linking])
],[
m4_ifdef([$5],[
AC_DEFINE($5)
AC_SUBST([plugin_]$2[_static_target], ["yes"])
AC_SUBST([plugin_]$2[_shared_target], [""])
])
])
])
mysql_plugin_defs="$mysql_plugin_defs, [builtin_]$2[_plugin]"
[with_plugin_]$2=yes
AC_MSG_RESULT([yes])
fi
m4_ifdef([$6],[
if test -n "$mysql_use_plugin_dir" ; then
mysql_plugin_dirs="$mysql_plugin_dirs $6"
m4_syscmd(test -f "$6/configure")
ifelse(m4_sysval, 0,
[other_configures="$other_configures $6/configure"],
[AC_CONFIG_FILES($6/Makefile)]
)
ifelse(m4_substr($6, 0, 8), [storage/],
[mysql_se_dirs="$mysql_se_dirs ]m4_substr($6, 8)",
m4_substr($6, 0, 7), [plugin/],
[mysql_pg_dirs="$mysql_pg_dirs ]m4_substr($6, 7)",
[AC_FATAL([don't know how to handle plugin dir ]$6)])
fi
])
fi
])
])
AC_DEFUN([_MYSQL_EMIT_PLUGIN_ACTIONS],[
ifelse($#, 0, [], $#, 1, [
_MYSQL_EMIT_PLUGIN_ACTION([$1])
],[
_MYSQL_EMIT_PLUGIN_ACTION([$1])
_MYSQL_EMIT_PLUGIN_ACTIONS(m4_shift($@))
])
])
AC_DEFUN([_MYSQL_EMIT_PLUGIN_ACTION],[
__MYSQL_EMIT_PLUGIN_ACTION(
[$1],
m4_bpatsubst([$1], -, _),
[MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1]),
[MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1])
)
])
AC_DEFUN([__MYSQL_EMIT_PLUGIN_ACTION],[
m4_ifdef([$3], [], [
if test "X[$with_plugin_]$2" = Xyes; then
if test "X[$plugin_]$2[_static_target]" = X -a \
"X[$plugin_]$2[_shared_target]" = X; then
AC_MSG_ERROR([that's strange, $1 failed sanity check])
fi
$4
fi
])
])
dnl ===========================================================================
dnl Private helper macros
dnl ===========================================================================
dnl SYNOPSIS
dnl MYSQL_REQUIRE_PLUGIN([name])
dnl
dnl DESCRIPTION
dnl Checks that the specified plugin does exist
AC_DEFUN([MYSQL_REQUIRE_PLUGIN],[
_MYSQL_REQUIRE_PLUGIN([$1], [__MYSQL_PLUGIN_]AS_TR_CPP([$1])[__])
])
define([_MYSQL_REQUIRE_PLUGIN],[
ifdef([$2],[
ifelse($2, [$1], [], [
AC_FATAL([Misspelt MYSQL_PLUGIN declaration for $1])
])
],[
AC_FATAL([Missing MYSQL_PLUGIN declaration for $1])
])
])
dnl ---------------------------------------------------------------------------
dnl SYNOPSIS
dnl _MYSQL_EMIT_METAPLUGINS([name,name...])
dnl
dnl DESCRIPTION
dnl Emits shell code for metaplugins
AC_DEFUN([_MYSQL_EMIT_METAPLUGINS], [ifelse($#, 0, [], $#, 1,
[_MYSQL_EMIT_METAPLUGIN([$1], [__mysql_]m4_bpatsubst($1, -, _)[_plugins__])
],
[_MYSQL_EMIT_METAPLUGIN([$1], [__mysql_]m4_bpatsubst($1, -, _)[_plugins__])
_MYSQL_EMIT_METAPLUGINS(m4_shift($@))])
])
AC_DEFUN([_MYSQL_EMIT_METAPLUGIN], [
[$1] )
m4_ifdef([$2], [
mysql_plugins='m4_bpatsubst($2, :, [ ])'
],[
mysql_plugins=''
])
;;
])
dnl ---------------------------------------------------------------------------
dnl SYNOPSIS
dnl _MYSQL_PLUGAPPEND([name],[to-append])
dnl
dnl DESCRIPTION
dnl Helper macro for appending to colon-delimited lists
dnl Optinal 3rd argument is for actions only required when defining
dnl macro named for the first time.
AC_DEFUN([_MYSQL_PLUGAPPEND],[
m4_ifdef([$1],[
m4_define([__plugin_append_tmp__], m4_defn([$1]))
m4_undefine([$1])
m4_define([$1], __plugin_append_tmp__[:$2])
m4_undefine([__plugin_append_tmp__])
],[
m4_define([$1], [$2])
$3
])
])
dnl SYNOPSIS
dnl _MYSQL_PLUGAPPEND_META([name],[meta,meta...])
dnl
dnl DESCRIPTION
dnl Helper macro for adding plugins to meta plugins
AC_DEFUN([_MYSQL_PLUGAPPEND_META],[
ifelse($#, 1, [], [$#:$2], [2:], [], [$2], [all], [
AC_FATAL([protected plugin group: all])
], [$2], [none], [
AC_FATAL([protected plugin group: none])
],[
_MYSQL_PLUGAPPEND([__mysql_$1_configs__],[$2])
_MYSQL_PLUGAPPEND([__mysql_]m4_bpatsubst($2, -, _)[_plugins__],[$1], [
_MYSQL_PLUGAPPEND([__mysql_metaplugin_list__],[$2])
])
_MYSQL_PLUGAPPEND_META([$1], m4_shift(m4_shift($@)))
])
])
dnl ---------------------------------------------------------------------------
dnl SYNOPSIS
dnl MYSQL_LIST_PLUGINS
dnl
dnl DESCRIPTION
dnl Emits formatted list of declared plugins
AC_DEFUN([MYSQL_LIST_PLUGINS],[dnl
m4_ifdef([__mysql_plugin_list__],[dnl
_MYSQL_LIST_PLUGINS(m4_bpatsubst(__mysql_plugin_list__, :, [,]))dnl
])dnl
])
AC_DEFUN([_MYSQL_LIST_PLUGINS],[dnl
ifelse($#, 0, [], $#, 1, [dnl
MYSQL_SHOW_PLUGIN([$1])dnl
],[dnl
MYSQL_SHOW_PLUGIN([$1])dnl
_MYSQL_LIST_PLUGINS(m4_shift($@))dnl
])dnl
])
AC_DEFUN([MYSQL_SHOW_PLUGIN],[
_MYSQL_SHOW_PLUGIN(
[$1],
[$1-plugin],
[MYSQL_PLUGIN_NAME_]AS_TR_CPP([$1]),
[MYSQL_PLUGIN_DESC_]AS_TR_CPP([$1]),
[MYSQL_PLUGIN_DEFINE_]AS_TR_CPP([$1]),
[MYSQL_PLUGIN_DIRECTORY_]AS_TR_CPP([$1]),
[MYSQL_PLUGIN_STATIC_]AS_TR_CPP([$1]),
[MYSQL_PLUGIN_DYNAMIC_]AS_TR_CPP([$1]),
[MYSQL_PLUGIN_MANDATORY_]AS_TR_CPP([$1]),
[MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1]),
[MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1]),
__mysql_[$1]_configs__,
)
])
AC_DEFUN([_MYSQL_SHOW_PLUGIN],[dnl
=== $3 ===
Plugin Name: [$1]
Description: $4
Supports build: _PLUGIN_BUILD_TYPE([$7],[$8])[]dnl
m4_ifdef([$12],[
Configurations: m4_bpatsubst($12, :, [, ])])[]dnl
m4_ifdef([$10],[
Status: disabled])[]dnl
m4_ifdef([$9],[
Status: mandatory])[]dnl
])
AC_DEFUN([_PLUGIN_BUILD_TYPE],
[m4_ifdef([$1],[static ]m4_ifdef([$2],[and dnl
]))[]m4_ifdef([$2],[dynamic],[m4_ifdef([$1],[],[static])])])
dnl ---------------------------------------------------------------------------
AC_DEFUN([_MYSQL_EMIT_PLUGINS],[
ifelse($#, 0, [], [$#:$1], [1:], [], [
m4_ifdef([MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1]), [], [
m4_define([MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1]),[ ])
])
[$1] )
m4_ifdef([MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1]),[
AC_MSG_ERROR([plugin $1 is disabled])
],[
_MYSQL_EMIT_PLUGIN_ENABLE([$1], m4_bpatsubst([$1], -, _),
[MYSQL_PLUGIN_NAME_]AS_TR_CPP([$1]),
[MYSQL_PLUGIN_STATIC_]AS_TR_CPP([$1]),
[MYSQL_PLUGIN_DYNAMIC_]AS_TR_CPP([$1]))
])
;;
_MYSQL_EMIT_PLUGINS(m4_shift($@))
])
])
AC_DEFUN([_MYSQL_EMIT_PLUGIN_ENABLE],[
m4_ifdef([$5],m4_ifdef([$4],[
[mysql_plugin_]$2=yes
],[
AC_MSG_WARN([$3 can only be built as a plugin])
]),[
[mysql_plugin_]$2=yes
])
])
AC_DEFUN([_MYSQL_EMIT_PLUGIN_DEPENDS], [
ifelse($#, 0, [], [$#:$1], [1:], [], [
_MYSQL_EMIT_CHECK_DEPENDS(m4_bpatsubst([$1], -, _),
[__mysql_plugdepends_$1__])
_MYSQL_EMIT_PLUGIN_DEPENDS(m4_shift($@))
])
])
AC_DEFUN([_MYSQL_EMIT_CHECK_DEPENDS], [
m4_ifdef([$2], [
if test "X[$mysql_plugin_]$1" = Xyes -a \
"X[$with_plugin_]$1" != Xno -o \
"X[$with_plugin_]$1" = Xyes; then
_MYSQL_EMIT_PLUGIN_DEPENDENCIES(m4_bpatsubst($2, :, [,]))
fi
])
])
AC_DEFUN([_MYSQL_EMIT_PLUGIN_DEPENDENCIES], [
ifelse([$1], [], [], [
m4_ifdef([MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1]),[
AC_MSG_ERROR([depends upon disabled plugin $1])
],[
[mysql_plugin_]m4_bpatsubst([$1], -, _)=yes
if test "X[$with_plugin_]m4_bpatsubst([$1], -, _)" = Xno; then
AC_MSG_ERROR([depends upon disabled plugin $1])
fi
])
_MYSQL_EMIT_PLUGIN_DEPENDENCIES(m4_shift($@))
])
])
dnl SYNOPSIS
dnl _MYSQL_CHECK_PLUGIN_ARGS([plugin],[plugin]...)
dnl
dnl DESCRIPTION
dnl Emits shell script for checking configure arguments
dnl Arguments to this macro is default value for selected plugins
AC_DEFUN([_MYSQL_CHECK_PLUGIN_ARGS],[
__MYSQL_CHECK_PLUGIN_ARGS(m4_default([$1], [none]))
])
AC_DEFUN([__MYSQL_CHECK_PLUGIN_ARGS],[
AC_ARG_WITH([plugins],
AS_HELP_STRING([--with-plugins=PLUGIN[[[[[,PLUGIN..]]]]]],
[Plugins to include in mysqld. (default is: $1) Must be a
configuration name or a comma separated list of plugins.])
AS_HELP_STRING([],
[Available configurations are:] dnl
m4_bpatsubst([none:]m4_ifdef([__mysql_metaplugin_list__],
__mysql_metaplugin_list__:)[all], :, [ ])[.])
AS_HELP_STRING([],
[Available plugins are:] dnl
m4_bpatsubst(__mysql_plugin_list__, :, [ ])[.])
AS_HELP_STRING([--without-plugin-PLUGIN],
[Disable the named plugin from being built. Otherwise, for
plugins which are not selected for inclusion in mysqld will be
built dynamically (if supported)])
AS_HELP_STRING([--with-plugin-PLUGIN],
[Forces the named plugin to be linked into mysqld statically.]),
[mysql_plugins="`echo $withval | tr ',.:;*[]' ' '`"],
[mysql_plugins=['$1']])
m4_divert_once([HELP_VAR_END],[
Description of plugins:
MYSQL_LIST_PLUGINS])
case "$mysql_plugins" in
all )
mysql_plugins='m4_bpatsubst(__mysql_plugin_list__, :, [ ])'
;;
none )
mysql_plugins=''
;;
m4_ifdef([__mysql_metaplugin_list__],[
_MYSQL_EMIT_METAPLUGINS(m4_bpatsubst(__mysql_metaplugin_list__, :, [,]))
])
esac
for plugin in $mysql_plugins; do
case "$plugin" in
all | none )
AC_MSG_ERROR([bad plugin name: $plugin])
;;
_MYSQL_EMIT_PLUGINS(m4_bpatsubst(__mysql_plugin_list__, :, [,]))
* )
AC_MSG_ERROR([unknown plugin: $plugin])
;;
esac
done
_MYSQL_EMIT_PLUGIN_DEPENDS(m4_bpatsubst(__mysql_plugin_list__, :, [,]))
])
dnl ---------------------------------------------------------------------------
dnl Macro: _MYSQL_INCLUDE_LIST
dnl
dnl SYNOPSIS
dnl _MYSQL_INCLUDE_LIST([filename,filename...])
dnl
dnl DESCRIPTION
dnl includes all files from the list
dnl
dnl ---------------------------------------------------------------------------
AC_DEFUN([_MYSQL_INCLUDE_LIST],[
ifelse([$1], [], [], [
m4_define([__mysql_include__],[$1])
sinclude($1)
m4_undefine([__mysql_include__])
_MYSQL_INCLUDE_LIST(m4_shift($@))
])
])
dnl ===========================================================================

View file

@ -1,55 +0,0 @@
dnl ---------------------------------------------------------------------------
dnl Macro: MYSQL_STORAGE_ENGINE
dnl
dnl What it does:
dnl creates --with-xxx configure option
dnl adds HAVE_XXX to config.h
dnl appends &xxx_hton, to the list of hanldertons
dnl appends a dir to the list of source directories
dnl appends ha_xxx.cc to the list of handler files
dnl
dnl all names above are configurable with reasonable defaults.
dnl
dnl ---------------------------------------------------------------------------
AC_DEFUN([MYSQL_STORAGE_ENGINE],
[_MYSQL_STORAGE_ENGINE(
[$1], dnl name
m4_default([$2], [$1 storage engine]), dnl verbose name
m4_default([$3], [$1-storage-engine]), dnl with-name
m4_default([$4], no), dnl default
m4_default([$5], [WITH_]AS_TR_CPP([$1])[_STORAGE_ENGINE]),
m4_default([$6], $1[_hton]), dnl hton
m4_default([$7], []), dnl path to the code
m4_default([$8], [ha_$1.o]), dnl path to the handler in
m4_default([$9], []), dnl path to extra libraries
[$10], dnl code-if-set
)])
AC_DEFUN([_MYSQL_STORAGE_ENGINE],
[
AC_ARG_WITH([$3], AS_HELP_STRING([--with-$3], [enable $2 (default is $4)]),
[], [ [with_]m4_bpatsubst([$3], -, _)=['$4']])
AC_CACHE_CHECK([whether to use $2], [mysql_cv_use_]m4_bpatsubst([$3], -, _),
[mysql_cv_use_]m4_bpatsubst([$3], -, _)=[$with_]m4_bpatsubst([$3], -, _))
AH_TEMPLATE([$5], [Build $2])
if test "[$mysql_cv_use_]m4_bpatsubst([$3], -, _)" != no; then
if test "$6" != "no"
then
AC_DEFINE([$5])
mysql_se_decls="${mysql_se_decls},$6"
mysql_se_htons="${mysql_se_htons},&$6"
if test "$8" != "no"
then
mysql_se_objs="$mysql_se_objs $8"
fi
mysql_se_dirs="$mysql_se_dirs $7"
mysql_se_libs="$mysql_se_libs $9"
else
mysql_se_plugins="$mysql_se_plugins $7"
fi
$10
fi
])
dnl ---------------------------------------------------------------------------

View file

@ -31,7 +31,7 @@ sinclude(config/ac-macros/alloca.m4)
sinclude(config/ac-macros/check_cpu.m4)
sinclude(config/ac-macros/character_sets.m4)
sinclude(config/ac-macros/compiler_flag.m4)
sinclude(config/ac-macros/storage.m4)
sinclude(config/ac-macros/plugins.m4)
sinclude(config/ac-macros/ha_berkeley.m4)
sinclude(config/ac-macros/ha_ndbcluster.m4)
sinclude(config/ac-macros/large_file.m4)
@ -51,7 +51,6 @@ romanian russian serbian slovak spanish swedish ukrainian"
#####
#####
AC_SUBST(MYSQL_NO_DASH_VERSION)
AC_SUBST(MYSQL_BASE_VERSION)
AC_SUBST(MYSQL_VERSION_ID)
@ -1623,7 +1622,7 @@ fi
# If we should allow error injection tests
AC_ARG_WITH(error-inject,
[ --with-error-inject Enable error injection in MySQL Server],
AC_HELP_STRING([--with-error-inject],[Enable error injection in MySQL Server]),
[ with_error_inject=$withval ],
[ with_error_inject=no ])
@ -2196,6 +2195,90 @@ then
fi
AC_MSG_RESULT("$netinet_inc")
#--------------------------------------------------------------------
# Check for requested features
#--------------------------------------------------------------------
MYSQL_CHECK_BIG_TABLES
MYSQL_CHECK_MAX_INDEXES
MYSQL_CHECK_REPLICATION
MYSQL_CHECK_VIO
MYSQL_CHECK_OPENSSL
MYSQL_CHECK_YASSL
#--------------------------------------------------------------------
# Declare our plugin modules
# Has to be done late, as the plugin may need to check for existence of
# functions tested above
#--------------------------------------------------------------------
MYSQL_STORAGE_ENGINE(berkeley, berkeley-db, [BerkeleyDB Storage Engine],
[Transactional Tables using BerkeleyDB], [max,max-no-ndb])
MYSQL_PLUGIN_DIRECTORY(berkeley,[storage/bdb])
MYSQL_PLUGIN_STATIC(berkeley, [[\$(bdb_libs_with_path)]])
MYSQL_PLUGIN_ACTIONS(berkeley, [MYSQL_SETUP_BERKELEY_DB])
MYSQL_STORAGE_ENGINE(blackhole,,[Blackhole Storage Engine],
[Basic Write-only Read-never tables], [max,max-no-ndb])
MYSQL_PLUGIN_DIRECTORY(blackhole, [storage/blackhole])
MYSQL_PLUGIN_STATIC(blackhole, [libblackhole.a])
MYSQL_PLUGIN_DYNAMIC(blackhole, [ha_blackhole.la])
MYSQL_STORAGE_ENGINE(csv,, [CSV Storage Engine],
[Stores tables in text CSV format])
MYSQL_PLUGIN_DIRECTORY(csv, [storage/csv])
MYSQL_PLUGIN_STATIC(csv, [libcsv.a])
MYSQL_PLUGIN_MANDATORY(csv) dnl Used for logging
MYSQL_STORAGE_ENGINE(federated,,[Federated Storage Engine],
[Connects to tables on remote MySQL servers], [max,max-no-ndb])
MYSQL_PLUGIN(ftexample, [Simple Parser],
[Simple full-text parser plugin])
MYSQL_PLUGIN_DIRECTORY(ftexample, [plugin/fulltext])
MYSQL_PLUGIN_DYNAMIC(ftexample, [mypluglib.la])
MYSQL_STORAGE_ENGINE(heap,no, [Memory Storage Engine],
[Volatile memory based tables])
MYSQL_PLUGIN_DIRECTORY(heap, [storage/heap])
MYSQL_PLUGIN_STATIC(heap, [libheap.a])
MYSQL_PLUGIN_MANDATORY(heap) dnl Memory tables
MYSQL_STORAGE_ENGINE(innobase, innodb, [InnoDB Storage Engine],
[Transactional Tables using InnoDB], [max,max-no-ndb])
MYSQL_PLUGIN_DIRECTORY(innobase, [storage/innobase])
MYSQL_PLUGIN_STATIC(innobase, [libinnobase.a])
MYSQL_PLUGIN_ACTIONS(innobase, [
AC_CHECK_LIB(rt, aio_read, [innodb_system_libs="-lrt"])
AC_SUBST(innodb_system_libs)
])
MYSQL_STORAGE_ENGINE(myisam,no, [MyISAM Storage Engine],
[Traditional non-transactional MySQL tables])
MYSQL_PLUGIN_DIRECTORY(myisam, [storage/myisam])
MYSQL_PLUGIN_STATIC(myisam, [libmyisam.a])
MYSQL_PLUGIN_MANDATORY(myisam) dnl Default
MYSQL_STORAGE_ENGINE(myisammrg,no,[MyISAM MERGE Engine],
[Merge multiple MySQL tables into one])
MYSQL_PLUGIN_DIRECTORY(myisammrg,[storage/myisammrg])
MYSQL_PLUGIN_STATIC(myisammrg, [libmyisammrg.a])
MYSQL_PLUGIN_MANDATORY(myisammrg)
MYSQL_STORAGE_ENGINE(ndbcluster, ndbcluster, [Cluster Storage Engine],
[High Availability Clustered tables], [max])
MYSQL_PLUGIN_DIRECTORY(ndbcluster,[storage/ndb])
MYSQL_PLUGIN_STATIC(ndbcluster, [[\$(ndbcluster_libs) \$(ndbcluster_system_libs) \$(NDB_SCI_LIBS)]])
MYSQL_PLUGIN_ACTIONS(ndbcluster,[MYSQL_SETUP_NDBCLUSTER])
MYSQL_STORAGE_ENGINE(partition, partition, [Partition Support],
[MySQL Partitioning Support], [max,max-no-ndb])
dnl -- ndbcluster requires partition to be enabled
MYSQL_PLUGIN_DEPENDS(ndbcluster, [partition])
MYSQL_CONFIGURE_PLUGINS([none])
# Only build client code?
AC_ARG_WITH(server,
[ --without-server Only build the client.],
@ -2249,21 +2332,18 @@ fi
tools_dirs=""
AC_ARG_WITH([mysqlmanager],
AC_HELP_STRING([--with-mysqlmanager], [Build the mysqlmanager binary: yes/no (default: build if server is built.)]),
[if test "x${withval}" != "xno"; then
tools_dirs="$tools_dirs server-tools"
fi],
[if test "x${with_server}" = "xyes"; then
tools_dirs="$tools_dirs server-tools"
fi]
)
AC_HELP_STRING([--with-mysqlmanager], [Build the mysqlmanager binary: yes/no (default: build if server is built.)]),,)
if test "$with_mysqlmanager" = "yes" -o \
'(' "$with_mysqlmanager:$with_server" = ":yes" -a \
-d "$srcdir/server-tools" ')' ; then
tools_dirs="$tools_dirs server-tools"
AC_CONFIG_FILES(server-tools/Makefile server-tools/instance-manager/Makefile)
fi
AC_SUBST(tools_dirs)
#MYSQL_CHECK_CPU
MYSQL_CHECK_VIO
MYSQL_CHECK_OPENSSL
MYSQL_CHECK_YASSL
libmysqld_dirs=
linked_libmysqld_targets=
@ -2428,73 +2508,6 @@ AC_SUBST(readline_basedir)
AC_SUBST(readline_link)
AC_SUBST(readline_h_ln_cmd)
MYSQL_CHECK_BIG_TABLES
MYSQL_CHECK_MAX_INDEXES
MYSQL_CHECK_REPLICATION
MYSQL_STORAGE_ENGINE(innobase,,innodb,,,,innobase,ha_innodb.o,[ dnl
\$(top_builddir)/storage/innobase/usr/libusr.a dnl
\$(top_builddir)/storage/innobase/srv/libsrv.a dnl
\$(top_builddir)/storage/innobase/dict/libdict.a dnl
\$(top_builddir)/storage/innobase/que/libque.a dnl
\$(top_builddir)/storage/innobase/srv/libsrv.a dnl
\$(top_builddir)/storage/innobase/ibuf/libibuf.a dnl
\$(top_builddir)/storage/innobase/row/librow.a dnl
\$(top_builddir)/storage/innobase/pars/libpars.a dnl
\$(top_builddir)/storage/innobase/btr/libbtr.a dnl
\$(top_builddir)/storage/innobase/trx/libtrx.a dnl
\$(top_builddir)/storage/innobase/read/libread.a dnl
\$(top_builddir)/storage/innobase/usr/libusr.a dnl
\$(top_builddir)/storage/innobase/buf/libbuf.a dnl
\$(top_builddir)/storage/innobase/ibuf/libibuf.a dnl
\$(top_builddir)/storage/innobase/eval/libeval.a dnl
\$(top_builddir)/storage/innobase/log/liblog.a dnl
\$(top_builddir)/storage/innobase/fsp/libfsp.a dnl
\$(top_builddir)/storage/innobase/fut/libfut.a dnl
\$(top_builddir)/storage/innobase/fil/libfil.a dnl
\$(top_builddir)/storage/innobase/lock/liblock.a dnl
\$(top_builddir)/storage/innobase/mtr/libmtr.a dnl
\$(top_builddir)/storage/innobase/page/libpage.a dnl
\$(top_builddir)/storage/innobase/rem/librem.a dnl
\$(top_builddir)/storage/innobase/thr/libthr.a dnl
\$(top_builddir)/storage/innobase/sync/libsync.a dnl
\$(top_builddir)/storage/innobase/data/libdata.a dnl
\$(top_builddir)/storage/innobase/mach/libmach.a dnl
\$(top_builddir)/storage/innobase/ha/libha.a dnl
\$(top_builddir)/storage/innobase/dyn/libdyn.a dnl
\$(top_builddir)/storage/innobase/mem/libmem.a dnl
\$(top_builddir)/storage/innobase/sync/libsync.a dnl
\$(top_builddir)/storage/innobase/ut/libut.a dnl
\$(top_builddir)/storage/innobase/os/libos.a dnl
\$(top_builddir)/storage/innobase/ut/libut.a],[
AC_CHECK_LIB(rt, aio_read, [innodb_system_libs="-lrt"])
AC_SUBST(innodb_includes)
AC_SUBST(innodb_libs)
AC_SUBST(innodb_system_libs)
other_configures="$other_configures storage/innobase/configure"
])
MYSQL_STORAGE_ENGINE(berkeley,,berkeley-db,,,,bdb,,,[
MYSQL_SETUP_BERKELEY_DB
])
MYSQL_STORAGE_ENGINE(example,,,,,,example,no,
\$(top_builddir)/storage/example/libexample.a,[
AC_CONFIG_FILES(storage/example/Makefile)
])
MYSQL_STORAGE_ENGINE(archive,,,,,,archive,,
\$(top_builddir)/storage/archive/libarchive.a, [
AC_CONFIG_FILES(storage/archive/Makefile)
])
MYSQL_STORAGE_ENGINE(csv,,,"yes",,tina_hton,csv,no,
\$(top_builddir)/storage/csv/libcsv.a,[
AC_CONFIG_FILES(storage/csv/Makefile)
])
MYSQL_STORAGE_ENGINE(blackhole)
MYSQL_STORAGE_ENGINE(federated)
MYSQL_STORAGE_ENGINE(ndbcluster,,ndbcluster,,,,ndb,,,[
MYSQL_SETUP_NDBCLUSTER
])
MYSQL_STORAGE_ENGINE(partition,,partition)
# If we have threads generate some library functions and test programs
sql_server_dirs=
@ -2551,7 +2564,7 @@ then
AC_SUBST(THREAD_LOBJECTS)
server_scripts="mysqld_safe mysql_install_db"
sql_server_dirs="strings mysys dbug extra regex"
mysql_se_dirs="myisam myisammrg heap $mysql_se_dirs"
sql_server="$sql_server vio sql"
fi
@ -2567,12 +2580,9 @@ AC_SUBST(sql_server)
AC_SUBST(thread_dirs)
AC_SUBST(server_scripts)
AC_SUBST(mysql_se_dirs)
AC_SUBST(mysql_se_libs)
AC_SUBST(mysql_se_objs)
AC_SUBST(mysql_se_htons)
AC_SUBST(mysql_se_decls)
AC_SUBST(mysql_se_plugins)
AC_SUBST(mysql_plugin_dirs)
AC_SUBST(mysql_plugin_libs)
AC_SUBST(mysql_plugin_defs)
# Now that sql_client_dirs and sql_server_dirs are stable, determine the union.
@ -2614,25 +2624,18 @@ AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS)
# Output results
AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
unittest/Makefile dnl
unittest/mytap/Makefile unittest/mytap/t/Makefile dnl
unittest/Makefile unittest/mytap/Makefile unittest/mytap/t/Makefile dnl
unittest/mysys/Makefile unittest/examples/Makefile dnl
strings/Makefile regex/Makefile storage/Makefile storage/heap/Makefile dnl
storage/myisam/Makefile storage/myisammrg/Makefile dnl
strings/Makefile regex/Makefile storage/Makefile dnl
man/Makefile BUILD/Makefile vio/Makefile dnl
libmysql/Makefile client/Makefile dnl
pstack/Makefile pstack/aout/Makefile sql/Makefile sql/share/Makefile dnl
sql/handlerton.cc sql-common/Makefile dnl
dbug/Makefile scripts/Makefile dnl
include/Makefile dnl
server-tools/Makefile server-tools/instance-manager/Makefile dnl
sql/sql_builtin.cc sql-common/Makefile dnl
dbug/Makefile scripts/Makefile include/Makefile dnl
tests/Makefile Docs/Makefile support-files/Makefile dnl
support-files/MacOSX/Makefile mysql-test/Makefile dnl
mysql-test/ndb/Makefile netware/Makefile dnl
include/mysql_version.h dnl
plugin/Makefile dnl
plugin/fulltext/Makefile dnl
win/Makefile)
include/mysql_version.h plugin/Makefile win/Makefile)
AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
AC_OUTPUT

View file

@ -176,7 +176,7 @@ typedef struct my_charset_handler_st
uint (*lengthsp)(struct charset_info_st *, const char *ptr, uint length);
uint (*numcells)(struct charset_info_st *, const char *b, const char *e);
/* Unicode convertion */
/* Unicode conversion */
int (*mb_wc)(struct charset_info_st *cs,my_wc_t *wc,
const unsigned char *s,const unsigned char *e);
int (*wc_mb)(struct charset_info_st *cs,my_wc_t wc,
@ -186,7 +186,7 @@ typedef struct my_charset_handler_st
int (*ctype)(struct charset_info_st *cs, int *ctype,
const unsigned char *s, const unsigned char *e);
/* Functions for case and sort convertion */
/* Functions for case and sort conversion */
void (*caseup_str)(struct charset_info_st *, char *);
void (*casedn_str)(struct charset_info_st *, char *);
uint (*caseup)(struct charset_info_st *, char *src, uint srclen,
@ -204,7 +204,7 @@ typedef struct my_charset_handler_st
void (*fill)(struct charset_info_st *, char *to, uint len, int fill);
/* String-to-number convertion routines */
/* String-to-number conversion routines */
long (*strntol)(struct charset_info_st *, const char *s, uint l,
int base, char **e, int *err);
ulong (*strntoul)(struct charset_info_st *, const char *s, uint l,

View file

@ -231,6 +231,7 @@ enum ha_base_keytype {
#define HA_VAR_LENGTH_KEY 8
#define HA_NULL_PART_KEY 64
#define HA_USES_PARSER 16384 /* Fulltext index uses [pre]parser */
#define HA_USES_BLOCK_SIZE ((uint) 32768)
#define HA_SORT_ALLOWS_SAME 512 /* Intern bit when sorting records */
/*
Key has a part that can have end space. If this is an unique key

View file

@ -558,6 +558,7 @@ extern File my_open(const char *FileName,int Flags,myf MyFlags);
extern File my_register_filename(File fd, const char *FileName,
enum file_type type_of_file,
uint error_message_number, myf MyFlags);
extern void my_print_open_files(void);
extern File my_create(const char *FileName,int CreateFlags,
int AccessFlags, myf MyFlags);
extern int my_close(File Filedes,myf MyFlags);
@ -601,6 +602,11 @@ extern char *_my_strndup(const byte *from, uint length,
const char *sFile, uint uLine,
myf MyFlag);
/* implemented in my_memmem.c */
extern void *my_memmem(const void *haystack, size_t haystacklen,
const void *needle, size_t needlelen);
#ifdef __WIN__
extern int my_access(const char *path, int amode);
extern File my_sopen(const char *path, int oflag, int shflag, int pmode);
@ -642,6 +648,12 @@ extern void allow_break(void);
#define allow_break()
#endif
#ifdef EXTRA_DEBUG
void my_print_open_files();
#else
#define my_print_open_files()
#endif
extern my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist);
extern char *my_tmpdir(MY_TMPDIR *tmpdir);
extern void free_tmpdir(MY_TMPDIR *tmpdir);
@ -812,6 +824,7 @@ extern int unpackfrm(const void **, uint *, const void *);
extern ha_checksum my_checksum(ha_checksum crc, const byte *mem, uint count);
extern uint my_bit_log2(ulong value);
extern uint32 my_round_up_to_next_power(uint32 v);
extern uint my_count_bits(ulonglong v);
extern uint my_count_bits_ushort(ushort v);
extern void my_sleep(ulong m_seconds);

View file

@ -84,7 +84,7 @@ TREE_ELEMENT *tree_insert(TREE *tree,void *key, uint key_size,
void *tree_search(TREE *tree, void *key, void *custom_arg);
int tree_walk(TREE *tree,tree_walk_action action,
void *argument, TREE_WALK visit);
int tree_delete(TREE *tree, void *key, void *custom_arg);
int tree_delete(TREE *tree, void *key, uint key_size, void *custom_arg);
void *tree_search_key(TREE *tree, const void *key,
TREE_ELEMENT **parents, TREE_ELEMENT ***last_pos,
enum ha_rkey_function flag, void *custom_arg);

View file

@ -192,7 +192,7 @@ typedef struct st_mi_keydef /* Key definition with open & info */
uint16 keylength; /* Tot length of keyparts (auto) */
uint16 minlength; /* min length of (packed) key (auto) */
uint16 maxlength; /* max length of (packed) key (auto) */
uint16 block_size; /* block_size (auto) */
uint16 block_size_index; /* block_size (auto) */
uint32 version; /* For concurrent read/write */
uint32 ftparser_nr; /* distinct ftparser number */

View file

@ -37,10 +37,25 @@
be a st_mysql_plugin struct for each plugin to be declared.
*/
#define mysql_declare_plugin \
int _mysql_plugin_interface_version_= MYSQL_PLUGIN_INTERFACE_VERSION; \
int _mysql_sizeof_struct_st_plugin_= sizeof(struct st_mysql_plugin); \
#ifndef MYSQL_DYNAMIC_PLUGIN
#define __MYSQL_DECLARE_PLUGIN(NAME, VERSION, PSIZE, DECLS) \
int VERSION= MYSQL_PLUGIN_INTERFACE_VERSION; \
int PSIZE= sizeof(struct st_mysql_plugin); \
struct st_mysql_plugin DECLS[]= {
#else
#define __MYSQL_DECLARE_PLUGIN(NAME, VERSION, PSIZE, DECLS) \
int _mysql_plugin_interface_version_= MYSQL_PLUGIN_INTERFACE_VERSION; \
int _mysql_sizeof_struct_st_plugin_= sizeof(struct st_mysql_plugin); \
struct st_mysql_plugin _mysql_plugin_declarations_[]= {
#endif
#define mysql_declare_plugin(NAME) \
__MYSQL_DECLARE_PLUGIN(NAME, \
builtin_ ## NAME ## _plugin_interface_version, \
builtin_ ## NAME ## _sizeof_struct_st_plugin, \
builtin_ ## NAME ## _plugin)
#define mysql_declare_plugin_end ,{0,0,0,0,0,0,0,0,0}}
/*

View file

@ -62,7 +62,8 @@ extern const char * NEAR globerrs[]; /* my_error_messages is here */
#define EE_SYNC 27
#define EE_UNKNOWN_COLLATION 28
#define EE_FILENOTFOUND 29
#define EE_ERROR_LAST 29 /*Copy last error nr.*/
#define EE_FILE_NOT_CLOSED 30
#define EE_ERROR_LAST 30 /* Copy last error nr */
/* Add error numbers before EE_ERROR_LAST and change it accordingly. */
/* exit codes for all MySQL programs */

View file

@ -132,6 +132,7 @@ struct st_VioSSLAcceptorFd
const char *ca_file,const char *ca_path,
const char *cipher);
Vio *new_VioSSL(struct st_VioSSLAcceptorFd *fd, Vio *sd, int state);
void free_vio_ssl_acceptor_fd(struct st_VioSSLAcceptorFd *fd);
#endif /* HAVE_OPENSSL */
#ifdef HAVE_SMEM

View file

@ -44,7 +44,10 @@ libmysqlsources = errmsg.c get_password.c libmysql.c client.c pack.c \
noinst_HEADERS = embedded_priv.h emb_qcache.h
sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
ha_heap.cc ha_myisam.cc ha_myisammrg.cc handler.cc sql_handler.cc \
ha_heap.cc ha_myisam.cc ha_myisammrg.cc \
ha_innodb.cc ha_berkeley.cc ha_federated.cc ha_ndbcluster.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 \
@ -65,17 +68,12 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.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 \
event_executor.cc event.cc event_timed.cc \
rpl_filter.cc sql_partition.cc handlerton.cc sql_plugin.cc \
sql_tablespace.cc \
rpl_injector.cc my_user.c partition_info.cc
event_executor.cc event.cc event_timed.cc \
rpl_filter.cc sql_partition.cc sql_builtin.cc sql_plugin.cc \
sql_tablespace.cc \
rpl_injector.cc my_user.c partition_info.cc
libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources)
EXTRA_libmysqld_a_SOURCES = ha_innodb.cc ha_berkeley.cc ha_archive.cc \
ha_blackhole.cc ha_federated.cc ha_ndbcluster.cc \
ha_ndbcluster_binlog.cc \
ha_partition.cc
libmysqld_a_DEPENDENCIES= @mysql_se_objs@
libmysqld_a_SOURCES=
sqlstoragesources = $(EXTRA_libmysqld_a_SOURCES)
@ -85,15 +83,11 @@ 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)/storage/myisam/libmyisam.a \
$(top_builddir)/storage/myisammrg/libmyisammrg.a \
$(top_builddir)/storage/archive/libarchive.a \
$(top_builddir)/storage/heap/libheap.a \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/strings/libmystrings.a \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/vio/libvio.a \
@mysql_se_libs@ \
@mysql_plugin_libs@ \
$(yassl_las)
if HAVE_YASSL

View file

@ -17,3 +17,8 @@ OPTIMIZE TABLE non_existing;
sync_slave_with_master;
# End of 4.1 tests
connection master;
select * from t1;
commit;
drop table t1;

View file

@ -5,6 +5,8 @@ show variables like "have_ndbcluster";
enable_query_log;
# Check that NDB is installed and known to be working
# This will disable ndb from the shell script 'mysql-test-run'
-- require r/have_ndb_status_ok.require
disable_query_log;
eval select "$NDB_STATUS_OK" as ndb_status_ok;

View file

@ -157,6 +157,7 @@ sub mtr_report_stats ($) {
my $tot_passed= 0;
my $tot_failed= 0;
my $tot_tests= 0;
my $found_problems= 0; # Some warnings are errors...
foreach my $tinfo (@$tests)
{
@ -214,10 +215,11 @@ sub mtr_report_stats ($) {
}
else
{
my $found_problems= 0; # Some warnings are errors...
# We report different types of problems in order
foreach my $pattern ( "^Warning:", "^Error:", "^==.* at 0x" )
foreach my $pattern ( "^Warning:", "^Error:", "^==.* at 0x",
"InnoDB: Warning", "missing DBUG_RETURN",
"mysqld: Warning",
"Attempting backtrace", "Assertion .* failed" )
{
foreach my $errlog ( sort glob("$::opt_vardir/log/*.err") )
{
@ -231,7 +233,8 @@ sub mtr_report_stats ($) {
# Skip some non fatal warnings from the log files
if ( /Warning:\s+Table:.* on (delete|rename)/ or
/Warning:\s+Setting lower_case_table_names=2/ or
/Warning:\s+One can only use the --user.*root/ )
/Warning:\s+One can only use the --user.*root/ or
/InnoDB: Warning: we did not need to do crash recovery/)
{
next; # Skip these lines
}
@ -242,11 +245,11 @@ sub mtr_report_stats ($) {
}
}
}
if ( $found_problems )
{
mtr_warning("Got errors/warnings while running tests, please examine",
"\"$warnlog\" for details.");
}
}
if ( $found_problems )
{
mtr_warning("Got errors/warnings while running tests, please examine",
"\"$warnlog\" for details.");
}
}
}
@ -266,6 +269,9 @@ sub mtr_report_stats ($) {
}
}
print "\n";
}
if ( $tot_failed != 0 || $found_problems)
{
mtr_error("there where failing test cases");
}
}

View file

@ -1224,17 +1224,20 @@ sub environment_setup () {
$ENV{MTR_BUILD_THREAD}= 0 unless $ENV{MTR_BUILD_THREAD}; # Set if not set
# We are nice and report a bit about our settings
print "Using MTR_BUILD_THREAD = $ENV{MTR_BUILD_THREAD}\n";
print "Using MASTER_MYPORT = $ENV{MASTER_MYPORT}\n";
print "Using MASTER_MYPORT1 = $ENV{MASTER_MYPORT1}\n";
print "Using SLAVE_MYPORT = $ENV{SLAVE_MYPORT}\n";
print "Using SLAVE_MYPORT1 = $ENV{SLAVE_MYPORT1}\n";
print "Using SLAVE_MYPORT2 = $ENV{SLAVE_MYPORT2}\n";
print "Using NDBCLUSTER_PORT = $ENV{NDBCLUSTER_PORT}\n";
print "Using NDBCLUSTER_PORT_SLAVE = $ENV{NDBCLUSTER_PORT_SLAVE}\n";
print "Using IM_PORT = $ENV{IM_PORT}\n";
print "Using IM_MYSQLD1_PORT = $ENV{IM_MYSQLD1_PORT}\n";
print "Using IM_MYSQLD2_PORT = $ENV{IM_MYSQLD2_PORT}\n";
if (!$opt_extern)
{
print "Using MTR_BUILD_THREAD = $ENV{MTR_BUILD_THREAD}\n";
print "Using MASTER_MYPORT = $ENV{MASTER_MYPORT}\n";
print "Using MASTER_MYPORT1 = $ENV{MASTER_MYPORT1}\n";
print "Using SLAVE_MYPORT = $ENV{SLAVE_MYPORT}\n";
print "Using SLAVE_MYPORT1 = $ENV{SLAVE_MYPORT1}\n";
print "Using SLAVE_MYPORT2 = $ENV{SLAVE_MYPORT2}\n";
print "Using NDBCLUSTER_PORT = $ENV{NDBCLUSTER_PORT}\n";
print "Using NDBCLUSTER_PORT_SLAVE = $ENV{NDBCLUSTER_PORT_SLAVE}\n";
print "Using IM_PORT = $ENV{IM_PORT}\n";
print "Using IM_MYSQLD1_PORT = $ENV{IM_MYSQLD1_PORT}\n";
print "Using IM_MYSQLD2_PORT = $ENV{IM_MYSQLD2_PORT}\n";
}
}
@ -1399,7 +1402,7 @@ sub check_running_as_root () {
sub check_ssl_support () {
if ($opt_skip_ssl)
if ($opt_skip_ssl || $opt_extern)
{
mtr_report("Skipping SSL");
$opt_ssl_supported= 0;
@ -1857,7 +1860,7 @@ sub mysql_install_db () {
}
}
if ( ndbcluster_install_slave() )
if ( $use_slaves and ndbcluster_install_slave() )
{
if ( $opt_force)
{

View file

@ -205,6 +205,7 @@ TOT_SKIP=0
TOT_PASS=0
TOT_FAIL=0
TOT_TEST=0
GOT_WARNINGS=0
USERT=0
SYST=0
REALT=0
@ -1072,22 +1073,21 @@ report_stats () {
#
$RM -f $MY_LOG_DIR/warnings $MY_LOG_DIR/warnings.tmp
# Remove some non fatal warnings from the log files
$SED -e 's!Warning: Table:.* on delete!!g' -e 's!Warning: Setting lower_case_table_names=2!!g' -e 's!Warning: One can only use the --user.*root!!g' \
$SED -e 's!Warning: Table:.* on delete!!g' -e 's!Warning: Setting lower_case_table_names=2!!g' -e 's!Warning: One can only use the --user.*root!!g' -e 's|InnoDB: Warning: we did not need to do crash recovery||g' \
$MY_LOG_DIR/*.err \
| $SED -e 's!Warning: Table:.* on rename!!g' \
> $MY_LOG_DIR/warnings.tmp
found_error=0
# Find errors
for i in "^Warning:" "^Error:" "^==.* at 0x" "InnoDB: Warning" "missing DBUG_RETURN"
for i in "^Warning:" "^Error:" "^==.* at 0x" "InnoDB: Warning" "missing DBUG_RETURN" "mysqld: Warning" "Attempting backtrace" "Assertion .* failed"
do
if $GREP "$i" $MY_LOG_DIR/warnings.tmp >> $MY_LOG_DIR/warnings
then
found_error=1
GOT_WARNINGS=1
fi
done
$RM -f $MY_LOG_DIR/warnings.tmp
if [ $found_error = "1" ]
if [ $GOT_WARNINGS = "1" ]
then
echo "WARNING: Got errors/warnings while running tests. Please examine"
echo "$MY_LOG_DIR/warnings for details."
@ -2300,6 +2300,8 @@ if [ $TOT_FAIL -ne 0 ]; then
$ECHO "mysql-test-run in $TEST_MODE mode: *** Failing the test(s):$FAILED_CASES"
$ECHO
exit 1
else
exit 0
fi
if [ $GOT_WARNINGS -ne 0 ]; then
exit 1
fi
exit 0

View file

@ -46,4 +46,12 @@ Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_
execute stmt1;
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
deallocate prepare stmt1;
create temporary table t1(a int, index(a));
insert into t1 values('1'),('2'),('3'),('4'),('5');
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
show index from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 1 a 1 a A 5 NULL NULL YES BTREE
drop table t1;

View file

@ -186,8 +186,8 @@ a b a b a b
explain select * from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
1 SIMPLE t2 index PRIMARY PRIMARY 8 NULL 3 Using where; Using index
1 SIMPLE t3 index PRIMARY PRIMARY 8 NULL 3 Using where; Using index
1 SIMPLE t2 ref PRIMARY PRIMARY 4 test.t1.a 1 Using index
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 8 test.t2.b,test.t1.b 1 Using index
delete t2.*,t3.* from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b;
select * from t3;
a b

View file

@ -1,3 +1,5 @@
drop database if exists events_test;
drop database if exists events_test2;
drop table if exists t1;
CREATE TABLE t1 (
Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,

View file

@ -246,3 +246,13 @@ DELETE from t1 where a < 100;
SELECT * from t1;
a
DROP TABLE t1;
CREATE TABLE t1(val INT, KEY USING BTREE(val)) ENGINE=memory;
INSERT INTO t1 VALUES(0);
SELECT INDEX_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME='t1';
INDEX_LENGTH
21
UPDATE t1 SET val=1;
SELECT INDEX_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME='t1';
INDEX_LENGTH
21
DROP TABLE t1;

View file

@ -760,6 +760,7 @@ information_schema PARTITIONS PARTITION_EXPRESSION
information_schema PARTITIONS SUBPARTITION_EXPRESSION
information_schema PARTITIONS PARTITION_DESCRIPTION
information_schema PLUGINS PLUGIN_DESCRIPTION
information_schema PROCESSLIST INFO
information_schema ROUTINES ROUTINE_DEFINITION
information_schema ROUTINES SQL_MODE
information_schema TRIGGERS ACTION_CONDITION

View file

@ -3455,3 +3455,12 @@ SELECT p0.a FROM t2 p0 WHERE BINARY p0.b = 'customer_over';
a
1
drop table t2, t1;
create table t1 (g geometry not null, spatial gk(g)) engine=innodb;
ERROR HY000: The used table type doesn't support SPATIAL indexes
CREATE TABLE t1 ( a int ) ENGINE=innodb;
BEGIN;
INSERT INTO t1 VALUES (1);
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
DROP TABLE t1;

View file

@ -0,0 +1,13 @@
drop table if exists t1,t2;
create table t1 (a int) engine=myisam;
drop table if exists t1;
Warnings:
Error 2 Can't find file: 't1' (errno: 2)
create table t1 (a int) engine=myisam;
drop table t1;
Got one of the listed errors
create table t1 (a int) engine=myisam;
drop table t1;
Got one of the listed errors
drop table t1;
ERROR 42S02: Unknown table 't1'

View file

@ -1344,18 +1344,6 @@ drop table t1;
create table t1 (v varchar(65535));
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs
set storage_engine=MyISAM;
create table t1 (a int) engine=myisam;
drop table if exists t1;
Warnings:
Error 2 Can't find file: 't1' (errno: 2)
create table t1 (a int) engine=myisam;
drop table t1;
Got one of the listed errors
create table t1 (a int) engine=myisam;
drop table t1;
Got one of the listed errors
drop table t1;
ERROR 42S02: Unknown table 't1'
set @save_concurrent_insert=@@concurrent_insert;
set global concurrent_insert=1;
create table t1 (a int);
@ -1433,3 +1421,149 @@ create table t3 (c1 int) engine=myisam pack_keys=default;
create table t4 (c1 int) engine=myisam pack_keys=2;
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 '2' at line 1
drop table t1, t2, t3;
create table t1 (a int not null, key `a` (a) key_block_size=1024);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
KEY `a` (`a`) KEY_BLOCK_SIZE=1024
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a int not null, key `a` (a) key_block_size=2048);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
KEY `a` (`a`) KEY_BLOCK_SIZE=2048
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a varchar(2048), key `a` (a));
Warnings:
Warning 1071 Specified key was too long; max key length is 1000 bytes
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(2048) DEFAULT NULL,
KEY `a` (`a`(1000))
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a varchar(2048), key `a` (a) key_block_size=1024);
Warnings:
Warning 1071 Specified key was too long; max key length is 1000 bytes
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(2048) DEFAULT NULL,
KEY `a` (`a`(1000)) KEY_BLOCK_SIZE=4096
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a int not null, b varchar(2048), key (a), key(b)) key_block_size=1024;
Warnings:
Warning 1071 Specified key was too long; max key length is 1000 bytes
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` varchar(2048) DEFAULT NULL,
KEY `a` (`a`),
KEY `b` (`b`(1000)) KEY_BLOCK_SIZE=4096
) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1024
alter table t1 key_block_size=2048;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` varchar(2048) DEFAULT NULL,
KEY `a` (`a`) KEY_BLOCK_SIZE=1024,
KEY `b` (`b`(1000)) KEY_BLOCK_SIZE=4096
) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=2048
alter table t1 add c int, add key (c);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` varchar(2048) DEFAULT NULL,
`c` int(11) DEFAULT NULL,
KEY `a` (`a`) KEY_BLOCK_SIZE=1024,
KEY `b` (`b`(1000)) KEY_BLOCK_SIZE=4096,
KEY `c` (`c`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=2048
alter table t1 key_block_size=0;
alter table t1 add d int, add key (d);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` varchar(2048) DEFAULT NULL,
`c` int(11) DEFAULT NULL,
`d` int(11) DEFAULT NULL,
KEY `a` (`a`) KEY_BLOCK_SIZE=1024,
KEY `b` (`b`(1000)) KEY_BLOCK_SIZE=4096,
KEY `c` (`c`) KEY_BLOCK_SIZE=2048,
KEY `d` (`d`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a int not null, b varchar(2048), key (a), key(b)) key_block_size=8192;
Warnings:
Warning 1071 Specified key was too long; max key length is 1000 bytes
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` varchar(2048) DEFAULT NULL,
KEY `a` (`a`),
KEY `b` (`b`(1000))
) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=8192
drop table t1;
create table t1 (a int not null, b varchar(2048), key (a) key_block_size=1024, key(b)) key_block_size=8192;
Warnings:
Warning 1071 Specified key was too long; max key length is 1000 bytes
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` varchar(2048) DEFAULT NULL,
KEY `a` (`a`) KEY_BLOCK_SIZE=1024,
KEY `b` (`b`(1000))
) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=8192
drop table t1;
create table t1 (a int not null, b int, key (a) key_block_size=1024, key(b) key_block_size=8192) key_block_size=16384;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` int(11) DEFAULT NULL,
KEY `a` (`a`) KEY_BLOCK_SIZE=1024,
KEY `b` (`b`) KEY_BLOCK_SIZE=8192
) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=16384
drop table t1;
create table t1 (a int not null, key `a` (a) key_block_size=512);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
KEY `a` (`a`) KEY_BLOCK_SIZE=1024
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a varchar(2048), key `a` (a) key_block_size=1000000000000000000);
Warnings:
Warning 1071 Specified key was too long; max key length is 1000 bytes
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(2048) DEFAULT NULL,
KEY `a` (`a`(1000)) KEY_BLOCK_SIZE=4096
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a int not null, key `a` (a) key_block_size=1025);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
KEY `a` (`a`) KEY_BLOCK_SIZE=2048
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a int not null, key key_block_size=1024 (a));
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 '=1024 (a))' at line 1
create table t1 (a int not null, key `a` key_block_size=1024 (a));
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 'key_block_size=1024 (a))' at line 1

View file

@ -3,13 +3,14 @@ drop database if exists mysqldump_test_db;
drop database if exists db1;
drop database if exists db2;
drop view if exists v1, v2, v3;
CREATE TABLE t1(a int);
CREATE TABLE t1(a int, key (a)) key_block_size=1024;
INSERT INTO t1 VALUES (1), (2);
<?xml version="1.0"?>
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="test">
<table_structure name="t1">
<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
<field Field="a" Type="int(11)" Null="YES" Key="MUL" Extra="" />
<key Table="t1" Non_unique="1" Key_name="a" Seq_in_index="1" Column_name="a" Collation="A" Null="YES" Index_type="BTREE" Comment="" />
</table_structure>
<table_data name="t1">
<row>

View file

@ -286,3 +286,45 @@ unique key tx1 (c002, c003, c004, c005)) engine=ndb;
create index tx2
on t1 (c010, c011, c012, c013);
drop table t1;
CREATE TABLE t1 (
auto int(5) unsigned NOT NULL auto_increment,
string char(10),
vstring varchar(10),
bin binary(2),
vbin varbinary(7),
tiny tinyint(4) DEFAULT '0' NOT NULL ,
short smallint(6) DEFAULT '1' NOT NULL ,
medium mediumint(8) DEFAULT '0' NOT NULL,
long_int int(11) DEFAULT '0' NOT NULL,
longlong bigint(13) DEFAULT '0' NOT NULL,
real_float float(13,1) DEFAULT 0.0 NOT NULL,
real_double double(16,4),
real_decimal decimal(16,4),
utiny tinyint(3) unsigned DEFAULT '0' NOT NULL,
ushort smallint(5) unsigned zerofill DEFAULT '00000' NOT NULL,
umedium mediumint(8) unsigned DEFAULT '0' NOT NULL,
ulong int(11) unsigned DEFAULT '0' NOT NULL,
ulonglong bigint(13) unsigned DEFAULT '0' NOT NULL,
bits bit(3),
options enum('zero','one','two','three','four') not null,
flags set('zero','one','two','three','four') not null,
date_field date,
year_field year,
time_field time,
date_time datetime,
time_stamp timestamp,
PRIMARY KEY (auto)
) engine=ndb;
CREATE TEMPORARY TABLE ndb_show_tables (id INT, type VARCHAR(20), state VARCHAR(20), logging VARCHAR(20), _database VARCHAR(255), _schema VARCHAR(20), name VARCHAR(255));
LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
set @t1_id = (select id from ndb_show_tables where name like '%t1%');
truncate ndb_show_tables;
alter table t1 change tiny new_tiny tinyint(4) DEFAULT '0' NOT NULL;
create index i1 on t1(medium);
alter table t1 add index i2(long_int);
drop index i1 on t1;
LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
select 'no_copy' from ndb_show_tables where id = @t1_id and name like '%t1%';
no_copy
no_copy
DROP TABLE t1, ndb_show_tables;

View file

@ -1,29 +0,0 @@
DROP TABLE IF EXISTS t1;
create table t1 ( a int primary key, b varchar(10), c varchar(10), index (b) )
engine=ndb;
insert into t1 values (1,'one','one'), (2,'two','two'), (3,'three','three');
create index c on t1(c);
select * from t1 where c = 'two';
a b c
2 two two
alter table t1 drop index c;
select * from t1 where c = 'two';
select * from t1 where c = 'two';
a b c
2 two two
drop table t1;
create table t3 (a int primary key) engine=ndbcluster;
begin;
insert into t3 values (1);
alter table t3 rename t4;
delete from t3;
insert into t3 values (1);
commit;
select * from t3;
ERROR HY000: Can't lock file (errno: 155)
select * from t4;
a
1
drop table t4;
show tables;
Tables_in_test

View file

@ -6,6 +6,13 @@ attr1 INT NOT NULL,
attr2 INT,
attr3 VARCHAR(10)
) ENGINE=ndbcluster;
drop table t1;
CREATE TABLE t1 (
pk1 INT NOT NULL PRIMARY KEY,
attr1 INT NOT NULL,
attr2 INT,
attr3 VARCHAR(10)
) ENGINE=ndbcluster;
SHOW INDEX FROM t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 0 PRIMARY 1 pk1 A 0 NULL NULL BTREE

View file

@ -481,14 +481,22 @@ msg text NOT NULL
insert into t1 (msg) values(
'Tries to validate (8 byte length + inline bytes) as UTF8 :(
Fast fix: removed validation for Text. It is not yet indexable
so bad data will not crash kernel.
Proper fix: Set inline bytes to multiple of mbmaxlen and
validate it (after the 8 byte length).');
so bad data will not crash kernel.');
select * from t1;
id msg
1 Tries to validate (8 byte length + inline bytes) as UTF8 :(
Fast fix: removed validation for Text. It is not yet indexable
so bad data will not crash kernel.
Proper fix: Set inline bytes to multiple of mbmaxlen and
validate it (after the 8 byte length).
drop table t1;
create table t1 (
a int primary key not null auto_increment,
b text
) engine=ndbcluster;
select count(*) from t1;
count(*)
500
truncate t1;
select count(*) from t1;
count(*)
0
drop table t1;

View file

@ -8,4 +8,3 @@ ndbd,1,localhost,52428800,26214400 ndbd,2,localhost,52428800,36700160 ndbd,3,loc
ndbd,1,localhost ndbd,2,localhost ndbd,3,localhost ndbd,4,localhost ndb_mgmd,5,localhost mysqld,6, mysqld,7, mysqld,8, mysqld,9, mysqld,10,
ndbd,2,localhost ndbd,3,localhost ndbd,4,localhost ndbd,5,localhost ndb_mgmd,6,localhost mysqld,1, mysqld,7, mysqld,8, mysqld,9, mysqld,10,
ndbd,3,localhost ndbd,4,localhost ndbd,5,localhost ndbd,6,localhost ndb_mgmd,1,localhost ndb_mgmd,2,localhost mysqld,11, mysqld,12, mysqld,13, mysqld,14, mysqld,15,
shm,3,4,35,3 shm,3,5,35,3 shm,3,6,35,3 shm,4,5,35,4 shm,4,6,35,4 shm,5,6,35,5 tcp,11,3,55,3 tcp,11,4,55,4 tcp,11,5,55,5 tcp,11,6,55,6 tcp,12,3,55,3 tcp,12,4,55,4 tcp,12,5,55,5 tcp,12,6,55,6 tcp,13,3,55,3 tcp,13,4,55,4 tcp,13,5,55,5 tcp,13,6,55,6 tcp,14,3,55,3 tcp,14,4,55,4 tcp,14,5,55,5 tcp,14,6,55,6 tcp,15,3,55,3 tcp,15,4,55,4 tcp,15,5,55,5 tcp,15,6,55,6 tcp,1,3,55,1 tcp,1,4,55,1 tcp,1,5,55,1 tcp,1,6,55,1 tcp,2,3,55,2 tcp,2,4,55,2 tcp,2,5,55,2 tcp,2,6,55,2

View file

@ -0,0 +1 @@
shm,3,4,35,3 shm,3,5,35,3 shm,3,6,35,3 shm,4,5,35,4 shm,4,6,35,4 shm,5,6,35,5 tcp,11,3,55,3 tcp,11,4,55,4 tcp,11,5,55,5 tcp,11,6,55,6 tcp,12,3,55,3 tcp,12,4,55,4 tcp,12,5,55,5 tcp,12,6,55,6 tcp,13,3,55,3 tcp,13,4,55,4 tcp,13,5,55,5 tcp,13,6,55,6 tcp,14,3,55,3 tcp,14,4,55,4 tcp,14,5,55,5 tcp,14,6,55,6 tcp,15,3,55,3 tcp,15,4,55,4 tcp,15,5,55,5 tcp,15,6,55,6 tcp,1,3,55,1 tcp,1,4,55,1 tcp,1,5,55,1 tcp,1,6,55,1 tcp,2,3,55,2 tcp,2,4,55,2 tcp,2,5,55,2 tcp,2,6,55,2

View file

@ -5,20 +5,20 @@ INITIAL_SIZE 16M
UNDO_BUFFER_SIZE = 1M
ENGINE=MYISAM;
Warnings:
Error 1539 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
Error 1465 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
ALTER LOGFILE GROUP lg1
ADD UNDOFILE 'undofile02.dat'
INITIAL_SIZE = 4M
ENGINE=XYZ;
Warnings:
Error 1266 Using storage engine MyISAM for table 'lg1'
Error 1539 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
Error 1465 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
CREATE TABLESPACE ts1
ADD DATAFILE 'datafile.dat'
USE LOGFILE GROUP lg1
INITIAL_SIZE 12M;
Warnings:
Error 1539 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
Error 1465 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
set storage_engine=ndb;
CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'

View file

@ -16,7 +16,7 @@ ERROR HY000: Failed to create LOGFILE GROUP
SHOW WARNINGS;
Level Code Message
Error 1296 Got error 1514 'Currently there is a limit of one logfile group' from NDB
Error 1507 Failed to create LOGFILE GROUP
Error 1515 Failed to create LOGFILE GROUP
CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'
INITIAL_SIZE 16M

View file

@ -62,4 +62,6 @@ t4
drop table t1, t2, t3, t4;
drop table if exists t1, t3, t4;
Warnings:
Error 155 Table 'test.t1' doesn't exist
Error 155 Table 'test.t3' doesn't exist
Error 155 Table 'test.t4' doesn't exist

View file

@ -1056,3 +1056,104 @@ a b
1 9
3 7
drop table t1;
create table t1 (a int);
create table t2 like t1;
create table t3 like t2;
prepare stmt from "repair table t1";
execute stmt;
Table Op Msg_type Msg_text
test.t1 repair status OK
execute stmt;
Table Op Msg_type Msg_text
test.t1 repair status OK
prepare stmt from "optimize table t1";
execute stmt;
Table Op Msg_type Msg_text
test.t1 optimize status OK
execute stmt;
Table Op Msg_type Msg_text
test.t1 optimize status Table is already up to date
prepare stmt from "analyze table t1";
execute stmt;
Table Op Msg_type Msg_text
test.t1 analyze status Table is already up to date
execute stmt;
Table Op Msg_type Msg_text
test.t1 analyze status Table is already up to date
prepare stmt from "repair table t1, t2, t3";
execute stmt;
Table Op Msg_type Msg_text
test.t1 repair status OK
test.t2 repair status OK
test.t3 repair status OK
execute stmt;
Table Op Msg_type Msg_text
test.t1 repair status OK
test.t2 repair status OK
test.t3 repair status OK
prepare stmt from "optimize table t1, t2, t3";
execute stmt;
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t2 optimize status OK
test.t3 optimize status OK
execute stmt;
Table Op Msg_type Msg_text
test.t1 optimize status Table is already up to date
test.t2 optimize status Table is already up to date
test.t3 optimize status Table is already up to date
prepare stmt from "analyze table t1, t2, t3";
execute stmt;
Table Op Msg_type Msg_text
test.t1 analyze status Table is already up to date
test.t2 analyze status Table is already up to date
test.t3 analyze status Table is already up to date
execute stmt;
Table Op Msg_type Msg_text
test.t1 analyze status Table is already up to date
test.t2 analyze status Table is already up to date
test.t3 analyze status Table is already up to date
prepare stmt from "repair table t1, t4, t3";
execute stmt;
Table Op Msg_type Msg_text
test.t1 repair status OK
test.t4 repair error Table 'test.t4' doesn't exist
test.t3 repair status OK
Warnings:
Error 1146 Table 'test.t4' doesn't exist
execute stmt;
Table Op Msg_type Msg_text
test.t1 repair status OK
test.t4 repair error Table 'test.t4' doesn't exist
test.t3 repair status OK
Warnings:
Error 1146 Table 'test.t4' doesn't exist
prepare stmt from "optimize table t1, t3, t4";
execute stmt;
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t3 optimize status OK
test.t4 optimize error Table 'test.t4' doesn't exist
Warnings:
Error 1146 Table 'test.t4' doesn't exist
execute stmt;
Table Op Msg_type Msg_text
test.t1 optimize status Table is already up to date
test.t3 optimize status Table is already up to date
test.t4 optimize error Table 'test.t4' doesn't exist
Warnings:
Error 1146 Table 'test.t4' doesn't exist
prepare stmt from "analyze table t4, t1";
execute stmt;
Table Op Msg_type Msg_text
test.t4 analyze error Table 'test.t4' doesn't exist
test.t1 analyze status Table is already up to date
Warnings:
Error 1146 Table 'test.t4' doesn't exist
execute stmt;
Table Op Msg_type Msg_text
test.t4 analyze error Table 'test.t4' doesn't exist
test.t1 analyze status Table is already up to date
Warnings:
Error 1146 Table 'test.t4' doesn't exist
deallocate prepare stmt;

View file

@ -410,13 +410,10 @@ ERROR HY000: This command is not supported in the prepared statement protocol ye
prepare stmt1 from ' select * into outfile ''data.txt'' from t1 ';
execute stmt1 ;
prepare stmt1 from ' optimize table t1 ' ;
ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt1 from ' analyze table t1 ' ;
ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt1 from ' checksum table t1 ' ;
ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt1 from ' repair table t1 ' ;
ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt1 from ' restore table t1 from ''data.txt'' ' ;
ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt1 from ' handler t1 open ';

View file

@ -18,3 +18,8 @@ Table Op Msg_type Msg_text
test.non_existing optimize error Table 'test.non_existing' doesn't exist
Warnings:
Error 1146 Table 'test.non_existing' doesn't exist
select * from t1;
a
1
commit;
drop table t1;

View file

@ -18,12 +18,12 @@ select * into outfile 'MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_out
drop table t1;
create table t1(a int primary key);
load data local infile 'MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' into table t1;
select * from t1;
SELECT * FROM t1 ORDER BY a;
a
1
2
3
select * from t1;
SELECT * FROM t1 ORDER BY a;
a
1
2

View file

@ -19,24 +19,30 @@ set spv=spv+1;
end while;
end//
call p1();
select * from t1;
SELECT * FROM t1 ORDER BY a;
a
1
2
3
4
5
SELECT * FROM t1 ORDER BY a;
a
1
2
3
4
5
delete from t1;
create procedure p2()
begin
declare a int default 4;
create table t2 as select a;
end//
call p2();
select * from t2;
SELECT * FROM t2 ORDER BY a;
a
4
select * from t2;
SELECT * FROM t2 ORDER BY a;
a
4
drop procedure p1;
@ -61,43 +67,58 @@ end//
call p1(f1(1), f1(2));
yes
yes
select * from t1;
SELECT * FROM t1 ORDER BY a;
a
1
1
2
2
3
4
5
5
6
7
8
create table t2(a int);
insert into t2 values (10),(11);
select a,f1(a) from t2;
SELECT a,f1(a) FROM t2 ORDER BY a;
a f1(a)
10 11
11 12
insert into t2 select f1(3);
select 'master:',a from t1;
SELECT 'master:',a FROM t1 ORDER BY a;
master: a
master: 1
master: 1
master: 2
master: 2
master: 3
master: 3
master: 4
master: 5
master: 5
master: 6
master: 7
master: 8
master: 10
master: 11
master: 3
select 'slave:',a from t1;
SELECT 'slave:',a FROM t1 ORDER BY a;
slave: a
slave: 1
slave: 1
slave: 2
slave: 2
slave: 3
slave: 3
slave: 4
slave: 5
slave: 5
slave: 6
slave: 7
slave: 8
slave: 10
slave: 11
slave: 3
drop procedure p1;
delete from t1;
delete from t2;
@ -108,11 +129,11 @@ select * from v1;
f1(a)
2
3
select 'master:',a from t1;
SELECT 'master:',a FROM t1 ORDER BY a;
master: a
master: 1
master: 2
select 'slave:',a from t1;
SELECT 'slave:',a FROM t1 ORDER BY a;
slave: a
slave: 1
slave: 2
@ -123,10 +144,10 @@ set @xx=123;
execute s1 using @xx;
f1(?)
124
select 'master:',a from t1;
SELECT 'master:',a FROM t1 ORDER BY a;
master: a
master: 123
select 'slave:',a from t1;
SELECT 'slave:',a FROM t1 ORDER BY a;
slave: a
slave: 123
delete from t1;
@ -141,18 +162,18 @@ set spv= spv - 10;
end while;
end//
call p1(15);
select 'master:',a from t1;
SELECT 'master:',a FROM t1 ORDER BY a;
master: a
master: 15
master: 15
master: 6
master: 6
select 'slave:',a from t1;
master: 15
master: 15
SELECT 'slave:',a FROM t1 ORDER BY a;
slave: a
slave: 15
slave: 15
slave: 6
slave: 6
slave: 15
slave: 15
drop procedure p1;
drop function f1;
drop table t1,t2;
@ -187,26 +208,26 @@ f1()
0
set @x=30;
call p1();
select 'master', a from t1;
SELECT 'master', a FROM t1 ORDER BY a;
master a
master 20
master 10
master 11
master 100
master 101
master 20
master 30
master 31
master 100
master 101
master 101
master 102
select 'slave', a from t1;
SELECT 'slave', a FROM t1 ORDER BY a;
slave a
slave 20
slave 10
slave 11
slave 100
slave 101
slave 20
slave 30
slave 31
slave 100
slave 101
slave 101
slave 102
drop table t1;

View file

@ -3390,3 +3390,24 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 Using where
DROP TABLE t1,t2;
CREATE TABLE t1 (i TINYINT UNSIGNED NOT NULL);
INSERT t1 SET i = 0;
UPDATE t1 SET i = -1;
Warnings:
Warning 1264 Out of range value for column 'i' at row 1
SELECT * FROM t1;
i
0
UPDATE t1 SET i = CAST(i - 1 AS SIGNED);
Warnings:
Warning 1264 Out of range value for column 'i' at row 1
SELECT * FROM t1;
i
0
UPDATE t1 SET i = i - 1;
Warnings:
Warning 1264 Out of range value for column 'i' at row 1
SELECT * FROM t1;
i
255
DROP TABLE t1;

View file

@ -286,12 +286,12 @@ id stmt_text status
1 select 1 supported
2 flush tables not supported
3 handler t1 open as ha not supported
4 analyze table t1 not supported
4 analyze table t1 supported
5 check table t1 not supported
6 checksum table t1 not supported
7 check table t1 not supported
8 optimize table t1 not supported
9 repair table t1 not supported
8 optimize table t1 supported
9 repair table t1 supported
10 describe extended select * from t1 supported
11 help help not supported
12 show databases supported

View file

@ -1,3 +1,4 @@
drop table if exists t1,t3;
drop procedure if exists bug4902|
create procedure bug4902()
begin

View file

@ -1354,10 +1354,10 @@ a
explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 index NULL a 5 NULL 4 Using where; Using index
2 DEPENDENT SUBQUERY t3 index a a 5 NULL 3 Using index
2 DEPENDENT SUBQUERY t1 ref a a 10 func,test.t3.a 1167 Using where; Using index
2 DEPENDENT SUBQUERY t1 ref a a 5 func 1001 Using where; Using index
2 DEPENDENT SUBQUERY t3 index a a 5 NULL 3 Using where; Using index
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(select 1 AS `Not_used` from `test`.`t1` join `test`.`t3` where ((`test`.`t1`.`b` = `test`.`t3`.`a`) and (<cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`))))
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(select 1 AS `Not_used` from `test`.`t1` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t1`.`b`) and (<cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`))))
insert into t1 values (3,31);
select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
a

View file

@ -1,4 +1,5 @@
drop table if exists t1, t2;
drop function if exists f1;
create table t1 (ts timestamp);
set time_zone='+00:00';
select unix_timestamp(utc_timestamp())-unix_timestamp(current_timestamp());
@ -268,3 +269,17 @@ select * from t1;
convert_tz(NULL, NULL, NULL)
NULL
drop table t1;
create table t1 (ldt datetime, udt datetime);
create function f1(i datetime) returns datetime
return convert_tz(i, 'UTC', 'Europe/Moscow');
create trigger t1_bi before insert on t1 for each row
set new.udt:= convert_tz(new.ldt, 'Europe/Moscow', 'UTC');
insert into t1 (ldt) values ('2006-04-19 16:30:00');
select * from t1;
ldt udt
2006-04-19 16:30:00 2006-04-19 12:30:00
select ldt, f1(udt) as ldt2 from t1;
ldt ldt2
2006-04-19 16:30:00 2006-04-19 16:30:00
drop table t1;
drop function f1;

View file

@ -665,3 +665,12 @@ CALL p2();
EXTRACTVALUE(p,'/Ñ/r')
A
DROP PROCEDURE p2;
select extractValue('<ns:element xmlns:ns="myns"/>','count(ns:element)');
extractValue('<ns:element xmlns:ns="myns"/>','count(ns:element)')
1
select extractValue('<ns:element xmlns:ns="myns">a</ns:element>','/ns:element');
extractValue('<ns:element xmlns:ns="myns">a</ns:element>','/ns:element')
a
select extractValue('<ns:element xmlns:ns="myns">a</ns:element>','/ns:element/@xmlns:ns');
extractValue('<ns:element xmlns:ns="myns">a</ns:element>','/ns:element/@xmlns:ns')
myns

View file

@ -61,6 +61,14 @@ prepare stmt1 from "SELECT * FROM t1 PROCEDURE ANALYSE()";
execute stmt1;
execute stmt1;
deallocate prepare stmt1;
#
# bug#15225 (ANALYZE temporary has no effect)
#
create temporary table t1(a int, index(a));
insert into t1 values('1'),('2'),('3'),('4'),('5');
analyze table t1;
show index from t1;
drop table t1;
# End of 4.1 tests

View file

@ -47,7 +47,7 @@ select cast('1a' as signed);
select cast('' as signed);
#
# Character set convertion
# Character set conversion
#
set names binary;
select cast(_latin1'test' as char character set latin2);

View file

@ -18,22 +18,23 @@ ndb_autodiscover2 : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t
ndb_binlog_discover : BUG#19395 2006-04-28 tomas/knielsen mysqld does not always detect cluster shutdown
#ndb_cache2 : BUG#18597 2006-03-28 brian simultaneous drop table and ndb statistics update triggers node failure
#ndb_cache_multi2 : BUG#18597 2006-04-10 kent simultaneous drop table and ndb statistics update triggers node failure
ndb_load : BUG#17233 2006-05-04 tomas failed load data from infile causes mysqld dbug_assert, binlog not flushed
partition_03ndb : BUG#16385 2006-03-24 mikael Partitions: crash when updating a range partitioned NDB table
ps_7ndb : BUG#18950 2006-02-16 jmiller create table like does not obtain LOCK_open
rpl_ndb_2innodb : BUG#19227 2006-04-20 pekka pk delete apparently not replicated
rpl_ndb_2myisam : BUG#19227 2006-04-20 pekka pk delete apparently not replicated
rpl_ndb_auto_inc : BUG#17086 2006-02-16 jmiller CR: auto_increment_increment and auto_increment_offset produce duplicate key er
rpl_ndb_dd_partitions : BUG#19259 2006-04-21 rpl_ndb_dd_partitions fails on solaris
rpl_ndb_commit_afterflush : BUG#19328 2006-05-04 tomas Slave timeout with COM_REGISTER_SLAVE error causing stop
rpl_ndb_dd_partitions : BUG#19259 2006-04-21 rpl_ndb_dd_partitions fails on s/AMD
rpl_ndb_ddl : BUG#18946 result file needs update + test needs to checked
rpl_ndb_innodb2ndb : BUG#17400 2006-04-19 tomas Cluster Replication: delete & update of rows in table without pk fails on slave.
rpl_ndb_log : BUG#18947 2006-03-21 tomas CRBR: order in binlog of create table and insert (on different table) not determ
rpl_ndb_myisam2ndb : BUG#17400 2006-04-19 tomas Cluster Replication: delete & update of rows in table without pk fails on slave.
rpl_switch_stm_row_mixed : BUG#18590 2006-03-28 brian
rpl_row_blob_innodb : BUG#18980 2006-04-10 kent Test fails randomly
rpl_row_func003 : BUG#19074 2006-13-04 andrei test failed
rpl_row_func003 : BUG#19074 2006-13-04 andrei test failed
rpl_row_inexist_tbl : BUG#18948 2006-03-09 mats Disabled since patch makes this test wait forever
rpl_sp : BUG#16456 2006-02-16 jmiller
mysqldump : BUG#18078 2006-03-10 lars
udf : BUG#18564 2006-03-27 ian (Permission by Brian)
# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open

View file

@ -5,6 +5,10 @@
-- source include/have_exampledb.inc
--disable_warnings
# Clean up if event's test fails
drop database if exists events_test;
drop database if exists events_test2;
drop table if exists t1;
--enable_warnings

View file

@ -164,4 +164,16 @@ DELETE from t1 where a < 100;
SELECT * from t1;
DROP TABLE t1;
#
# BUG#18160 - Memory-/HEAP Table endless growing indexes
#
CREATE TABLE t1(val INT, KEY USING BTREE(val)) ENGINE=memory;
INSERT INTO t1 VALUES(0);
--replace_result 37 21
SELECT INDEX_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME='t1';
UPDATE t1 SET val=1;
--replace_result 37 21
SELECT INDEX_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME='t1';
DROP TABLE t1;
# End of 4.1 tests

View file

@ -2494,3 +2494,19 @@ SELECT DISTINCT p0.a FROM t2 p0 WHERE BINARY p0.b = 'customer_over';
SELECT p0.a FROM t2 p0 WHERE BINARY p0.b = 'customer_over';
drop table t2, t1;
#
# Bug #15680 (SPATIAL key in innodb)
#
--error ER_TABLE_CANT_HANDLE_SPKEYS
create table t1 (g geometry not null, spatial gk(g)) engine=innodb;
#
# Test optimize on table with open transaction
#
CREATE TABLE t1 ( a int ) ENGINE=innodb;
BEGIN;
INSERT INTO t1 VALUES (1);
OPTIMIZE TABLE t1;
DROP TABLE t1;

View file

@ -63,10 +63,10 @@ flush logs;
# check locking of the log tables
#
--error 1533
--error ER_CANT_WRITE_LOCK_LOG_TABLE
lock tables mysql.general_log WRITE;
--error 1533
--error ER_CANT_WRITE_LOCK_LOG_TABLE
lock tables mysql.slow_log WRITE;
#
@ -75,10 +75,10 @@ lock tables mysql.slow_log WRITE;
# tables are always opened and locked by the logger.
#
--error 1534
--error ER_CANT_READ_LOCK_LOG_TABLE
lock tables mysql.general_log READ;
--error 1534
--error ER_CANT_READ_LOCK_LOG_TABLE
lock tables mysql.slow_log READ;
#

View file

@ -0,0 +1,21 @@
#
# Test how DROP TABLE works if the index or data file doesn't exists
# Initialise
--disable_warnings
drop table if exists t1,t2;
--enable_warnings
create table t1 (a int) engine=myisam;
system rm $MYSQLTEST_VARDIR/master-data/test/t1.MYI ;
drop table if exists t1;
create table t1 (a int) engine=myisam;
system rm $MYSQLTEST_VARDIR/master-data/test/t1.MYI ;
--error 1051,6
drop table t1;
create table t1 (a int) engine=myisam;
system rm $MYSQLTEST_VARDIR/master-data/test/t1.MYD ;
--error 1105,6,29
drop table t1;
--error 1051
drop table t1;

View file

@ -726,23 +726,6 @@ create table t1 (v varchar(65535));
eval set storage_engine=$default;
#
# Test how DROP TABLE works if the index or data file doesn't exists
create table t1 (a int) engine=myisam;
system rm $MYSQLTEST_VARDIR/master-data/test/t1.MYI ;
drop table if exists t1;
create table t1 (a int) engine=myisam;
system rm $MYSQLTEST_VARDIR/master-data/test/t1.MYI ;
--error 1051,6
drop table t1;
create table t1 (a int) engine=myisam;
system rm $MYSQLTEST_VARDIR/master-data/test/t1.MYD ;
--error 1105,6,29
drop table t1;
--error 1051
drop table t1;
#
# Test concurrent insert
# First with static record length
@ -824,3 +807,66 @@ create table t3 (c1 int) engine=myisam pack_keys=default;
create table t4 (c1 int) engine=myisam pack_keys=2;
drop table t1, t2, t3;
#
# Test of key_block_size
#
create table t1 (a int not null, key `a` (a) key_block_size=1024);
show create table t1;
drop table t1;
create table t1 (a int not null, key `a` (a) key_block_size=2048);
show create table t1;
drop table t1;
create table t1 (a varchar(2048), key `a` (a));
show create table t1;
drop table t1;
create table t1 (a varchar(2048), key `a` (a) key_block_size=1024);
show create table t1;
drop table t1;
create table t1 (a int not null, b varchar(2048), key (a), key(b)) key_block_size=1024;
show create table t1;
alter table t1 key_block_size=2048;
show create table t1;
alter table t1 add c int, add key (c);
show create table t1;
alter table t1 key_block_size=0;
alter table t1 add d int, add key (d);
show create table t1;
drop table t1;
create table t1 (a int not null, b varchar(2048), key (a), key(b)) key_block_size=8192;
show create table t1;
drop table t1;
create table t1 (a int not null, b varchar(2048), key (a) key_block_size=1024, key(b)) key_block_size=8192;
show create table t1;
drop table t1;
create table t1 (a int not null, b int, key (a) key_block_size=1024, key(b) key_block_size=8192) key_block_size=16384;
show create table t1;
drop table t1;
# Test limits and errors of key_block_size
create table t1 (a int not null, key `a` (a) key_block_size=512);
show create table t1;
drop table t1;
create table t1 (a varchar(2048), key `a` (a) key_block_size=1000000000000000000);
show create table t1;
drop table t1;
create table t1 (a int not null, key `a` (a) key_block_size=1025);
show create table t1;
drop table t1;
--error 1064
create table t1 (a int not null, key key_block_size=1024 (a));
--error 1064
create table t1 (a int not null, key `a` key_block_size=1024 (a));

View file

@ -0,0 +1 @@
--log --log-output=FILE

View file

@ -11,7 +11,7 @@ drop view if exists v1, v2, v3;
# XML output
CREATE TABLE t1(a int);
CREATE TABLE t1(a int, key (a)) key_block_size=1024;
INSERT INTO t1 VALUES (1), (2);
--exec $MYSQL_DUMP --skip-create --skip-comments -X test t1
DROP TABLE t1;
@ -1174,8 +1174,8 @@ create database first;
use first;
set time_zone = 'UTC';
## prove one works
create event ee1 on schedule at '2035-12-31 20:01:23' do set @a=5;
## prove one works (with spaces and tabs on the end)
create event ee1 on schedule at '2035-12-31 20:01:23' do set @a=5;
show events;
show create event ee1;
--exec $MYSQL_DUMP --events first > $MYSQLTEST_VARDIR/tmp/bug16853-1.sql
@ -1187,10 +1187,10 @@ use second;
show events;
show create event ee1;
## prove three works
## prove three works (with spaces and tabs on the end)
# start with one from the previous restore
create event ee2 on schedule at '2018-12-31 21:01:23' do set @a=5;
create event ee3 on schedule at '2030-12-31 22:01:23' do set @a=5;
create event ee2 on schedule at '2018-12-31 21:01:23' do set @a=5;
create event ee3 on schedule at '2030-12-31 22:01:23' do set @a=5;
show events;
--exec $MYSQL_DUMP --events second > $MYSQLTEST_VARDIR/tmp/bug16853-2.sql
drop database second;

View file

@ -327,3 +327,59 @@ drop table t1;
# End of 4.1 tests
# On-line alter table
CREATE TABLE t1 (
auto int(5) unsigned NOT NULL auto_increment,
string char(10),
vstring varchar(10),
bin binary(2),
vbin varbinary(7),
tiny tinyint(4) DEFAULT '0' NOT NULL ,
short smallint(6) DEFAULT '1' NOT NULL ,
medium mediumint(8) DEFAULT '0' NOT NULL,
long_int int(11) DEFAULT '0' NOT NULL,
longlong bigint(13) DEFAULT '0' NOT NULL,
real_float float(13,1) DEFAULT 0.0 NOT NULL,
real_double double(16,4),
real_decimal decimal(16,4),
utiny tinyint(3) unsigned DEFAULT '0' NOT NULL,
ushort smallint(5) unsigned zerofill DEFAULT '00000' NOT NULL,
umedium mediumint(8) unsigned DEFAULT '0' NOT NULL,
ulong int(11) unsigned DEFAULT '0' NOT NULL,
ulonglong bigint(13) unsigned DEFAULT '0' NOT NULL,
bits bit(3),
options enum('zero','one','two','three','four') not null,
flags set('zero','one','two','three','four') not null,
date_field date,
year_field year,
time_field time,
date_time datetime,
time_stamp timestamp,
PRIMARY KEY (auto)
) engine=ndb;
CREATE TEMPORARY TABLE ndb_show_tables (id INT, type VARCHAR(20), state VARCHAR(20), logging VARCHAR(20), _database VARCHAR(255), _schema VARCHAR(20), name VARCHAR(255));
--disable_warnings
--exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
--enable_warnings
set @t1_id = (select id from ndb_show_tables where name like '%t1%');
truncate ndb_show_tables;
alter table t1 change tiny new_tiny tinyint(4) DEFAULT '0' NOT NULL;
create index i1 on t1(medium);
alter table t1 add index i2(long_int);
drop index i1 on t1;
--disable_warnings
--exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLTEST_VARDIR/master-data/test/tmp.dat
LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
--enable_warnings
select 'no_copy' from ndb_show_tables where id = @t1_id and name like '%t1%';
DROP TABLE t1, ndb_show_tables;

View file

@ -1,7 +1,6 @@
-- source include/have_ndb.inc
-- source include/have_multi_ndb.inc
-- source include/not_embedded.inc
-- source include/have_binlog_format_row.inc
--disable_warnings
DROP TABLE IF EXISTS t1;

View file

@ -1,55 +0,0 @@
-- source include/have_ndb.inc
-- source include/have_multi_ndb.inc
-- source include/not_embedded.inc
-- source include/have_binlog_format_statement.inc
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
connection server1;
create table t1 ( a int primary key, b varchar(10), c varchar(10), index (b) )
engine=ndb;
insert into t1 values (1,'one','one'), (2,'two','two'), (3,'three','three');
create index c on t1(c);
connection server2;
select * from t1 where c = 'two';
connection server1;
alter table t1 drop index c;
connection server2;
--disable_result_log
--error 0,1412
select * from t1 where c = 'two';
--enable_result_log
select * from t1 where c = 'two';
connection server1;
drop table t1;
connection server1;
create table t3 (a int primary key) engine=ndbcluster;
connection server2;
begin;
insert into t3 values (1);
connection server1;
alter table t3 rename t4;
connection server2;
# with rbr the below will not work as the "alter" event
# explicitly invalidates the dictionary cache.
# This should work as transaction is ongoing...
delete from t3;
insert into t3 values (1);
commit;
# This should fail as its a new transaction
--error 1015
select * from t3;
select * from t4;
drop table t4;
show tables;
connection server1;

View file

@ -6,6 +6,18 @@ DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7;
drop database if exists mysqltest;
--enable_warnings
# workaround for bug#16445
# remove to reproduce bug and run tests from ndb start
# and with ndb_autodiscover disabled. Fails on Linux 50 % of the times
CREATE TABLE t1 (
pk1 INT NOT NULL PRIMARY KEY,
attr1 INT NOT NULL,
attr2 INT,
attr3 VARCHAR(10)
) ENGINE=ndbcluster;
drop table t1;
#
# Basic test to show that the NDB
# table handler is working

View file

@ -403,10 +403,29 @@ create table t1 (
insert into t1 (msg) values(
'Tries to validate (8 byte length + inline bytes) as UTF8 :(
Fast fix: removed validation for Text. It is not yet indexable
so bad data will not crash kernel.
Proper fix: Set inline bytes to multiple of mbmaxlen and
validate it (after the 8 byte length).');
so bad data will not crash kernel.');
select * from t1;
drop table t1;
# -- bug #19201
create table t1 (
a int primary key not null auto_increment,
b text
) engine=ndbcluster;
--disable_query_log
set autocommit=1;
# more rows than batch size (64)
# for this bug no blob parts would be necessary
let $1 = 500;
while ($1)
{
insert into t1 (b) values (repeat('x',4000));
dec $1;
}
--enable_query_log
select count(*) from t1;
truncate t1;
select count(*) from t1;
drop table t1;
# End of 4.1 tests

View file

@ -15,4 +15,3 @@
--exec $NDB_TOOLS_DIR/ndb_config --defaults-group-suffix=.cluster0 --defaults-file=$MYSQL_TEST_DIR/std_data/ndb_config_mycnf2.cnf --query=type,nodeid,host --mycnf 2> /dev/null
--exec $NDB_TOOLS_DIR/ndb_config --defaults-group-suffix=.cluster1 --defaults-file=$MYSQL_TEST_DIR/std_data/ndb_config_mycnf2.cnf --query=type,nodeid,host --mycnf 2> /dev/null
--exec $NDB_TOOLS_DIR/ndb_config --defaults-group-suffix=.cluster2 --defaults-file=$MYSQL_TEST_DIR/std_data/ndb_config_mycnf2.cnf --query=type,nodeid,host --mycnf 2> /dev/null
--exec $NDB_TOOLS_DIR/ndb_config --defaults-group-suffix=.cluster2 --defaults-file=$MYSQL_TEST_DIR/std_data/ndb_config_mycnf2.cnf --ndb-shm --connections --query=type,nodeid1,nodeid2,group,nodeidserver --mycnf 2> /dev/null

View file

@ -0,0 +1,7 @@
-- source include/have_ndb.inc
-- source include/ndb_default_cluster.inc
-- source include/not_embedded.inc
# Following doesn't work in all configurations (if shm is not defined)
--exec $NDB_TOOLS_DIR/ndb_config --defaults-group-suffix=.cluster2 --defaults-file=$MYSQL_TEST_DIR/std_data/ndb_config_mycnf2.cnf --ndb-shm --connections --query=type,nodeid1,nodeid2,group,nodeidserver --mycnf 2> /dev/null

View file

@ -66,6 +66,6 @@ partition by list(a)
partitions 2
(partition x123 values in (11, 12),
partition x234 values in (5, 1));
--error 1505
--error ER_NO_PARTITION_FOR_GIVEN_VALUE
insert into t1 values (NULL,1,1);
drop table t1;

View file

@ -1110,4 +1110,40 @@ select * from t1 order by 1+1;
drop table t1;
#
# Bug#19308 "REPAIR/OPTIMIZE/ANALYZE supported in SP but not in PS".
# Add test coverage for the added commands.
#
create table t1 (a int);
create table t2 like t1;
create table t3 like t2;
prepare stmt from "repair table t1";
execute stmt;
execute stmt;
prepare stmt from "optimize table t1";
execute stmt;
execute stmt;
prepare stmt from "analyze table t1";
execute stmt;
execute stmt;
prepare stmt from "repair table t1, t2, t3";
execute stmt;
execute stmt;
prepare stmt from "optimize table t1, t2, t3";
execute stmt;
execute stmt;
prepare stmt from "analyze table t1, t2, t3";
execute stmt;
execute stmt;
prepare stmt from "repair table t1, t4, t3";
execute stmt;
execute stmt;
prepare stmt from "optimize table t1, t3, t4";
execute stmt;
execute stmt;
prepare stmt from "analyze table t4, t1";
execute stmt;
execute stmt;
deallocate prepare stmt;
# End of 5.0 tests

View file

@ -456,13 +456,10 @@ into table t1 fields terminated by ''\t'' ';
prepare stmt1 from ' select * into outfile ''data.txt'' from t1 ';
execute stmt1 ;
##
--error 1295
prepare stmt1 from ' optimize table t1 ' ;
--error 1295
prepare stmt1 from ' analyze table t1 ' ;
--error 1295
prepare stmt1 from ' checksum table t1 ' ;
--error 1295
prepare stmt1 from ' repair table t1 ' ;
--error 1295
prepare stmt1 from ' restore table t1 from ''data.txt'' ' ;

View file

@ -207,7 +207,7 @@ show status like "Qcache_queries_in_cache";
drop table t1;
#
# Charset convertion (cp1251_koi8 always present)
# Charset conversion (cp1251_koi8 always present)
#
create table t1 (a char(1) not null collate koi8r_general_ci);
insert into t1 values(_koi8r"á");

View file

@ -53,11 +53,11 @@ create table t1(a int primary key);
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval load data local infile '$MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile' into table t1;
system rm $MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile ;
select * from t1;
SELECT * FROM t1 ORDER BY a;
save_master_pos;
connection slave;
sync_with_master;
select * from t1;
SELECT * FROM t1 ORDER BY a;
connection master;
drop table t1;
save_master_pos;

View file

@ -1,3 +1,9 @@
##########################################
# Change Author: JBM
# Change Date: 2006-05-02
# Change: Added Order By for NDB testing
##########################################
# Test of replication of stored procedures (WL#2146 for MySQL 5.0)
-- source include/master-slave.inc
@ -30,9 +36,9 @@ call p1();
sync_slave_with_master;
connection slave;
select * from t1;
SELECT * FROM t1 ORDER BY a;
connection master;
delete from t1;
SELECT * FROM t1 ORDER BY a;
# 2. Test SP variable name
delimiter //;
@ -44,10 +50,10 @@ end//
delimiter ;//
call p2();
select * from t2;
SELECT * FROM t2 ORDER BY a;
sync_slave_with_master;
connection slave;
select * from t2;
SELECT * FROM t2 ORDER BY a;
connection master;
drop procedure p1;
@ -78,19 +84,19 @@ end//
delimiter ;//
call p1(f1(1), f1(2));
select * from t1;
SELECT * FROM t1 ORDER BY a;
create table t2(a int);
insert into t2 values (10),(11);
select a,f1(a) from t2;
SELECT a,f1(a) FROM t2 ORDER BY a;
# This shouldn't put separate 'call f1(3)' into binlog:
insert into t2 select f1(3);
select 'master:',a from t1;
SELECT 'master:',a FROM t1 ORDER BY a;
sync_slave_with_master;
connection slave;
select 'slave:',a from t1;
SELECT 'slave:',a FROM t1 ORDER BY a;
connection master;
drop procedure p1;
@ -102,11 +108,11 @@ delete from t1;
insert into t2 values(1),(2);
create view v1 as select f1(a) from t2;
select * from v1;
select 'master:',a from t1;
SELECT 'master:',a FROM t1 ORDER BY a;
sync_slave_with_master;
connection slave;
select 'slave:',a from t1;
SELECT 'slave:',a FROM t1 ORDER BY a;
connection master;
drop view v1;
@ -116,11 +122,11 @@ delete from t1;
prepare s1 from 'select f1(?)';
set @xx=123;
execute s1 using @xx;
select 'master:',a from t1;
SELECT 'master:',a FROM t1 ORDER BY a;
sync_slave_with_master;
connection slave;
select 'slave:',a from t1;
SELECT 'slave:',a FROM t1 ORDER BY a;
connection master;
delete from t1;
@ -140,10 +146,10 @@ begin
end//
delimiter ;//
call p1(15);
select 'master:',a from t1;
SELECT 'master:',a FROM t1 ORDER BY a;
sync_slave_with_master;
connection slave;
select 'slave:',a from t1;
SELECT 'slave:',a FROM t1 ORDER BY a;
connection master;
drop procedure p1;
@ -188,10 +194,10 @@ select f1();
set @x=30;
call p1();
select 'master', a from t1;
SELECT 'master', a FROM t1 ORDER BY a;
sync_slave_with_master;
connection slave;
select 'slave', a from t1;
SELECT 'slave', a FROM t1 ORDER BY a;
connection master;
drop table t1;

View file

@ -2871,3 +2871,18 @@ SELECT t2.sku, t2.sppr, t2.name, t1.sku, t1.pr
DROP TABLE t1,t2;
#
# Bug#18712: Truncation problem (needs just documenting and test
# cases to prevent fixing this accidently. It is intended behaviour)
#
CREATE TABLE t1 (i TINYINT UNSIGNED NOT NULL);
INSERT t1 SET i = 0;
UPDATE t1 SET i = -1;
SELECT * FROM t1;
UPDATE t1 SET i = CAST(i - 1 AS SIGNED);
SELECT * FROM t1;
UPDATE t1 SET i = i - 1;
SELECT * FROM t1;
DROP TABLE t1;

View file

@ -1,6 +1,10 @@
# Can't test with embedded server
-- source include/not_embedded.inc
--sleep 2
--disable_warnings
drop table if exists t1,t3;
--enable_warnings
delimiter |;
#

View file

@ -3,6 +3,7 @@
# Preparing playground
--disable_warnings
drop table if exists t1, t2;
drop function if exists f1;
--enable_warnings
@ -222,3 +223,22 @@ select * from t1;
drop table t1;
# End of 4.1 tests
#
# Test for bug #11081 "Using a CONVERT_TZ function in a stored function
# or trigger fails".
#
create table t1 (ldt datetime, udt datetime);
create function f1(i datetime) returns datetime
return convert_tz(i, 'UTC', 'Europe/Moscow');
create trigger t1_bi before insert on t1 for each row
set new.udt:= convert_tz(new.ldt, 'Europe/Moscow', 'UTC');
# This should work without errors
insert into t1 (ldt) values ('2006-04-19 16:30:00');
select * from t1;
# This should work without errors as well
select ldt, f1(udt) as ldt2 from t1;
drop table t1;
drop function f1;
# End of 5.0 tests

View file

@ -335,3 +335,11 @@ END//
DELIMITER ;//
CALL p2();
DROP PROCEDURE p2;
#
# Bug#18170: XML: ExtractValue():
# XPath expression can't use QNames (colon in names)
#
select extractValue('<ns:element xmlns:ns="myns"/>','count(ns:element)');
select extractValue('<ns:element xmlns:ns="myns">a</ns:element>','/ns:element');
select extractValue('<ns:element xmlns:ns="myns">a</ns:element>','/ns:element/@xmlns:ns');

View file

@ -53,6 +53,7 @@ libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c my_mmap.c \
charset.c charset-def.c my_bitmap.c my_bit.c md5.c \
my_gethostbyname.c rijndael.c my_aes.c sha1.c \
my_handler.c my_netware.c my_largepage.c \
my_memmem.c \
my_windac.c my_access.c base64.c
EXTRA_DIST = thr_alarm.c thr_lock.c my_pthread.c my_thr_init.c \
thr_mutex.c thr_rwlock.c \

View file

@ -26,4 +26,4 @@ ADD_LIBRARY(mysys array.c charset-def.c charset.c checksum.c default.c default_m
my_static.c my_symlink.c my_symlink2.c my_sync.c my_thr_init.c my_wincond.c
my_windac.c my_winsem.c my_winthread.c my_write.c ptr_cmp.c queues.c
rijndael.c safemalloc.c sha1.c string.c thr_alarm.c thr_lock.c thr_mutex.c
thr_rwlock.c tree.c typelib.c my_vle.c base64.c)
thr_rwlock.c tree.c typelib.c my_vle.c base64.c my_memmem.c)

Some files were not shown because too many files have changed in this diff Show more