From 5f43b8609a175e9a7d98385b47c082211f02d6c9 Mon Sep 17 00:00:00 2001 From: "igreenhoe@mysql.com" <> Date: Mon, 17 Apr 2006 19:43:19 -0700 Subject: [PATCH 01/22] Fix for bug #18979, bad RE in mysql-test-run.pl --- mysql-test/lib/mtr_cases.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl index d8f3e61bd11..ed0395abd9d 100644 --- a/mysql-test/lib/mtr_cases.pl +++ b/mysql-test/lib/mtr_cases.pl @@ -116,7 +116,7 @@ sub collect_test_cases ($) { while ( ) { chomp; - if ( /^\s*(\S+)\s*:\s*(.*?)\s*$/ ) + if ( /^\s*([^\s:]+)\s*:\s*(.*?)\s*$/ ) { $disabled{$1}= $2; } From ed2432494ff892eb255a75a5bc9460afc9e03ec7 Mon Sep 17 00:00:00 2001 From: "igreenhoe@mysql.com" <> Date: Mon, 17 Apr 2006 19:57:50 -0700 Subject: [PATCH 02/22] Fix for bug #17353. --- scripts/mysqld_safe.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index a584c384712..02a961dc3ec 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -321,10 +321,13 @@ then ulimit -n $open_files args="--open-files-limit=$open_files $args" fi - if test -n "$core_file_size" - then - ulimit -c $core_file_size - fi +fi + +# Try to set the core file size (even if we aren't root) because many systems +# don't specify a hard limit on core file size. +if test -n "$core_file_size" +then + ulimit -c $core_file_size fi # From 51eec5cf9b888a020918440e79cb458eb7cdc2d4 Mon Sep 17 00:00:00 2001 From: "bar@mysql.com" <> Date: Thu, 4 May 2006 11:55:09 +0500 Subject: [PATCH 03/22] Bugs#17647: Trouble with "create database" Problem: if a user was granted privileges on database "d1", it also was able to act on "D1" (i.e. in upper case), even on Unix with case sensitive file system. Fix: Initialize grant hash to use binary comparison if lower_case_file_system is not set (on most unixes), and case insensitive comparison otherwise (Windows, MacOSX). --- .../have_case_sensitive_file_system.inc | 4 +++ .../r/case_sensitive_file_system.require | 2 ++ mysql-test/r/lowercase_fs_off.result | 11 ++++++++ mysql-test/t/lowercase_fs_off.test | 27 +++++++++++++++++++ sql/sql_acl.cc | 4 ++- 5 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 mysql-test/include/have_case_sensitive_file_system.inc create mode 100644 mysql-test/r/case_sensitive_file_system.require create mode 100644 mysql-test/r/lowercase_fs_off.result create mode 100644 mysql-test/t/lowercase_fs_off.test diff --git a/mysql-test/include/have_case_sensitive_file_system.inc b/mysql-test/include/have_case_sensitive_file_system.inc new file mode 100644 index 00000000000..730af975497 --- /dev/null +++ b/mysql-test/include/have_case_sensitive_file_system.inc @@ -0,0 +1,4 @@ +--require r/case_sensitive_file_system.require +--disable_query_log +show variables like "lower_case_file_system"; +--enable_query_log diff --git a/mysql-test/r/case_sensitive_file_system.require b/mysql-test/r/case_sensitive_file_system.require new file mode 100644 index 00000000000..d0bdc6bf4ce --- /dev/null +++ b/mysql-test/r/case_sensitive_file_system.require @@ -0,0 +1,2 @@ +Variable_name Value +lower_case_file_system OFF diff --git a/mysql-test/r/lowercase_fs_off.result b/mysql-test/r/lowercase_fs_off.result new file mode 100644 index 00000000000..f610b959a47 --- /dev/null +++ b/mysql-test/r/lowercase_fs_off.result @@ -0,0 +1,11 @@ +create database d1; +grant all on d1.* to 'sample'@'localhost' identified by 'password'; +flush privileges; +select database(); +database() +d1 +create database d2; +ERROR 42000: Access denied for user 'sample'@'localhost' to database 'd2' +create database D1; +ERROR 42000: Access denied for user 'sample'@'localhost' to database 'D1' +drop database if exists d1; diff --git a/mysql-test/t/lowercase_fs_off.test b/mysql-test/t/lowercase_fs_off.test new file mode 100644 index 00000000000..7f7b573e7ee --- /dev/null +++ b/mysql-test/t/lowercase_fs_off.test @@ -0,0 +1,27 @@ +# +# Specific tests for case sensitive file systems +# i.e. lower_case_filesystem=OFF +# +-- source include/have_case_sensitive_file_system.inc + +connect (master,localhost,root,,); +connection master; +create database d1; +grant all on d1.* to 'sample'@'localhost' identified by 'password'; +flush privileges; + +connect (sample,localhost,sample,password,d1); +connection sample; +select database(); +--error 1044 +create database d2; +--error 1044 +create database D1; +disconnect sample; + +connection master; +drop database if exists d1; +disconnect master; +connection default; + +# End of 4.1 tests diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 4626e5892a4..d1cd001e306 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -146,7 +146,9 @@ my_bool acl_init(bool dont_read_acl_tables) acl_cache= new hash_filo(ACL_CACHE_SIZE, 0, 0, (hash_get_key) acl_entry_get_key, - (hash_free_key) free, system_charset_info); + (hash_free_key) free, + lower_case_file_system ? + system_charset_info : &my_charset_bin); if (dont_read_acl_tables) { DBUG_RETURN(0); /* purecov: tested */ From 1579af9578b3578ffd7329d6cabc1eb9d73042cb Mon Sep 17 00:00:00 2001 From: "bar@mysql.com" <> Date: Wed, 24 May 2006 16:10:25 +0500 Subject: [PATCH 04/22] bug#10979 USE does not refresh db privilege changes if the same db is used in command. The problem happened because "mysql" didn't send mysql_select_db() if the current active database was specified in USE. Now it always send mysql_select_db(). Rebuilding of completion hash is skipped in the same db is used (for performance purposes). --- client/mysql.cc | 65 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 42 insertions(+), 23 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index 900df825b25..d0f54f7bf0c 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -2969,6 +2969,7 @@ static int com_use(String *buffer __attribute__((unused)), char *line) { char *tmp, buff[FN_REFLEN + 1]; + int select_db; bzero(buff, sizeof(buff)); strmov(buff, line); @@ -2988,34 +2989,52 @@ com_use(String *buffer __attribute__((unused)), char *line) if (!current_db || cmp_database(charset_info, current_db,tmp)) { if (one_database) - skip_updates= 1; - else { - /* - reconnect once if connection is down or if connection was found to - be down during query - */ - if (!connected && reconnect()) - return opt_reconnect ? -1 : 1; // Fatal error - if (mysql_select_db(&mysql,tmp)) - { - if (mysql_errno(&mysql) != CR_SERVER_GONE_ERROR) - return put_error(&mysql); - - if (reconnect()) - return opt_reconnect ? -1 : 1; // Fatal error - if (mysql_select_db(&mysql,tmp)) - return put_error(&mysql); - } - my_free(current_db,MYF(MY_ALLOW_ZERO_PTR)); - current_db=my_strdup(tmp,MYF(MY_WME)); -#ifdef HAVE_READLINE - build_completion_hash(rehash, 1); -#endif + skip_updates= 1; + select_db= 0; // don't do mysql_select_db() } + else + select_db= 2; // do mysql_select_db() and build_completion_hash() } else + { + /* + USE to the current db specified. + We do need to send mysql_select_db() to make server + update database level privileges, which might + change since last USE (see bug#10979). + For performance purposes, we'll skip rebuilding of completion hash. + */ skip_updates= 0; + select_db= 1; // do only mysql_select_db(), without completion + } + + if (select_db) + { + /* + reconnect once if connection is down or if connection was found to + be down during query + */ + if (!connected && reconnect()) + return opt_reconnect ? -1 : 1; // Fatal error + if (mysql_select_db(&mysql,tmp)) + { + if (mysql_errno(&mysql) != CR_SERVER_GONE_ERROR) + return put_error(&mysql); + + if (reconnect()) + return opt_reconnect ? -1 : 1; // Fatal error + if (mysql_select_db(&mysql,tmp)) + return put_error(&mysql); + } + my_free(current_db,MYF(MY_ALLOW_ZERO_PTR)); + current_db=my_strdup(tmp,MYF(MY_WME)); +#ifdef HAVE_READLINE + if (select_db > 1) + build_completion_hash(rehash, 1); +#endif + } + put_info("Database changed",INFO_INFO); return 0; } From bc35c50063a28afeb6c70c22607a76088a1f10cb Mon Sep 17 00:00:00 2001 From: "holyfoot@deer.(none)" <> Date: Thu, 1 Jun 2006 17:06:42 +0500 Subject: [PATCH 05/22] bug #16017 (memory leaks in embedded server) There actually was 3 different problems - hash_user_connections wasn't cleaned one strdupped database name wasn't freed and stmt->mem_root wasn't cleaned as it was replased with mysql->field_alloc for result For the last one - i made the library using stmt's fields to store result if it's the case. --- include/mysql.h | 17 ++++++++++--- include/sql_common.h | 3 ++- libmysql/libmysql.c | 13 +++++----- libmysqld/embedded_priv.h | 6 ++--- libmysqld/lib_sql.cc | 53 +++++++++++++++++++++++---------------- libmysqld/libmysqld.c | 9 +++---- sql-common/client.c | 3 ++- sql/sql_parse.cc | 18 ++++++++----- 8 files changed, 74 insertions(+), 48 deletions(-) diff --git a/include/mysql.h b/include/mysql.h index 0949937814c..143f6752c46 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -216,6 +216,7 @@ enum mysql_rpl_type }; struct st_mysql_methods; +struct st_mysql_stmt; typedef struct st_mysql { @@ -269,6 +270,12 @@ typedef struct st_mysql from mysql_stmt_close if close had to cancel result set of this object. */ my_bool *unbuffered_fetch_owner; + /* + In embedded server it points to the statement that is processed + in the current query. We store some results directly in statement + fields then. + */ + struct st_mysql_stmt *current_stmt; } MYSQL; typedef struct st_mysql_res { @@ -636,7 +643,8 @@ typedef struct st_mysql_methods unsigned long header_length, const char *arg, unsigned long arg_length, - my_bool skip_check); + my_bool skip_check, + MYSQL_STMT *stmt); MYSQL_DATA *(*read_rows)(MYSQL *mysql,MYSQL_FIELD *mysql_fields, unsigned int fields); MYSQL_RES * (*use_result)(MYSQL *mysql); @@ -724,8 +732,11 @@ int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB); */ #define simple_command(mysql, command, arg, length, skip_check) \ - (*(mysql)->methods->advanced_command)(mysql, command, \ - NullS, 0, arg, length, skip_check) + (*(mysql)->methods->advanced_command)(mysql, command, NullS, \ + 0, arg, length, skip_check, NULL) +#define stmt_command(mysql, command, arg, length, stmt) \ + (*(mysql)->methods->advanced_command)(mysql, command, NullS, \ + 0, arg, length, 1, stmt) unsigned long net_safe_read(MYSQL* mysql); #ifdef __NETWARE__ diff --git a/include/sql_common.h b/include/sql_common.h index c07a4a831bb..52d766d77d2 100644 --- a/include/sql_common.h +++ b/include/sql_common.h @@ -33,7 +33,8 @@ void mysql_read_default_options(struct st_mysql_options *options, my_bool cli_advanced_command(MYSQL *mysql, enum enum_server_command command, const char *header, ulong header_length, - const char *arg, ulong arg_length, my_bool skip_check); + const char *arg, ulong arg_length, my_bool skip_check, + MYSQL_STMT *stmt); void set_stmt_errmsg(MYSQL_STMT * stmt, const char *err, int errcode, const char *sqlstate); diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 4b8f1c9da1f..0f246b3030e 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -2085,7 +2085,7 @@ mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length) mysql_use_result it won't be freed in mysql_stmt_free_result and we should get 'Commands out of sync' here. */ - if (simple_command(mysql, COM_CLOSE_STMT, buff, 4, 1)) + if (stmt_command(mysql, COM_CLOSE_STMT, buff, 4, stmt)) { set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno, mysql->net.sqlstate); @@ -2094,7 +2094,7 @@ mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length) stmt->state= MYSQL_STMT_INIT_DONE; } - if (simple_command(mysql, COM_PREPARE, query, length, 1)) + if (stmt_command(mysql, COM_PREPARE, query, length, stmt)) { set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno, mysql->net.sqlstate); @@ -2505,7 +2505,7 @@ static my_bool execute(MYSQL_STMT *stmt, char *packet, ulong length) buff[4]= (char) 0; /* no flags */ int4store(buff+5, 1); /* iteration count */ if (cli_advanced_command(mysql, COM_EXECUTE, buff, sizeof(buff), - packet, length, 1) || + packet, length, 1, NULL) || (*mysql->methods->read_query_result)(mysql)) { set_stmt_errmsg(stmt, net->last_error, net->last_errno, net->sqlstate); @@ -3279,7 +3279,8 @@ mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number, This is intentional to save bandwidth. */ if ((*mysql->methods->advanced_command)(mysql, COM_LONG_DATA, buff, - sizeof(buff), data, length, 1)) + sizeof(buff), data, length, 1, + NULL)) { set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno, mysql->net.sqlstate); @@ -4603,7 +4604,7 @@ my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt) mysql->status= MYSQL_STATUS_READY; } int4store(buff, stmt->stmt_id); - if ((rc= simple_command(mysql, COM_CLOSE_STMT, buff, 4, 1))) + if ((rc= stmt_command(mysql, COM_CLOSE_STMT, buff, 4, stmt))) { set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno, mysql->net.sqlstate); @@ -4641,7 +4642,7 @@ my_bool STDCALL mysql_stmt_reset(MYSQL_STMT *stmt) mysql= stmt->mysql->last_used_con; int4store(buff, stmt->stmt_id); /* Send stmt id to server */ if ((*mysql->methods->advanced_command)(mysql, COM_RESET_STMT, buff, - sizeof(buff), 0, 0, 0)) + sizeof(buff), 0, 0, 0, 0)) { set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno, mysql->net.sqlstate); diff --git a/libmysqld/embedded_priv.h b/libmysqld/embedded_priv.h index d4316dff63f..1e1db071b33 100644 --- a/libmysqld/embedded_priv.h +++ b/libmysqld/embedded_priv.h @@ -24,9 +24,9 @@ C_MODE_START void lib_connection_phase(NET *net, int phase); -void init_embedded_mysql(MYSQL *mysql, int client_flag, char *db); -void *create_embedded_thd(int client_flag, char *db); -int check_embedded_connection(MYSQL *mysql); +void init_embedded_mysql(MYSQL *mysql, int client_flag); +void *create_embedded_thd(int client_flag); +int check_embedded_connection(MYSQL *mysql, const char *db); void free_old_query(MYSQL *mysql); void embedded_get_error(MYSQL *mysql); extern MYSQL_METHODS embedded_methods; diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index bf8c17a71af..1f5d749cbbf 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -47,6 +47,7 @@ C_MODE_START #include "errmsg.h" #include + void embedded_get_error(MYSQL *mysql) { THD *thd=(THD *) mysql->thd; @@ -66,7 +67,8 @@ void embedded_get_error(MYSQL *mysql) static my_bool emb_advanced_command(MYSQL *mysql, enum enum_server_command command, const char *header, ulong header_length, - const char *arg, ulong arg_length, my_bool skip_check) + const char *arg, ulong arg_length, my_bool skip_check, + MYSQL_STMT *stmt) { my_bool result= 1; THD *thd=(THD *) mysql->thd; @@ -90,6 +92,7 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command, mysql->affected_rows= ~(my_ulonglong) 0; mysql->field_count= 0; net->last_errno= 0; + mysql->current_stmt= stmt; thd->store_globals(); // Fix if more than one connect /* @@ -183,7 +186,6 @@ static my_bool emb_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt) mysql->server_status|= SERVER_STATUS_IN_TRANS; stmt->fields= mysql->fields; - stmt->mem_root= mysql->field_alloc; mysql->fields= NULL; } @@ -225,7 +227,7 @@ static int emb_stmt_execute(MYSQL_STMT *stmt) thd->client_param_count= stmt->param_count; thd->client_params= stmt->params; if (emb_advanced_command(stmt->mysql, COM_EXECUTE,0,0, - header, sizeof(header), 1) || + header, sizeof(header), 1, stmt) || emb_mysql_read_query_result(stmt->mysql)) { NET *net= &stmt->mysql->net; @@ -242,8 +244,6 @@ int emb_read_binary_rows(MYSQL_STMT *stmt) MYSQL_DATA *data; if (!(data= emb_read_rows(stmt->mysql, 0, 0))) return 1; - stmt->result= *data; - my_free((char *) data, MYF(0)); return 0; } @@ -298,7 +298,8 @@ my_bool emb_next_result(MYSQL *mysql) DBUG_ENTER("emb_next_result"); if (emb_advanced_command(mysql, COM_QUERY,0,0, - thd->query_rest.ptr(),thd->query_rest.length(),1) || + thd->query_rest.ptr(), + thd->query_rest.length(),1, 0) || emb_mysql_read_query_result(mysql)) DBUG_RETURN(1); @@ -482,14 +483,14 @@ void end_embedded_server() } /* extern "C" */ C_MODE_START -void init_embedded_mysql(MYSQL *mysql, int client_flag, char *db) +void init_embedded_mysql(MYSQL *mysql, int client_flag) { THD *thd = (THD *)mysql->thd; thd->mysql= mysql; mysql->server_version= server_version; } -void *create_embedded_thd(int client_flag, char *db) +void *create_embedded_thd(int client_flag) { THD * thd= new THD; thd->thread_id= thread_id++; @@ -515,8 +516,8 @@ void *create_embedded_thd(int client_flag, char *db) thd->init_for_queries(); thd->client_capabilities= client_flag; - thd->db= db; - thd->db_length= db ? strip_sp(db) : 0; + thd->db= NULL; + thd->db_length= 0; #ifndef NO_EMBEDDED_ACCESS_CHECKS thd->db_access= DB_ACLS; thd->master_access= ~NO_ACCESS; @@ -533,18 +534,18 @@ err: } #ifdef NO_EMBEDDED_ACCESS_CHECKS -int check_embedded_connection(MYSQL *mysql) +int check_embedded_connection(MYSQL *mysql, const char *db) { THD *thd= (THD*)mysql->thd; thd->host= (char*)my_localhost; thd->host_or_ip= thd->host; thd->user= my_strdup(mysql->user, MYF(0)); thd->priv_user= thd->user; - return check_user(thd, COM_CONNECT, NULL, 0, thd->db, true); + return check_user(thd, COM_CONNECT, NULL, 0, db, true); } #else -int check_embedded_connection(MYSQL *mysql) +int check_embedded_connection(MYSQL *mysql, const char *db) { THD *thd= (THD*)mysql->thd; int result; @@ -578,7 +579,7 @@ int check_embedded_connection(MYSQL *mysql) passwd_len= 0; if((result= check_user(thd, COM_CONNECT, - scramble_buff, passwd_len, thd->db, true))) + scramble_buff, passwd_len, db, true))) goto err; return 0; @@ -636,8 +637,9 @@ bool Protocol::send_fields(List *list, uint flag) DBUG_RETURN(0); field_count= list->elements; - field_alloc= &mysql->field_alloc; - if (!(client_field= thd->mysql->fields= + field_alloc= mysql->current_stmt ? &mysql->current_stmt->mem_root : + &mysql->field_alloc; + if (!(client_field= mysql->fields= (MYSQL_FIELD *)alloc_root(field_alloc, sizeof(MYSQL_FIELD) * field_count))) goto err; @@ -707,7 +709,7 @@ bool Protocol::send_fields(List *list, uint flag) client_field->max_length= 0; ++client_field; } - thd->mysql->field_count= field_count; + mysql->field_count= field_count; DBUG_RETURN(prepare_for_send(list)); err: @@ -736,13 +738,20 @@ bool Protocol_prep::write() if (!data) { - if (!(data= (MYSQL_DATA*) my_malloc(sizeof(MYSQL_DATA), - MYF(MY_WME | MY_ZEROFILL)))) - return true; + MYSQL *mysql= thd->mysql; + + if (mysql->current_stmt) + data= &mysql->current_stmt->result; + else + { + if (!(data= (MYSQL_DATA*) my_malloc(sizeof(MYSQL_DATA), + MYF(MY_WME | MY_ZEROFILL)))) + return true; + init_alloc_root(&data->alloc,8192,0); /* Assume rowlength < 8192 */ + data->alloc.min_malloc=sizeof(MYSQL_ROWS); + } alloc= &data->alloc; - init_alloc_root(alloc,8192,0); /* Assume rowlength < 8192 */ - alloc->min_malloc=sizeof(MYSQL_ROWS); data->rows=0; data->fields=field_count; data->prev_ptr= &data->data; diff --git a/libmysqld/libmysqld.c b/libmysqld/libmysqld.c index 6fa41fb3fd0..5505049e0e0 100644 --- a/libmysqld/libmysqld.c +++ b/libmysqld/libmysqld.c @@ -134,7 +134,6 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user, const char *passwd, const char *db, uint port, const char *unix_socket,ulong client_flag) { - char *db_name; char name_buff[USERNAME_LENGTH]; DBUG_ENTER("mysql_real_connect"); @@ -197,13 +196,11 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user, port=0; unix_socket=0; - db_name = db ? my_strdup(db,MYF(MY_WME)) : NULL; + mysql->thd= create_embedded_thd(client_flag); - mysql->thd= create_embedded_thd(client_flag, db_name); + init_embedded_mysql(mysql, client_flag); - init_embedded_mysql(mysql, client_flag, db_name); - - if (check_embedded_connection(mysql)) + if (check_embedded_connection(mysql, db)) goto error; if (mysql_init_charset(mysql)) diff --git a/sql-common/client.c b/sql-common/client.c index 3a598832253..ce49048ce79 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -648,7 +648,8 @@ void free_rows(MYSQL_DATA *cur) my_bool cli_advanced_command(MYSQL *mysql, enum enum_server_command command, const char *header, ulong header_length, - const char *arg, ulong arg_length, my_bool skip_check) + const char *arg, ulong arg_length, my_bool skip_check, + MYSQL_STMT *stmt __attribute__((unused))) { NET *net= &mysql->net; my_bool result= 1; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 51ef3f31b26..37fce192aa1 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -54,8 +54,8 @@ extern "C" int gethostname(char *name, int namelen); static void time_out_user_resource_limits(THD *thd, USER_CONN *uc); #ifndef NO_EMBEDDED_ACCESS_CHECKS static int check_for_max_user_connections(THD *thd, USER_CONN *uc); -#endif static void decrease_user_connections(USER_CONN *uc); +#endif /* NO_EMBEDDED_ACCESS_CHECKS */ static bool check_db_used(THD *thd,TABLE_LIST *tables); static bool check_multi_update_lock(THD *thd, TABLE_LIST *tables, List *fields, SELECT_LEX *select_lex); @@ -137,6 +137,7 @@ inline bool all_tables_not_ok(THD *thd, TABLE_LIST *tables) #endif +#ifndef NO_EMBEDDED_ACCESS_CHECKS static HASH hash_user_connections; static int get_or_create_user_conn(THD *thd, const char *user, @@ -190,6 +191,7 @@ end: return return_val; } +#endif /* !NO_EMBEDDED_ACCESS_CHECKS */ /* @@ -231,11 +233,7 @@ int check_user(THD *thd, enum enum_server_command command, thd->db= 0; thd->db_length= 0; if (mysql_change_db(thd, db)) - { - if (thd->user_connect) - decrease_user_connections(thd->user_connect); DBUG_RETURN(-1); - } } else send_ok(thd); @@ -409,10 +407,12 @@ extern "C" void free_user(struct user_conn *uc) void init_max_user_conn(void) { +#ifndef NO_EMBEDDED_ACCESS_CHECKS (void) hash_init(&hash_user_connections,system_charset_info,max_connections, 0,0, (hash_get_key) get_key_conn, (hash_free_key) free_user, 0); +#endif } @@ -466,7 +466,6 @@ static int check_for_max_user_connections(THD *thd, USER_CONN *uc) (void) pthread_mutex_unlock(&LOCK_user_conn); DBUG_RETURN(error); } -#endif /* NO_EMBEDDED_ACCESS_CHECKS */ /* Decrease user connection count @@ -500,13 +499,18 @@ static void decrease_user_connections(USER_CONN *uc) DBUG_VOID_RETURN; } +#endif /* NO_EMBEDDED_ACCESS_CHECKS */ + void free_max_user_conn(void) { +#ifndef NO_EMBEDDED_ACCESS_CHECKS hash_free(&hash_user_connections); +#endif /* NO_EMBEDDED_ACCESS_CHECKS */ } + /* Mark all commands that somehow changes a table This is used to check number of updates / hour @@ -1476,9 +1480,11 @@ bool dispatch_command(enum enum_server_command command, THD *thd, } else { +#ifndef NO_EMBEDDED_ACCESS_CHECKS /* we've authenticated new user */ if (save_user_connect) decrease_user_connections(save_user_connect); +#endif /* NO_EMBEDDED_ACCESS_CHECKS */ x_free((gptr) save_db); x_free((gptr) save_user); } From 85d130c58b64d77d88e2051a4bde5561a21438bb Mon Sep 17 00:00:00 2001 From: "igreenhoe@mysql.com" <> Date: Wed, 21 Jun 2006 00:12:23 -0700 Subject: [PATCH 06/22] Fix for bug #15977 (switch ordering of DISABLE KEYS/LOCK TABLE in mysqldump) --- client/mysqldump.c | 25 +++++----- mysql-test/r/mysqldump.result | 86 ++++++++++++++--------------------- 2 files changed, 48 insertions(+), 63 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 3445a23eb5e..58e51b9b955 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -1722,17 +1722,18 @@ static void dumpTable(uint numFields, char *table) goto err; } - if (opt_disable_keys) - { - fprintf(md_result_file, "\n/*!40000 ALTER TABLE %s DISABLE KEYS */;\n", - opt_quoted_table); - check_io(md_result_file); - } if (opt_lock) { fprintf(md_result_file,"LOCK TABLES %s WRITE;\n", opt_quoted_table); check_io(md_result_file); } + /* Moved disable keys to after lock per bug 15977 */ + if (opt_disable_keys) + { + fprintf(md_result_file, "/*!40000 ALTER TABLE %s DISABLE KEYS */;\n", + opt_quoted_table); + check_io(md_result_file); + } total_length= opt_net_buffer_length; /* Force row break */ row_break=0; @@ -1991,17 +1992,19 @@ static void dumpTable(uint numFields, char *table) error= EX_CONSCHECK; goto err; } - if (opt_lock) - { - fputs("UNLOCK TABLES;\n", md_result_file); - check_io(md_result_file); - } + + /* Moved enable keys to before unlock per bug 15977 */ if (opt_disable_keys) { fprintf(md_result_file,"/*!40000 ALTER TABLE %s ENABLE KEYS */;\n", opt_quoted_table); check_io(md_result_file); } + if (opt_lock) + { + fputs("UNLOCK TABLES;\n", md_result_file); + check_io(md_result_file); + } if (opt_autocommit) { fprintf(md_result_file, "commit;\n"); diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index c3b393acadc..6c5c757061d 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -68,12 +68,11 @@ CREATE TABLE `t1` ( `b` float default NULL ); - -/*!40000 ALTER TABLE `t1` DISABLE KEYS */; LOCK TABLES `t1` WRITE; +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456); -UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -160,13 +159,12 @@ CREATE TABLE `t1` ( `a` varchar(255) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=koi8r; - -/*!40000 ALTER TABLE `t1` DISABLE KEYS */; LOCK TABLES `t1` WRITE; +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; INSERT INTO `t1` VALUES ('абцде'); INSERT INTO `t1` VALUES (NULL); -UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -188,12 +186,11 @@ CREATE TABLE `t1` ( `a` int(11) default NULL ) TYPE=MyISAM; - -/*!40000 ALTER TABLE `t1` DISABLE KEYS */; LOCK TABLES `t1` WRITE; +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; INSERT INTO `t1` VALUES (1),(2); -UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -209,12 +206,11 @@ CREATE TABLE `t1` ( `a` int(11) default NULL ) TYPE=MyISAM; - -/*!40000 ALTER TABLE `t1` DISABLE KEYS */; LOCK TABLES `t1` WRITE; +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; INSERT INTO `t1` VALUES (1),(2); -UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -242,11 +238,10 @@ CREATE TABLE `t1` ( `a` int(11) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -/*!40000 ALTER TABLE `t1` DISABLE KEYS */; LOCK TABLES `t1` WRITE; -UNLOCK TABLES; +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -265,11 +260,10 @@ CREATE TABLE "t1" ( "a" int(11) default NULL ); - -/*!40000 ALTER TABLE "t1" DISABLE KEYS */; LOCK TABLES "t1" WRITE; -UNLOCK TABLES; +/*!40000 ALTER TABLE "t1" DISABLE KEYS */; /*!40000 ALTER TABLE "t1" ENABLE KEYS */; +UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -291,11 +285,10 @@ CREATE TABLE `t1` ( `a` int(11) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -/*!40000 ALTER TABLE `t1` DISABLE KEYS */; LOCK TABLES `t1` WRITE; -UNLOCK TABLES; +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -314,11 +307,10 @@ CREATE TABLE "t1" ( "a" int(11) default NULL ); - -/*!40000 ALTER TABLE "t1" DISABLE KEYS */; LOCK TABLES "t1" WRITE; -UNLOCK TABLES; +/*!40000 ALTER TABLE "t1" DISABLE KEYS */; /*!40000 ALTER TABLE "t1" ENABLE KEYS */; +UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -414,12 +406,11 @@ CREATE TABLE `t1` ( `a` char(10) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -/*!40000 ALTER TABLE `t1` DISABLE KEYS */; LOCK TABLES `t1` WRITE; +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; INSERT INTO `t1` VALUES ('ÄÖÜß'); -UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -438,12 +429,11 @@ CREATE TABLE `t1` ( `a` char(10) default NULL ) TYPE=MyISAM; - -/*!40000 ALTER TABLE `t1` DISABLE KEYS */; LOCK TABLES `t1` WRITE; +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; INSERT INTO `t1` VALUES ('Ž™šá'); -UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -459,12 +449,11 @@ CREATE TABLE `t1` ( `a` char(10) default NULL ) TYPE=MyISAM; - -/*!40000 ALTER TABLE `t1` DISABLE KEYS */; LOCK TABLES `t1` WRITE; +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; INSERT INTO `t1` VALUES ('Ž™šá'); -UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -480,12 +469,11 @@ CREATE TABLE `t1` ( `a` char(10) default NULL ) TYPE=MyISAM; - -/*!40000 ALTER TABLE `t1` DISABLE KEYS */; LOCK TABLES `t1` WRITE; +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; INSERT INTO `t1` VALUES ('ÄÖÜß'); -UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -511,12 +499,11 @@ CREATE TABLE `t2` ( `a` int(11) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -/*!40000 ALTER TABLE `t2` DISABLE KEYS */; LOCK TABLES `t2` WRITE; +/*!40000 ALTER TABLE `t2` DISABLE KEYS */; INSERT INTO `t2` VALUES (4),(5),(6); -UNLOCK TABLES; /*!40000 ALTER TABLE `t2` ENABLE KEYS */; +UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -544,12 +531,11 @@ CREATE TABLE `t1` ( `b` blob ) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -/*!40000 ALTER TABLE `t1` DISABLE KEYS */; LOCK TABLES `t1` WRITE; +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; INSERT INTO `t1` VALUES (0x602010000280100005E71A); -UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -577,12 +563,11 @@ CREATE TABLE `t1` ( `a` decimal(240,20) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -/*!40000 ALTER TABLE `t1` DISABLE KEYS */; LOCK TABLES `t1` WRITE; +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; INSERT IGNORE INTO `t1` VALUES ('1234567890123456789012345678901234567890.00000000000000000000'),('0987654321098765432109876543210987654321.00000000000000000000'); -UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -606,7 +591,6 @@ CREATE TABLE `t1` ( `a` decimal(240,20) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; - /*!40000 ALTER TABLE `t1` DISABLE KEYS */; INSERT DELAYED IGNORE INTO `t1` VALUES ('1234567890123456789012345678901234567890.00000000000000000000'),('0987654321098765432109876543210987654321.00000000000000000000'); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; @@ -1295,12 +1279,11 @@ CREATE TABLE `t1` ( `F_fe73f687e5bc5280214e0486b273a5f9` int(11) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -/*!40000 ALTER TABLE `t1` DISABLE KEYS */; LOCK TABLES `t1` WRITE; +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; INSERT INTO `t1` (`F_c4ca4238a0b923820dcc509a6f75849b`, `F_c81e728d9d4c2f636f067f89cc14862c`, `F_eccbc87e4b5ce2fe28308fd9f2a7baf3`, `F_a87ff679a2f3e71d9181a67b7542122c`, `F_e4da3b7fbbce2345d7772b0674a318d5`, `F_1679091c5a880faf6fb5e6087eb1b2dc`, `F_8f14e45fceea167a5a36dedd4bea2543`, `F_c9f0f895fb98ab9159f51fd0297e236d`, `F_45c48cce2e2d7fbdea1afc51c7c6ad26`, `F_d3d9446802a44259755d38e6d163e820`, `F_6512bd43d9caa6e02c990b0a82652dca`, `F_c20ad4d76fe97759aa27a0c99bff6710`, `F_c51ce410c124a10e0db5e4b97fc2af39`, `F_aab3238922bcc25a6f606eb525ffdc56`, `F_9bf31c7ff062936a96d3c8bd1f8f2ff3`, `F_c74d97b01eae257e44aa9d5bade97baf`, `F_70efdf2ec9b086079795c442636b55fb`, `F_6f4922f45568161a8cdf4ad2299f6d23`, `F_1f0e3dad99908345f7439f8ffabdffc4`, `F_98f13708210194c475687be6106a3b84`, `F_3c59dc048e8850243be8079a5c74d079`, `F_b6d767d2f8ed5d21a44b0e5886680cb9`, `F_37693cfc748049e45d87b8c7d8b9aacd`, `F_1ff1de774005f8da13f42943881c655f`, `F_8e296a067a37563370ded05f5a3bf3ec`, `F_4e732ced3463d06de0ca9a15b6153677`, `F_02e74f10e0327ad868d138f2b4fdd6f0`, `F_33e75ff09dd601bbe69f351039152189`, `F_6ea9ab1baa0efb9e19094440c317e21b`, `F_34173cb38f07f89ddbebc2ac9128303f`, `F_c16a5320fa475530d9583c34fd356ef5`, `F_6364d3f0f495b6ab9dcf8d3b5c6e0b01`, `F_182be0c5cdcd5072bb1864cdee4d3d6e`, `F_e369853df766fa44e1ed0ff613f563bd`, `F_1c383cd30b7c298ab50293adfecb7b18`, `F_19ca14e7ea6328a42e0eb13d585e4c22`, `F_a5bfc9e07964f8dddeb95fc584cd965d`, `F_a5771bce93e200c36f7cd9dfd0e5deaa`, `F_d67d8ab4f4c10bf22aa353e27879133c`, `F_d645920e395fedad7bbbed0eca3fe2e0`, `F_3416a75f4cea9109507cacd8e2f2aefc`, `F_a1d0c6e83f027327d8461063f4ac58a6`, `F_17e62166fc8586dfa4d1bc0e1742c08b`, `F_f7177163c833dff4b38fc8d2872f1ec6`, `F_6c8349cc7260ae62e3b1396831a8398f`, `F_d9d4f495e875a2e075a1a4a6e1b9770f`, `F_67c6a1e7ce56d3d6fa748ab6d9af3fd7`, `F_642e92efb79421734881b53e1e1b18b6`, `F_f457c545a9ded88f18ecee47145a72c0`, `F_c0c7c76d30bd3dcaefc96f40275bdc0a`, `F_2838023a778dfaecdc212708f721b788`, `F_9a1158154dfa42caddbd0694a4e9bdc8`, `F_d82c8d1619ad8176d665453cfb2e55f0`, `F_a684eceee76fc522773286a895bc8436`, `F_b53b3a3d6ab90ce0268229151c9bde11`, `F_9f61408e3afb633e50cdf1b20de6f466`, `F_72b32a1f754ba1c09b3695e0cb6cde7f`, `F_66f041e16a60928b05a7e228a89c3799`, `F_093f65e080a295f8076b1c5722a46aa2`, `F_072b030ba126b2f4b2374f342be9ed44`, `F_7f39f8317fbdb1988ef4c628eba02591`, `F_44f683a84163b3523afe57c2e008bc8c`, `F_03afdbd66e7929b125f8597834fa83a4`, `F_ea5d2f1c4608232e07d3aa3d998e5135`, `F_fc490ca45c00b1249bbe3554a4fdf6fb`, `F_3295c76acbf4caaed33c36b1b5fc2cb1`, `F_735b90b4568125ed6c3f678819b6e058`, `F_a3f390d88e4c41f2747bfa2f1b5f87db`, `F_14bfa6bb14875e45bba028a21ed38046`, `F_7cbbc409ec990f19c78c75bd1e06f215`, `F_e2c420d928d4bf8ce0ff2ec19b371514`, `F_32bb90e8976aab5298d5da10fe66f21d`, `F_d2ddea18f00665ce8623e36bd4e3c7c5`, `F_ad61ab143223efbc24c7d2583be69251`, `F_d09bf41544a3365a46c9077ebb5e35c3`, `F_fbd7939d674997cdb4692d34de8633c4`, `F_28dd2c7955ce926456240b2ff0100bde`, `F_35f4a8d465e6e1edc05f3d8ab658c551`, `F_d1fe173d08e959397adf34b1d77e88d7`, `F_f033ab37c30201f73f142449d037028d`, `F_43ec517d68b6edd3015b3edc9a11367b`, `F_9778d5d219c5080b9a6a17bef029331c`, `F_fe9fc289c3ff0af142b6d3bead98a923`, `F_68d30a9594728bc39aa24be94b319d21`, `F_3ef815416f775098fe977004015c6193`, `F_93db85ed909c13838ff95ccfa94cebd9`, `F_c7e1249ffc03eb9ded908c236bd1996d`, `F_2a38a4a9316c49e5a833517c45d31070`, `F_7647966b7343c29048673252e490f736`, `F_8613985ec49eb8f757ae6439e879bb2a`, `F_54229abfcfa5649e7003b83dd4755294`, `F_92cc227532d17e56e07902b254dfad10`, `F_98dce83da57b0395e163467c9dae521b`, `F_f4b9ec30ad9f68f89b29639786cb62ef`, `F_812b4ba287f5ee0bc9d43bbf5bbe87fb`, `F_26657d5ff9020d2abefe558796b99584`, `F_e2ef524fbf3d9fe611d5a8e90fefdc9c`, `F_ed3d2c21991e3bef5e069713af9fa6ca`, `F_ac627ab1ccbdb62ec96e702f07f6425b`, `F_f899139df5e1059396431415e770c6dd`, `F_38b3eff8baf56627478ec76a704e9b52`, `F_ec8956637a99787bd197eacd77acce5e`, `F_6974ce5ac660610b44d9b9fed0ff9548`, `F_c9e1074f5b3f9fc8ea15d152add07294`, `F_65b9eea6e1cc6bb9f0cd2a47751a186f`, `F_f0935e4cd5920aa6c7c996a5ee53a70f`, `F_a97da629b098b75c294dffdc3e463904`, `F_a3c65c2974270fd093ee8a9bf8ae7d0b`, `F_2723d092b63885e0d7c260cc007e8b9d`, `F_5f93f983524def3dca464469d2cf9f3e`, `F_698d51a19d8a121ce581499d7b701668`, `F_7f6ffaa6bb0b408017b62254211691b5`, `F_73278a4a86960eeb576a8fd4c9ec6997`, `F_5fd0b37cd7dbbb00f97ba6ce92bf5add`, `F_2b44928ae11fb9384c4cf38708677c48`, `F_c45147dee729311ef5b5c3003946c48f`, `F_eb160de1de89d9058fcb0b968dbbbd68`, `F_5ef059938ba799aaa845e1c2e8a762bd`, `F_07e1cd7dca89a1678042477183b7ac3f`, `F_da4fb5c6e93e74d3df8527599fa62642`, `F_4c56ff4ce4aaf9573aa5dff913df997a`, `F_a0a080f42e6f13b3a2df133f073095dd`, `F_202cb962ac59075b964b07152d234b70`, `F_c8ffe9a587b126f152ed3d89a146b445`, `F_3def184ad8f4755ff269862ea77393dd`, `F_069059b7ef840f0c74a814ec9237b6ec`, `F_ec5decca5ed3d6b8079e2e7e7bacc9f2`, `F_76dc611d6ebaafc66cc0879c71b5db5c`, `F_d1f491a404d6854880943e5c3cd9ca25`, `F_9b8619251a19057cff70779273e95aa6`, `F_1afa34a7f984eeabdbb0a7d494132ee5`, `F_65ded5353c5ee48d0b7d48c591b8f430`, `F_9fc3d7152ba9336a670e36d0ed79bc43`, `F_02522a2b2726fb0a03bb19f2d8d9524d`, `F_7f1de29e6da19d22b51c68001e7e0e54`, `F_42a0e188f5033bc65bf8d78622277c4e`, `F_3988c7f88ebcb58c6ce932b957b6f332`, `F_013d407166ec4fa56eb1e1f8cbe183b9`, `F_e00da03b685a0dd18fb6a08af0923de0`, `F_1385974ed5904a438616ff7bdb3f7439`, `F_0f28b5d49b3020afeecd95b4009adf4c`, `F_a8baa56554f96369ab93e4f3bb068c22`, `F_903ce9225fca3e988c2af215d4e544d3`, `F_0a09c8844ba8f0936c20bd791130d6b6`, `F_2b24d495052a8ce66358eb576b8912c8`, `F_a5e00132373a7031000fd987a3c9f87b`, `F_8d5e957f297893487bd98fa830fa6413`, `F_47d1e990583c9c67424d369f3414728e`, `F_f2217062e9a397a1dca429e7d70bc6ca`, `F_7ef605fc8dba5425d6965fbd4c8fbe1f`, `F_a8f15eda80c50adb0e71943adc8015cf`, `F_37a749d808e46495a8da1e5352d03cae`, `F_b3e3e393c77e35a4a3f3cbd1e429b5dc`, `F_1d7f7abc18fcb43975065399b0d1e48e`, `F_2a79ea27c279e471f4d180b08d62b00a`, `F_1c9ac0159c94d8d0cbedc973445af2da`, `F_6c4b761a28b734fe93831e3fb400ce87`, `F_06409663226af2f3114485aa4e0a23b4`, `F_140f6969d5213fd0ece03148e62e461e`, `F_b73ce398c39f506af761d2277d853a92`, `F_bd4c9ab730f5513206b999ec0d90d1fb`, `F_82aa4b0af34c2313a562076992e50aa3`, `F_0777d5c17d4066b82ab86dff8a46af6f`, `F_fa7cdfad1a5aaf8370ebeda47a1ff1c3`, `F_9766527f2b5d3e95d4a733fcfb77bd7e`, `F_7e7757b1e12abcb736ab9a754ffb617a`, `F_5878a7ab84fb43402106c575658472fa`, `F_006f52e9102a8d3be2fe5614f42ba989`, `F_3636638817772e42b59d74cff571fbb3`, `F_149e9677a5989fd342ae44213df68868`, `F_a4a042cf4fd6bfb47701cbc8a1653ada`, `F_1ff8a7b5dc7a7d1f0ed65aaa29c04b1e`, `F_f7e6c85504ce6e82442c770f7c8606f0`, `F_bf8229696f7a3bb4700cfddef19fa23f`, `F_82161242827b703e6acf9c726942a1e4`, `F_38af86134b65d0f10fe33d30dd76442e`, `F_96da2f590cd7246bbde0051047b0d6f7`, `F_8f85517967795eeef66c225f7883bdcb`, `F_8f53295a73878494e9bc8dd6c3c7104f`, `F_045117b0e0a11a242b9765e79cbf113f`, `F_fc221309746013ac554571fbd180e1c8`, `F_4c5bde74a8f110656874902f07378009`, `F_cedebb6e872f539bef8c3f919874e9d7`, `F_6cdd60ea0045eb7a6ec44c54d29ed402`, `F_eecca5b6365d9607ee5a9d336962c534`, `F_9872ed9fc22fc182d371c3e9ed316094`, `F_31fefc0e570cb3860f2a6d4b38c6490d`, `F_9dcb88e0137649590b755372b040afad`, `F_a2557a7b2e94197ff767970b67041697`, `F_cfecdb276f634854f3ef915e2e980c31`, `F_0aa1883c6411f7873cb83dacb17b0afc`, `F_58a2fc6ed39fd083f55d4182bf88826d`, `F_bd686fd640be98efaae0091fa301e613`, `F_a597e50502f5ff68e3e25b9114205d4a`, `F_0336dcbab05b9d5ad24f4333c7658a0e`, `F_084b6fbb10729ed4da8c3d3f5a3ae7c9`, `F_85d8ce590ad8981ca2c8286f79f59954`, `F_0e65972dce68dad4d52d063967f0a705`, `F_84d9ee44e457ddef7f2c4f25dc8fa865`, `F_3644a684f98ea8fe223c713b77189a77`, `F_757b505cfd34c64c85ca5b5690ee5293`, `F_854d6fae5ee42911677c739ee1734486`, `F_e2c0be24560d78c5e599c2a9c9d0bbd2`, `F_274ad4786c3abca69fa097b85867d9a4`, `F_eae27d77ca20db309e056e3d2dcd7d69`, `F_7eabe3a1649ffa2b3ff8c02ebfd5659f`, `F_69adc1e107f7f7d035d7baf04342e1ca`, `F_091d584fced301b442654dd8c23b3fc9`, `F_b1d10e7bafa4421218a51b1e1f1b0ba2`, `F_6f3ef77ac0e3619e98159e9b6febf557`, `F_eb163727917cbba1eea208541a643e74`, `F_1534b76d325a8f591b52d302e7181331`, `F_979d472a84804b9f647bc185a877a8b5`, `F_ca46c1b9512a7a8315fa3c5a946e8265`, `F_3b8a614226a953a8cd9526fca6fe9ba5`, `F_45fbc6d3e05ebd93369ce542e8f2322d`, `F_63dc7ed1010d3c3b8269faf0ba7491d4`, `F_e96ed478dab8595a7dbda4cbcbee168f`, `F_c0e190d8267e36708f955d7ab048990d`, `F_ec8ce6abb3e952a85b8551ba726a1227`, `F_060ad92489947d410d897474079c1477`, `F_bcbe3365e6ac95ea2c0343a2395834dd`, `F_115f89503138416a242f40fb7d7f338e`, `F_13fe9d84310e77f13a6d184dbf1232f3`, `F_d1c38a09acc34845c6be3a127a5aacaf`, `F_9cfdf10e8fc047a44b08ed031e1f0ed1`, `F_705f2172834666788607efbfca35afb3`, `F_74db120f0a8e5646ef5a30154e9f6deb`, `F_57aeee35c98205091e18d1140e9f38cf`, `F_6da9003b743b65f4c0ccd295cc484e57`, `F_9b04d152845ec0a378394003c96da594`, `F_be83ab3ecd0db773eb2dc1b0a17836a1`, `F_e165421110ba03099a1c0393373c5b43`, `F_289dff07669d7a23de0ef88d2f7129e7`, `F_577ef1154f3240ad5b9b413aa7346a1e`, `F_01161aaa0b6d1345dd8fe4e481144d84`, `F_539fd53b59e3bb12d203f45a912eeaf2`, `F_ac1dd209cbcc5e5d1c6e28598e8cbbe8`, `F_555d6702c950ecb729a966504af0a635`, `F_335f5352088d7d9bf74191e006d8e24c`, `F_f340f1b1f65b6df5b5e3f94d95b11daf`, `F_e4a6222cdb5b34375400904f03d8e6a5`, `F_cb70ab375662576bd1ac5aaf16b3fca4`, `F_9188905e74c28e489b44e954ec0b9bca`, `F_0266e33d3f546cb5436a10798e657d97`, `F_38db3aed920cf82ab059bfccbd02be6a`, `F_3cec07e9ba5f5bb252d13f5f431e4bbb`, `F_621bf66ddb7c962aa0d22ac97d69b793`, `F_077e29b11be80ab57e1a2ecabb7da330`, `F_6c9882bbac1c7093bd25041881277658`, `F_19f3cd308f1455b3fa09a282e0d496f4`, `F_03c6b06952c750899bb03d998e631860`, `F_c24cd76e1ce41366a4bbe8a49b02a028`, `F_c52f1bd66cc19d05628bd8bf27af3ad6`, `F_fe131d7f5a6b38b23cc967316c13dae2`, `F_f718499c1c8cef6730f9fd03c8125cab`, `F_d96409bf894217686ba124d7356686c9`, `F_502e4a16930e414107ee22b6198c578f`, `F_cfa0860e83a4c3a763a7e62d825349f7`, `F_a4f23670e1833f3fdb077ca70bbd5d66`, `F_b1a59b315fc9a3002ce38bbe070ec3f5`, `F_36660e59856b4de58a219bcf4e27eba3`, `F_8c19f571e251e61cb8dd3612f26d5ecf`, `F_d6baf65e0b240ce177cf70da146c8dc8`, `F_e56954b4f6347e897f954495eab16a88`, `F_f7664060cc52bc6f3d620bcedc94a4b6`, `F_eda80a3d5b344bc40f3bc04f65b7a357`, `F_8f121ce07d74717e0b1f21d122e04521`, `F_06138bc5af6023646ede0e1f7c1eac75`, `F_39059724f73a9969845dfe4146c5660e`, `F_7f100b7b36092fb9b06dfb4fac360931`, `F_7a614fd06c325499f1680b9896beedeb`, `F_4734ba6f3de83d861c3176a6273cac6d`, `F_d947bf06a885db0d477d707121934ff8`, `F_63923f49e5241343aa7acb6a06a751e7`, `F_db8e1af0cb3aca1ae2d0018624204529`, `F_20f07591c6fcb220ffe637cda29bb3f6`, `F_07cdfd23373b17c6b337251c22b7ea57`, `F_d395771085aab05244a4fb8fd91bf4ee`, `F_92c8c96e4c37100777c7190b76d28233`, `F_e3796ae838835da0b6f6ea37bcf8bcb7`, `F_6a9aeddfc689c1d0e3b9ccc3ab651bc5`, `F_0f49c89d1e7298bb9930789c8ed59d48`, `F_46ba9f2a6976570b0353203ec4474217`, `F_0e01938fc48a2cfb5f2217fbfb00722d`, `F_16a5cdae362b8d27a1d8f8c7b78b4330`, `F_918317b57931b6b7a7d29490fe5ec9f9`, `F_48aedb8880cab8c45637abc7493ecddd`, `F_839ab46820b524afda05122893c2fe8e`, `F_f90f2aca5c640289d0a29417bcb63a37`, `F_9c838d2e45b2ad1094d42f4ef36764f6`, `F_1700002963a49da13542e0726b7bb758`, `F_53c3bce66e43be4f209556518c2fcb54`, `F_6883966fd8f918a4aa29be29d2c386fb`, `F_49182f81e6a13cf5eaa496d51fea6406`, `F_d296c101daa88a51f6ca8cfc1ac79b50`, `F_9fd81843ad7f202f26c1a174c7357585`, `F_26e359e83860db1d11b6acca57d8ea88`, `F_ef0d3930a7b6c95bd2b32ed45989c61f`, `F_94f6d7e04a4d452035300f18b984988c`, `F_34ed066df378efacc9b924ec161e7639`, `F_577bcc914f9e55d5e4e4f82f9f00e7d4`, `F_11b9842e0a271ff252c1903e7132cd68`, `F_37bc2f75bf1bcfe8450a1a41c200364c`, `F_496e05e1aea0a9c4655800e8a7b9ea28`, `F_b2eb7349035754953b57a32e2841bda5`, `F_8e98d81f8217304975ccb23337bb5761`, `F_a8c88a0055f636e4a163a5e3d16adab7`, `F_eddea82ad2755b24c4e168c5fc2ebd40`, `F_06eb61b839a0cefee4967c67ccb099dc`, `F_9dfcd5e558dfa04aaf37f137a1d9d3e5`, `F_950a4152c2b4aa3ad78bdd6b366cc179`, `F_158f3069a435b314a80bdcb024f8e422`, `F_758874998f5bd0c393da094e1967a72b`, `F_ad13a2a07ca4b7642959dc0c4c740ab6`, `F_3fe94a002317b5f9259f82690aeea4cd`, `F_5b8add2a5d98b1a652ea7fd72d942dac`, `F_432aca3a1e345e339f35a30c8f65edce`, `F_8d3bba7425e7c98c50f52ca1b52d3735`, `F_320722549d1751cf3f247855f937b982`, `F_caf1a3dfb505ffed0d024130f58c5cfa`, `F_5737c6ec2e0716f3d8a7a5c4e0de0d9a`, `F_bc6dc48b743dc5d013b1abaebd2faed2`, `F_f2fc990265c712c49d51a18a32b39f0c`, `F_89f0fd5c927d466d6ec9a21b9ac34ffa`, `F_a666587afda6e89aec274a3657558a27`, `F_b83aac23b9528732c23cc7352950e880`, `F_cd00692c3bfe59267d5ecfac5310286c`, `F_6faa8040da20ef399b63a72d0e4ab575`, `F_fe73f687e5bc5280214e0486b273a5f9`) VALUES (NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); -UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; @@ -1333,12 +1316,11 @@ CREATE TABLE `t1` ( `a` int(11) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -/*!40000 ALTER TABLE `t1` DISABLE KEYS */; LOCK TABLES `t1` WRITE; +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; INSERT INTO `t1` VALUES (1),(2),(3); -UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; +UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; From d1c24548159a65866c8bf12627687fbd976de2ae Mon Sep 17 00:00:00 2001 From: "bar@mysql.com" <> Date: Fri, 30 Jun 2006 16:48:18 +0500 Subject: [PATCH 07/22] Bug#7192 Specify --with-collation doesn't work for connections? --with-collation worked only on the server side. Client side ignored this argument, so collation_connection was not properly set (remained latin1_swedish_ci). --- sql-common/client.c | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/sql-common/client.c b/sql-common/client.c index ea8baeeffc7..6925f1bd265 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -1543,11 +1543,18 @@ C_MODE_START int mysql_init_character_set(MYSQL *mysql) { NET *net= &mysql->net; + const char *default_collation_name; + /* Set character set */ - if (!mysql->options.charset_name && - !(mysql->options.charset_name= + if (!mysql->options.charset_name) + { + default_collation_name= MYSQL_DEFAULT_COLLATION_NAME; + if (!(mysql->options.charset_name= my_strdup(MYSQL_DEFAULT_CHARSET_NAME,MYF(MY_WME)))) return 1; + } + else + default_collation_name= NULL; { const char *save= charsets_dir; @@ -1555,6 +1562,28 @@ int mysql_init_character_set(MYSQL *mysql) charsets_dir=mysql->options.charset_dir; mysql->charset=get_charset_by_csname(mysql->options.charset_name, MY_CS_PRIMARY, MYF(MY_WME)); + if (mysql->charset && default_collation_name) + { + CHARSET_INFO *collation; + if ((collation= + get_charset_by_name(default_collation_name, MYF(MY_WME)))) + { + if (!my_charset_same(mysql->charset, collation)) + { + my_printf_error(ER_UNKNOWN_ERROR, + "COLLATION %s is not valid for CHARACTER SET %s", + MYF(0), + default_collation_name, mysql->options.charset_name); + mysql->charset= NULL; + } + else + { + mysql->charset= collation; + } + } + else + mysql->charset= NULL; + } charsets_dir= save; } From 5039184e83047a7fa531ea627c4910912645bc7e Mon Sep 17 00:00:00 2001 From: "cmiller@zippy.(none)" <> Date: Sat, 1 Jul 2006 14:31:52 -0400 Subject: [PATCH 08/22] Bug#19006: 4.0 valgrind problems (in test func_str) On exactly-sized Strings, the String::c_ptr() function peeked beyond the end of the buffer, possibly into unititialized space to see whether the buffer was NUL-terminated. In a place that did peek improperly, we now use a c_ptr_safe() function, which doesn't peek where it shouldn't. --- client/sql_string.h | 8 ++++++++ sql/item_func.h | 5 ++++- sql/item_strfunc.cc | 4 ++-- sql/sql_string.h | 8 ++++++++ 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/client/sql_string.h b/client/sql_string.h index cffe78936a0..13687eef4dc 100644 --- a/client/sql_string.h +++ b/client/sql_string.h @@ -67,6 +67,14 @@ public: Ptr[str_length]=0; return Ptr; } + inline char *c_ptr_safe() + { + if (Ptr && str_length < Alloced_length) + Ptr[str_length]=0; + else + (void) realloc(str_length); + return Ptr; + } void set(String &str,uint32 offset,uint32 arg_length) { diff --git a/sql/item_func.h b/sql/item_func.h index 3627af4ebb1..3336f2afd1b 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -120,7 +120,10 @@ public: { return (null_value=args[0]->get_time(ltime)); } - bool is_null() { (void) val_int(); return null_value; } + bool is_null() { + (void) val_int(); /* Discard result. It sets null_value as side-effect. */ + return null_value; + } friend class udf_handler; unsigned int size_of() { return sizeof(*this);} Field *tmp_table_field(TABLE *t_arg); diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 2ea693e94a3..81e3129471c 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -51,14 +51,14 @@ double Item_str_func::val() { String *res; res=val_str(&str_value); - return res ? atof(res->c_ptr()) : 0.0; + return res ? atof(res->c_ptr_safe()) : 0.0; } longlong Item_str_func::val_int() { String *res; res=val_str(&str_value); - return res ? strtoll(res->c_ptr(),NULL,10) : (longlong) 0; + return res ? strtoll(res->c_ptr_safe(),NULL,10) : (longlong) 0; } diff --git a/sql/sql_string.h b/sql/sql_string.h index ad7455ecbf1..25abfd27eef 100644 --- a/sql/sql_string.h +++ b/sql/sql_string.h @@ -74,6 +74,14 @@ public: Ptr[str_length]=0; return Ptr; } + inline char *c_ptr_safe() + { + if (Ptr && str_length < Alloced_length) + Ptr[str_length]=0; + else + (void) realloc(str_length); + return Ptr; + } void set(String &str,uint32 offset,uint32 arg_length) { From 8e735d2c119bc74c75868e4c9ad4198e42e4d26d Mon Sep 17 00:00:00 2001 From: "konstantin@bodhi.netgear" <> Date: Thu, 6 Jul 2006 23:59:04 +0400 Subject: [PATCH 09/22] A fix and a test case for Bug#19399 "res 'Lost Connection' when dropping/creating tables". The bug could lead to a crash when multi-delete statements were prepared and used with temporary tables. The bug was caused by lack of clean-up of multi-delete tables before re-execution of a prepared statement. In a statement like DELETE t1 FROM t1, t2 WHERE ... the first table list (t1) is moved to lex->auxilliary_table_list and excluded from lex->query_tables or select_lex->tables. Thus it was unaccessible to reinit_stmt_before_use and not cleaned up before re-execution of a prepared statement. --- mysql-test/r/ps.result | 14 ++++++++++++++ mysql-test/t/ps.test | 25 +++++++++++++++++++++++++ sql/sql_lex.cc | 1 + sql/sql_prepare.cc | 20 +++++++++++++------- sql/table.cc | 17 +++++++++++++++++ sql/table.h | 5 +++++ 6 files changed, 75 insertions(+), 7 deletions(-) diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 2be5366b180..01aa4ddf859 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -875,3 +875,17 @@ select @@max_prepared_stmt_count, @@prepared_stmt_count; @@max_prepared_stmt_count @@prepared_stmt_count 3 0 set global max_prepared_stmt_count= @old_max_prepared_stmt_count; +drop table if exists t1; +create temporary table if not exists t1 (a1 int); +prepare stmt from "delete t1 from t1 where (cast(a1/3 as unsigned) * 3) = a1"; +drop temporary table t1; +create temporary table if not exists t1 (a1 int); +execute stmt; +drop temporary table t1; +create temporary table if not exists t1 (a1 int); +execute stmt; +drop temporary table t1; +create temporary table if not exists t1 (a1 int); +execute stmt; +drop temporary table t1; +deallocate prepare stmt; diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index d6dcf02d5b7..0ca293eb1ba 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -926,4 +926,29 @@ select @@max_prepared_stmt_count, @@prepared_stmt_count; set global max_prepared_stmt_count= @old_max_prepared_stmt_count; --enable_ps_protocol +# +# Bug#19399 "Stored Procedures 'Lost Connection' when dropping/creating +# tables" +# Check that multi-delete tables are also cleaned up before re-execution. +# +--disable_warnings +drop table if exists t1; +create temporary table if not exists t1 (a1 int); +--enable_warnings +# exact delete syntax is essential +prepare stmt from "delete t1 from t1 where (cast(a1/3 as unsigned) * 3) = a1"; +drop temporary table t1; +create temporary table if not exists t1 (a1 int); +# the server crashed on the next statement without the fix +execute stmt; +drop temporary table t1; +create temporary table if not exists t1 (a1 int); +# the problem was in memory corruption: repeat the test just in case +execute stmt; +drop temporary table t1; +create temporary table if not exists t1 (a1 int); +execute stmt; +drop temporary table t1; +deallocate prepare stmt; + # End of 4.1 tests diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 29ea8ab2ae2..fb9a765f12c 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -125,6 +125,7 @@ void lex_start(THD *thd, uchar *buf,uint length) lex->value_list.empty(); lex->update_list.empty(); lex->param_list.empty(); + lex->auxilliary_table_list.empty(); lex->unit.next= lex->unit.master= lex->unit.link_next= lex->unit.return_to= 0; lex->unit.prev= lex->unit.link_prev= 0; diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 2d9e80df63c..2688841d96c 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1727,14 +1727,9 @@ static void reset_stmt_for_execute(Prepared_statement *stmt) tables; tables= tables->next) { - /* - Reset old pointers to TABLEs: they are not valid since the tables - were closed in the end of previous prepare or execute call. - */ - tables->table= 0; - tables->table_list= 0; + tables->reinit_before_use(thd); } - + { SELECT_LEX_UNIT *unit= sl->master_unit(); unit->unclean(); @@ -1743,6 +1738,17 @@ static void reset_stmt_for_execute(Prepared_statement *stmt) unit->reinit_exec_mechanism(); } } + /* + Cleanup of the special case of DELETE t1, t2 FROM t1, t2, t3 ... + (multi-delete). We do a full clean up, although at the moment all we + need to clean in the tables of MULTI-DELETE list is 'table' member. + */ + for (TABLE_LIST *tables= (TABLE_LIST*) lex->auxilliary_table_list.first; + tables; + tables= tables->next) + { + tables->reinit_before_use(thd); + } lex->current_select= &lex->select_lex; if (lex->result) lex->result->cleanup(); diff --git a/sql/table.cc b/sql/table.cc index 513f42665a6..26da6dc4605 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1523,6 +1523,23 @@ db_type get_table_type(const char *name) DBUG_RETURN(ha_checktype((enum db_type) (uint) *(head+3))); } +/* + Cleanup this table for re-execution. + + SYNOPSIS + st_table_list::reinit_before_use() +*/ + +void st_table_list::reinit_before_use(THD * /* thd */) +{ + /* + Reset old pointers to TABLEs: they are not valid since the tables + were closed in the end of previous prepare or execute call. + */ + table= 0; + table_list= 0; +} + /***************************************************************************** ** Instansiate templates diff --git a/sql/table.h b/sql/table.h index 8cb15d3a69c..d615623cc37 100644 --- a/sql/table.h +++ b/sql/table.h @@ -238,6 +238,11 @@ typedef struct st_table_list bool cacheable_table; /* stop PS caching */ /* used in multi-upd privelege check */ bool table_in_update_from_clause; + /* + Cleanup for re-execution in a prepared statement or a stored + procedure. + */ + void reinit_before_use(THD *thd); } TABLE_LIST; typedef struct st_changed_table_list From eec0355de294079f9a04b2d33a998c7c281e4fcd Mon Sep 17 00:00:00 2001 From: "bar@myoffice.izhnet.ru" <> Date: Fri, 7 Jul 2006 17:06:30 +0500 Subject: [PATCH 10/22] func_str.result, func_str.test: Adding test case. item_strfunc.cc: bug#11728 string function LEFT, strange undocumented behaviour Fixing LEFT and RIGHT return NULL if the second argument is NULL. --- mysql-test/r/func_str.result | 3 +++ mysql-test/t/func_str.test | 5 +++++ sql/item_strfunc.cc | 4 ++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 1485809ba70..1042840fe04 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -33,6 +33,9 @@ instr('hello','HE') instr('hello',binary 'HE') instr(binary 'hello','HE') select position(binary 'll' in 'hello'),position('a' in binary 'hello'); position(binary 'll' in 'hello') position('a' in binary 'hello') 3 0 +select left('hello',null), right('hello',null); +left('hello',null) right('hello',null) +NULL NULL select left('hello',2),right('hello',2),substring('hello',2,2),mid('hello',1,5) ; left('hello',2) right('hello',2) substring('hello',2,2) mid('hello',1,5) he lo el hello diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index b13fe039261..56a03283d3a 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -19,6 +19,11 @@ select hex(char(256)); select locate('he','hello'),locate('he','hello',2),locate('lo','hello',2) ; select instr('hello','HE'), instr('hello',binary 'HE'), instr(binary 'hello','HE'); select position(binary 'll' in 'hello'),position('a' in binary 'hello'); +# +# Bug#11728 string function LEFT, +# strange undocumented behaviour, strict mode +# +select left('hello',null), right('hello',null); select left('hello',2),right('hello',2),substring('hello',2,2),mid('hello',1,5) ; select concat('',left(right(concat('what ',concat('is ','happening')),9),4),'',substring('monty',5,1)) ; select substring_index('www.tcx.se','.',-2),substring_index('www.tcx.se','.',1); diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 9e3a9b64288..5aef789074f 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1038,7 +1038,7 @@ String *Item_func_left::val_str(String *str) long length =(long) args[1]->val_int(); uint char_pos; - if ((null_value=args[0]->null_value)) + if ((null_value=(args[0]->null_value || args[1]->null_value))) return 0; if (length <= 0) return &my_empty_string; @@ -1078,7 +1078,7 @@ String *Item_func_right::val_str(String *str) String *res =args[0]->val_str(str); long length =(long) args[1]->val_int(); - if ((null_value=args[0]->null_value)) + if ((null_value=(args[0]->null_value || args[1]->null_value))) return 0; /* purecov: inspected */ if (length <= 0) return &my_empty_string; /* purecov: inspected */ From 8ea01fbca805a48f6d69d5022fe885359c294fd2 Mon Sep 17 00:00:00 2001 From: "cmiller@zippy.(none)" <> Date: Fri, 7 Jul 2006 16:47:57 -0400 Subject: [PATCH 11/22] Add a more reliable "getconf" test for Linuxthreads. The later trees should already have a better test (and so this should be null-merged there). ALSO! Make it so that it accepts NPTL as a valid _equivalent_ implementation. --- configure.in | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/configure.in b/configure.in index 8dd224d0a87..376cf48c476 100644 --- a/configure.in +++ b/configure.in @@ -1241,8 +1241,9 @@ if test "$with_named_thread" = "no" -a "$with_mit_threads" = "no" then # Look for LinuxThreads. AC_MSG_CHECKING("LinuxThreads") - res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l` - if test "$res" -gt 0 + grepres=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l` + getconfres=`which getconf >/dev/null && getconf GNU_LIBPTHREAD_VERSION | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ |grep LINUXTHREADS | wc -l || echo 0` + if test "$grepres" -gt 0 -o "$getconfres" -gt 0 then AC_MSG_RESULT("Found") AC_DEFINE(HAVE_LINUXTHREADS) @@ -1255,12 +1256,20 @@ then else AC_MSG_RESULT("Not found") # If this is a linux machine we should barf + AC_MSG_CHECKING("NPTL") if test "$IS_LINUX" = "true" then - AC_MSG_ERROR([This is a linux system and Linuxthreads was not -found. On linux Linuxthreads should be used. Please install Linuxthreads -(or a new glibc) and try again. See the Installation chapter in the -Reference Manual for more information.]) + getconfres=`which getconf >/dev/null && getconf GNU_LIBPTHREAD_VERSION | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ |grep NPTL | wc -l || echo 0` + if test "$getconfres" -gt 0 + then + AC_DEFINE(HAVE_LINUXTHREADS) dnl All this code predates NPTL, so "have linuxthreads" is a poor name. + with_named_thread="-lpthread" + else + AC_MSG_ERROR([This is a Linux system and neither Linuxthreads nor NPTL were +found. Please install Linuxthreads or a new glibc and try +again. See the Installation chapter in the Reference Manual for +more information.]) + fi else AC_MSG_CHECKING("DEC threads") if test -f /usr/shlib/libpthread.so -a -f /usr/lib/libmach.a -a -f /usr/ccs/lib/cmplrs/cc/libexc.a From 4893022ea6f71319b249f6a5421ef2f7a5e426c0 Mon Sep 17 00:00:00 2001 From: "pekka@orca.ndb.mysql.com" <> Date: Mon, 10 Jul 2006 12:05:51 +0200 Subject: [PATCH 12/22] ndb - bug#20847: non-debug compile fix --- ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp b/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp index ad8daff0729..73165dc7738 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp @@ -568,7 +568,9 @@ Dbtup::execDROP_TAB_REQ(Signal* signal) { ljamEntry(); if (ERROR_INSERTED(4013)) { +#ifdef VM_TRACE verifytabdes(); +#endif } DropTabReq* req = (DropTabReq*)signal->getDataPtr(); @@ -690,7 +692,9 @@ void Dbtup::execFSREMOVECONF(Signal* signal) initTab(tabPtr.p); if (ERROR_INSERTED(4013)) { CLEAR_ERROR_INSERT_VALUE; +#ifdef VM_TRACE verifytabdes(); +#endif } }//Dbtup::execFSREMOVECONF() From e62e7300202f8bfc6adbc9046be32363da66e48b Mon Sep 17 00:00:00 2001 From: "cmiller@zippy.(none)" <> Date: Mon, 10 Jul 2006 16:38:03 -0400 Subject: [PATCH 13/22] A patch to Bug#17667 didn't take into consideration that the vardir, which contains the server's binlog file, might be set to a different directory. This adds a new "vardir" parameter, which takes the name of the directory as a value, so that the test_bug17667() test can find the binlog. --- mysql-test/mysql-test-run.pl | 1 + tests/mysql_client_test.c | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 5226e6f80df..a3040127fcc 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -3069,6 +3069,7 @@ sub run_mysqltest ($) { my $cmdline_mysql_client_test= "$exe_mysql_client_test --no-defaults --testcase --user=root --silent " . "--port=$master->[0]->{'path_myport'} " . + "--vardir=$opt_vardir " . "--socket=$master->[0]->{'path_mysock'}"; if ( $glob_use_embedded_server ) diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 3876de58b0e..2e8a3c7f4e9 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -58,6 +58,7 @@ static unsigned int iter_count= 0; static my_bool have_innodb= FALSE; static const char *opt_basedir= "./"; +static const char *opt_vardir= "mysql-test/var"; static longlong opt_getopt_ll_test= 0; @@ -14850,6 +14851,7 @@ static void test_bug17667() struct buffer_and_length *statement_cursor; FILE *log_file; + char *master_log_filename; myheader("test_bug17667"); @@ -14861,7 +14863,13 @@ static void test_bug17667() } sleep(1); /* The server may need time to flush the data to the log. */ - log_file= fopen("var/log/master.log", "r"); + + master_log_filename = (char *) malloc(strlen(opt_vardir) + strlen("/log/master.log") + 1); + strcpy(master_log_filename, opt_vardir); + strcat(master_log_filename, "/log/master.log"); + log_file= fopen(master_log_filename, "r"); + free(master_log_filename); + if (log_file != NULL) { for (statement_cursor= statements; statement_cursor->buffer != NULL; @@ -14883,8 +14891,8 @@ static void test_bug17667() printf("success. All queries found intact in the log.\n"); } else { - fprintf(stderr, "Could not find the log file, var/log/master.log, so " - "test_bug17667 is \ninconclusive. Run test from the " + fprintf(stderr, "Could not find the log file, VARDIR/log/master.log, " + "so test_bug17667 \nis inconclusive. Run test from the " "mysql-test/mysql-test-run* program \nto set up the correct " "environment for this test.\n\n"); } @@ -14971,6 +14979,8 @@ static struct my_option client_test_long_options[] = {"user", 'u', "User for login if not current user", (char **) &opt_user, (char **) &opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif + {"vardir", 'v', "Data dir for tests.", (gptr*) &opt_vardir, + (gptr*) &opt_vardir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"getopt-ll-test", 'g', "Option for testing bug in getopt library", (char **) &opt_getopt_ll_test, (char **) &opt_getopt_ll_test, 0, GET_LL, REQUIRED_ARG, 0, 0, LONGLONG_MAX, 0, 0, 0}, From 22485908ce5eb1ab04869f3636bed0b980613015 Mon Sep 17 00:00:00 2001 From: "cmiller@zippy.(none)" <> Date: Tue, 11 Jul 2006 13:06:29 -0400 Subject: [PATCH 14/22] Bug#20729: Bad date_format() call makes mysql server crash The problem is that the author used the wrong function to send a warning to the user about truncation of data. push_warning() takes a constant string and push_warning_printf() takes a format and variable arguments to fill it. Since the string we were complaining about contains percent characters, the printf() code interprets the "%Y" et c. that the user sends. That's wrong, and often causes a crash, especially if the date mentions seconds, "%s". A alternate fix would be to use push_warning_printf(..., "%s", warn_buff) . --- mysql-test/r/date_formats.result | 6 ++++++ mysql-test/t/date_formats.test | 8 +++++++- sql/time.cc | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result index 24abdfcf148..04ada125847 100644 --- a/mysql-test/r/date_formats.result +++ b/mysql-test/r/date_formats.result @@ -509,3 +509,9 @@ TIME_FORMAT("24:00:00", '%l %p') SELECT TIME_FORMAT("25:00:00", '%l %p'); TIME_FORMAT("25:00:00", '%l %p') 1 AM +SELECT DATE_FORMAT('%Y-%m-%d %H:%i:%s', 1151414896); +DATE_FORMAT('%Y-%m-%d %H:%i:%s', 1151414896) +NULL +Warnings: +Warning 1292 Truncated incorrect datetime value: '%Y-%m-%d %H:%i:%s' +"End of 4.1 tests" diff --git a/mysql-test/t/date_formats.test b/mysql-test/t/date_formats.test index f3d507e69e6..0c227258383 100644 --- a/mysql-test/t/date_formats.test +++ b/mysql-test/t/date_formats.test @@ -275,7 +275,6 @@ drop table t1; select str_to_date( 1, NULL ); select str_to_date( NULL, 1 ); select str_to_date( 1, IF(1=1,NULL,NULL) ); -# End of 4.1 tests # # Bug#11326 @@ -298,3 +297,10 @@ SELECT TIME_FORMAT("12:00:00", '%l %p'); SELECT TIME_FORMAT("23:00:00", '%l %p'); SELECT TIME_FORMAT("24:00:00", '%l %p'); SELECT TIME_FORMAT("25:00:00", '%l %p'); + +# +# Bug#20729: Bad date_format() call makes mysql server crash +# +SELECT DATE_FORMAT('%Y-%m-%d %H:%i:%s', 1151414896); + +--echo "End of 4.1 tests" diff --git a/sql/time.cc b/sql/time.cc index e76b169b336..ef832ac5a70 100644 --- a/sql/time.cc +++ b/sql/time.cc @@ -797,7 +797,7 @@ void make_truncated_value_warning(THD *thd, const char *str_val, } sprintf(warn_buff, ER(ER_TRUNCATED_WRONG_VALUE), type_str, str.ptr()); - push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_TRUNCATED_WRONG_VALUE, warn_buff); } From 834111811b5190733dcd26336a4ae6fe83bb2ba4 Mon Sep 17 00:00:00 2001 From: "cmiller@calliope.local" <> Date: Wed, 12 Jul 2006 10:26:19 -0400 Subject: [PATCH 15/22] Bug#18470: Compile Failure: strings.s fails make with unknown pseudo-ops The bug is thqt we use some nonstandard assembly codes in our strings source, and some assemblers don't know what to do with them: Specifically, Sun's Solaris assembler and Apple's Darwin assembler balk at them. This patch, rather than trying to test for properties of the assembler, which Autoconf doesn't have any decent facilites for, instead tries to compile the code in question and disables assembly if it fails. There's still the problem of unportable assembly, but I'll leave that to someone who feels like rewriting and debugging it. --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index b230b7f042e..b32426595ad 100644 --- a/configure.in +++ b/configure.in @@ -718,7 +718,7 @@ AC_ARG_ENABLE(assembler, AC_MSG_CHECKING(if we should use assembler functions) # For now we only support assembler on i386 and sparc systems -AM_CONDITIONAL(ASSEMBLER_x86, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "i386") +AM_CONDITIONAL(ASSEMBLER_x86, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "i386" && $AS strings/strings-x86.s -o checkassembler >/dev/null 2>&1 && test -f checkassembler && (rm -f checkassembler; exit 0;)) AM_CONDITIONAL(ASSEMBLER_sparc32, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparc") AM_CONDITIONAL(ASSEMBLER_sparc64, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparcv9") AM_CONDITIONAL(ASSEMBLER, test "$ASSEMBLER_x86_TRUE" = "" -o "$ASSEMBLER_sparc32_TRUE" = "") From 4be51e1644c2a002aa78a5f5ae06b09eef38c400 Mon Sep 17 00:00:00 2001 From: "tnurnberg@mysql.com/salvation.intern.azundris.com" <> Date: Thu, 13 Jul 2006 09:04:06 +0200 Subject: [PATCH 16/22] Bug#20432: mysql client interprets commands in comments do not look for client-specific commands while inside a multi-line comment. we will allow multi-comments pretty much anywhere within SQL-statements, but client-specific commands (help, use, print, ...) must be the first token in the input. --- client/mysql.cc | 2 +- mysql-test/r/mysql_client.result | 4 ++++ mysql-test/t/mysql_client.test | 29 +++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 mysql-test/r/mysql_client.result create mode 100644 mysql-test/t/mysql_client.test diff --git a/client/mysql.cc b/client/mysql.cc index 2f9031b84b8..09818ae27b3 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1052,7 +1052,7 @@ static int read_lines(bool execute_commands) (We want to allow help, print and clear anywhere at line start */ if (execute_commands && (named_cmds || glob_buffer.is_empty()) - && !in_string && (com=find_command(line,0))) + && !ml_comment && !in_string && (com=find_command(line,0))) { if ((*com->func)(&glob_buffer,line) > 0) break; diff --git a/mysql-test/r/mysql_client.result b/mysql-test/r/mysql_client.result new file mode 100644 index 00000000000..87d09428ff6 --- /dev/null +++ b/mysql-test/r/mysql_client.result @@ -0,0 +1,4 @@ +1 +1 +ERROR 1064 (42000) at line 3: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 +ERROR at line 1: USE must be followed by a database name diff --git a/mysql-test/t/mysql_client.test b/mysql-test/t/mysql_client.test new file mode 100644 index 00000000000..e4b6658b631 --- /dev/null +++ b/mysql-test/t/mysql_client.test @@ -0,0 +1,29 @@ +# This test should work in embedded server after we fix mysqltest +-- source include/not_embedded.inc + +# +# Bug #20432: mysql client interprets commands in comments +# + +# if the client sees the 'use' within the comment, we haven't fixed +--exec echo "/*" > $MYSQLTEST_VARDIR/tmp/bug20432.sql +--exec echo "use" >> $MYSQLTEST_VARDIR/tmp/bug20432.sql +--exec echo "*/" >> $MYSQLTEST_VARDIR/tmp/bug20432.sql +--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug20432.sql 2>&1 + +# SQL can have embedded comments => workie +--exec echo "select /*" > $MYSQLTEST_VARDIR/tmp/bug20432.sql +--exec echo "use" >> $MYSQLTEST_VARDIR/tmp/bug20432.sql +--exec echo "*/ 1" >> $MYSQLTEST_VARDIR/tmp/bug20432.sql +--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug20432.sql 2>&1 + +# client commands on the other hand must be at BOL => error +--exec echo "/*" > $MYSQLTEST_VARDIR/tmp/bug20432.sql +--exec echo "xxx" >> $MYSQLTEST_VARDIR/tmp/bug20432.sql +--exec echo "*/ use" >> $MYSQLTEST_VARDIR/tmp/bug20432.sql +--error 1 +--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug20432.sql 2>&1 + +# client comment recognized, but parameter missing => error +--exec echo "use" > $MYSQLTEST_VARDIR/tmp/bug20432.sql +--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug20432.sql 2>&1 From d3eab1ca3574816e675eaa96bff6fdc2d2bb95c0 Mon Sep 17 00:00:00 2001 From: "iggy@rolltop.ignatz42.dyndns.org" <> Date: Thu, 13 Jul 2006 10:48:34 -0400 Subject: [PATCH 17/22] Bug #19779: mysql_explain_log documentation is outdated. --- scripts/mysql_explain_log.sh | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/scripts/mysql_explain_log.sh b/scripts/mysql_explain_log.sh index 973d9e8a363..fd468fdf091 100644 --- a/scripts/mysql_explain_log.sh +++ b/scripts/mysql_explain_log.sh @@ -1,5 +1,6 @@ -#!@PERL@ -w +#!@PERL@ use strict; +use warnings; use DBI; use Getopt::Long; @@ -58,7 +59,7 @@ else { } else { $Param->{Start} = time; - while() { + while(<>) { $Param->{LineCount} ++ ; if ($Param->{ViewDate} ) { @@ -317,6 +318,8 @@ Usage: $0 [OPTIONS] < LOGFILE -p=PASSWORD --socket=SOCKET mysqld socket file to connect -s=SOCKET +--printerror=1 enable error output +-e 1 Read logfile from STDIN an try to EXPLAIN all SELECT statements. All UPDATE statements are rewritten to an EXPLAIN SELECT statement. The results of the EXPLAIN statement are collected and counted. All results with type=ALL are collected in an separete list. Results are printed to STDOUT. @@ -331,7 +334,7 @@ __END__ =head1 NAME -explain_log.pl +mysql_explain_log Feed a mysqld general logfile (created with mysqld --log) back into mysql and collect statistics about index usage with EXPLAIN. @@ -348,7 +351,7 @@ Then add indices to avoid table scans and remove those which aren't used. =head1 USAGE -explain_log.pl [--date=YYMMDD] --host=dbhost] [--user=dbuser] [--password=dbpw] [--socket=/path/to/socket] < logfile +mysql_explain_log [--date=YYMMDD] --host=dbhost] [--user=dbuser] [--password=dbpw] [--socket=/path/to/socket] < logfile --date=YYMMDD select only entrys of date @@ -370,21 +373,20 @@ explain_log.pl [--date=YYMMDD] --host=dbhost] [--user=dbuser] [--password=dbpw] -s=SOCKET +--printerror=1 enable error output + +-e 1 + =head1 EXAMPLE -explain_log.pl --host=localhost --user=foo --password=bar < /var/lib/mysql/mobile.log +mysql_explain_log --host=localhost --user=foo --password=bar < /var/lib/mysql/mobile.log =head1 AUTHORS Stefan Nitz - Jan Willamowius , http://www.mobile.de + Jan Willamowius , http://www.willamowius.de Dennis Haney (Added socket support) -=head1 RECRUITING - -If you are looking for a MySQL or Perl job, take a look at http://www.mobile.de -and send me an email with your resume (you must be speaking German!). - =head1 SEE ALSO mysql documentation From 4316f715d3702e5b10ddf5b4cc39960caa22c62d Mon Sep 17 00:00:00 2001 From: "tnurnberg@mysql.com/salvation.intern.azundris.com" <> Date: Fri, 14 Jul 2006 01:25:13 +0200 Subject: [PATCH 18/22] Bug#21014: Segmentation fault of mysqldump on view mysqldump did not select the correct database before trying to dump views from it. this resulted in an empty result set, which in turn startled mysql-dump into a core-dump. this only happened for views, not for tables, and was only visible with multiple databases that weren't by sheer luck in the order mysqldump required, anyway. this fixes by selecting the correct database before dumping views; it also catches the empty set-condition if it should occur for other reasons. --- client/mysqldump.c | 11 +++++-- mysql-test/r/mysqldump.result | 61 +++++++++++++++++++++++++++++++++++ mysql-test/t/mysqldump.test | 18 +++++++++++ 3 files changed, 88 insertions(+), 2 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 53cb06be6f3..9469815bfaf 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -2781,6 +2781,12 @@ static my_bool dump_all_views_in_db(char *database) uint numrows; char table_buff[NAME_LEN*2+3]; + if (mysql_select_db(sock, database)) + { + DB_error(sock, "when selecting the database"); + return 1; + } + if (opt_xml) print_xml_tag1(md_result_file, "", "database name=", database, "\n"); if (lock_tables) @@ -3436,12 +3442,13 @@ static my_bool get_view_structure(char *table, char* db) mysql_free_result(table_res); /* Get the result from "select ... information_schema" */ - if (!(table_res= mysql_store_result(sock))) + if (!(table_res= mysql_store_result(sock)) || + !(row= mysql_fetch_row(table_res))) { safe_exit(EX_MYSQLERR); DBUG_RETURN(1); } - row= mysql_fetch_row(table_res); + lengths= mysql_fetch_lengths(table_res); /* diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index f9714e067e6..dc5886107ed 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -2844,3 +2844,64 @@ DROP TABLE IF EXISTS `v1`; drop view v1; drop table t1; drop database mysqldump_test_db; +create database mysqldump_tables; +use mysqldump_tables; +create table basetable ( id serial, tag varchar(64) ); +create database mysqldump_views; +use mysqldump_views; +create view nasishnasifu as select mysqldump_tables.basetable.id from mysqldump_tables.basetable; + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_tables` /*!40100 DEFAULT CHARACTER SET latin1 */; + +USE `mysqldump_tables`; +DROP TABLE IF EXISTS `basetable`; +CREATE TABLE `basetable` ( + `id` bigint(20) unsigned NOT NULL auto_increment, + `tag` varchar(64) default NULL, + UNIQUE KEY `id` (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + + +/*!40000 ALTER TABLE `basetable` DISABLE KEYS */; +LOCK TABLES `basetable` WRITE; +UNLOCK TABLES; +/*!40000 ALTER TABLE `basetable` ENABLE KEYS */; + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_views` /*!40100 DEFAULT CHARACTER SET latin1 */; + +USE `mysqldump_views`; +DROP TABLE IF EXISTS `nasishnasifu`; +/*!50001 DROP VIEW IF EXISTS `nasishnasifu`*/; +/*!50001 CREATE TABLE `nasishnasifu` ( + `id` bigint(20) unsigned +) */; +/*!50001 DROP TABLE IF EXISTS `nasishnasifu`*/; +/*!50001 DROP VIEW IF EXISTS `nasishnasifu`*/; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `mysqldump_views`.`nasishnasifu` AS select `mysqldump_tables`.`basetable`.`id` AS `id` from `mysqldump_tables`.`basetable` */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +drop view nasishnasifu; +drop database mysqldump_views; +drop table mysqldump_tables.basetable; +drop database mysqldump_tables; diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 4a355897adb..858d8910781 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -1194,6 +1194,7 @@ drop table t1; --exec $MYSQL_DUMP --force -N --compact --skip-comments test --echo } mysqldump drop view v1; + # BUG#17201 Spurious 'DROP DATABASE' in output, # also confusion between tables and views. # Example code from Markus Popp @@ -1210,3 +1211,20 @@ insert into t1 values (0815); drop view v1; drop table t1; drop database mysqldump_test_db; + +# Bug21014 Segmentation fault of mysqldump on view + +create database mysqldump_tables; +use mysqldump_tables; +create table basetable ( id serial, tag varchar(64) ); + +create database mysqldump_views; +use mysqldump_views; +create view nasishnasifu as select mysqldump_tables.basetable.id from mysqldump_tables.basetable; + +--exec $MYSQL_DUMP --skip-comments --databases mysqldump_tables mysqldump_views; + +drop view nasishnasifu; +drop database mysqldump_views; +drop table mysqldump_tables.basetable; +drop database mysqldump_tables; From b170112caee29fc078073785756d8a8a23450c46 Mon Sep 17 00:00:00 2001 From: "igreenhoe/greenman@anubis.greendragongames.com" <> Date: Fri, 14 Jul 2006 05:56:30 -0700 Subject: [PATCH 19/22] 4.1 -> 5.0 merge fixes --- mysql-test/r/mysqldump-max.result | 12 ------------ mysql-test/r/mysqldump.result | 1 - mysql-test/r/ps.result | 28 ++++++++++++++-------------- sql/sql_lex.cc | 1 - sql/table.cc | 1 - 5 files changed, 14 insertions(+), 29 deletions(-) diff --git a/mysql-test/r/mysqldump-max.result b/mysql-test/r/mysqldump-max.result index 39d607910aa..78867d1e430 100644 --- a/mysql-test/r/mysqldump-max.result +++ b/mysql-test/r/mysqldump-max.result @@ -115,7 +115,6 @@ CREATE TABLE `t1` ( `name` varchar(32) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; - /*!40000 ALTER TABLE `t1` DISABLE KEYS */; INSERT DELAYED IGNORE INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; @@ -125,7 +124,6 @@ CREATE TABLE `t2` ( `name` varchar(32) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; - /*!40000 ALTER TABLE `t2` DISABLE KEYS */; INSERT DELAYED IGNORE INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); /*!40000 ALTER TABLE `t2` ENABLE KEYS */; @@ -135,7 +133,6 @@ CREATE TABLE `t3` ( `name` varchar(32) default NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1; - /*!40000 ALTER TABLE `t3` DISABLE KEYS */; INSERT DELAYED IGNORE INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); /*!40000 ALTER TABLE `t3` ENABLE KEYS */; @@ -145,7 +142,6 @@ CREATE TABLE `t4` ( `name` varchar(32) default NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1; - /*!40000 ALTER TABLE `t4` DISABLE KEYS */; INSERT DELAYED IGNORE INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); /*!40000 ALTER TABLE `t4` ENABLE KEYS */; @@ -155,7 +151,6 @@ CREATE TABLE `t5` ( `name` varchar(32) default NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1; - /*!40000 ALTER TABLE `t5` DISABLE KEYS */; INSERT DELAYED IGNORE INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); /*!40000 ALTER TABLE `t5` ENABLE KEYS */; @@ -165,7 +160,6 @@ CREATE TABLE `t6` ( `name` varchar(32) default NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; - /*!40000 ALTER TABLE `t6` DISABLE KEYS */; INSERT IGNORE INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); /*!40000 ALTER TABLE `t6` ENABLE KEYS */; @@ -200,7 +194,6 @@ CREATE TABLE `t1` ( `name` varchar(32) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; - /*!40000 ALTER TABLE `t1` DISABLE KEYS */; INSERT DELAYED INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; @@ -210,7 +203,6 @@ CREATE TABLE `t2` ( `name` varchar(32) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; - /*!40000 ALTER TABLE `t2` DISABLE KEYS */; INSERT DELAYED INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); /*!40000 ALTER TABLE `t2` ENABLE KEYS */; @@ -220,7 +212,6 @@ CREATE TABLE `t3` ( `name` varchar(32) default NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1; - /*!40000 ALTER TABLE `t3` DISABLE KEYS */; INSERT DELAYED INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); /*!40000 ALTER TABLE `t3` ENABLE KEYS */; @@ -230,7 +221,6 @@ CREATE TABLE `t4` ( `name` varchar(32) default NULL ) ENGINE=MEMORY DEFAULT CHARSET=latin1; - /*!40000 ALTER TABLE `t4` DISABLE KEYS */; INSERT DELAYED INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); /*!40000 ALTER TABLE `t4` ENABLE KEYS */; @@ -240,7 +230,6 @@ CREATE TABLE `t5` ( `name` varchar(32) default NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1; - /*!40000 ALTER TABLE `t5` DISABLE KEYS */; INSERT DELAYED INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); /*!40000 ALTER TABLE `t5` ENABLE KEYS */; @@ -250,7 +239,6 @@ CREATE TABLE `t6` ( `name` varchar(32) default NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; - /*!40000 ALTER TABLE `t6` DISABLE KEYS */; INSERT INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); /*!40000 ALTER TABLE `t6` ENABLE KEYS */; diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index a6311bde387..ab3be183d3d 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -656,7 +656,6 @@ CREATE TABLE `t1` ( `a` int(11) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; - /*!40000 ALTER TABLE `t1` DISABLE KEYS */; INSERT DELAYED IGNORE INTO `t1` VALUES (1),(2),(3),(4),(5),(6); /*!40000 ALTER TABLE `t1` ENABLE KEYS */; diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index b40abb17120..3d352a02ad2 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -485,6 +485,20 @@ execute stmt; pnum deallocate prepare stmt; drop table t1, t2; +drop table if exists t1; +create temporary table if not exists t1 (a1 int); +prepare stmt from "delete t1 from t1 where (cast(a1/3 as unsigned) * 3) = a1"; +drop temporary table t1; +create temporary table if not exists t1 (a1 int); +execute stmt; +drop temporary table t1; +create temporary table if not exists t1 (a1 int); +execute stmt; +drop temporary table t1; +create temporary table if not exists t1 (a1 int); +execute stmt; +drop temporary table t1; +deallocate prepare stmt; create table t1 (a varchar(20)); insert into t1 values ('foo'); prepare stmt FROM 'SELECT char_length (a) FROM t1'; @@ -502,20 +516,6 @@ SELECT FOUND_ROWS(); FOUND_ROWS() 2 deallocate prepare stmt; -drop table if exists t1; -create temporary table if not exists t1 (a1 int); -prepare stmt from "delete t1 from t1 where (cast(a1/3 as unsigned) * 3) = a1"; -drop temporary table t1; -create temporary table if not exists t1 (a1 int); -execute stmt; -drop temporary table t1; -create temporary table if not exists t1 (a1 int); -execute stmt; -drop temporary table t1; -create temporary table if not exists t1 (a1 int); -execute stmt; -drop temporary table t1; -deallocate prepare stmt; create table t1 (a char(3) not null, b char(3) not null, c char(3) not null, primary key (a, b, c)); create table t2 like t1; diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 5bccff658f2..7d4dca15608 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -124,7 +124,6 @@ void lex_start(THD *thd, uchar *buf,uint length) lex->value_list.empty(); lex->update_list.empty(); lex->param_list.empty(); - lex->auxilliary_table_list.empty(); lex->view_list.empty(); lex->prepared_stmt_params.empty(); lex->unit.next= lex->unit.master= diff --git a/sql/table.cc b/sql/table.cc index 55e1575b9a3..e50b401df5f 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -2999,7 +2999,6 @@ void st_table_list::reinit_before_use(THD * /* thd */) were closed in the end of previous prepare or execute call. */ table= 0; - table_list= 0; } From 20de0388878e7b168172f25813e50cabb7255324 Mon Sep 17 00:00:00 2001 From: "igreenhoe/greenman@anubis.greendragongames.com" <> Date: Fri, 14 Jul 2006 13:30:23 -0700 Subject: [PATCH 20/22] 4.1 -> 5.0 merge --- mysql-test/r/mysqldump.result | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 6803533eefa..118079906bf 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -2835,11 +2835,10 @@ CREATE TABLE `basetable` ( UNIQUE KEY `id` (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -/*!40000 ALTER TABLE `basetable` DISABLE KEYS */; LOCK TABLES `basetable` WRITE; -UNLOCK TABLES; +/*!40000 ALTER TABLE `basetable` DISABLE KEYS */; /*!40000 ALTER TABLE `basetable` ENABLE KEYS */; +UNLOCK TABLES; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_views` /*!40100 DEFAULT CHARACTER SET latin1 */; From 011f57e0ec154f0a2696170341fdef8bc893f08c Mon Sep 17 00:00:00 2001 From: "msvensson@shellback.(none)" <> Date: Mon, 17 Jul 2006 10:50:20 +0200 Subject: [PATCH 21/22] Import yaSSL version 1.3.7 - Fix for "bug#16755 Please find a SSL library that is FLOSS-Exception / LGPL copyrighted" --- extra/yassl/FLOSS-EXCEPTIONS | 120 +++++++++++++++++++ extra/yassl/README | 12 +- extra/yassl/include/buffer.hpp | 4 + extra/yassl/include/cert_wrapper.hpp | 4 + extra/yassl/include/crypto_wrapper.hpp | 8 +- extra/yassl/include/factory.hpp | 4 + extra/yassl/include/handshake.hpp | 6 +- extra/yassl/include/lock.hpp | 4 + extra/yassl/include/log.hpp | 4 + extra/yassl/include/openssl/ssl.h | 12 ++ extra/yassl/include/socket_wrapper.hpp | 4 + extra/yassl/include/timer.hpp | 4 + extra/yassl/include/yassl_error.hpp | 4 + extra/yassl/include/yassl_imp.hpp | 8 +- extra/yassl/include/yassl_int.hpp | 10 +- extra/yassl/include/yassl_types.hpp | 4 + extra/yassl/mySTL/algorithm.hpp | 4 + extra/yassl/mySTL/helpers.hpp | 4 + extra/yassl/mySTL/list.hpp | 4 + extra/yassl/mySTL/memory.hpp | 4 + extra/yassl/mySTL/pair.hpp | 4 + extra/yassl/mySTL/stdexcept.hpp | 4 + extra/yassl/mySTL/vector.hpp | 4 + extra/yassl/src/buffer.cpp | 4 + extra/yassl/src/cert_wrapper.cpp | 7 +- extra/yassl/src/crypto_wrapper.cpp | 19 ++- extra/yassl/src/handshake.cpp | 22 ++-- extra/yassl/src/lock.cpp | 4 + extra/yassl/src/log.cpp | 4 + extra/yassl/src/socket_wrapper.cpp | 17 ++- extra/yassl/src/ssl.cpp | 50 ++++++-- extra/yassl/src/template_instnt.cpp | 4 + extra/yassl/src/timer.cpp | 4 + extra/yassl/src/yassl.cpp | 4 + extra/yassl/src/yassl_error.cpp | 4 + extra/yassl/src/yassl_imp.cpp | 22 +++- extra/yassl/src/yassl_int.cpp | 43 ++++++- extra/yassl/taocrypt/include/aes.hpp | 4 + extra/yassl/taocrypt/include/algebra.hpp | 4 + extra/yassl/taocrypt/include/arc4.hpp | 4 + extra/yassl/taocrypt/include/asn.hpp | 4 + extra/yassl/taocrypt/include/block.hpp | 4 + extra/yassl/taocrypt/include/blowfish.hpp | 4 + extra/yassl/taocrypt/include/coding.hpp | 4 + extra/yassl/taocrypt/include/des.hpp | 4 + extra/yassl/taocrypt/include/dh.hpp | 4 + extra/yassl/taocrypt/include/dsa.hpp | 4 + extra/yassl/taocrypt/include/error.hpp | 4 + extra/yassl/taocrypt/include/file.hpp | 4 + extra/yassl/taocrypt/include/hash.hpp | 4 + extra/yassl/taocrypt/include/hmac.hpp | 4 + extra/yassl/taocrypt/include/integer.hpp | 4 + extra/yassl/taocrypt/include/kernelc.hpp | 4 + extra/yassl/taocrypt/include/md2.hpp | 4 + extra/yassl/taocrypt/include/md4.hpp | 4 + extra/yassl/taocrypt/include/md5.hpp | 4 + extra/yassl/taocrypt/include/misc.hpp | 4 + extra/yassl/taocrypt/include/modarith.hpp | 4 + extra/yassl/taocrypt/include/modes.hpp | 4 + extra/yassl/taocrypt/include/pwdbased.hpp | 4 + extra/yassl/taocrypt/include/random.hpp | 4 + extra/yassl/taocrypt/include/ripemd.hpp | 4 + extra/yassl/taocrypt/include/rsa.hpp | 4 + extra/yassl/taocrypt/include/runtime.hpp | 7 ++ extra/yassl/taocrypt/include/sha.hpp | 4 + extra/yassl/taocrypt/include/twofish.hpp | 4 + extra/yassl/taocrypt/include/type_traits.hpp | 4 + extra/yassl/taocrypt/include/types.hpp | 4 + extra/yassl/taocrypt/src/aes.cpp | 4 + extra/yassl/taocrypt/src/aestables.cpp | 4 + extra/yassl/taocrypt/src/algebra.cpp | 4 + extra/yassl/taocrypt/src/arc4.cpp | 4 + extra/yassl/taocrypt/src/asn.cpp | 15 +-- extra/yassl/taocrypt/src/bftables.cpp | 4 + extra/yassl/taocrypt/src/blowfish.cpp | 4 + extra/yassl/taocrypt/src/coding.cpp | 4 + extra/yassl/taocrypt/src/des.cpp | 4 + extra/yassl/taocrypt/src/dh.cpp | 4 + extra/yassl/taocrypt/src/dsa.cpp | 4 + extra/yassl/taocrypt/src/file.cpp | 4 + extra/yassl/taocrypt/src/hash.cpp | 4 + extra/yassl/taocrypt/src/integer.cpp | 4 + extra/yassl/taocrypt/src/md2.cpp | 4 + extra/yassl/taocrypt/src/md4.cpp | 4 + extra/yassl/taocrypt/src/md5.cpp | 4 + extra/yassl/taocrypt/src/misc.cpp | 4 + extra/yassl/taocrypt/src/random.cpp | 4 + extra/yassl/taocrypt/src/ripemd.cpp | 4 + extra/yassl/taocrypt/src/rsa.cpp | 4 + extra/yassl/taocrypt/src/sha.cpp | 4 + extra/yassl/taocrypt/src/template_instnt.cpp | 4 + extra/yassl/taocrypt/src/tftables.cpp | 4 + extra/yassl/taocrypt/src/twofish.cpp | 4 + 93 files changed, 628 insertions(+), 58 deletions(-) create mode 100644 extra/yassl/FLOSS-EXCEPTIONS diff --git a/extra/yassl/FLOSS-EXCEPTIONS b/extra/yassl/FLOSS-EXCEPTIONS new file mode 100644 index 00000000000..344083b0114 --- /dev/null +++ b/extra/yassl/FLOSS-EXCEPTIONS @@ -0,0 +1,120 @@ +yaSSL FLOSS License Exception +**************************************** + +Version 0.1, 26 June 2006 + +The Sawtooth Consulting Ltd. Exception for Free/Libre and Open Source +Software-only Applications Using yaSSL Libraries (the "FLOSS Exception"). + +*Exception Intent* + +We want specified Free/Libre and Open Source Software ("FLOSS") +applications to be able to use specified GPL-licensed yaSSL +libraries (the "Program") despite the fact that not all FLOSS +licenses are compatible with version 2 of the GNU General Public +License (the "GPL"). + +*Legal Terms and Conditions* + +As a special exception to the terms and conditions of version 2.0 of +the GPL: + + 1. You are free to distribute a Derivative Work that is formed + entirely from the Program and one or more works (each, a "FLOSS + Work") licensed under one or more of the licenses listed below + in section 1, as long as: + + 1. You obey the GPL in all respects for the Program and the + Derivative Work, except for identifiable sections of the + Derivative Work which are not derived from the Program, + and which can reasonably be considered independent and + separate works in themselves, + + 2. all identifiable sections of the Derivative Work which + are not derived from the Program, and which can reasonably be + considered independent and separate works in themselves, + + * i + + are distributed subject to one of the FLOSS licenses + listed below, and + + * ii + + the object code or executable form of those sections are + accompanied by the complete corresponding machine-readable + source code for those sections on the same medium and under + the same FLOSS license as the corresponding object code or + executable forms of those sections, and + + + 3. any works which are aggregated with the Program or with + a Derivative Work on a volume of a storage or distribution + medium in accordance with the GPL, can reasonably be considered + independent and separate works in themselves which are not + derivatives of either the Program, a Derivative Work or a FLOSS + Work. + + + If the above conditions are not met, then the Program may only be + copied, modified, distributed or used under the terms and + conditions of the GPL or another valid licensing option from + Sawtooth Consulting Ltd. + + 2. FLOSS License List + + *License name* *Version(s)/Copyright Date* + Academic Free License 2.0 + Apache Software License 1.0/1.1/2.0 + Apple Public Source License 2.0 + Artistic license From Perl 5.8.0 + BSD license "July 22 1999" + Common Development and Distribution License (CDDL) 1.0 + Common Public License 1.0 + GNU Library or "Lesser" General Public 2.0/2.1 + License (LGPL) + Jabber Open Source License 1.0 + MIT license - + Mozilla Public License (MPL) 1.0/1.1 + Open Software License 2.0 + PHP License 3.0 + Python license (CNRI Python License) - + Python Software Foundation License 2.1.1 + Sleepycat License "1999" + W3C License "2001" + X11 License "2001" + Zlib/libpng License - + Zope Public License 2.0 + + Due to the many variants of some of the above licenses, we require + that any version follow the 2003 version of the Free Software + Foundation's Free Software Definition + (http://www.gnu.org/philosophy/free-sw.html + (http://www.gnu.org/philosophy/free-sw.html)) or version 1.9 of + the Open Source Definition by the Open Source Initiative + (http://www.opensource.org/docs/definition.php + (http://www.opensource.org/docs/definition.php)). + + 3. Definitions + + 1. Terms used, but not defined, herein shall have the + meaning provided in the GPL. + + 2. Derivative Work means a derivative work under copyright + law. + + + 4. Applicability This FLOSS Exception applies to all Programs that + contain a notice placed by Sawtooth Consulting Ltd. saying that the + Program may be distributed under the terms of this FLOSS Exception. + If you create or distribute a work which is a Derivative Work of + both the Program and any other work licensed under the GPL, then + this FLOSS Exception is not available for that work; thus, you + must remove the FLOSS Exception notice from that work and + comply with the GPL in all respects, including by retaining all + GPL notices. You may choose to redistribute a copy of the + Program exclusively under the terms of the GPL by removing the + FLOSS Exception notice from that copy of the Program, provided + that the copy has never been modified by you or any third party. + + diff --git a/extra/yassl/README b/extra/yassl/README index a5ff70aa6f6..25d4d94c306 100644 --- a/extra/yassl/README +++ b/extra/yassl/README @@ -1,4 +1,14 @@ -yaSSL Release notes, version 1.3.5 (06/01/06) +yaSSL Release notes, version 1.3.7 (06/26/06) + + + This release of yaSSL contains bug fixes, portability enhancements, + and libcurl 7.15.4 support (any newer versions may not build). + +See normal build instructions below under 1.0.6. +See libcurl build instructions below under 1.3.0. + + +********************yaSSL Release notes, version 1.3.5 (06/01/06) This release of yaSSL contains bug fixes, portability enhancements, diff --git a/extra/yassl/include/buffer.hpp b/extra/yassl/include/buffer.hpp index 6b0e9e65389..4816f79a9bc 100644 --- a/extra/yassl/include/buffer.hpp +++ b/extra/yassl/include/buffer.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/include/cert_wrapper.hpp b/extra/yassl/include/cert_wrapper.hpp index 2a214c529fd..8b5b7491772 100644 --- a/extra/yassl/include/cert_wrapper.hpp +++ b/extra/yassl/include/cert_wrapper.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/include/crypto_wrapper.hpp b/extra/yassl/include/crypto_wrapper.hpp index cb542c25a67..4c4e4d5da5b 100644 --- a/extra/yassl/include/crypto_wrapper.hpp +++ b/extra/yassl/include/crypto_wrapper.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -36,6 +40,7 @@ #define yaSSL_CRYPTO_WRAPPER_HPP #include "yassl_types.hpp" +#include // FILE namespace yaSSL { @@ -410,7 +415,8 @@ private: class x509; -x509* PemToDer(const char*, CertType); + +x509* PemToDer(FILE*, CertType); } // naemspace diff --git a/extra/yassl/include/factory.hpp b/extra/yassl/include/factory.hpp index f457188f587..5619e90cd62 100644 --- a/extra/yassl/include/factory.hpp +++ b/extra/yassl/include/factory.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/include/handshake.hpp b/extra/yassl/include/handshake.hpp index 6261359cd58..ea390fee322 100644 --- a/extra/yassl/include/handshake.hpp +++ b/extra/yassl/include/handshake.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -55,7 +59,7 @@ void sendCertificateVerify(SSL&, BufferOutput = buffered); int sendData(SSL&, const void*, int); int sendAlert(SSL& ssl, const Alert& alert); -int receiveData(SSL&, Data&); +int receiveData(SSL&, Data&, bool peek = false); void processReply(SSL&); void buildFinished(SSL&, Finished&, const opaque*); diff --git a/extra/yassl/include/lock.hpp b/extra/yassl/include/lock.hpp index f5231528821..5b585b1cf16 100644 --- a/extra/yassl/include/lock.hpp +++ b/extra/yassl/include/lock.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/include/log.hpp b/extra/yassl/include/log.hpp index c20116901ad..33cb38ebae0 100644 --- a/extra/yassl/include/log.hpp +++ b/extra/yassl/include/log.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/include/openssl/ssl.h b/extra/yassl/include/openssl/ssl.h index af801029561..47b4d075894 100644 --- a/extra/yassl/include/openssl/ssl.h +++ b/extra/yassl/include/openssl/ssl.h @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -36,6 +40,10 @@ #include "opensslv.h" /* for version number */ #include "rsa.h" + +#define YASSL_VERSION "1.3.7" + + #if defined(__cplusplus) extern "C" { #endif @@ -414,6 +422,7 @@ int RAND_load_file(const char*, long); /* for libcurl */ int RAND_status(void); +int RAND_bytes(unsigned char* buf, int num); int DES_set_key(const_DES_cblock*, DES_key_schedule*); void DES_set_odd_parity(DES_cblock*); @@ -421,6 +430,7 @@ void DES_ecb_encrypt(DES_cblock*, DES_cblock*, DES_key_schedule*, int); void SSL_CTX_set_default_passwd_cb_userdata(SSL_CTX*, void* userdata); void SSL_SESSION_free(SSL_SESSION* session); +int SSL_peek(SSL* ssl, void* buf, int num); X509* SSL_get_certificate(SSL* ssl); EVP_PKEY* SSL_get_privatekey(SSL* ssl); @@ -513,6 +523,8 @@ void MD5_Init(MD5_CTX*); void MD5_Update(MD5_CTX*, const void*, unsigned long); void MD5_Final(unsigned char*, MD5_CTX*); +#define MD5_DIGEST_LENGTH 16 + #define SSL_DEFAULT_CIPHER_LIST "" /* default all */ diff --git a/extra/yassl/include/socket_wrapper.hpp b/extra/yassl/include/socket_wrapper.hpp index 16db142b3a2..1dd61b63148 100644 --- a/extra/yassl/include/socket_wrapper.hpp +++ b/extra/yassl/include/socket_wrapper.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/include/timer.hpp b/extra/yassl/include/timer.hpp index 3025b7a0bd9..ff90aa884de 100644 --- a/extra/yassl/include/timer.hpp +++ b/extra/yassl/include/timer.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/include/yassl_error.hpp b/extra/yassl/include/yassl_error.hpp index 2f35fecb59b..3c3d5fa5231 100644 --- a/extra/yassl/include/yassl_error.hpp +++ b/extra/yassl/include/yassl_error.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/include/yassl_imp.hpp b/extra/yassl/include/yassl_imp.hpp index 2f240b71c03..838aace72c8 100644 --- a/extra/yassl/include/yassl_imp.hpp +++ b/extra/yassl/include/yassl_imp.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -664,9 +668,9 @@ struct Parameters { char cipher_name_[MAX_SUITE_NAME]; char cipher_list_[MAX_CIPHERS][MAX_SUITE_NAME]; - Parameters(ConnectionEnd, const Ciphers&, ProtocolVersion); + Parameters(ConnectionEnd, const Ciphers&, ProtocolVersion, bool haveDH); - void SetSuites(ProtocolVersion pv); + void SetSuites(ProtocolVersion pv, bool removeDH = false); void SetCipherNames(); private: Parameters(const Parameters&); // hide copy diff --git a/extra/yassl/include/yassl_int.hpp b/extra/yassl/include/yassl_int.hpp index 633b75d479f..26900aed3af 100644 --- a/extra/yassl/include/yassl_int.hpp +++ b/extra/yassl/include/yassl_int.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -429,9 +433,10 @@ private: // holds input and output buffers class Buffers { +public: typedef mySTL::list inputList; typedef mySTL::list outputList; - +private: inputList dataList_; // list of users app data / handshake outputList handShakeList_; // buffered handshake msgs public: @@ -458,7 +463,7 @@ class Security { bool resuming_; // trying to resume public: Security(ProtocolVersion, RandomPool&, ConnectionEnd, const Ciphers&, - SSL_CTX*); + SSL_CTX*, bool); const SSL_CTX* GetContext() const; const Connection& get_connection() const; @@ -521,6 +526,7 @@ public: void makeTLSMasterSecret(); void addData(input_buffer* data); void fillData(Data&); + void PeekData(Data&); void addBuffer(output_buffer* b); void flushBuffer(); void verifyState(const RecordLayerHeader&); diff --git a/extra/yassl/include/yassl_types.hpp b/extra/yassl/include/yassl_types.hpp index 76c807cd05f..b75a2a45302 100644 --- a/extra/yassl/include/yassl_types.hpp +++ b/extra/yassl/include/yassl_types.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/mySTL/algorithm.hpp b/extra/yassl/mySTL/algorithm.hpp index 3ceb0ca5fdc..efc7aa21a07 100644 --- a/extra/yassl/mySTL/algorithm.hpp +++ b/extra/yassl/mySTL/algorithm.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/mySTL/helpers.hpp b/extra/yassl/mySTL/helpers.hpp index df79025197a..c4449519db3 100644 --- a/extra/yassl/mySTL/helpers.hpp +++ b/extra/yassl/mySTL/helpers.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/mySTL/list.hpp b/extra/yassl/mySTL/list.hpp index dd8485f48a7..11a1a914868 100644 --- a/extra/yassl/mySTL/list.hpp +++ b/extra/yassl/mySTL/list.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/mySTL/memory.hpp b/extra/yassl/mySTL/memory.hpp index cc70fbf60d8..f480af12316 100644 --- a/extra/yassl/mySTL/memory.hpp +++ b/extra/yassl/mySTL/memory.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/mySTL/pair.hpp b/extra/yassl/mySTL/pair.hpp index c9bb03b5953..13916fece13 100644 --- a/extra/yassl/mySTL/pair.hpp +++ b/extra/yassl/mySTL/pair.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/mySTL/stdexcept.hpp b/extra/yassl/mySTL/stdexcept.hpp index 33ea43bf0e0..4fd343ae6fd 100644 --- a/extra/yassl/mySTL/stdexcept.hpp +++ b/extra/yassl/mySTL/stdexcept.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/mySTL/vector.hpp b/extra/yassl/mySTL/vector.hpp index 9eab91cfda8..6a412447b91 100644 --- a/extra/yassl/mySTL/vector.hpp +++ b/extra/yassl/mySTL/vector.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/src/buffer.cpp b/extra/yassl/src/buffer.cpp index 3bc6dced887..4d396a8d29f 100644 --- a/extra/yassl/src/buffer.cpp +++ b/extra/yassl/src/buffer.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/src/cert_wrapper.cpp b/extra/yassl/src/cert_wrapper.cpp index ae609b510ba..6ad0aa568ed 100644 --- a/extra/yassl/src/cert_wrapper.cpp +++ b/extra/yassl/src/cert_wrapper.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -182,7 +186,8 @@ int CertManager::CopyCaCert(const x509* x) signers_.push_back(NEW_YS TaoCrypt::Signer(key.GetKey(), key.size(), cert.GetCommonName(), cert.GetHash())); } - return cert.GetError().What(); + // just don't add, not an error return cert.GetError().What(); + return 0; } diff --git a/extra/yassl/src/crypto_wrapper.cpp b/extra/yassl/src/crypto_wrapper.cpp index 8859fbdd70f..799106ec7c0 100644 --- a/extra/yassl/src/crypto_wrapper.cpp +++ b/extra/yassl/src/crypto_wrapper.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -904,7 +908,7 @@ void DiffieHellman::get_parms(byte* bp, byte* bg, byte* bpub) const // convert PEM file to DER x509 type -x509* PemToDer(const char* fname, CertType type) +x509* PemToDer(FILE* file, CertType type) { using namespace TaoCrypt; @@ -919,10 +923,6 @@ x509* PemToDer(const char* fname, CertType type) strncpy(footer, "-----END RSA PRIVATE KEY-----", sizeof(header)); } - FILE* file = fopen(fname, "rb"); - if (!file) - return 0; - long begin = -1; long end = 0; bool foundEnd = false; @@ -943,18 +943,14 @@ x509* PemToDer(const char* fname, CertType type) else end = ftell(file); - if (begin == -1 || !foundEnd) { - fclose(file); + if (begin == -1 || !foundEnd) return 0; - } input_buffer tmp(end - begin); fseek(file, begin, SEEK_SET); size_t bytes = fread(tmp.get_buffer(), end - begin, 1, file); - if (bytes != 1) { - fclose(file); + if (bytes != 1) return 0; - } Source der(tmp.get_buffer(), end - begin); Base64Decoder b64Dec(der); @@ -963,7 +959,6 @@ x509* PemToDer(const char* fname, CertType type) mySTL::auto_ptr x(NEW_YS x509(sz), ysDelete); memcpy(x->use_buffer(), der.get_buffer(), sz); - fclose(file); return x.release(); } diff --git a/extra/yassl/src/handshake.cpp b/extra/yassl/src/handshake.cpp index 12b62f26e14..e93f5385b3d 100644 --- a/extra/yassl/src/handshake.cpp +++ b/extra/yassl/src/handshake.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -880,7 +884,7 @@ int sendData(SSL& ssl, const void* buffer, int sz) ssl.SetError(no_error); ssl.verfiyHandShakeComplete(); - if (ssl.GetError()) return 0; + if (ssl.GetError()) return -1; int sent = 0; for (;;) { @@ -891,7 +895,7 @@ int sendData(SSL& ssl, const void* buffer, int sz) buildMessage(ssl, out, data); ssl.Send(out.get_buffer(), out.get_size()); - if (ssl.GetError()) return 0; + if (ssl.GetError()) return -1; sent += len; if (sent == sz) break; } @@ -912,20 +916,24 @@ int sendAlert(SSL& ssl, const Alert& alert) // process input data -int receiveData(SSL& ssl, Data& data) +int receiveData(SSL& ssl, Data& data, bool peek) { if (ssl.GetError() == YasslError(SSL_ERROR_WANT_READ)) ssl.SetError(no_error); ssl.verfiyHandShakeComplete(); - if (ssl.GetError()) return 0; + if (ssl.GetError()) return -1; if (!ssl.bufferedData()) processReply(ssl); - ssl.fillData(data); - ssl.useLog().ShowData(data.get_length()); - if (ssl.GetError()) return 0; + if (peek) + ssl.PeekData(data); + else + ssl.fillData(data); + + ssl.useLog().ShowData(data.get_length()); + if (ssl.GetError()) return -1; if (data.get_length() == 0 && ssl.getSocket().WouldBlock()) { ssl.SetError(YasslError(SSL_ERROR_WANT_READ)); diff --git a/extra/yassl/src/lock.cpp b/extra/yassl/src/lock.cpp index 4827d396e81..0f4c80b1616 100644 --- a/extra/yassl/src/lock.cpp +++ b/extra/yassl/src/lock.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/src/log.cpp b/extra/yassl/src/log.cpp index 8ab351ee2b1..c8030787f3d 100644 --- a/extra/yassl/src/log.cpp +++ b/extra/yassl/src/log.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/src/socket_wrapper.cpp b/extra/yassl/src/socket_wrapper.cpp index 803f4b01249..7790001fc2d 100644 --- a/extra/yassl/src/socket_wrapper.cpp +++ b/extra/yassl/src/socket_wrapper.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -113,13 +117,22 @@ uint Socket::get_ready() const uint Socket::send(const byte* buf, unsigned int sz, int flags) const { + const byte* pos = buf; + const byte* end = pos + sz; + assert(socket_ != INVALID_SOCKET); - int sent = ::send(socket_, reinterpret_cast(buf), sz, flags); + + while (pos != end) { + int sent = ::send(socket_, reinterpret_cast(pos), + static_cast(end - pos), flags); if (sent == -1) return 0; - return sent; + pos += sent; + } + + return sz; } diff --git a/extra/yassl/src/ssl.cpp b/extra/yassl/src/ssl.cpp index 07f5e9859b2..81e585ff735 100644 --- a/extra/yassl/src/ssl.cpp +++ b/extra/yassl/src/ssl.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -64,12 +68,15 @@ int read_file(SSL_CTX* ctx, const char* file, int format, CertType type) return SSL_BAD_FILE; if (type == CA) { - x509* ptr = PemToDer(file, Cert); - if (!ptr) { + // may have a bunch of CAs + x509* ptr; + while ( (ptr = PemToDer(input, Cert)) ) + ctx->AddCA(ptr); + + if (!feof(input)) { fclose(input); return SSL_BAD_FILE; } - ctx->AddCA(ptr); // takes ownership } else { x509*& x = (type == Cert) ? ctx->certificate_ : ctx->privateKey_; @@ -86,7 +93,7 @@ int read_file(SSL_CTX* ctx, const char* file, int format, CertType type) } } else { - x = PemToDer(file, type); + x = PemToDer(input, type); if (!x) { fclose(input); return SSL_BAD_FILE; @@ -1189,6 +1196,35 @@ void MD5_Final(unsigned char* hash, MD5_CTX* md5) } +int RAND_bytes(unsigned char* buf, int num) +{ + RandomPool ran; + + if (ran.GetError()) return 0; + + ran.Fill(buf, num); + return 1; +} + + +int SSL_peek(SSL* ssl, void* buffer, int sz) +{ + Data data(min(sz, MAX_RECORD_SIZE), static_cast(buffer)); + return receiveData(*ssl, data, true); +} + + +int SSL_pending(SSL* ssl) +{ + // Just in case there's pending data that hasn't been processed yet... + char c; + SSL_peek(ssl, &c, 1); + + return ssl->bufferedData(); +} + + + // functions for stunnel void RAND_screen() @@ -1352,12 +1388,6 @@ void MD5_Final(unsigned char* hash, MD5_CTX* md5) } - int SSL_pending(SSL*) - { - return SSL_SUCCESS; // TODO: - } - - int SSL_want_read(SSL*) { return 0; // TODO: diff --git a/extra/yassl/src/template_instnt.cpp b/extra/yassl/src/template_instnt.cpp index ce8972c72fe..c5fc23dabdb 100644 --- a/extra/yassl/src/template_instnt.cpp +++ b/extra/yassl/src/template_instnt.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/src/timer.cpp b/extra/yassl/src/timer.cpp index 8b7d2d17a84..8500d09120b 100644 --- a/extra/yassl/src/timer.cpp +++ b/extra/yassl/src/timer.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/src/yassl.cpp b/extra/yassl/src/yassl.cpp index 86af12fd448..5bc8bad8bbc 100644 --- a/extra/yassl/src/yassl.cpp +++ b/extra/yassl/src/yassl.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/src/yassl_error.cpp b/extra/yassl/src/yassl_error.cpp index 72b8e459241..4f75de34a98 100644 --- a/extra/yassl/src/yassl_error.cpp +++ b/extra/yassl/src/yassl_error.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/src/yassl_imp.cpp b/extra/yassl/src/yassl_imp.cpp index 4d6d1fc7aff..310e8819c54 100644 --- a/extra/yassl/src/yassl_imp.cpp +++ b/extra/yassl/src/yassl_imp.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -428,7 +432,7 @@ opaque* DH_Server::get_serverKey() const // set available suites Parameters::Parameters(ConnectionEnd ce, const Ciphers& ciphers, - ProtocolVersion pv) : entity_(ce) + ProtocolVersion pv, bool haveDH) : entity_(ce) { pending_ = true; // suite not set yet @@ -438,11 +442,11 @@ Parameters::Parameters(ConnectionEnd ce, const Ciphers& ciphers, SetCipherNames(); } else - SetSuites(pv); // defaults + SetSuites(pv, ce == server_end && !haveDH); // defaults } -void Parameters::SetSuites(ProtocolVersion pv) +void Parameters::SetSuites(ProtocolVersion pv, bool removeDH) { int i = 0; // available suites, best first @@ -450,19 +454,23 @@ void Parameters::SetSuites(ProtocolVersion pv) // MAX_CIPHERS is big enough if (isTLS(pv)) { + if (!removeDH) { suites_[i++] = 0x00; suites_[i++] = TLS_DHE_RSA_WITH_AES_256_CBC_SHA; suites_[i++] = 0x00; suites_[i++] = TLS_DHE_DSS_WITH_AES_256_CBC_SHA; + } suites_[i++] = 0x00; suites_[i++] = TLS_RSA_WITH_AES_256_CBC_SHA; - suites_[i++] = 0x00; - suites_[i++] = TLS_RSA_WITH_AES_128_CBC_SHA; + if (!removeDH) { suites_[i++] = 0x00; suites_[i++] = TLS_DHE_RSA_WITH_AES_128_CBC_SHA; suites_[i++] = 0x00; suites_[i++] = TLS_DHE_DSS_WITH_AES_128_CBC_SHA; + } + suites_[i++] = 0x00; + suites_[i++] = TLS_RSA_WITH_AES_128_CBC_SHA; suites_[i++] = 0x00; suites_[i++] = TLS_RSA_WITH_AES_256_CBC_RMD160; @@ -471,6 +479,7 @@ void Parameters::SetSuites(ProtocolVersion pv) suites_[i++] = 0x00; suites_[i++] = TLS_RSA_WITH_3DES_EDE_CBC_RMD160; + if (!removeDH) { suites_[i++] = 0x00; suites_[i++] = TLS_DHE_RSA_WITH_AES_256_CBC_RMD160; suites_[i++] = 0x00; @@ -485,6 +494,7 @@ void Parameters::SetSuites(ProtocolVersion pv) suites_[i++] = 0x00; suites_[i++] = TLS_DHE_DSS_WITH_3DES_EDE_CBC_RMD160; } + } suites_[i++] = 0x00; suites_[i++] = SSL_RSA_WITH_RC4_128_SHA; @@ -496,6 +506,7 @@ void Parameters::SetSuites(ProtocolVersion pv) suites_[i++] = 0x00; suites_[i++] = SSL_RSA_WITH_DES_CBC_SHA; + if (!removeDH) { suites_[i++] = 0x00; suites_[i++] = SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA; suites_[i++] = 0x00; @@ -505,6 +516,7 @@ void Parameters::SetSuites(ProtocolVersion pv) suites_[i++] = SSL_DHE_RSA_WITH_DES_CBC_SHA; suites_[i++] = 0x00; suites_[i++] = SSL_DHE_DSS_WITH_DES_CBC_SHA; + } suites_size_ = i; diff --git a/extra/yassl/src/yassl_int.cpp b/extra/yassl/src/yassl_int.cpp index 1ff46903bfd..831942aaf69 100644 --- a/extra/yassl/src/yassl_int.cpp +++ b/extra/yassl/src/yassl_int.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -260,7 +264,8 @@ const ClientKeyFactory& sslFactory::getClientKey() const // extract context parameters and store SSL::SSL(SSL_CTX* ctx) : secure_(ctx->getMethod()->getVersion(), crypto_.use_random(), - ctx->getMethod()->getSide(), ctx->GetCiphers(), ctx) + ctx->getMethod()->getSide(), ctx->GetCiphers(), ctx, + ctx->GetDH_Parms().set_) { if (int err = crypto_.get_random().GetError()) { SetError(YasslError(err)); @@ -986,6 +991,36 @@ void SSL::fillData(Data& data) } +// like Fill but keep data in buffer +void SSL::PeekData(Data& data) +{ + if (GetError()) return; + uint dataSz = data.get_length(); // input, data size to fill + uint elements = buffers_.getData().size(); + + data.set_length(0); // output, actual data filled + dataSz = min(dataSz, bufferedData()); + + Buffers::inputList::iterator front = buffers_.getData().begin(); + + while (elements) { + uint frontSz = (*front)->get_remaining(); + uint readSz = min(dataSz - data.get_length(), frontSz); + uint before = (*front)->get_current(); + + (*front)->read(data.set_buffer() + data.get_length(), readSz); + data.set_length(data.get_length() + readSz); + (*front)->set_current(before); + + if (data.get_length() == dataSz) + break; + + elements--; + front++; + } +} + + // flush output buffer void SSL::flushBuffer() { @@ -1910,9 +1945,9 @@ Buffers::outputList& Buffers::useHandShake() Security::Security(ProtocolVersion pv, RandomPool& ran, ConnectionEnd ce, - const Ciphers& ciphers, SSL_CTX* ctx) - : conn_(pv, ran), parms_(ce, ciphers, pv), resumeSession_(ran), ctx_(ctx), - resuming_(false) + const Ciphers& ciphers, SSL_CTX* ctx, bool haveDH) + : conn_(pv, ran), parms_(ce, ciphers, pv, haveDH), resumeSession_(ran), + ctx_(ctx), resuming_(false) {} diff --git a/extra/yassl/taocrypt/include/aes.hpp b/extra/yassl/taocrypt/include/aes.hpp index e2c1a34b0e3..cb70f5c0e7e 100644 --- a/extra/yassl/taocrypt/include/aes.hpp +++ b/extra/yassl/taocrypt/include/aes.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/include/algebra.hpp b/extra/yassl/taocrypt/include/algebra.hpp index a09ac8dce16..07fc405f093 100644 --- a/extra/yassl/taocrypt/include/algebra.hpp +++ b/extra/yassl/taocrypt/include/algebra.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/include/arc4.hpp b/extra/yassl/taocrypt/include/arc4.hpp index c37b89fb294..05b0921f5a1 100644 --- a/extra/yassl/taocrypt/include/arc4.hpp +++ b/extra/yassl/taocrypt/include/arc4.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/include/asn.hpp b/extra/yassl/taocrypt/include/asn.hpp index da4c0ce1349..90bc46a59fd 100644 --- a/extra/yassl/taocrypt/include/asn.hpp +++ b/extra/yassl/taocrypt/include/asn.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/include/block.hpp b/extra/yassl/taocrypt/include/block.hpp index 76836615ce6..88cb06f62f1 100644 --- a/extra/yassl/taocrypt/include/block.hpp +++ b/extra/yassl/taocrypt/include/block.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/include/blowfish.hpp b/extra/yassl/taocrypt/include/blowfish.hpp index 7d794a37329..fbc4f223702 100644 --- a/extra/yassl/taocrypt/include/blowfish.hpp +++ b/extra/yassl/taocrypt/include/blowfish.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/include/coding.hpp b/extra/yassl/taocrypt/include/coding.hpp index 9aab2a30c7e..da6771a5bea 100644 --- a/extra/yassl/taocrypt/include/coding.hpp +++ b/extra/yassl/taocrypt/include/coding.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/include/des.hpp b/extra/yassl/taocrypt/include/des.hpp index e0867b09166..48bb1e9119d 100644 --- a/extra/yassl/taocrypt/include/des.hpp +++ b/extra/yassl/taocrypt/include/des.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/include/dh.hpp b/extra/yassl/taocrypt/include/dh.hpp index 75a5d6280d3..869c3edf5b3 100644 --- a/extra/yassl/taocrypt/include/dh.hpp +++ b/extra/yassl/taocrypt/include/dh.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/include/dsa.hpp b/extra/yassl/taocrypt/include/dsa.hpp index f1fdd2dfa25..a5ba416382d 100644 --- a/extra/yassl/taocrypt/include/dsa.hpp +++ b/extra/yassl/taocrypt/include/dsa.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/include/error.hpp b/extra/yassl/taocrypt/include/error.hpp index 55ab39313f5..b0ff9b280ba 100644 --- a/extra/yassl/taocrypt/include/error.hpp +++ b/extra/yassl/taocrypt/include/error.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/include/file.hpp b/extra/yassl/taocrypt/include/file.hpp index fe7e1073c99..87fc6139f8f 100644 --- a/extra/yassl/taocrypt/include/file.hpp +++ b/extra/yassl/taocrypt/include/file.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/include/hash.hpp b/extra/yassl/taocrypt/include/hash.hpp index 16112cb644d..e3030088e0e 100644 --- a/extra/yassl/taocrypt/include/hash.hpp +++ b/extra/yassl/taocrypt/include/hash.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/include/hmac.hpp b/extra/yassl/taocrypt/include/hmac.hpp index 543366afc3a..d46a6d4e7c3 100644 --- a/extra/yassl/taocrypt/include/hmac.hpp +++ b/extra/yassl/taocrypt/include/hmac.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/include/integer.hpp b/extra/yassl/taocrypt/include/integer.hpp index ee83906cfbc..7e4f6450316 100644 --- a/extra/yassl/taocrypt/include/integer.hpp +++ b/extra/yassl/taocrypt/include/integer.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/include/kernelc.hpp b/extra/yassl/taocrypt/include/kernelc.hpp index bb74c10ad07..317359553e4 100644 --- a/extra/yassl/taocrypt/include/kernelc.hpp +++ b/extra/yassl/taocrypt/include/kernelc.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/include/md2.hpp b/extra/yassl/taocrypt/include/md2.hpp index 1e1c17e9cbe..89856adffe9 100644 --- a/extra/yassl/taocrypt/include/md2.hpp +++ b/extra/yassl/taocrypt/include/md2.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/include/md4.hpp b/extra/yassl/taocrypt/include/md4.hpp index aac930d7498..d2da7e35e4d 100644 --- a/extra/yassl/taocrypt/include/md4.hpp +++ b/extra/yassl/taocrypt/include/md4.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/include/md5.hpp b/extra/yassl/taocrypt/include/md5.hpp index 981f29108fe..30d14d54fbf 100644 --- a/extra/yassl/taocrypt/include/md5.hpp +++ b/extra/yassl/taocrypt/include/md5.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/include/misc.hpp b/extra/yassl/taocrypt/include/misc.hpp index 0808d76ccdf..48604620706 100644 --- a/extra/yassl/taocrypt/include/misc.hpp +++ b/extra/yassl/taocrypt/include/misc.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/include/modarith.hpp b/extra/yassl/taocrypt/include/modarith.hpp index 66a841b05c3..47b91560657 100644 --- a/extra/yassl/taocrypt/include/modarith.hpp +++ b/extra/yassl/taocrypt/include/modarith.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/include/modes.hpp b/extra/yassl/taocrypt/include/modes.hpp index 10f336c00eb..65b7318661e 100644 --- a/extra/yassl/taocrypt/include/modes.hpp +++ b/extra/yassl/taocrypt/include/modes.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/include/pwdbased.hpp b/extra/yassl/taocrypt/include/pwdbased.hpp index f40c48fe026..c3e916e3d83 100644 --- a/extra/yassl/taocrypt/include/pwdbased.hpp +++ b/extra/yassl/taocrypt/include/pwdbased.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/include/random.hpp b/extra/yassl/taocrypt/include/random.hpp index 62f49a8716f..628faaf116c 100644 --- a/extra/yassl/taocrypt/include/random.hpp +++ b/extra/yassl/taocrypt/include/random.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/include/ripemd.hpp b/extra/yassl/taocrypt/include/ripemd.hpp index b72e503f095..2e594b7604d 100644 --- a/extra/yassl/taocrypt/include/ripemd.hpp +++ b/extra/yassl/taocrypt/include/ripemd.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/include/rsa.hpp b/extra/yassl/taocrypt/include/rsa.hpp index e327fdd20ad..1b531b9d0c0 100644 --- a/extra/yassl/taocrypt/include/rsa.hpp +++ b/extra/yassl/taocrypt/include/rsa.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/include/runtime.hpp b/extra/yassl/taocrypt/include/runtime.hpp index 3a5cf62865a..3a72b2917f8 100644 --- a/extra/yassl/taocrypt/include/runtime.hpp +++ b/extra/yassl/taocrypt/include/runtime.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -28,6 +32,9 @@ #ifndef yaSSL_NEW_HPP #define yaSSL_NEW_HPP +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #ifdef __sun diff --git a/extra/yassl/taocrypt/include/sha.hpp b/extra/yassl/taocrypt/include/sha.hpp index 3e301a6f0ae..2d65932dc17 100644 --- a/extra/yassl/taocrypt/include/sha.hpp +++ b/extra/yassl/taocrypt/include/sha.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/include/twofish.hpp b/extra/yassl/taocrypt/include/twofish.hpp index 8605221854f..0529c37d6c5 100644 --- a/extra/yassl/taocrypt/include/twofish.hpp +++ b/extra/yassl/taocrypt/include/twofish.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/include/type_traits.hpp b/extra/yassl/taocrypt/include/type_traits.hpp index d03ccae64ed..b985358e1c1 100644 --- a/extra/yassl/taocrypt/include/type_traits.hpp +++ b/extra/yassl/taocrypt/include/type_traits.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/include/types.hpp b/extra/yassl/taocrypt/include/types.hpp index a2453a994fb..9c3fa8f64f2 100644 --- a/extra/yassl/taocrypt/include/types.hpp +++ b/extra/yassl/taocrypt/include/types.hpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/src/aes.cpp b/extra/yassl/taocrypt/src/aes.cpp index e737af33df3..574a88a736c 100644 --- a/extra/yassl/taocrypt/src/aes.cpp +++ b/extra/yassl/taocrypt/src/aes.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/src/aestables.cpp b/extra/yassl/taocrypt/src/aestables.cpp index af9924703ef..4118715fd0c 100644 --- a/extra/yassl/taocrypt/src/aestables.cpp +++ b/extra/yassl/taocrypt/src/aestables.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/src/algebra.cpp b/extra/yassl/taocrypt/src/algebra.cpp index 9c485609dd0..e9bc3fceac0 100644 --- a/extra/yassl/taocrypt/src/algebra.cpp +++ b/extra/yassl/taocrypt/src/algebra.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/src/arc4.cpp b/extra/yassl/taocrypt/src/arc4.cpp index 6d1c4d4e3a6..ea1e084014c 100644 --- a/extra/yassl/taocrypt/src/arc4.cpp +++ b/extra/yassl/taocrypt/src/arc4.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/src/asn.cpp b/extra/yassl/taocrypt/src/asn.cpp index 383fe65dea6..beb5490bb66 100644 --- a/extra/yassl/taocrypt/src/asn.cpp +++ b/extra/yassl/taocrypt/src/asn.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -472,16 +476,7 @@ void CertDecoder::Decode(SignerList* signers, CertType ct) return; } - if (ct == CA) { - if ( memcmp(issuerHash_, subjectHash_, SHA::DIGEST_SIZE) == 0 ) { - if (!ValidateSelfSignature() && verify_) - source_.SetError(SIG_CONFIRM_E); - } - else - if (!ValidateSignature(signers) && verify_) - source_.SetError(SIG_OTHER_E); - } - else if (!ValidateSignature(signers) && verify_) + if (ct != CA && verify_ && !ValidateSignature(signers)) source_.SetError(SIG_OTHER_E); } diff --git a/extra/yassl/taocrypt/src/bftables.cpp b/extra/yassl/taocrypt/src/bftables.cpp index e072b117f54..2dbb6c01674 100644 --- a/extra/yassl/taocrypt/src/bftables.cpp +++ b/extra/yassl/taocrypt/src/bftables.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/src/blowfish.cpp b/extra/yassl/taocrypt/src/blowfish.cpp index 16e2277dc10..cc929cd7d41 100644 --- a/extra/yassl/taocrypt/src/blowfish.cpp +++ b/extra/yassl/taocrypt/src/blowfish.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/src/coding.cpp b/extra/yassl/taocrypt/src/coding.cpp index 01ea399df13..b8bbd29bb2b 100644 --- a/extra/yassl/taocrypt/src/coding.cpp +++ b/extra/yassl/taocrypt/src/coding.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/src/des.cpp b/extra/yassl/taocrypt/src/des.cpp index d2db4fc939e..054c8c2eb78 100644 --- a/extra/yassl/taocrypt/src/des.cpp +++ b/extra/yassl/taocrypt/src/des.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/src/dh.cpp b/extra/yassl/taocrypt/src/dh.cpp index 44934394343..aec7122b70b 100644 --- a/extra/yassl/taocrypt/src/dh.cpp +++ b/extra/yassl/taocrypt/src/dh.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/src/dsa.cpp b/extra/yassl/taocrypt/src/dsa.cpp index 4574fe5ebd8..a132c7339f5 100644 --- a/extra/yassl/taocrypt/src/dsa.cpp +++ b/extra/yassl/taocrypt/src/dsa.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/src/file.cpp b/extra/yassl/taocrypt/src/file.cpp index 4d48b9e7bca..7c59af09708 100644 --- a/extra/yassl/taocrypt/src/file.cpp +++ b/extra/yassl/taocrypt/src/file.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/src/hash.cpp b/extra/yassl/taocrypt/src/hash.cpp index 4e783e2c3b1..fbbdf0c8c31 100644 --- a/extra/yassl/taocrypt/src/hash.cpp +++ b/extra/yassl/taocrypt/src/hash.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/src/integer.cpp b/extra/yassl/taocrypt/src/integer.cpp index a296e122985..823c0c5e193 100644 --- a/extra/yassl/taocrypt/src/integer.cpp +++ b/extra/yassl/taocrypt/src/integer.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/src/md2.cpp b/extra/yassl/taocrypt/src/md2.cpp index 16834b6bc89..aeadbdfb367 100644 --- a/extra/yassl/taocrypt/src/md2.cpp +++ b/extra/yassl/taocrypt/src/md2.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/src/md4.cpp b/extra/yassl/taocrypt/src/md4.cpp index dfc2b079141..6012330cba3 100644 --- a/extra/yassl/taocrypt/src/md4.cpp +++ b/extra/yassl/taocrypt/src/md4.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/src/md5.cpp b/extra/yassl/taocrypt/src/md5.cpp index 3d64ff8a8a1..f7b0b1ee2dc 100644 --- a/extra/yassl/taocrypt/src/md5.cpp +++ b/extra/yassl/taocrypt/src/md5.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/src/misc.cpp b/extra/yassl/taocrypt/src/misc.cpp index 2869df71c8a..b8095334789 100644 --- a/extra/yassl/taocrypt/src/misc.cpp +++ b/extra/yassl/taocrypt/src/misc.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/src/random.cpp b/extra/yassl/taocrypt/src/random.cpp index 945a7fa6ff7..2ee1e57a663 100644 --- a/extra/yassl/taocrypt/src/random.cpp +++ b/extra/yassl/taocrypt/src/random.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/src/ripemd.cpp b/extra/yassl/taocrypt/src/ripemd.cpp index da96b6cc1b4..c791189544f 100644 --- a/extra/yassl/taocrypt/src/ripemd.cpp +++ b/extra/yassl/taocrypt/src/ripemd.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/src/rsa.cpp b/extra/yassl/taocrypt/src/rsa.cpp index 021fd992b5c..b280c48f1af 100644 --- a/extra/yassl/taocrypt/src/rsa.cpp +++ b/extra/yassl/taocrypt/src/rsa.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/src/sha.cpp b/extra/yassl/taocrypt/src/sha.cpp index 12f80c1af75..b877e2b7857 100644 --- a/extra/yassl/taocrypt/src/sha.cpp +++ b/extra/yassl/taocrypt/src/sha.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/src/template_instnt.cpp b/extra/yassl/taocrypt/src/template_instnt.cpp index 12bcd8238f2..512c5cf9dce 100644 --- a/extra/yassl/taocrypt/src/template_instnt.cpp +++ b/extra/yassl/taocrypt/src/template_instnt.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/src/tftables.cpp b/extra/yassl/taocrypt/src/tftables.cpp index 55846d5f79d..7d7f2e98ac3 100644 --- a/extra/yassl/taocrypt/src/tftables.cpp +++ b/extra/yassl/taocrypt/src/tftables.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/extra/yassl/taocrypt/src/twofish.cpp b/extra/yassl/taocrypt/src/twofish.cpp index 8b896ad5dc4..a16a8f0d169 100644 --- a/extra/yassl/taocrypt/src/twofish.cpp +++ b/extra/yassl/taocrypt/src/twofish.cpp @@ -9,6 +9,10 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * + * There are special exceptions to the terms and conditions of the GPL as it + * is applied to yaSSL. View the full text of the exception in the file + * FLOSS-EXCEPTIONS in the directory of this software distribution. + * * yaSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the From 00f56da9af79e19ec457a03044542117f222049e Mon Sep 17 00:00:00 2001 From: "holyfoot/hf@mysql.com/deer.(none)" <> Date: Tue, 18 Jul 2006 16:43:39 +0500 Subject: [PATCH 22/22] merging --- libmysql/libmysql.c | 5 +++-- libmysqld/lib_sql.cc | 14 -------------- libmysqld/libmysqld.c | 3 +-- sql/sql_parse.cc | 1 + tests/mysql_client_test.c | 2 +- 5 files changed, 6 insertions(+), 19 deletions(-) diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index b1fc99ad60e..4efc3c2fd1c 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -2699,7 +2699,8 @@ stmt_read_row_from_cursor(MYSQL_STMT *stmt, unsigned char **row) int4store(buff, stmt->stmt_id); int4store(buff + 4, stmt->prefetch_rows); /* number of rows to fetch */ if ((*mysql->methods->advanced_command)(mysql, COM_STMT_FETCH, - buff, sizeof(buff), NullS, 0, 1)) + buff, sizeof(buff), NullS, 0, + 1, NULL)) { set_stmt_errmsg(stmt, net->last_error, net->last_errno, net->sqlstate); return 1; @@ -4948,7 +4949,7 @@ static my_bool reset_stmt_handle(MYSQL_STMT *stmt, uint flags) char buff[MYSQL_STMT_HEADER]; /* packet header: 4 bytes for stmt id */ int4store(buff, stmt->stmt_id); if ((*mysql->methods->advanced_command)(mysql, COM_STMT_RESET, buff, - sizeof(buff), 0, 0, 0)) + sizeof(buff), 0, 0, 0, NULL)) { set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno, mysql->net.sqlstate); diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 5fc0a007921..2640910990e 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -387,20 +387,6 @@ static MYSQL_RES * emb_store_result(MYSQL *mysql) return mysql_store_result(mysql); } -my_bool emb_next_result(MYSQL *mysql) -{ - THD *thd= (THD*)mysql->thd; - DBUG_ENTER("emb_next_result"); - - if (emb_advanced_command(mysql, COM_QUERY,0,0, - thd->query_rest.ptr(),thd->query_rest.length(), - 1, NULL) || - emb_mysql_read_query_result(mysql)) - DBUG_RETURN(1); - - DBUG_RETURN(0); /* No more results */ -} - int emb_read_change_user_result(MYSQL *mysql, char *buff __attribute__((unused)), const char *passwd __attribute__((unused))) diff --git a/libmysqld/libmysqld.c b/libmysqld/libmysqld.c index 1cb37e8252a..cb4fa104b4c 100644 --- a/libmysqld/libmysqld.c +++ b/libmysqld/libmysqld.c @@ -164,7 +164,6 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user, port=0; unix_socket=0; - db_name = db ? my_strdup(db,MYF(MY_WME)) : NULL; /* Send client information for access check */ client_flag|=CLIENT_CAPABILITIES; @@ -175,7 +174,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user, client_flag|=CLIENT_CONNECT_WITH_DB; mysql->info_buffer= my_malloc(MYSQL_ERRMSG_SIZE, MYF(0)); - mysql->thd= create_embedded_thd(client_flag, db_name); + mysql->thd= create_embedded_thd(client_flag); init_embedded_mysql(mysql, client_flag); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 94e2d8e4c37..e37bc7cc3f7 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -306,6 +306,7 @@ int check_user(THD *thd, enum enum_server_command command, /* Send the error to the client */ net_send_error(thd); DBUG_RETURN(-1); + } } send_ok(thd); DBUG_RETURN(0); diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 04eb427b35f..b81c0aef506 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -13100,7 +13100,7 @@ static void test_bug9478() int4store(buff, stmt->stmt_id); buff[4]= 1; /* prefetch rows */ rc= ((*mysql->methods->advanced_command)(mysql, COM_STMT_FETCH, buff, - sizeof(buff), 0,0,1) || + sizeof(buff), 0,0,1,NULL) || (*mysql->methods->read_query_result)(mysql)); DIE_UNLESS(rc); if (!opt_silent && i == 0)