diff options
Diffstat (limited to 'sql')
-rw-r--r-- | sql/mysqld.cc | 60 | ||||
-rw-r--r-- | sql/share/dutch/errmsg.txt | 3 | ||||
-rw-r--r-- | sql/sql_delete.cc | 8 | ||||
-rw-r--r-- | sql/sql_union.cc | 7 |
4 files changed, 71 insertions, 7 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 0dda582da59..99f0a463a42 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1720,6 +1720,12 @@ int main(int argc, char **argv) my_umask=0660; // Default umask for new files my_umask_dir=0700; // Default umask for new directories MAIN_THD; + /* initialize signal_th and shutdown_th to main_th for default value + as we need to initialize them to something safe. They are used + when compiled with safemalloc + */ + SIGNAL_THD; + SHUTDOWN_THD; MY_INIT(argv[0]); // init my_sys library & pthreads tzset(); // Set tzname @@ -2733,7 +2739,9 @@ enum options { OPT_SLAVE_LOAD_TMPDIR, OPT_NO_MIX_TYPE, OPT_RPL_RECOVERY_RANK,OPT_INIT_RPL_ROLE, OPT_RELAY_LOG, OPT_RELAY_LOG_INDEX, OPT_RELAY_LOG_INFO_FILE, - OPT_SLAVE_SKIP_ERRORS, OPT_DES_KEY_FILE, OPT_LOCAL_INFILE + OPT_SLAVE_SKIP_ERRORS, OPT_DES_KEY_FILE, OPT_LOCAL_INFILE, + OPT_SSL_SSL, OPT_SSL_KEY, OPT_SSL_CERT, OPT_SSL_CA, + OPT_SSL_CAPATH, OPT_SSL_CIPHER }; static struct option long_options[] = { @@ -2894,7 +2902,14 @@ static struct option long_options[] = { {"socket", required_argument, 0, (int) OPT_SOCKET}, {"sql-bin-update-same", no_argument, 0, (int) OPT_SQL_BIN_UPDATE_SAME}, {"sql-mode", required_argument, 0, (int) OPT_SQL_MODE}, -#include "sslopt-longopts.h" +#ifdef HAVE_OPENSSL + {"ssl", no_argument, 0, OPT_SSL_SSL}, + {"ssl-key", required_argument, 0, OPT_SSL_KEY}, + {"ssl-cert", required_argument, 0, OPT_SSL_CERT}, + {"ssl-ca", required_argument, 0, OPT_SSL_CA}, + {"ssl-capath", required_argument, 0, OPT_SSL_CAPATH}, + {"ssl-cipher", required_argument, 0, OPT_SSL_CIPHER}, +#endif #ifdef __WIN__ {"standalone", no_argument, 0, (int) OPT_STANDALONE}, #endif @@ -3539,7 +3554,15 @@ Starts the MySQL server\n"); print_defaults("my",load_default_groups); puts(""); -#include "sslopt-usage.h" +#ifdef HAVE_OPENSSL + puts("\ + --ssl Use SSL for connection (automatically set with other flags\n\ + --ssl-key X509 key in PEM format (implies --ssl)\n\ + --ssl-cert X509 cert in PEM format (implies --ssl)\n\ + --ssl-ca CA file in PEM format (check OpenSSL docs, implies --ssl)\n\ + --ssl-capath CA directory (check OpenSSL docs, implies --ssl)\n\ + --ssl-cipher SSL cipher to use (implies --ssl)"); +#endif fix_paths(); set_ports(); @@ -4083,7 +4106,36 @@ static void get_options(int argc,char **argv) strmake(mysql_charsets_dir, optarg, sizeof(mysql_charsets_dir)-1); charsets_dir = mysql_charsets_dir; break; -#include "sslopt-case.h" +#ifdef HAVE_OPENSSL + case OPT_SSL_SSL: + opt_use_ssl = 1; /* true */ + break; + case OPT_SSL_KEY: + opt_use_ssl = 1; /* true */ + my_free(opt_ssl_key, MYF(MY_ALLOW_ZERO_PTR)); + opt_ssl_key = my_strdup(optarg, MYF(0)); + break; + case OPT_SSL_CERT: + opt_use_ssl = 1; /* true */ + my_free(opt_ssl_cert, MYF(MY_ALLOW_ZERO_PTR)); + opt_ssl_cert = my_strdup(optarg, MYF(0)); + break; + case OPT_SSL_CA: + opt_use_ssl = 1; /* true */ + my_free(opt_ssl_ca, MYF(MY_ALLOW_ZERO_PTR)); + opt_ssl_ca = my_strdup(optarg, MYF(0)); + break; + case OPT_SSL_CAPATH: + opt_use_ssl = 1; /* true */ + my_free(opt_ssl_capath, MYF(MY_ALLOW_ZERO_PTR)); + opt_ssl_capath = my_strdup(optarg, MYF(0)); + break; + case OPT_SSL_CIPHER: + opt_use_ssl = 1; /* true */ + my_free(opt_ssl_cipher, MYF(MY_ALLOW_ZERO_PTR)); + opt_ssl_cipher = my_strdup(optarg, MYF(0)); + break; +#endif case OPT_DES_KEY_FILE: #ifdef HAVE_OPENSSL des_key_file=optarg; diff --git a/sql/share/dutch/errmsg.txt b/sql/share/dutch/errmsg.txt index 9af197e9e4b..c8b47cb3c19 100644 --- a/sql/share/dutch/errmsg.txt +++ b/sql/share/dutch/errmsg.txt @@ -5,6 +5,7 @@ 2001-08-02 - Arjen Lentz (agl@bitbike.com) Completed earlier partial translation; worked on consistency and spelling. 2002-01-29 - Arjen Lentz (arjen@mysql.com) + 2002-04-11 - Arjen Lentz (arjen@mysql.com) Translated new error messages. */ @@ -234,4 +235,4 @@ "Kan de query niet uitvoeren vanwege een conflicterende read lock", "Het combineren van transactionele en niet-transactionele tabellen is uitgeschakeld.", "Optie '%s' tweemaal gebruikt in opdracht", -"User '%-64s' has exceeded the '%s' resource (current value: %ld)", +"Gebruiker '%-64s' heeft het maximale gebruik van de '%s' faciliteit overschreden (huidige waarde: %ld)", diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 89e30f31fd5..f5a5a684fc0 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -520,7 +520,11 @@ int mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok) if ((error= (int) !(open_temporary_table(thd, path, table_list->db, table_list->real_name, 1)))) (void) rm_temporary_table(table_type, path); - DBUG_RETURN(error ? -1 : 0); + /* Sasha: if we return here we will not have binloged the truncation and + we will not send_ok() to the client. Yes, we do need better coverage + testing, this bug has been here for a few months :-). + */ + goto end; } (void) sprintf(path,"%s/%s/%s%s",mysql_data_home,table_list->db, @@ -549,7 +553,7 @@ int mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok) *fn_ext(path)=0; // Remove the .frm extension error= ha_create_table(path,&create_info,1) ? -1 : 0; query_cache_invalidate3(thd, table_list, 0); - +end: if (!dont_send_ok) { if (!error) diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 541b2383e8d..c8237f3ae9b 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -33,6 +33,7 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) TABLE *table; int describe=(lex->select_lex.options & SELECT_DESCRIBE) ? 1 : 0; int res; + bool found_rows_for_union=false; TABLE_LIST result_table_list; TABLE_LIST *first_table=(TABLE_LIST *)lex->select_lex.table_list.first; TMP_TABLE_PARAM tmp_table_param; @@ -60,6 +61,10 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) */ lex_sl= sl; order= (ORDER *) lex_sl->order_list.first; + found_rows_for_union = lex->select_lex.options & OPTION_FOUND_ROWS && !describe && sl->select_limit; + if (found_rows_for_union) + lex->select_lex.options ^= OPTION_FOUND_ROWS; +// This is done to eliminate unnecessary slowing down of the first query if (!order || !describe) last_sl->next=0; // Remove this extra element } @@ -198,6 +203,8 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) item_list, NULL, (describe) ? 0 : order, (ORDER*) NULL, NULL, (ORDER*) NULL, thd->options, result); + if (found_rows_for_union && !res) + thd->limit_found_rows = (ulonglong)table->file->records; } } |