summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2001-10-02 05:53:00 +0300
committerunknown <monty@hundin.mysql.fi>2001-10-02 05:53:00 +0300
commit9e72e1ef534384ab53a0c5943399c946856bef76 (patch)
treeb029d516fe4b48e540f64b01492d64cf5d68ad2f /sql
parent003ed4cfaecf0c80dc2ced8593e869076cd8c34d (diff)
downloadmariadb-git-9e72e1ef534384ab53a0c5943399c946856bef76.tar.gz
Cleaned up SSL documentation
Fixes for embedded server Made key_cache more configurable Fixed that one can change key blocksize in MyISAM A lot of optimizations to make MyISAM slightly faster Docs/manual.texi: Cleaned up SSL documentation client/mysql.cc: Fixes for embedded server client/mysqltest.c: Fixes for embedded server Removed memory and file leaks include/my_global.h: Added C_MODE_START / C_MODE_END macros include/my_sys.h: Made key_cache more configurable include/myisam.h: Fixed that one can change MyISAM key block size include/mysql.h: Fixes for embedded server libmysql/libmysql.c: Cleanup libmysqld/Makefile.am: Cleanup libmysqld/examples/test-run: Added --debug libmysqld/lib_sql.cc: Cleanup libmysqld/libmysqld.c: Cleanup myisam/ft_boolean_search.c: Optimized mi_key_cmp to be faster myisam/ft_nlq_search.c: Optimized mi_key_cmp to be faster myisam/ft_search.c: Optimized mi_key_cmp to be faster myisam/mi_changed.c: Optimized mi_key_cmp to be faster myisam/mi_check.c: Optimized mi_key_cmp to be faster myisam/mi_create.c: Fixed that one can change blocksize by changing myisam_block_size myisam/mi_delete.c: Optimized mi_key_cmp to be faster myisam/mi_delete_all.c: Optimized mi_key_cmp to be faster myisam/mi_dynrec.c: Speed optimizations myisam/mi_info.c: Speed optimizations myisam/mi_key.c: Speed optimizations myisam/mi_locking.c: Speed optimizations myisam/mi_open.c: Fixed that one can change blocksize by changing myisam_block_size myisam/mi_page.c: Fixed that one can change blocksize by changing myisam_block_size myisam/mi_range.c: Speed optimizations myisam/mi_rkey.c: Speed optimizations myisam/mi_rnext.c: Speed optimizations myisam/mi_rnext_same.c: Speed optimizations myisam/mi_rprev.c: Speed optimizations myisam/mi_rsame.c: Speed optimizations myisam/mi_search.c: Speed optimizations myisam/mi_static.c: Fixed that one can change blocksize by changing myisam_block_size myisam/mi_statrec.c: Speed optimizations myisam/mi_test2.c: Added more test options myisam/mi_test_all.res: Added more test options myisam/mi_test_all.sh: Added more test options myisam/mi_write.c: Speed optimizations myisam/myisamchk.c: Added options to change block size and repair checksums myisam/myisamdef.h: Speed optimizations mysys/Makefile.am: Added bit handling functions mysys/mf_keycache.c: Made key_cache more configurable mysys/my_init.c: made my_init_done global scripts/mysql_fix_privilege_tables.sh: Fixes for SSL scripts/mysql_install_db.sh: Fixes for SSL sql/derror.cc: Don't call exit, call unireg_abort() sql/item_cmpfunc.cc: Speed optimizations sql/item_cmpfunc.h: Speed optimizations sql/mysql_priv.h: Fixes for embedded server sql/mysqld.cc: Fixes for embedded server
Diffstat (limited to 'sql')
-rw-r--r--sql/derror.cc6
-rw-r--r--sql/item_cmpfunc.cc10
-rw-r--r--sql/item_cmpfunc.h9
-rw-r--r--sql/mysql_priv.h2
-rw-r--r--sql/mysqld.cc54
5 files changed, 52 insertions, 29 deletions
diff --git a/sql/derror.cc b/sql/derror.cc
index 62971fde394..697d363b86b 100644
--- a/sql/derror.cc
+++ b/sql/derror.cc
@@ -72,8 +72,7 @@ static void read_texts(const char *file_name,const char ***point,
Check that the above file is the right version for this program!\n\n",
my_progname,name,ant,error_messages);
VOID(my_close(file,MYF(MY_WME)));
- clean_up(0); /* Clean_up frees everything */
- exit(1); /* We can't continue */
+ unireg_abort(1);
}
x_free((gptr) *point); /* Free old language */
@@ -115,8 +114,7 @@ err:
if (file != FERR)
VOID(my_close(file,MYF(MY_WME)));
fprintf(stderr,buff,my_progname,name);
- clean_up(0); /* Clean_up frees everything */
- exit(1); /* We can't continue */
+ unireg_abort(1);
} /* read_texts */
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index db1d6911119..ac8534916d6 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -1197,13 +1197,19 @@ longlong Item_cond_or::val_int()
longlong Item_func_isnull::val_int()
{
- (void) args[0]->val();
+ if (internal_result_type == REAL_RESULT)
+ (void) args[0]->val();
+ else
+ (void) args[0]->val_int();
return (args[0]->null_value) ? 1 : 0;
}
longlong Item_func_isnotnull::val_int()
{
- (void) args[0]->val();
+ if (internal_result_type == REAL_RESULT)
+ (void) args[0]->val();
+ else
+ (void) args[0]->val_int();
return !(args[0]->null_value) ? 1 : 0;
}
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 5ee0687c064..9c9336264f7 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -429,6 +429,7 @@ class Item_func_in :public Item_int_func
class Item_func_isnull :public Item_bool_func
{
+ enum Item_result internal_result_type;
public:
Item_func_isnull(Item *a) :Item_bool_func(a) {}
longlong val_int();
@@ -437,6 +438,7 @@ public:
{
decimals=0; max_length=1; maybe_null=0;
Item_func_isnull::update_used_tables();
+ internal_result_type=args[0]->result_type();
}
const char *func_name() const { return "isnull"; }
/* Optimize case of not_null_column IS NULL */
@@ -455,11 +457,16 @@ public:
class Item_func_isnotnull :public Item_bool_func
{
+ enum Item_result internal_result_type;
public:
Item_func_isnotnull(Item *a) :Item_bool_func(a) {}
longlong val_int();
enum Functype functype() const { return ISNOTNULL_FUNC; }
- void fix_length_and_dec() { decimals=0; max_length=1; maybe_null=0; }
+ void fix_length_and_dec()
+ {
+ decimals=0; max_length=1; maybe_null=0;
+ internal_result_type=args[0]->result_type();
+ }
const char *func_name() const { return "isnotnull"; }
optimize_type select_optimize() const { return OPTIMIZE_NULL; }
};
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 7a32a253d6c..851e33fca04 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -506,7 +506,7 @@ void sql_print_error(const char *format,...)
__attribute__ ((format (printf, 1, 2)));
extern uint32 server_id;
-extern char mysql_data_home[2],server_version[SERVER_VERSION_LENGTH],
+extern char *mysql_data_home,server_version[SERVER_VERSION_LENGTH],
max_sort_char, mysql_real_data_home[];
extern my_string mysql_unix_port,mysql_tmpdir;
extern const char *first_keyword, *localhost, *delayed_user;
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index c14ae3aa61a..bd5769c3237 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -214,8 +214,9 @@ SHOW_COMP_OPTION have_symlink=SHOW_OPTION_YES;
static bool opt_skip_slave_start = 0; // if set, slave is not autostarted
static bool opt_do_pstack = 0;
static ulong opt_specialflag=SPECIAL_ENGLISH;
-static my_socket unix_sock= INVALID_SOCKET,ip_sock= INVALID_SOCKET;
static ulong back_log,connect_timeout,concurrency;
+static ulong opt_myisam_block_size;
+static my_socket unix_sock= INVALID_SOCKET,ip_sock= INVALID_SOCKET;
static my_string opt_logname=0,opt_update_logname=0,
opt_binlog_index_name = 0,opt_slow_logname=0;
static char mysql_home[FN_REFLEN],pidfile_name[FN_REFLEN];
@@ -310,10 +311,16 @@ ulong slow_launch_threads = 0;
ulong myisam_max_sort_file_size, myisam_max_extra_sort_file_size;
char mysql_real_data_home[FN_REFLEN],
- mysql_data_home[2],language[LIBLEN],reg_ext[FN_EXTLEN],
+ language[LIBLEN],reg_ext[FN_EXTLEN],
default_charset[LIBLEN],mysql_charsets_dir[FN_REFLEN], *charsets_list,
blob_newline,f_fyllchar,max_sort_char,*mysqld_user,*mysqld_chroot,
*opt_init_file;
+#ifndef EMBEDDED_LIBRARY
+char mysql_data_home_buff[2], *mysql_data_home=mysql_data_home_buff;
+#else
+char *mysql_data_home=mysql_real_data_home;
+#endif
+
char *opt_bin_logname = 0; // this one needs to be seen in sql_parse.cc
char server_version[SERVER_VERSION_LENGTH]=MYSQL_SERVER_VERSION;
const char *first_keyword="first";
@@ -677,9 +684,8 @@ static sig_handler print_signal_warning(int sig)
void unireg_end(int signal_number __attribute__((unused)))
{
clean_up();
-#ifndef EMBEDDED_LIBRARY
+ my_thread_end();
pthread_exit(0); // Exit is in main thread
-#endif
}
@@ -688,6 +694,7 @@ void unireg_abort(int exit_code)
if (exit_code)
sql_print_error("Aborting\n");
clean_up(); /* purecov: inspected */
+ my_thread_end();
exit(exit_code); /* purecov: inspected */
}
@@ -730,14 +737,13 @@ void clean_up(bool print_message)
free_max_user_conn();
end_slave_list();
-#ifndef __WIN__
+#if !defined(__WIN__) && !defined(EMBEDDED_LIBRARY)
if (!opt_bootstrap)
(void) my_delete(pidfile_name,MYF(0)); // This may not always exist
#endif
if (print_message)
sql_print_error(ER(ER_SHUTDOWN_COMPLETE),my_progname);
x_free((gptr) my_errmsg[ERRMAPP]); /* Free messages */
- my_thread_end();
/* Tell main we are ready */
(void) pthread_mutex_lock(&LOCK_thread_count);
@@ -1782,10 +1788,6 @@ int main(int argc, char **argv)
init_thr_lock();
init_slave_list();
- /* Fix varibles that are base 1024*1024 */
- myisam_max_temp_length= (my_off_t) min(((ulonglong) myisam_max_sort_file_size)*1024*1024, (ulonglong) MAX_FILE_SIZE);
- myisam_max_extra_temp_length= (my_off_t) min(((ulonglong) myisam_max_extra_sort_file_size)*1024*1024, (ulonglong) MAX_FILE_SIZE);
-
/* Setup log files */
if (opt_log)
open_log(&mysql_log, glob_hostname, opt_logname, ".log", LOG_NORMAL);
@@ -1796,17 +1798,18 @@ int main(int argc, char **argv)
using_update_log=1;
}
- //make sure slave thread gets started
- // if server_id is set, valid master.info is present, and master_host has
- // not been specified
- if(server_id && !master_host)
- {
- char fname[FN_REFLEN+128];
- MY_STAT stat_area;
- fn_format(fname, master_info_file, mysql_data_home, "", 4+16+32);
- if(my_stat(fname, &stat_area, MYF(0)) && !init_master_info(&glob_mi))
- master_host = glob_mi.host;
- }
+ /*
+ make sure slave thread gets started if server_id is set,
+ valid master.info is present, and master_host has not been specified
+ */
+ if (server_id && !master_host)
+ {
+ char fname[FN_REFLEN+128];
+ MY_STAT stat_area;
+ fn_format(fname, master_info_file, mysql_data_home, "", 4+16+32);
+ if (my_stat(fname, &stat_area, MYF(0)) && !init_master_info(&glob_mi))
+ master_host = glob_mi.host;
+ }
if (opt_bin_log && !server_id)
{
@@ -2882,6 +2885,9 @@ CHANGEABLE_VAR changeable_vars[] = {
~0L, 1, ~0L, 0, 1 },
{ "myisam_bulk_insert_tree_size", (long*) &myisam_bulk_insert_tree_size,
8192*1024, 4, ~0L, 0, 1 },
+ { "myisam_block_size", (long*) &opt_myisam_block_size,
+ MI_KEY_BLOCK_LENGTH, MI_MIN_KEY_BLOCK_LENGTH, MI_MAX_KEY_BLOCK_LENGTH,
+ 0, MI_MIN_KEY_BLOCK_LENGTH },
{ "myisam_max_extra_sort_file_size",
(long*) &myisam_max_extra_sort_file_size,
(long) (MI_MAX_TEMP_LENGTH/(1024L*1024L)), 0, ~0L, 0, 1 },
@@ -4025,6 +4031,12 @@ static void get_options(int argc,char **argv)
/* To be deleted in MySQL 4.0 */
if (!record_rnd_cache_size)
record_rnd_cache_size=my_default_record_cache_size;
+
+ /* Fix variables that are base 1024*1024 */
+ myisam_max_temp_length= (my_off_t) min(((ulonglong) myisam_max_sort_file_size)*1024*1024, (ulonglong) MAX_FILE_SIZE);
+ myisam_max_extra_temp_length= (my_off_t) min(((ulonglong) myisam_max_extra_sort_file_size)*1024*1024, (ulonglong) MAX_FILE_SIZE);
+
+ myisam_block_size=(uint) 1 << my_bit_log2(opt_myisam_block_size);
}