Commit graph

60 commits

Author SHA1 Message Date
Kent Boortz
9da00ebec9 Updated/added copyright headers 2011-06-30 17:46:53 +02:00
Kent Boortz
1400d7a2cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
Kent Boortz
e5ce023f57 Updated/added copyright headers 2011-06-30 17:31:31 +02:00
Tatjana Azundris Nuernberg
92b901d297 Bug#11745920/Bug#21287: "SSL connection error" is not helpful! (ssl-verify-server-cert=true vs localhos)
SSL errors on client and now more specific to aid end-user
with debugging. Also restructures error handling for
compliance with SSL docs.
2011-05-19 10:47:43 +01:00
Davi Arnaut
f54a118249 WL#5486: Remove code for unsupported platforms
Remove Netware specific code.
2010-07-15 08:13:30 -03:00
Davi Arnaut
a10ae35328 Bug#34043: Server loops excessively in _checkchunk() when safemalloc is enabled
Essentially, the problem is that safemalloc is excruciatingly
slow as it checks all allocated blocks for overrun at each
memory management primitive, yielding a almost exponential
slowdown for the memory management functions (malloc, realloc,
free). The overrun check basically consists of verifying some
bytes of a block for certain magic keys, which catches some
simple forms of overrun. Another minor problem is violation
of aliasing rules and that its own internal list of blocks
is prone to corruption.

Another issue with safemalloc is rather the maintenance cost
as the tool has a significant impact on the server code.
Given the magnitude of memory debuggers available nowadays,
especially those that are provided with the platform malloc
implementation, maintenance of a in-house and largely obsolete
memory debugger becomes a burden that is not worth the effort
due to its slowness and lack of support for detecting more
common forms of heap corruption.

Since there are third-party tools that can provide the same
functionality at a lower or comparable performance cost, the
solution is to simply remove safemalloc. Third-party tools
can provide the same functionality at a lower or comparable
performance cost. 

The removal of safemalloc also allows a simplification of the
malloc wrappers, removing quite a bit of kludge: redefinition
of my_malloc, my_free and the removal of the unused second
argument of my_free. Since free() always check whether the
supplied pointer is null, redudant checks are also removed.

Also, this patch adds unit testing for my_malloc and moves
my_realloc implementation into the same file as the other
memory allocation primitives.
2010-07-08 18:20:08 -03:00
Davi Arnaut
0b87650887 Post-merge fixes: fix typo and remove unused variables. 2009-11-21 10:11:45 -02:00
Georgi Kodinov
b9553d83ea merge 2009-10-27 15:20:34 +02:00
Georgi Kodinov
95dce2b033 merge from 4.1 2009-10-27 15:11:06 +02:00
Georgi Kodinov
90d32d8bc8 Bug #47320: OpenSSL client does not check YaSSL server certificate
Removed the verify callback, as it's not needed to verify even self
signed certificates and is a security problem.
2009-10-20 13:09:16 +03:00
Staale Smedseng
63ab8415d9 Bug #45770 errors reading server SSL files are printed, but
not logged
        
Errors encountered during initialization of the SSL subsystem
are printed to stderr, rather than to the error log.
        
This patch adds a parameter to several SSL init functions to
report the error (if any) out to the caller. The function
init_ssl() in mysqld.cc is moved after the initialization of
the log subsystem, so that any error messages can be logged to
the error log. Printing of messages to stderr has been 
retained to get diagnostic output in a client context.
2009-07-23 13:38:11 +02:00
Staale Smedseng
47a9a25228 Merge from 5.0 2009-07-23 13:53:28 +02:00
guilhem@gbichot4.local
9e2b31b026 Fix for server bug experienced in Maria (wrong "Truncated incorrect <var_name>
value" error even though the value was correct): a C function in my_getopt.c
was taking bool* in parameter and was called from C++ sql_plugin.cc,
but on some Mac OS X sizeof(bool) is 1 in C and 4 in C++, giving funny
mismatches. Fixed, all other occurences of bool in C are removed, future
ones are blocked by a "C-bool-catcher" in my_global.h (use my_bool).
2008-02-18 23:29:39 +01:00
monty@mysql.com/narttu.mysql.fi
088e2395f1 WL#3817: Simplify string / memory area types and make things more consistent (first part)
The following type conversions was done:

- Changed byte to uchar
- Changed gptr to uchar*
- Change my_string to char *
- Change my_size_t to size_t
- Change size_s to size_t

Removed declaration of byte, gptr, my_string, my_size_t and size_s. 

Following function parameter changes was done:
- All string functions in mysys/strings was changed to use size_t
  instead of uint for string lengths.
- All read()/write() functions changed to use size_t (including vio).
- All protocoll functions changed to use size_t instead of uint
- Functions that used a pointer to a string length was changed to use size_t*
- Changed malloc(), free() and related functions from using gptr to use void *
  as this requires fewer casts in the code and is more in line with how the
  standard functions work.
- Added extra length argument to dirname_part() to return the length of the
  created string.
- Changed (at least) following functions to take uchar* as argument:
  - db_dump()
  - my_net_write()
  - net_write_command()
  - net_store_data()
  - DBUG_DUMP()
  - decimal2bin() & bin2decimal()
- Changed my_compress() and my_uncompress() to use size_t. Changed one
  argument to my_uncompress() from a pointer to a value as we only return
  one value (makes function easier to use).
- Changed type of 'pack_data' argument to packfrm() to avoid casts.
- Changed in readfrm() and writefrom(), ha_discover and handler::discover()
  the type for argument 'frmdata' to uchar** to avoid casts.
- Changed most Field functions to use uchar* instead of char* (reduced a lot of
  casts).
- Changed field->val_xxx(xxx, new_ptr) to take const pointers.

Other changes:
- Removed a lot of not needed casts
- Added a few new cast required by other changes
- Added some cast to my_multi_malloc() arguments for safety (as string lengths
  needs to be uint, not size_t).
- Fixed all calls to hash-get-key functions to use size_t*. (Needed to be done
  explicitely as this conflict was often hided by casting the function to
  hash_get_key).
- Changed some buffers to memory regions to uchar* to avoid casts.
- Changed some string lengths from uint to size_t.
- Changed field->ptr to be uchar* instead of char*. This allowed us to
  get rid of a lot of casts.
- Some changes from true -> TRUE, false -> FALSE, unsigned char -> uchar
- Include zlib.h in some files as we needed declaration of crc32()
- Changed MY_FILE_ERROR to be (size_t) -1.
- Changed many variables to hold the result of my_read() / my_write() to be
  size_t. This was needed to properly detect errors (which are
  returned as (size_t) -1).
- Removed some very old VMS code
- Changed packfrm()/unpackfrm() to not be depending on uint size
  (portability fix)
- Removed windows specific code to restore cursor position as this
  causes slowdown on windows and we should not mix read() and pread()
  calls anyway as this is not thread safe. Updated function comment to
  reflect this. Changed function that depended on original behavior of
  my_pwrite() to itself restore the cursor position (one such case).
- Added some missing checking of return value of malloc().
- Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid 'long' overflow.
- Changed type of table_def::m_size from my_size_t to ulong to reflect that
  m_size is the number of elements in the array, not a string/memory
  length.
- Moved THD::max_row_length() to table.cc (as it's not depending on THD).
  Inlined max_row_length_blob() into this function.
- More function comments
- Fixed some compiler warnings when compiled without partitions.
- Removed setting of LEX_STRING() arguments in declaration (portability fix).
- Some trivial indentation/variable name changes.
- Some trivial code simplifications:
  - Replaced some calls to alloc_root + memcpy to use
    strmake_root()/strdup_root().
  - Changed some calls from memdup() to strmake() (Safety fix)
  - Simpler loops in client-simple.c
2007-05-10 12:59:39 +03:00
msvensson@pilot.blaudden
4774c40089 Merge pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.1-maint
2007-04-11 22:08:00 +02:00
msvensson@pilot.blaudden
900e0d685d Merge pilot.blaudden:/home/msvensson/mysql/bug21611/my50-bug21611
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
2007-04-11 21:03:29 +02:00
msvensson@pilot.blaudden
82b454aa28 Bug#21611 Slave can't connect when master-ssl-cipher specified
- Change check for return value of 'SSL_CTX_set_cipher_list'
   in order to handle 0 as error setting cipher.
 - Thanks to Dan Lukes for finding the problem!
2007-04-02 13:12:59 +02:00
msvensson@pilot.blaudden
cb806be68d Merge pilot.blaudden:/home/msvensson/mysql/bug25309/my51-bug25309
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.1-maint
2007-03-29 11:48:05 +02:00
msvensson@pilot.blaudden
f47c4368de Merge pilot.blaudden:/home/msvensson/mysql/bug25309/my50-bug25309
into  pilot.blaudden:/home/msvensson/mysql/bug25309/my51-bug25309
2007-03-29 11:38:48 +02:00
msvensson@pilot.blaudden
aec7927c8e Bug#25309 SSL connections without CA certificate broken since MySQL 5.0.23
- Turn off verification of peer if both ca_path and ca_file is null
   i.e from only passing --ssl-key=<client_key> and --ssl-cert=<client_cert>
   to the mysql utility programs.
   The server will authenticate the client accoring to GRANT tables
   but the client won't authenticate the server
2007-03-28 12:23:55 +02:00
monty@mysql.com/narttu.mysql.fi
f0ae3ce9b9 Fixed compiler warnings
Fixed compile-pentium64 scripts
Fixed wrong estimate of update_with_key_prefix in sql-bench
Merge bk-internal.mysql.com:/home/bk/mysql-5.1 into mysql.com:/home/my/mysql-5.1
Fixed unsafe define of uint4korr()
Fixed that --extern works with mysql-test-run.pl
Small trivial cleanups
This also fixes a bug in counting number of rows that are updated when we have many simultanous queries
Move all connection handling and command exectuion main loop from sql_parse.cc to sql_connection.cc
Split handle_one_connection() into reusable sub functions.
Split create_new_thread() into reusable sub functions.
Added thread_scheduler; Preliminary interface code for future thread_handling code.

Use 'my_thread_id' for internal thread id's
Make thr_alarm_kill() to depend on thread_id instead of thread
Make thr_abort_locks_for_thread() depend on thread_id instead of thread
In store_globals(), set my_thread_var->id to be thd->thread_id.
Use my_thread_var->id as basis for my_thread_name()
The above changes makes the connection we have between THD and threads more soft.

Added a lot of DBUG_PRINT() and DBUG_ASSERT() functions
Fixed compiler warnings
Fixed core dumps when running with --debug
Removed setting of signal masks (was never used)
Made event code call pthread_exit() (portability fix)
Fixed that event code doesn't call DBUG_xxx functions before my_thread_init() is called.
Made handling of thread_id and thd->variables.pseudo_thread_id uniform.
Removed one common 'not freed memory' warning from mysqltest
Fixed a couple of usage of not initialized warnings (unlikely cases)
Suppress compiler warnings from bdb and (for the moment) warnings from ndb
2007-02-23 13:13:55 +02:00
msvensson@neptunus.(none)
5f5b0e9b39 Merge neptunus.(none):/home/msvensson/mysql/yassL-import/my50-yassL-import
into  neptunus.(none):/home/msvensson/mysql/yassL-import/my51-yassL-import
2007-02-06 17:34:06 +01:00
msvensson@neptunus.(none)
6fc734a768 Bug#24157 openssl_1 regression test is broken two different ways
- Send output from 'ERR_print_errors_fp' to DBUG_FILE if --debug is used
2007-02-06 17:33:11 +01:00
gluh@mysql.com/eagle.(none)
010dc0b55c Valgrind error fixes
Notes:
This patch doesn't fix all issues in the tree and we need jani's fix for that
This patch shoud not be merged into 5.0
2007-02-01 18:00:24 +04:00
kent@kent-amd64.(none)
be15e3bc15 Merge mysql.com:/home/kent/bk/main/mysql-5.0
into  mysql.com:/home/kent/bk/main/mysql-5.1
2006-12-23 20:20:40 +01:00
kent@mysql.com/kent-amd64.(none)
226a5c833f Many files:
Changed header to GPL version 2 only
2006-12-23 20:17:15 +01:00
monty@nosik.monty.fi
89570bf966 Merge mysql.com:/home/my/mysql-5.0
into  mysql.com:/home/my/mysql-5.1
2006-11-22 14:11:36 +02:00
monty@mysql.com/nosik.monty.fi
e825879800 Remove compiler warnings
(Mostly in DBUG_PRINT() and unused arguments)
Fixed bug in query cache when used with traceing (--with-debug)
Fixed memory leak in mysqldump
Removed warnings from mysqltest scripts (replaced -- with #)
2006-11-20 22:42:06 +02:00
msvensson@neptunus.(none)
c64f5c7931 Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
into  neptunus.(none):/home/msvensson/mysql/mysql-5.1-new-maint
2006-11-07 16:17:54 +01:00
msvensson@neptunus.(none)
ffa100d2d0 Bug#23981 memory leaks from yassl code + other
- Fix memory leak in vio_VioSSLFD that occurs when one of the calls to SSL_* function fails. As in the "ssl_des"
   test case where the server is currently not supposed to be able to read the specific cert/key file.
 - Change error message to be generic as it's called both from server and client code.
2006-11-07 15:20:24 +01:00
msvensson@neptunus.(none)
33a200d73d Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
into  neptunus.(none):/home/msvensson/mysql/mysql-5.1-new-maint
2006-10-24 12:53:47 +02:00
msvensson@neptunus.(none)
25abce028e When using yaSSL on NetWare some of the OpenSSL specifix hacks can be skipped 2006-10-24 10:43:15 +02:00
jani@ua141d10.elisa.omakaista.fi
083f8455c7 Merge ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.0
into  ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.1-new
2006-05-09 20:50:29 +03:00
msvensson@neptunus.(none)
b60540a862 Remove valgrind and compiler warnings
Add function 'vio_end' that will cleanup resources allocated by vio and the components it uses.
2006-05-08 17:14:06 +02:00
msvensson@neptunus.(none)
697069af2c Fix warnings 2006-05-04 10:30:08 +02:00
monty@mysql.com
343644dd5d Added support for key_block_size for key and table level (WL#602)
Added support for key_block_size to MyISAM.
Simplify interface to 'new Key' to make it easier to add new key options.
mysqld option --new is used to define where key options are printed.
(In 5.3 we should move all key options to after key part definition to avoid problem with reserved names)
Fixed some compiler warnings and a memory leak in ssl
2006-05-03 15:59:17 +03:00
msvensson@neptunus.(none)
e1b41812b7 Load CA certs before setting local certs.
Make it possible to get the yaSSL error message printed in the DBUG log file.
2006-05-03 14:09:08 +02:00
msvensson@neptunus.(none)
a51668c74c Bug#17208 SSL: client does not verify server certificate
- Add new function 'ssl_verify_server_cert' which is used if we are 
   connecting to the server with SSL. It will compare the hostname in 
   the server's cert against the hostname that we used when connecting 
   to the server. Will reject the connection if hostname does not match.
 - Add new option "OPT_SSL_VERIFY_SERVER_CERT" to be passed to mysql_options
   which will turn on checking of servers cert.
 - Add new argument "ssl-verify-server-cert" to all mysql* clients which 
   will activate the above option.
 - Generate a new server cert with 1024 bits that has "localhost" as the server name.
2006-04-18 17:58:27 +02:00
msvensson@neptunus.(none)
d66ac94911 Fix up patch 2006-04-12 14:06:05 +02:00
msvensson@neptunus.(none)
aa3abd1550 Cleanup SSL implementation
Remove duplicate code
Merge common functions
Enforce MySQL coding standard
2006-03-10 16:41:14 +01:00
jimw@mysql.com
f8afbe6f0c Merge mysql.com:/home/jimw/my/mysql-4.1-clean
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2005-11-29 15:33:58 -08:00
gluh@eagle.intranet.mysql.r18.ru
4b6a94ffb4 Fix for bug#14221 SSL support breaks going from OpenSSL 0.9.7i to 0.9.8a
added SSL_library_init()
2005-11-29 12:15:48 +04:00
msvensson@neptunus.(none)
8c0f7f82d9 Bug #11286 yassl incompatible with "load data infile"
- Make sure that mysqltest always uses ssl when connecting to the server.
 - Pass a i32-bit int variable as argument to FIONREAD ioctl.
2005-09-01 11:46:43 +02:00
monty@mysql.com
3fb088a075 Add 0x before pointers (to help with debugging)
Add support for VARCHAR with 1 or 2 length bytes
Enable VARCHAR packing in MyISAM files (previous patch didn't pack data properly)
Give error if we got problems in temporary tables during a SELECT
Don't use new table generated by ALTER TABLE if index generation fails
Fixed wrong call by range_end() (Could cause an ASSERT in debug mode)
2004-12-18 05:19:21 +02:00
monty@mysql.com
f2e1e3ce4c Added patches from Novell 2004-05-25 22:00:14 +03:00
monty@narttu.mysql.fi
66b160c253 vio ssl structure renames (to get rid of ending _)
Added TCP/IP read/write timeout for windows
Check on windows if second server is started with same TCP/IP port
2003-08-27 02:51:39 +03:00
monty@mashka.mysql.fi
8f08c511ee Review of changesets since last pull.
(Mostly code cleanups)
2003-08-07 20:16:37 +03:00
gluh@gluh.mysql.r18.ru
7d43750eb6 Fix bug #673: MySQL 4.0.13 no SSL connection with mysql client possible 2003-06-26 12:47:36 +05:00
gluh@gluh.(none)
7bf903ea10 Error code for ssl connection
Fix bug when server hang(with SSL, with modified libmysql)
Add options master-ssl-capath and master-ssl-cipher
Add some error checking(SSL)
2002-11-05 12:05:58 +04:00
monty@mashka.mysql.fi
f638ee6df9 Added code to flush a bulk_insert index.
This fixes a bug when doing multi-row inserts on table with an auto_increment key that is not in the first key segment.
2002-09-18 21:04:49 +03:00