From c5aadd2821c25689e366958d13f3dcf665bdd9fe Mon Sep 17 00:00:00 2001 From: "jani@rhols221.adsl.netsonic.fi" <> Date: Sun, 9 Mar 2003 19:03:55 +0200 Subject: [PATCH] Made it possible to use --max-delayed-threads=0 in order to disable INSERT DELAYED. --- sql/mysqld.cc | 4 ++-- sql/sql_insert.cc | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index a03c4f5db8b..a042b7f314b 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3770,9 +3770,9 @@ struct my_option my_long_options[] = (gptr*) &max_connect_errors, (gptr*) &max_connect_errors, 0, GET_ULONG, REQUIRED_ARG, MAX_CONNECT_ERRORS, 1, ~0L, 0, 1, 0}, {"max_delayed_threads", OPT_MAX_DELAYED_THREADS, - "Don't start more than this number of threads to handle INSERT DELAYED statements.", + "Don't start more than this number of threads to handle INSERT DELAYED statements. This option does not yet have effect (on TODO), unless it is set to zero, which means INSERT DELAYED is not used.", (gptr*) &max_insert_delayed_threads, (gptr*) &max_insert_delayed_threads, - 0, GET_ULONG, REQUIRED_ARG, 20, 1, 16384, 0, 1, 0}, + 0, GET_ULONG, REQUIRED_ARG, 20, 0, 16384, 0, 1, 0}, {"max_heap_table_size", OPT_MAX_HEP_TABLE_SIZE, "Don't allow creation of heap tables bigger than this.", (gptr*) &global_system_variables.max_heap_table_size, diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 7725808075a..5bf852afc32 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -140,7 +140,8 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, List &fields, if ((lock_type == TL_WRITE_DELAYED && ((specialflag & (SPECIAL_NO_NEW_FUNC | SPECIAL_SAFE_MODE)) || thd->slave_thread)) || - (lock_type == TL_WRITE_CONCURRENT_INSERT && duplic == DUP_REPLACE)) + (lock_type == TL_WRITE_CONCURRENT_INSERT && duplic == DUP_REPLACE) || + !max_insert_delayed_threads) lock_type=TL_WRITE; if (lock_type == TL_WRITE_DELAYED)