Commit 64b6c611 authored by iggy@amd64.(none)'s avatar iggy@amd64.(none)

Merge amd64.(none):/src/mysql-5.1-maint

into  amd64.(none):/src/mysql-5.1-build_29903
parents db15f4da 171f402a
...@@ -1099,6 +1099,7 @@ libmysqld/item_sum.cc ...@@ -1099,6 +1099,7 @@ libmysqld/item_sum.cc
libmysqld/item_timefunc.cc libmysqld/item_timefunc.cc
libmysqld/item_uniq.cc libmysqld/item_uniq.cc
libmysqld/key.cc libmysqld/key.cc
libmysqld/lex_hash.h
libmysqld/lib_sql.cpp libmysqld/lib_sql.cpp
libmysqld/libmysql.c libmysqld/libmysql.c
libmysqld/link_sources libmysqld/link_sources
...@@ -1107,6 +1108,8 @@ libmysqld/log.cc ...@@ -1107,6 +1108,8 @@ libmysqld/log.cc
libmysqld/log_event.cc libmysqld/log_event.cc
libmysqld/log_event_old.cc libmysqld/log_event_old.cc
libmysqld/md5.c libmysqld/md5.c
libmysqld/message.h
libmysqld/message.rc
libmysqld/mf_iocache.cc libmysqld/mf_iocache.cc
libmysqld/mini_client.cc libmysqld/mini_client.cc
libmysqld/my_decimal.cc libmysqld/my_decimal.cc
......
...@@ -48,7 +48,7 @@ enum options_client ...@@ -48,7 +48,7 @@ enum options_client
OPT_PROMPT, OPT_IGN_LINES,OPT_TRANSACTION,OPT_MYSQL_PROTOCOL, OPT_PROMPT, OPT_IGN_LINES,OPT_TRANSACTION,OPT_MYSQL_PROTOCOL,
OPT_SHARED_MEMORY_BASE_NAME, OPT_FRM, OPT_SKIP_OPTIMIZATION, OPT_SHARED_MEMORY_BASE_NAME, OPT_FRM, OPT_SKIP_OPTIMIZATION,
OPT_COMPATIBLE, OPT_RECONNECT, OPT_DELIMITER, OPT_SECURE_AUTH, OPT_COMPATIBLE, OPT_RECONNECT, OPT_DELIMITER, OPT_SECURE_AUTH,
OPT_OPEN_FILES_LIMIT, OPT_SET_CHARSET, OPT_CREATE_OPTIONS, OPT_OPEN_FILES_LIMIT, OPT_SET_CHARSET, OPT_CREATE_OPTIONS, OPT_SERVER_ARG,
OPT_START_POSITION, OPT_STOP_POSITION, OPT_START_DATETIME, OPT_STOP_DATETIME, OPT_START_POSITION, OPT_STOP_POSITION, OPT_START_DATETIME, OPT_STOP_DATETIME,
OPT_SIGINT_IGNORE, OPT_HEXBLOB, OPT_ORDER_BY_PRIMARY, OPT_COUNT, OPT_SIGINT_IGNORE, OPT_HEXBLOB, OPT_ORDER_BY_PRIMARY, OPT_COUNT,
#ifdef HAVE_NDBCLUSTER_DB #ifdef HAVE_NDBCLUSTER_DB
......
...@@ -51,6 +51,9 @@ const char *VER= "14.14"; ...@@ -51,6 +51,9 @@ const char *VER= "14.14";
/* Buffer to hold 'version' and 'version_comment' */ /* Buffer to hold 'version' and 'version_comment' */
#define MAX_SERVER_VERSION_LENGTH 128 #define MAX_SERVER_VERSION_LENGTH 128
/* Array of options to pass to libemysqld */
#define MAX_SERVER_ARGS 64
void* sql_alloc(unsigned size); // Don't use mysqld alloc for these void* sql_alloc(unsigned size); // Don't use mysqld alloc for these
void sql_element_free(void *ptr); void sql_element_free(void *ptr);
#include "sql_string.h" #include "sql_string.h"
...@@ -304,7 +307,10 @@ static COMMANDS commands[] = { ...@@ -304,7 +307,10 @@ static COMMANDS commands[] = {
}; };
static const char *load_default_groups[]= { "mysql","client",0 }; static const char *load_default_groups[]= { "mysql","client",0 };
static const char *server_default_groups[]=
static int embedded_server_arg_count= 0;
static char *embedded_server_args[MAX_SERVER_ARGS];
static const char *embedded_server_groups[]=
{ "server", "embedded", "mysql_SERVER", 0 }; { "server", "embedded", "mysql_SERVER", 0 };
#ifdef HAVE_READLINE #ifdef HAVE_READLINE
...@@ -349,15 +355,6 @@ static sig_handler handle_sigint(int sig); ...@@ -349,15 +355,6 @@ static sig_handler handle_sigint(int sig);
int main(int argc,char *argv[]) int main(int argc,char *argv[])
{ {
char buff[80]; char buff[80];
char *defaults, *extra_defaults, *group_suffix;
char *emb_argv[4];
int emb_argc;
/* Get --defaults-xxx args for mysql_server_init() */
emb_argc= get_defaults_options(argc, argv, &defaults, &extra_defaults,
&group_suffix)+1;
memcpy((char*) emb_argv, (char*) argv, emb_argc * sizeof(*argv));
emb_argv[emb_argc]= 0;
MY_INIT(argv[0]); MY_INIT(argv[0]);
DBUG_ENTER("main"); DBUG_ENTER("main");
...@@ -418,7 +415,8 @@ int main(int argc,char *argv[]) ...@@ -418,7 +415,8 @@ int main(int argc,char *argv[])
my_end(0); my_end(0);
exit(1); exit(1);
} }
if (mysql_server_init(emb_argc, emb_argv, (char**) server_default_groups)) if (mysql_server_init(embedded_server_arg_count, embedded_server_args,
(char**) embedded_server_groups))
{ {
free_defaults(defaults_argv); free_defaults(defaults_argv);
my_end(0); my_end(0);
...@@ -541,6 +539,8 @@ sig_handler mysql_end(int sig) ...@@ -541,6 +539,8 @@ sig_handler mysql_end(int sig)
my_free(shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR)); my_free(shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR));
#endif #endif
my_free(current_prompt,MYF(MY_ALLOW_ZERO_PTR)); my_free(current_prompt,MYF(MY_ALLOW_ZERO_PTR));
while (embedded_server_arg_count > 1)
my_free(embedded_server_args[--embedded_server_arg_count],MYF(0));
mysql_server_end(); mysql_server_end();
free_defaults(defaults_argv); free_defaults(defaults_argv);
my_end(my_end_arg); my_end(my_end_arg);
...@@ -766,6 +766,8 @@ static struct my_option my_long_options[] = ...@@ -766,6 +766,8 @@ static struct my_option my_long_options[] =
{"secure-auth", OPT_SECURE_AUTH, "Refuse client connecting to server if it" {"secure-auth", OPT_SECURE_AUTH, "Refuse client connecting to server if it"
" uses old (pre-4.1.1) protocol", (uchar**) &opt_secure_auth, " uses old (pre-4.1.1) protocol", (uchar**) &opt_secure_auth,
(uchar**) &opt_secure_auth, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, (uchar**) &opt_secure_auth, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"server-arg", OPT_SERVER_ARG, "Send embedded server this as a parameter.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"show-warnings", OPT_SHOW_WARNINGS, "Show warnings after every statement.", {"show-warnings", OPT_SHOW_WARNINGS, "Show warnings after every statement.",
(uchar**) &show_warnings, (uchar**) &show_warnings, 0, GET_BOOL, NO_ARG, (uchar**) &show_warnings, (uchar**) &show_warnings, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
...@@ -893,6 +895,28 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), ...@@ -893,6 +895,28 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib, opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
opt->name); opt->name);
break; break;
case OPT_SERVER_ARG:
#ifdef EMBEDDED_LIBRARY
/*
When the embedded server is being tested, the client needs to be
able to pass command-line arguments to the embedded server so it can
locate the language files and data directory.
*/
if (!embedded_server_arg_count)
{
embedded_server_arg_count= 1;
embedded_server_args[0]= (char*) "";
}
if (embedded_server_arg_count == MAX_SERVER_ARGS-1 ||
!(embedded_server_args[embedded_server_arg_count++]=
my_strdup(argument, MYF(MY_FAE))))
{
put_info("Can't use server argument", INFO_ERROR);
return 0;
}
#else /*EMBEDDED_LIBRARY */
printf("WARNING: --server-arg option not supported in this configuration.\n");
#endif
break; break;
case 'A': case 'A':
opt_rehash= 0; opt_rehash= 0;
......
...@@ -29,8 +29,12 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ...@@ -29,8 +29,12 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/zlib ${CMAKE_SOURCE_DIR}/zlib
) )
SET_SOURCE_FILES_PROPERTIES(${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc SET_SOURCE_FILES_PROPERTIES(sql_yacc.cc
${PROJECT_SOURCE_DIR}/sql/sql_yacc.h sql_yacc.h
message.h
message.rc
${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc
lex_hash.h
PROPERTIES GENERATED 1) PROPERTIES GENERATED 1)
ADD_LIBRARY(mysqldemb emb_qcache.cc libmysqld.c lib_sql.cc ADD_LIBRARY(mysqldemb emb_qcache.cc libmysqld.c lib_sql.cc
...@@ -76,10 +80,54 @@ ADD_LIBRARY(mysqldemb emb_qcache.cc libmysqld.c lib_sql.cc ...@@ -76,10 +80,54 @@ ADD_LIBRARY(mysqldemb emb_qcache.cc libmysqld.c lib_sql.cc
../sql/scheduler.cc ../sql/scheduler.cc
../vio/vio.c ../vio/viosocket.c ../vio/viossl.c ../vio/vio.c ../vio/viosocket.c ../vio/viossl.c
../vio/viosslfactories.c ../vio/viosslfactories.c
${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc sql_yacc.cc
${PROJECT_SOURCE_DIR}/sql/sql_yacc.h) sql_yacc.h
message.h
message.rc
lex_hash.h)
ADD_DEPENDENCIES(mysqldemb GenError) ADD_DEPENDENCIES(mysqldemb GenError)
# Sql Parser custom command
ADD_CUSTOM_COMMAND(
SOURCE ${PROJECT_SOURCE_DIR}/sql/sql_yacc.yy
OUTPUT sql_yacc.cc
COMMAND bison.exe
ARGS -y -p MYSQL --defines=sql_yacc.h
--output=sql_yacc.cc ${PROJECT_SOURCE_DIR}/sql/sql_yacc.yy
DEPENDS ${PROJECT_SOURCE_DIR}/sql/sql_yacc.yy
)
ADD_CUSTOM_COMMAND(
OUTPUT sql_yacc.h
COMMAND echo
DEPENDS ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
)
# Windows message file
ADD_CUSTOM_COMMAND(
SOURCE ${CMAKE_SOURCE_DIR}/sql/message.mc
OUTPUT message.rc message.h
COMMAND mc
ARGS ${CMAKE_SOURCE_DIR}/sql/message.mc
DEPENDS ${CMAKE_SOURCE_DIR}/sql/message.mc
)
# Gen_lex_hash
ADD_EXECUTABLE(gen_lex_hash ../sql/gen_lex_hash.cc)
TARGET_LINK_LIBRARIES(gen_lex_hash dbug mysqlclient wsock32)
GET_TARGET_PROPERTY(GEN_LEX_HASH_EXE gen_lex_hash LOCATION)
ADD_CUSTOM_COMMAND(
OUTPUT lex_hash.h
COMMAND ${GEN_LEX_HASH_EXE} ARGS > lex_hash.h
DEPENDS ${GEN_LEX_HASH_EXE}
)
# Remove the auto-generated files as part of 'Clean Solution'
SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
"lex_hash.h;message.rc;message.h;sql_yacc.h;sql_yacc.cc")
ADD_DEPENDENCIES(mysqldemb gen_lex_hash)
# Seems we cannot make a library without at least one source file. So use a # Seems we cannot make a library without at least one source file. So use a
# dummy empty file # dummy empty file
FILE(WRITE cmake_dummy.c " ") FILE(WRITE cmake_dummy.c " ")
...@@ -116,3 +164,6 @@ ENDIF(WITH_ARCHIVE_STORAGE_ENGINE) ...@@ -116,3 +164,6 @@ ENDIF(WITH_ARCHIVE_STORAGE_ENGINE)
IF(WITH_BLACKHOLE_STORAGE_ENGINE) IF(WITH_BLACKHOLE_STORAGE_ENGINE)
TARGET_LINK_LIBRARIES(libmysqld blackhole) TARGET_LINK_LIBRARIES(libmysqld blackhole)
ENDIF(WITH_BLACKHOLE_STORAGE_ENGINE) ENDIF(WITH_BLACKHOLE_STORAGE_ENGINE)
IF(WITH_CSV_STORAGE_ENGINE)
TARGET_LINK_LIBRARIES(libmysqld csv)
ENDIF(WITH_CSV_STORAGE_ENGINE)
...@@ -23,11 +23,11 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ...@@ -23,11 +23,11 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
# Currently does not work with DBUG, there are missing symbols reported. # Currently does not work with DBUG, there are missing symbols reported.
ADD_DEFINITIONS(-DDBUG_OFF) ADD_DEFINITIONS(-DDBUG_OFF)
ADD_DEFINITIONS(-DUSE_TLS) ADD_DEFINITIONS(-DUSE_TLS)
ADD_EXECUTABLE(test_libmysqld ../../client/completion_hash.cc ADD_EXECUTABLE(mysql_embedded ../../client/completion_hash.cc
../../client/mysql.cc ../../client/readline.cc ../../client/mysql.cc ../../client/readline.cc
../../client/sql_string.cc) ../../client/sql_string.cc)
TARGET_LINK_LIBRARIES(test_libmysqld mysys yassl taocrypt zlib dbug regex strings wsock32) TARGET_LINK_LIBRARIES(mysql_embedded mysys yassl taocrypt zlib dbug regex strings wsock32)
ADD_DEPENDENCIES(test_libmysqld libmysqld) ADD_DEPENDENCIES(mysql_embedded libmysqld)
ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.c) ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.c)
TARGET_LINK_LIBRARIES(mysqltest_embedded mysys yassl taocrypt zlib dbug regex strings wsock32) TARGET_LINK_LIBRARIES(mysqltest_embedded mysys yassl taocrypt zlib dbug regex strings wsock32)
......
LIBRARY LIBMYSQLD LIBRARY LIBMYSQLD
DESCRIPTION 'MySQL 5.0 Embedded Server Library' DESCRIPTION 'MySQL 5.1 Embedded Server Library'
VERSION 5.0 VERSION 5.1
EXPORTS EXPORTS
_dig_vec_upper _dig_vec_upper
_dig_vec_lower _dig_vec_lower
...@@ -48,6 +48,7 @@ EXPORTS ...@@ -48,6 +48,7 @@ EXPORTS
mysql_errno mysql_errno
mysql_error mysql_error
mysql_escape_string mysql_escape_string
mysql_hex_string
mysql_fetch_field mysql_fetch_field
mysql_fetch_field_direct mysql_fetch_field_direct
mysql_fetch_fields mysql_fetch_fields
...@@ -62,11 +63,13 @@ EXPORTS ...@@ -62,11 +63,13 @@ EXPORTS
mysql_get_host_info mysql_get_host_info
mysql_get_proto_info mysql_get_proto_info
mysql_get_server_info mysql_get_server_info
mysql_get_client_version
mysql_get_ssl_cipher mysql_get_ssl_cipher
mysql_info mysql_info
mysql_init mysql_init
mysql_insert_id mysql_insert_id
mysql_kill mysql_kill
mysql_set_server_option
mysql_list_dbs mysql_list_dbs
mysql_list_fields mysql_list_fields
mysql_list_processes mysql_list_processes
...@@ -172,4 +175,3 @@ EXPORTS ...@@ -172,4 +175,3 @@ EXPORTS
my_charset_bin my_charset_bin
my_charset_same my_charset_same
modify_defaults_file modify_defaults_file
mysql_set_server_option
...@@ -693,6 +693,37 @@ sub command_line_setup () { ...@@ -693,6 +693,37 @@ sub command_line_setup () {
$glob_timers= mtr_init_timers(); $glob_timers= mtr_init_timers();
# --------------------------------------------------------------------------
# Embedded server flag
# --------------------------------------------------------------------------
if ( $opt_embedded_server )
{
$glob_use_embedded_server= 1;
# Add the location for libmysqld.dll to the path.
if ( $glob_win32 )
{
my $lib_mysqld=
mtr_path_exists(vs_config_dirs('libmysqld',''));
$lib_mysqld= $glob_cygwin_perl ? ":".`cygpath "$lib_mysqld"`
: ";".$lib_mysqld;
chomp($lib_mysqld);
$ENV{'PATH'}="$ENV{'PATH'}".$lib_mysqld;
}
push(@glob_test_mode, "embedded");
$opt_skip_rpl= 1; # We never run replication with embedded
$opt_skip_ndbcluster= 1; # Turn off use of NDB cluster
$opt_skip_ssl= 1; # Turn off use of SSL
# Turn off use of bin log
push(@opt_extra_mysqld_opt, "--skip-log-bin");
if ( $opt_extern )
{
mtr_error("Can't use --extern with --embedded-server");
}
}
# #
# Find the mysqld executable to be able to find the mysqld version # Find the mysqld executable to be able to find the mysqld version
# number as early as possible # number as early as possible
......
...@@ -177,3 +177,4 @@ ERROR at line 1: DELIMITER cannot contain a backslash character ...@@ -177,3 +177,4 @@ ERROR at line 1: DELIMITER cannot contain a backslash character
1 1
1 1
End of 5.0 tests End of 5.0 tests
WARNING: --server-arg option not supported in this configuration.
...@@ -275,3 +275,10 @@ EOF ...@@ -275,3 +275,10 @@ EOF
--exec $MYSQL --character-sets-dir="540bytelengthstringxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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: The CMake build method does not produce the embedded library.
#
--disable_query_log
--exec $MYSQL --server-arg=no-defaults test -e "quit"
--enable_query_log
...@@ -65,6 +65,8 @@ The options right now are: ...@@ -65,6 +65,8 @@ The options right now are:
EMBED_MANIFESTS Embed custom manifests into final exes, otherwise VS EMBED_MANIFESTS Embed custom manifests into final exes, otherwise VS
default will be used. (Note - This option should only be default will be used. (Note - This option should only be
used by MySQL AB.) used by MySQL AB.)
EMBEDDED_ONLY Configure solution to produce libmysqld.dll
default will be used.
So the command line could look like: So the command line could look like:
...@@ -98,3 +100,16 @@ may be necessary to clean the build tree to remove any stale objects. ...@@ -98,3 +100,16 @@ may be necessary to clean the build tree to remove any stale objects.
Please see this link: http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/ Please see this link: http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/
At step 5 you only need to add the libraries advapi32.lib and user32.lib to At step 5 you only need to add the libraries advapi32.lib and user32.lib to
the file "corewin_express.vsprops" in order to avoid link errors. the file "corewin_express.vsprops" in order to avoid link errors.
3. Testing the Windows embedded library requires a two step process. The extra
step is necessary because the testsuite requires mysqld to run properly but both
the embedded library and the mysqld executable cannot be built at the same time.
Here's the process for building and testing the embedded library:
A. Follow steps 1 - 7 listed above to produce the Release configuration.
B. Perform step 5 from above again adding "--EMBEDDED-ONLY" to previously
supplied options.
C. Complete the build steps above to produce the Release configuration. Make
sure to Rebuild the solution so that all libraries are re-built.
D. Run the testsuite as usual.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment