Loading Docs/Makefile.am +11 −11 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ all-local: $(TXT_FILES) # make sure that "make install" installs the info page, too # automake only seems to take care of this automatically, # if we're building the info page from texi directly. install-data-hook: mysql.info install-data-hook: $(srcdir)/mysql.info $(mkinstalldirs) $(DESTDIR)$(infodir) $(INSTALL_DATA) $(srcdir)/mysql.info $(DESTDIR)$(infodir) Loading @@ -39,23 +39,23 @@ CLEAN_FILES: $(TXT_FILES) GT = $(srcdir)/Support/generate-text-files.pl ../INSTALL-SOURCE: mysql.info $(GT) perl -w $(GT) $< "installing-source" "windows-source-build" > $@ ../INSTALL-SOURCE: $(srcdir)/mysql.info $(GT) perl -w $(GT) $(srcdir)/mysql.info "installing-source" "windows-source-build" > $@ ../INSTALL-WIN-SOURCE: mysql.info $(GT) perl -w $(GT) $< "windows-source-build" "post-installation" > $@ ../INSTALL-WIN-SOURCE: $(srcdir)/mysql.info $(GT) perl -w $(GT) $(srcdir)/mysql.info "windows-source-build" "post-installation" > $@ # We put the description for the binary installation here so that # people who download source wont have to see it. It is moved up to # the toplevel by the script that makes the binary tar files. INSTALL-BINARY: mysql.info $(GT) perl -w $(GT) $< "installing-binary" "installing-source" > $@ INSTALL-BINARY: $(srcdir)/mysql.info $(GT) perl -w $(GT) $(srcdir)/mysql.info "installing-binary" "installing-source" > $@ ../EXCEPTIONS-CLIENT: mysql.info $(GT) perl -w $(GT) $< "mysql-floss-license-exception" "function-index" > $@ ../EXCEPTIONS-CLIENT: $(srcdir)/mysql.info $(GT) perl -w $(GT) $(srcdir)/mysql.info "mysql-floss-license-exception" "function-index" > $@ ../support-files/MacOSX/ReadMe.txt: mysql.info $(GT) perl -w $(GT) $< "mac-os-x-installation" "netware-installation" > $@ ../support-files/MacOSX/ReadMe.txt: $(srcdir)/mysql.info $(GT) perl -w $(GT) $(srcdir)/mysql.info "mac-os-x-installation" "netware-installation" > $@ # Don't update the files from bitkeeper %::SCCS/s.% Makefile.am +6 −0 Original line number Diff line number Diff line Loading @@ -131,3 +131,9 @@ test-force-pl: ./mysql-test-run.pl --force && \ ./mysql-test-run.pl --ps-protocol --force #used by autopush.pl to run memory based tests test-force-pl-mem: cd mysql-test; \ ./mysql-test-run.pl --force --mem && \ ./mysql-test-run.pl --ps-protocol --force --mem acinclude.m4 +8 −8 Original line number Diff line number Diff line Loading @@ -1448,20 +1448,20 @@ bdb_version_ok=yes ]) AC_DEFUN([MYSQL_TOP_BUILDDIR], [ # Remove trailing "./" if any [$1]=`echo $[$1] | sed -e 's,^\./,,'` case "$[$1]" in /* ) ;; # don't do anything with an absolute path "$srcdir"/* ) "bdb" | "$srcdir/bdb" | "$top_srcdir/bdb" | "$abs_top_srcdir/bdb" ) # If BDB is under the source directory, we need to look under the # build directory for bdb/build_unix. # NOTE: I'm being lazy, and assuming the user did not specify # something like --with-berkeley-db=bdb (it would be missing "./"). [$1]="\$(top_builddir)/"`echo "$[$1]" | sed -e "s,^$srcdir/,,"` [$1]="\$(top_builddir)/bdb" ;; /* ) ;; # Other absolute path is assume to be external BDB directory * ) AC_MSG_ERROR([The BDB directory must be directly under the MySQL source directory, or be specified using the full path. ('$srcdir'; '$[$1]')]) ;; esac if test X"$[$1]" != "/" if test X"$[$1]" != X"/" then [$1]=`echo $[$1] | sed -e 's,/$,,'` fi Loading Loading @@ -1493,7 +1493,7 @@ AC_DEFUN([MYSQL_CHECK_INNODB], [ AC_MSG_RESULT([Using Innodb]) AC_DEFINE([HAVE_INNOBASE_DB], [1], [Using Innobase DB]) have_innodb="yes" innodb_includes="-I../innobase/include" innodb_includes="-I\$(top_builddir)/innobase/include -I\$(top_srcdir)/innobase/include" innodb_system_libs="" dnl Some libs are listed several times, in order for gcc to sort out dnl circular references. Loading Loading @@ -1812,7 +1812,7 @@ AC_DEFUN([MYSQL_CHECK_NDBCLUSTER], [ AC_MSG_RESULT([Using NDB Cluster]) AC_DEFINE([HAVE_NDBCLUSTER_DB], [1], [Using Ndb Cluster DB]) have_ndbcluster="yes" ndbcluster_includes="-I../ndb/include -I../ndb/include/ndbapi" ndbcluster_includes="-I\$(top_builddir)/ndb/include -I\$(top_srcdir)/ndb/include -I\$(top_srcdir)/ndb/include/ndbapi" ndbcluster_libs="\$(top_builddir)/ndb/src/.libs/libndbclient.a" ndbcluster_system_libs="" ndb_mgmclient_libs="\$(top_builddir)/ndb/src/mgmclient/libndbmgmclient.la" Loading bdb/dist/gen_rec.awk +1 −1 Original line number Diff line number Diff line Loading @@ -180,7 +180,7 @@ BEGIN { t = types[i]; if (modes[i] == "POINTER") { ndx = index(t, "*"); t = substr(types[i], 0, ndx - 2); t = substr(types[i], 1, ndx - 2); } printf("\t%s\t%s;\n", t, vars[i]) >> HFILE } Loading client/mysqltest.c +79 −10 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ Matt Wagner <matt@mysql.com> Monty Jani Holyfoot */ #define MTEST_VERSION "3.0" Loading Loading @@ -220,6 +221,12 @@ struct st_connection MYSQL* util_mysql; char *name; MYSQL_STMT* stmt; const char *cur_query; int cur_query_len; pthread_mutex_t mutex; pthread_cond_t cond; int query_done; }; struct st_connection connections[128]; struct st_connection* cur_con, *next_con, *connections_end; Loading Loading @@ -458,7 +465,6 @@ void mysql_disable_rpl_parse(MYSQL* mysql __attribute__((unused))) {} int mysql_rpl_parse_enabled(MYSQL* mysql __attribute__((unused))) { return 1; } my_bool mysql_rpl_probe(MYSQL *mysql __attribute__((unused))) { return 1; } #endif void replace_dynstr_append_mem(DYNAMIC_STRING *ds, const char *val, int len); void replace_dynstr_append(DYNAMIC_STRING *ds, const char *val); Loading @@ -470,6 +476,56 @@ void handle_error(struct st_command*, void handle_no_error(struct st_command*); #ifdef EMBEDDED_LIBRARY /* send_one_query executes query in separate thread what is necessary in embedded library to run 'send' in proper way. This implementation doesn't handle errors returned by mysql_send_query. It's technically possible, though i don't see where it is needed. */ pthread_handler_decl(send_one_query, arg) { struct st_connection *cn= (struct st_connection*)arg; mysql_thread_init(); VOID(mysql_send_query(&cn->mysql, cn->cur_query, cn->cur_query_len)); mysql_thread_end(); pthread_mutex_lock(&cn->mutex); cn->query_done= 1; VOID(pthread_cond_signal(&cn->cond)); pthread_mutex_unlock(&cn->mutex); pthread_exit(0); return 0; } static int do_send_query(struct st_connection *cn, const char *q, int q_len, int flags) { pthread_t tid; if (flags & QUERY_REAP_FLAG) return mysql_send_query(&cn->mysql, q, q_len); if (pthread_mutex_init(&cn->mutex, NULL) || pthread_cond_init(&cn->cond, NULL)) die("Error in the thread library"); cn->cur_query= q; cn->cur_query_len= q_len; cn->query_done= 0; if (pthread_create(&tid, NULL, send_one_query, (void*)cn)) die("Cannot start new thread for query"); return 0; } #else /*EMBEDDED_LIBRARY*/ #define do_send_query(cn,q,q_len,flags) mysql_send_query(&cn->mysql, q, q_len) #endif /*EMBEDDED_LIBRARY*/ void do_eval(DYNAMIC_STRING *query_eval, const char *query, const char *query_end, my_bool pass_through_escape_chars) Loading Loading @@ -4506,7 +4562,6 @@ int append_warnings(DYNAMIC_STRING *ds, MYSQL* mysql) } /* Run query using MySQL C API Loading @@ -4523,10 +4578,11 @@ int append_warnings(DYNAMIC_STRING *ds, MYSQL* mysql) error - function will not return */ void run_query_normal(MYSQL *mysql, struct st_command *command, void run_query_normal(struct st_connection *cn, struct st_command *command, int flags, char *query, int query_len, DYNAMIC_STRING *ds, DYNAMIC_STRING *ds_warnings) { MYSQL *mysql= &cn->mysql; MYSQL_RES *res= 0; int err= 0, counter= 0; DBUG_ENTER("run_query_normal"); Loading @@ -4538,14 +4594,26 @@ void run_query_normal(MYSQL *mysql, struct st_command *command, /* Send the query */ if (mysql_send_query(mysql, query, query_len)) if (do_send_query(cn, query, query_len, flags)) { handle_error(command, mysql_errno(mysql), mysql_error(mysql), mysql_sqlstate(mysql), ds); goto end; } } #ifdef EMBEDDED_LIBRARY /* Here we handle 'reap' command, so we need to check if the query's thread was finished and probably wait */ else if (flags & QUERY_REAP_FLAG) { pthread_mutex_lock(&cn->mutex); while (!cn->query_done) pthread_cond_wait(&cn->cond, &cn->mutex); pthread_mutex_unlock(&cn->mutex); } #endif /*EMBEDDED_LIBRARY*/ if (!(flags & QUERY_REAP_FLAG)) DBUG_VOID_RETURN; Loading Loading @@ -5036,8 +5104,9 @@ int util_query(MYSQL* org_mysql, const char* query){ */ void run_query(MYSQL *mysql, struct st_command *command, int flags) void run_query(struct st_connection *cn, struct st_command *command, int flags) { MYSQL *mysql= &cn->mysql; DYNAMIC_STRING *ds; DYNAMIC_STRING ds_result; DYNAMIC_STRING ds_warnings; Loading Loading @@ -5194,7 +5263,7 @@ void run_query(MYSQL *mysql, struct st_command *command, int flags) match_re(&ps_re, query)) run_query_stmt(mysql, command, query, query_len, ds, &ds_warnings); else run_query_normal(mysql, command, flags, query, query_len, run_query_normal(cn, command, flags, query, query_len, ds, &ds_warnings); if (sp_created) Loading Loading @@ -5659,7 +5728,7 @@ int main(int argc, char **argv) strmake(command->require_file, save_file, sizeof(save_file)); save_file[0]= 0; } run_query(&cur_con->mysql, command, QUERY_REAP_FLAG|QUERY_SEND_FLAG); run_query(cur_con, command, QUERY_REAP_FLAG|QUERY_SEND_FLAG); display_result_vertically= old_display_result_vertically; command->last_argument= command->end; command_executed++; Loading Loading @@ -5690,7 +5759,7 @@ int main(int argc, char **argv) strmake(command->require_file, save_file, sizeof(save_file)); save_file[0]= 0; } run_query(&cur_con->mysql, command, flags); run_query(cur_con, command, flags); command_executed++; command->last_argument= command->end; break; Loading @@ -5716,7 +5785,7 @@ int main(int argc, char **argv) the query and read the result some time later when reap instruction is given on this connection. */ run_query(&cur_con->mysql, command, QUERY_SEND_FLAG); run_query(cur_con, command, QUERY_SEND_FLAG); command_executed++; command->last_argument= command->end; break; Loading Loading
Docs/Makefile.am +11 −11 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ all-local: $(TXT_FILES) # make sure that "make install" installs the info page, too # automake only seems to take care of this automatically, # if we're building the info page from texi directly. install-data-hook: mysql.info install-data-hook: $(srcdir)/mysql.info $(mkinstalldirs) $(DESTDIR)$(infodir) $(INSTALL_DATA) $(srcdir)/mysql.info $(DESTDIR)$(infodir) Loading @@ -39,23 +39,23 @@ CLEAN_FILES: $(TXT_FILES) GT = $(srcdir)/Support/generate-text-files.pl ../INSTALL-SOURCE: mysql.info $(GT) perl -w $(GT) $< "installing-source" "windows-source-build" > $@ ../INSTALL-SOURCE: $(srcdir)/mysql.info $(GT) perl -w $(GT) $(srcdir)/mysql.info "installing-source" "windows-source-build" > $@ ../INSTALL-WIN-SOURCE: mysql.info $(GT) perl -w $(GT) $< "windows-source-build" "post-installation" > $@ ../INSTALL-WIN-SOURCE: $(srcdir)/mysql.info $(GT) perl -w $(GT) $(srcdir)/mysql.info "windows-source-build" "post-installation" > $@ # We put the description for the binary installation here so that # people who download source wont have to see it. It is moved up to # the toplevel by the script that makes the binary tar files. INSTALL-BINARY: mysql.info $(GT) perl -w $(GT) $< "installing-binary" "installing-source" > $@ INSTALL-BINARY: $(srcdir)/mysql.info $(GT) perl -w $(GT) $(srcdir)/mysql.info "installing-binary" "installing-source" > $@ ../EXCEPTIONS-CLIENT: mysql.info $(GT) perl -w $(GT) $< "mysql-floss-license-exception" "function-index" > $@ ../EXCEPTIONS-CLIENT: $(srcdir)/mysql.info $(GT) perl -w $(GT) $(srcdir)/mysql.info "mysql-floss-license-exception" "function-index" > $@ ../support-files/MacOSX/ReadMe.txt: mysql.info $(GT) perl -w $(GT) $< "mac-os-x-installation" "netware-installation" > $@ ../support-files/MacOSX/ReadMe.txt: $(srcdir)/mysql.info $(GT) perl -w $(GT) $(srcdir)/mysql.info "mac-os-x-installation" "netware-installation" > $@ # Don't update the files from bitkeeper %::SCCS/s.%
Makefile.am +6 −0 Original line number Diff line number Diff line Loading @@ -131,3 +131,9 @@ test-force-pl: ./mysql-test-run.pl --force && \ ./mysql-test-run.pl --ps-protocol --force #used by autopush.pl to run memory based tests test-force-pl-mem: cd mysql-test; \ ./mysql-test-run.pl --force --mem && \ ./mysql-test-run.pl --ps-protocol --force --mem
acinclude.m4 +8 −8 Original line number Diff line number Diff line Loading @@ -1448,20 +1448,20 @@ bdb_version_ok=yes ]) AC_DEFUN([MYSQL_TOP_BUILDDIR], [ # Remove trailing "./" if any [$1]=`echo $[$1] | sed -e 's,^\./,,'` case "$[$1]" in /* ) ;; # don't do anything with an absolute path "$srcdir"/* ) "bdb" | "$srcdir/bdb" | "$top_srcdir/bdb" | "$abs_top_srcdir/bdb" ) # If BDB is under the source directory, we need to look under the # build directory for bdb/build_unix. # NOTE: I'm being lazy, and assuming the user did not specify # something like --with-berkeley-db=bdb (it would be missing "./"). [$1]="\$(top_builddir)/"`echo "$[$1]" | sed -e "s,^$srcdir/,,"` [$1]="\$(top_builddir)/bdb" ;; /* ) ;; # Other absolute path is assume to be external BDB directory * ) AC_MSG_ERROR([The BDB directory must be directly under the MySQL source directory, or be specified using the full path. ('$srcdir'; '$[$1]')]) ;; esac if test X"$[$1]" != "/" if test X"$[$1]" != X"/" then [$1]=`echo $[$1] | sed -e 's,/$,,'` fi Loading Loading @@ -1493,7 +1493,7 @@ AC_DEFUN([MYSQL_CHECK_INNODB], [ AC_MSG_RESULT([Using Innodb]) AC_DEFINE([HAVE_INNOBASE_DB], [1], [Using Innobase DB]) have_innodb="yes" innodb_includes="-I../innobase/include" innodb_includes="-I\$(top_builddir)/innobase/include -I\$(top_srcdir)/innobase/include" innodb_system_libs="" dnl Some libs are listed several times, in order for gcc to sort out dnl circular references. Loading Loading @@ -1812,7 +1812,7 @@ AC_DEFUN([MYSQL_CHECK_NDBCLUSTER], [ AC_MSG_RESULT([Using NDB Cluster]) AC_DEFINE([HAVE_NDBCLUSTER_DB], [1], [Using Ndb Cluster DB]) have_ndbcluster="yes" ndbcluster_includes="-I../ndb/include -I../ndb/include/ndbapi" ndbcluster_includes="-I\$(top_builddir)/ndb/include -I\$(top_srcdir)/ndb/include -I\$(top_srcdir)/ndb/include/ndbapi" ndbcluster_libs="\$(top_builddir)/ndb/src/.libs/libndbclient.a" ndbcluster_system_libs="" ndb_mgmclient_libs="\$(top_builddir)/ndb/src/mgmclient/libndbmgmclient.la" Loading
bdb/dist/gen_rec.awk +1 −1 Original line number Diff line number Diff line Loading @@ -180,7 +180,7 @@ BEGIN { t = types[i]; if (modes[i] == "POINTER") { ndx = index(t, "*"); t = substr(types[i], 0, ndx - 2); t = substr(types[i], 1, ndx - 2); } printf("\t%s\t%s;\n", t, vars[i]) >> HFILE } Loading
client/mysqltest.c +79 −10 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ Matt Wagner <matt@mysql.com> Monty Jani Holyfoot */ #define MTEST_VERSION "3.0" Loading Loading @@ -220,6 +221,12 @@ struct st_connection MYSQL* util_mysql; char *name; MYSQL_STMT* stmt; const char *cur_query; int cur_query_len; pthread_mutex_t mutex; pthread_cond_t cond; int query_done; }; struct st_connection connections[128]; struct st_connection* cur_con, *next_con, *connections_end; Loading Loading @@ -458,7 +465,6 @@ void mysql_disable_rpl_parse(MYSQL* mysql __attribute__((unused))) {} int mysql_rpl_parse_enabled(MYSQL* mysql __attribute__((unused))) { return 1; } my_bool mysql_rpl_probe(MYSQL *mysql __attribute__((unused))) { return 1; } #endif void replace_dynstr_append_mem(DYNAMIC_STRING *ds, const char *val, int len); void replace_dynstr_append(DYNAMIC_STRING *ds, const char *val); Loading @@ -470,6 +476,56 @@ void handle_error(struct st_command*, void handle_no_error(struct st_command*); #ifdef EMBEDDED_LIBRARY /* send_one_query executes query in separate thread what is necessary in embedded library to run 'send' in proper way. This implementation doesn't handle errors returned by mysql_send_query. It's technically possible, though i don't see where it is needed. */ pthread_handler_decl(send_one_query, arg) { struct st_connection *cn= (struct st_connection*)arg; mysql_thread_init(); VOID(mysql_send_query(&cn->mysql, cn->cur_query, cn->cur_query_len)); mysql_thread_end(); pthread_mutex_lock(&cn->mutex); cn->query_done= 1; VOID(pthread_cond_signal(&cn->cond)); pthread_mutex_unlock(&cn->mutex); pthread_exit(0); return 0; } static int do_send_query(struct st_connection *cn, const char *q, int q_len, int flags) { pthread_t tid; if (flags & QUERY_REAP_FLAG) return mysql_send_query(&cn->mysql, q, q_len); if (pthread_mutex_init(&cn->mutex, NULL) || pthread_cond_init(&cn->cond, NULL)) die("Error in the thread library"); cn->cur_query= q; cn->cur_query_len= q_len; cn->query_done= 0; if (pthread_create(&tid, NULL, send_one_query, (void*)cn)) die("Cannot start new thread for query"); return 0; } #else /*EMBEDDED_LIBRARY*/ #define do_send_query(cn,q,q_len,flags) mysql_send_query(&cn->mysql, q, q_len) #endif /*EMBEDDED_LIBRARY*/ void do_eval(DYNAMIC_STRING *query_eval, const char *query, const char *query_end, my_bool pass_through_escape_chars) Loading Loading @@ -4506,7 +4562,6 @@ int append_warnings(DYNAMIC_STRING *ds, MYSQL* mysql) } /* Run query using MySQL C API Loading @@ -4523,10 +4578,11 @@ int append_warnings(DYNAMIC_STRING *ds, MYSQL* mysql) error - function will not return */ void run_query_normal(MYSQL *mysql, struct st_command *command, void run_query_normal(struct st_connection *cn, struct st_command *command, int flags, char *query, int query_len, DYNAMIC_STRING *ds, DYNAMIC_STRING *ds_warnings) { MYSQL *mysql= &cn->mysql; MYSQL_RES *res= 0; int err= 0, counter= 0; DBUG_ENTER("run_query_normal"); Loading @@ -4538,14 +4594,26 @@ void run_query_normal(MYSQL *mysql, struct st_command *command, /* Send the query */ if (mysql_send_query(mysql, query, query_len)) if (do_send_query(cn, query, query_len, flags)) { handle_error(command, mysql_errno(mysql), mysql_error(mysql), mysql_sqlstate(mysql), ds); goto end; } } #ifdef EMBEDDED_LIBRARY /* Here we handle 'reap' command, so we need to check if the query's thread was finished and probably wait */ else if (flags & QUERY_REAP_FLAG) { pthread_mutex_lock(&cn->mutex); while (!cn->query_done) pthread_cond_wait(&cn->cond, &cn->mutex); pthread_mutex_unlock(&cn->mutex); } #endif /*EMBEDDED_LIBRARY*/ if (!(flags & QUERY_REAP_FLAG)) DBUG_VOID_RETURN; Loading Loading @@ -5036,8 +5104,9 @@ int util_query(MYSQL* org_mysql, const char* query){ */ void run_query(MYSQL *mysql, struct st_command *command, int flags) void run_query(struct st_connection *cn, struct st_command *command, int flags) { MYSQL *mysql= &cn->mysql; DYNAMIC_STRING *ds; DYNAMIC_STRING ds_result; DYNAMIC_STRING ds_warnings; Loading Loading @@ -5194,7 +5263,7 @@ void run_query(MYSQL *mysql, struct st_command *command, int flags) match_re(&ps_re, query)) run_query_stmt(mysql, command, query, query_len, ds, &ds_warnings); else run_query_normal(mysql, command, flags, query, query_len, run_query_normal(cn, command, flags, query, query_len, ds, &ds_warnings); if (sp_created) Loading Loading @@ -5659,7 +5728,7 @@ int main(int argc, char **argv) strmake(command->require_file, save_file, sizeof(save_file)); save_file[0]= 0; } run_query(&cur_con->mysql, command, QUERY_REAP_FLAG|QUERY_SEND_FLAG); run_query(cur_con, command, QUERY_REAP_FLAG|QUERY_SEND_FLAG); display_result_vertically= old_display_result_vertically; command->last_argument= command->end; command_executed++; Loading Loading @@ -5690,7 +5759,7 @@ int main(int argc, char **argv) strmake(command->require_file, save_file, sizeof(save_file)); save_file[0]= 0; } run_query(&cur_con->mysql, command, flags); run_query(cur_con, command, flags); command_executed++; command->last_argument= command->end; break; Loading @@ -5716,7 +5785,7 @@ int main(int argc, char **argv) the query and read the result some time later when reap instruction is given on this connection. */ run_query(&cur_con->mysql, command, QUERY_SEND_FLAG); run_query(cur_con, command, QUERY_SEND_FLAG); command_executed++; command->last_argument= command->end; break; Loading