Commit a68a9cb6 authored by unknown's avatar unknown
Browse files

Re-apply missing changeset, orignally pushed by elliot

Add define YASSL_PREFIX when compiling yassl

Import patch from yaSSL
- avoid allocating memory for each call to 'EVP_md5' and 
  'EVP_des_ede3_cbc' which were not released until server was stopped
- Those functions are used from the SQL function 'des_encrypt' and
  'des_decrypt'.

Add new define YASSL_PREFIX beforee including ssl.h to activate inclusion of prefix_*.h files

Bug#20022 mysql-test-run can't be run with secure connections turned on for all testcases
- Part 1, fixes rpl- and federated-tests where connection is made to 127.0.0.1

- Include prefix files that renames all public functions in yaSSLs
  OpenSSL API to ya<function_name>. They will otherwise conflict
  with OpenSSL functions if loaded by an application that uses OpenSSL
  as well as libmysqlclient with yaSSL support.

Bug#18235: assertion/crash when windows mysqld is ended with ctrl-c
  
Two threads both try a shutdown sequence which creates a race to the
de-init/free of certain resources.
  
This exists in similar form in the client as 17926: "mysql.exe crashes
when ctrl-c is pressed in windows."

Update after merge to 5.0

BUG#18669: Session COM_STATISTICS breaks mysqladmin status.
Changed COM_STATISTICS to display the global status, instead of thead status, for slow queries and table opens.

- In function 'handle_grant_struct' when searching the memory structures for an 
  entry to modify, convert all entries here host.hostname is NULL to "" and compare that 
  with the host passed in argument "user_from".
- A user created with hostname "" is stored in "mysql.user" table as host="" but when loaded into 
  memory it'll be stored as host.hostname NULL. Specifiying "" as hostname means
  that "any host" can connect. Thus is's correct to turn on allow_all_hosts
  when such a user is found. 
- Review and fix other places where host.hostname may be NULL.

BUG#19394 OPT_INNODB_THREAD_CONCURRENCY duplicated
Removed duplication (not a user-visible change)


client/Makefile.am:
  Remove $yassl_includes
client/mysqltest.c:
  Turn on ssl_verify_server_cert only if host is "localhost"
extra/yassl/include/openssl/crypto.h:
  Add prefix file for ssl.h
extra/yassl/include/openssl/ssl.h:
  Add include file "prefix_crypto.h" to rename SSL_* functions to yaSSL_*
extra/yassl/include/yassl_int.hpp:
  Import patch yassl.diff
extra/yassl/src/Makefile.am:
  Add defined YASSL_PREFIX when building yassl/testsuite
extra/yassl/src/ssl.cpp:
  Import patch yassl.diff
extra/yassl/src/template_instnt.cpp:
  Import patch yassl.diff
extra/yassl/src/yassl_int.cpp:
  Import patch yassl.diff
extra/yassl/testsuite/Makefile.am:
  Add defined YASSL_PREFIX when building yassl/testsuite
extra/yassl/yassl.vcproj:
  Add define YASSL_PREFIX when compiling yassl
include/violite.h:
  Add new define YASSL_PREFIX beforee including ssl.h to activate inclusion of prefix_*.h files
libmysql/Makefile.am:
  Remove yassl_includes
libmysql_r/Makefile.am:
  Remove yassl_includes
libmysqld/Makefile.am:
  Remove yassl_includes
libmysqld/examples/Makefile.am:
  Remove yassl_includes
mysql-test/r/analyze.result:
  Add missing drop table
mysql-test/r/grant.result:
  Reorder test result
  Add test cases for users with hostname ""
mysql-test/r/ps.result:
  Add missing drop table
mysql-test/t/analyze.test:
  Add missing drop table
mysql-test/t/grant.test:
  Add "use test"
  Add test cases for users with hostname ""
  - Test create, grant and drop as well as connecting as the user with hostname "".
mysql-test/t/ps.test:
  Add missing drop table
server-tools/instance-manager/Makefile.am:
  Remove yassl_includes
sql/Makefile.am:
  Remove yassl_includes
sql/mysqld.cc:
  We have three potential ways of hitting the iceberg:
  - unireg_end()   has basic de-init
  - unireg_abort() has extended de-init
  - main() has a de-init sequence similar to unireg_abort()
  
  In the Windows version of the server, Control-C is handled
  in a different thread from the one main() is in.  The main
  loop is told to end, then unireg_abort() is called.  Its
  de-init and that of main() will then race each other for
  mutex- and cond-var-destroys, free(), and finally exit().
  
  This patch introduces a special case for Windows that will eliminate
  the race by ending the signal-handler via unireg_end() instead if
  SIGINT is signalled.  This seems the least intrusive fix that still
  fixes user-visible behaviour.
  
  Two of the startup options for mysqld, innodb_commit_concurrency
  and innodb_thread_concurrency, were using the same enumeration
  value. Changed to give innodb_commit_concurrency it's own value.
sql/sql_acl.cc:
  Add check if host is NULL
  Add check if grant_name->host.hostname is null
  Convert places where host.hostname is NULL to "" before using it.
sql/sql_parse.cc:
  Calculate and display the global statistics.
vio/Makefile.am:
  Remove yassl_includes
extra/yassl/include/openssl/generate_prefix_files.pl:
  New BitKeeper file ``extra/yassl/include/openssl/generate_prefix_files.pl''
extra/yassl/include/openssl/prefix_crypto.h:
  New BitKeeper file ``extra/yassl/include/openssl/prefix_crypto.h''
extra/yassl/include/openssl/prefix_ssl.h:
  New BitKeeper file ``extra/yassl/include/openssl/prefix_ssl.h''
parent 0b870cc1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ endif
INCLUDES =			-I$(top_builddir)/include \
				-I$(top_srcdir)/include \
				-I$(top_srcdir)/regex \
				$(openssl_includes) $(yassl_includes)
                                $(openssl_includes)
LIBS =				@CLIENT_LIBS@
LDADD=				@CLIENT_EXTRA_LDFLAGS@ $(CLIENT_THREAD_LIBS) \
				$(top_builddir)/libmysql/libmysqlclient.la
+3 −0
Original line number Diff line number Diff line
@@ -2757,6 +2757,9 @@ int do_connect(struct st_query *q)
#ifdef HAVE_OPENSSL
  if (opt_use_ssl || con_ssl)
  {
    /* Turn on ssl_verify_server_cert only if host is "localhost" */
    opt_ssl_verify_server_cert= !strcmp(con_host, "localhost");

    mysql_ssl_set(&next_con->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
		  opt_ssl_capath, opt_ssl_cipher);
    mysql_options(&next_con->mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
+4 −0
Original line number Diff line number Diff line
@@ -3,6 +3,10 @@
#ifndef ysSSL_crypto_h__
#define yaSSL_crypto_h__

#ifdef YASSL_PREFIX
#include "prefix_crypto.h"
#endif

const char* SSLeay_version(int type);

#define SSLEAY_VERSION 0x0900L
+45 −0
Original line number Diff line number Diff line
#!/usr/bin/perl
#
# This script generates defines for all functions
# in yassl/include/openssl/ so they are renamed to
# ya<old_function_name>. Hopefully that is unique enough.
#
# The script is to be run manually when we import
# a new version of yaSSL
#



# Find all functions in "input" and add macros
# to prefix/rename them into "output
sub generate_prefix($$)
{
  my $input= shift;
  my $output= shift;
  open(IN, $input)
      or die("Can't open input file $input: $!");
  open(OUT, ">", $output)
    or mtr_error("Can't open output file $output: $!");

  while (<IN>)
  {
    chomp;

    if ( /typedef/ )
    {
      next;
    }

    if ( /^\s*[a-zA-Z0-9*_ ]+\s+([_a-zA-Z0-9]+)\s*\(/ )
    {
      print OUT "#define $1 ya$1\n";
    }
  }

  close OUT;
  close IN;
}

generate_prefix("ssl.h", "prefix_ssl.h");
generate_prefix("crypto.h", "prefix_crypto.h");
+1 −0
Original line number Diff line number Diff line
#define SSLeay_version yaSSLeay_version
Loading