summaryrefslogtreecommitdiff
path: root/sql/mysqld.cc
diff options
context:
space:
mode:
authorunknown <igor@rurik.mysql.com>2003-07-16 13:35:34 -0700
committerunknown <igor@rurik.mysql.com>2003-07-16 13:35:34 -0700
commit5742bdf60979d6b1d56a86fd27df556dcd4b1bf3 (patch)
tree7cda3f32b4df3b70ba418601d183b2f3265e1fff /sql/mysqld.cc
parent176d336404e1a29ff1b61ffb690d2132187e4d88 (diff)
parenta41a43f99d053b96821d0c7388126ca581146933 (diff)
downloadmariadb-git-5742bdf60979d6b1d56a86fd27df556dcd4b1bf3.tar.gz
Conflict resolution
include/my_sys.h: Auto merged sql/handler.cc: Auto merged sql/item_cmpfunc.h: Auto merged sql/mysql_priv.h: Auto merged sql/opt_range.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_parse.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/mysqld.cc: Manual merge
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r--sql/mysqld.cc89
1 files changed, 61 insertions, 28 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 9da15adcf68..52b1b26d7a9 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -312,11 +312,12 @@ const char *sql_mode_str="OFF";
FILE *bootstrap_file;
-I_List <i_string_pair> replicate_rewrite_db;
+I_List<i_string_pair> replicate_rewrite_db;
I_List<i_string> replicate_do_db, replicate_ignore_db;
// allow the user to tell us which db to replicate and which to ignore
I_List<i_string> binlog_do_db, binlog_ignore_db;
I_List<THD> threads,thread_cache;
+I_List<NAMED_LIST> key_caches;
struct system_variables global_system_variables;
struct system_variables max_system_variables;
@@ -875,6 +876,7 @@ void clean_up(bool print_message)
#endif
(void) ha_panic(HA_PANIC_CLOSE); /* close all tables and logs */
end_key_cache(&dflt_keycache,1);
+ delete_elements(&key_caches, free_key_cache);
end_thr_alarm(1); /* Free allocated memory */
#ifdef USE_RAID
end_raid();
@@ -1818,15 +1820,28 @@ extern "C" int my_message_sql(uint error, const char *str,
{
THD *thd;
DBUG_ENTER("my_message_sql");
- DBUG_PRINT("error",("Message: '%s'",str));
- if ((thd=current_thd))
+ DBUG_PRINT("error", ("Message: '%s'", str));
+ if ((thd= current_thd))
{
- NET *net= &thd->net;
- net->report_error= 1;
- if (!net->last_error[0]) // Return only first message
+ /*
+ thd->lex.current_select equel to zero if lex structure is not inited
+ (not query command (COM_QUERY))
+ */
+ if (thd->lex.current_select &&
+ thd->lex.current_select->no_error && !thd->is_fatal_error)
+ {
+ DBUG_PRINT("error", ("above error converted to warning"));
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, error, str);
+ }
+ else
{
- strmake(net->last_error,str,sizeof(net->last_error)-1);
- net->last_errno=error ? error : ER_UNKNOWN_ERROR;
+ NET *net= &thd->net;
+ net->report_error= 1;
+ if (!net->last_error[0]) // Return only first message
+ {
+ strmake(net->last_error, str, sizeof(net->last_error)-1);
+ net->last_errno= error ? error : ER_UNKNOWN_ERROR;
+ }
}
}
else
@@ -1988,22 +2003,6 @@ static int init_common_variables(const char *conf_file_name, int argc,
DBUG_PRINT("info",("%s Ver %s for %s on %s\n",my_progname,
server_version, SYSTEM_TYPE,MACHINE_TYPE));
-#ifdef HAVE_PTHREAD_ATTR_GETSTACKSIZE
- {
- /* Retrieve used stack size; Needed for checking stack overflows */
- size_t stack_size= 0;
- pthread_attr_getstacksize(&connection_attrib, &stack_size);
- /* We must check if stack_size = 0 as Solaris 2.9 can return 0 here */
- if (stack_size && stack_size < thread_stack)
- {
- if (global_system_variables.log_warnings)
- sql_print_error("Warning: Asked for %ld thread stack, but got %ld",
- thread_stack, stack_size);
- thread_stack= stack_size;
- }
- }
-#endif
-
#if defined( SET_RLIMIT_NOFILE) || defined( OS2)
/* connections and databases needs lots of files */
{
@@ -2353,6 +2352,21 @@ int main(int argc, char **argv)
if (!(opt_specialflag & SPECIAL_NO_PRIOR))
my_pthread_setprio(pthread_self(),CONNECT_PRIOR);
pthread_attr_setstacksize(&connection_attrib,thread_stack);
+#ifdef HAVE_PTHREAD_ATTR_GETSTACKSIZE
+ {
+ /* Retrieve used stack size; Needed for checking stack overflows */
+ size_t stack_size= 0;
+ pthread_attr_getstacksize(&connection_attrib, &stack_size);
+ /* We must check if stack_size = 0 as Solaris 2.9 can return 0 here */
+ if (stack_size && stack_size < thread_stack)
+ {
+ if (global_system_variables.log_warnings)
+ sql_print_error("Warning: Asked for %ld thread stack, but got %ld",
+ thread_stack, stack_size);
+ thread_stack= stack_size;
+ }
+ }
+#endif
(void) thr_setconcurrency(concurrency); // 10 by default
select_thread=pthread_self();
@@ -4091,7 +4105,7 @@ replicating a LOAD DATA INFILE command.",
REQUIRED_ARG, 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, ~0L, MALLOC_OVERHEAD,
IO_SIZE, 0},
{"key_buffer_size", OPT_KEY_BUFFER_SIZE,
- "The size of the buffer used for index blocks. Increase this to get better index handling (for all reads and multiple writes) to as much as you can afford; 64M on a 256M machine that mainly runs MySQL is quite common.",
+ "The size of the buffer used for index blocks for MyISAM tables. Increase this to get better index handling (for all reads and multiple writes) to as much as you can afford; 64M on a 256M machine that mainly runs MySQL is quite common.",
(gptr*) &keybuff_size, (gptr*) &keybuff_size, 0,
(enum get_opt_var_type) (GET_ULL | GET_ASK_ADDR),
REQUIRED_ARG, KEY_CACHE_SIZE, MALLOC_OVERHEAD, (long) ~0, MALLOC_OVERHEAD,
@@ -4667,6 +4681,9 @@ static void mysql_init_variables(void)
my_bind_addr = htonl(INADDR_ANY);
threads.empty();
thread_cache.empty();
+ key_caches.empty();
+ if (!get_or_create_key_cache("default", 7))
+ exit(1);
/* Initialize structures that is used when processing options */
replicate_rewrite_db.empty();
@@ -5297,16 +5314,30 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
}
return 0;
}
- /* Initiates DEBUG - but no debugging here ! */
extern "C" gptr *
-mysql_getopt_value(char *keyname, uint key_length,
+mysql_getopt_value(const char *keyname, uint key_length,
const struct my_option *option)
{
+ if (!key_length)
+ {
+ keyname= "default";
+ key_length= 7;
+ }
+ switch (option->id) {
+ case OPT_KEY_BUFFER_SIZE:
+ {
+ KEY_CACHE *key_cache;
+ if (!(key_cache= get_or_create_key_cache(keyname, key_length)))
+ exit(1);
+ return (gptr*) &key_cache->size;
+ }
+ }
return option->value;
}
+
static void get_options(int argc,char **argv)
{
int ho_error;
@@ -5354,6 +5385,8 @@ static void get_options(int argc,char **argv)
table_alias_charset= (lower_case_table_names ?
files_charset_info :
&my_charset_bin);
+ /* QQ To be deleted when we have key cache variables in a struct */
+ keybuff_size= (((KEY_CACHE *) find_named(&key_caches, "default", 7))->size);
}
@@ -5568,6 +5601,6 @@ template class I_List<THD>;
template class I_List_iterator<THD>;
template class I_List<i_string>;
template class I_List<i_string_pair>;
-
+template class I_List<NAMED_LIST>;
FIX_GCC_LINKING_PROBLEM
#endif