Commit graph

780 commits

Author SHA1 Message Date
Alexander Barkov
11005f3413 Merge 5.3->5.5 2013-10-16 18:17:51 +04:00
Alexander Barkov
049000101a Merge 5.1 -> 5.3 2013-10-16 17:48:31 +04:00
Alexander Barkov
de4ca539b8 MDEV-4890 Valgrind warnings on shutdown on a build with openSSL 2013-10-16 17:37:11 +04:00
Sreedhar.S
c8c948ffa6 Bug 13878021 - WINDOWS PACKAGE THAT INCLUDES .PDB FILES FOR INTERMEDIATE LIBRARIES USED 2013-10-09 11:10:46 +05:30
Sreedhar.S
faca34da04 Bug 13878021 - WINDOWS PACKAGE THAT INCLUDES .PDB FILES FOR INTERMEDIATE LIBRARIES USED 2013-10-09 11:10:46 +05:30
unknown
8f4eb208d2 merge 10.0-base -> 10.0 2013-10-17 19:01:57 +03:00
Raghav Kapoor
facdeb5ffc BUG#17294150-POTENTIAL CRASH DUE TO BUFFER OVERRUN IN SSL
ERROR HANDLING CODE 

BACKGROUND:
There can be a potential crash due to buffer overrun in 
SSL error handling code due to missing comma in
ssl_error_string[] array in viosslfactories.c.

ANALYSIS:
Found by code Inspection.

FIX:
Added the missing comma in SSL error handling code
in ssl_error_string[] array in viosslfactories.c.
2013-08-28 15:19:30 +05:30
Raghav Kapoor
efb6a1d070 BUG#17294150-POTENTIAL CRASH DUE TO BUFFER OVERRUN IN SSL
ERROR HANDLING CODE 

BACKGROUND:
There can be a potential crash due to buffer overrun in 
SSL error handling code due to missing comma in
ssl_error_string[] array in viosslfactories.c.

ANALYSIS:
Found by code Inspection.

FIX:
Added the missing comma in SSL error handling code
in ssl_error_string[] array in viosslfactories.c.
2013-08-28 15:19:30 +05:30
Raghav Kapoor
881e61db72 BUG#17294150-POTENTIAL CRASH DUE TO BUFFER OVERRUN IN SSL
ERROR HANDLING CODE 

BACKGROUND:
There can be a potential crash due to buffer overrun in 
SSL error handling code due to missing comma in
ssl_error_string[] array in viosslfactories.c.

ANALYSIS:
Found by code Inspection.

FIX:
Added the missing comma in SSL error handling code
in ssl_error_string[] array in viosslfactories.c.
2013-08-28 15:17:46 +05:30
Raghav Kapoor
c53cad81f8 BUG#17294150-POTENTIAL CRASH DUE TO BUFFER OVERRUN IN SSL
ERROR HANDLING CODE 

BACKGROUND:
There can be a potential crash due to buffer overrun in 
SSL error handling code due to missing comma in
ssl_error_string[] array in viosslfactories.c.

ANALYSIS:
Found by code Inspection.

FIX:
Added the missing comma in SSL error handling code
in ssl_error_string[] array in viosslfactories.c.
2013-08-28 15:17:46 +05:30
Sergei Golubchik
72ba95873a 10.0-base merge
(without InnoDB - all InnoDB changes were ignored)
2013-06-06 21:32:29 +02:00
Sergei Golubchik
4749d40c63 5.5 merge 2013-06-06 17:51:28 +02:00
unknown
a0fd7382bc Merge 10.0-base -> 10.0 2013-05-28 15:39:56 +02:00
Vladislav Vaintroub
08ce9bfe05 MDEV-4566 : Failing DBUG_ASSERT() in SELECT SLEEP(), with threadpool.
This bug only happens with long sleep()s ( > 5 sec), and in debug version.

Analysis: 
The assertion is caused by nested thd_wait_begin() calls, which is not an expected condition.
-  "outer" thd_wait_begin()) , in Item_func_sleep::val_int()
-  "inner" thd_wait_begin() in Interruptible_wait::wait(). This function periodically checks whether connection is still valid, via THD::is_connection(), which ends up  calling vio_io_wait()  with timeout parameter set to  0.


Fix is not to call thd wait callback in vio_io_wait(), if timeout parameter is 0. There is no "waiting" in this case.
2013-05-23 14:52:48 +02:00
Sergei Golubchik
e0a08c567a Compilation warnings.
openssl compilation problem.
2013-05-07 18:26:22 +02:00
Sergei Golubchik
b381cf843c mysql-5.5.31 merge 2013-05-07 13:05:09 +02:00
Michael Widenius
5333dafa84 Fixed errors and compiler warnings found by buildbot
Solaris fixes:
- Fixed that wait_timeout_func and wait_timeout tests works on solaris
- We have to compile without NO_ALARM on Solaris as Solaris doesn't support timeouts on sockets with setsockopt(.. SO_RCVTIMEO).
- Fixed that compile-solaris-amd64-debug works (before that we got a wrong ELF class: ELFCLASS64 on linkage)
- Added missing sync_with_master
Other bug fixes:
- Free memory for rpl_global_gtid_binlog_state before exit() to avoid 'accessing uninitalized mutex' error.



BUILD/FINISH.sh:
  Fixed issues on Solaris with ksh
BUILD/compile-solaris-amd64-debug:
  Added missing -m64 flag
configure.cmake:
  We have to compile without NO_ALARM on Solaris as Solaris doesn't support timeouts on sockets with setsockopt(.. SO_RCVTIMEO)
mysql-test/suite/rpl/t/rpl_gtid_mdev4473.test:
  - Added missing sync_with_master (fix by knielsen)
sql-common/client.c:
  Added () to get rid of compiler warning
sql/item_strfunc.cc:
  Fixed compiler warning
sql/log.cc:
  Free memory for static variable rpl_global_gtid_binlog_state before exit()
  - If we are compiling with safemalloc, we would try to call sf_free() for some members after sf_terminate() was called, which would result of trying to access the uninitalized mutex 'sf_mutex'
sql/multi_range_read.cc:
  Fixed compiler warnings of converting double to ulong.
sql/opt_range.cc:
  Fixed compiler warnings of converting double to ulong or uint
  - Better to have all variables that can be number of rows as 'ha_rows'
sql/rpl_gtid.cc:
  Added rpl_binlog_state::free() to be able to free memory for static objects before exit()
sql/rpl_gtid.h:
  Added rpl_binlog_state::free() to be able to free memory for static objects before exit()
sql/set_var.cc:
  Fixed compiler warning
sql/sql_join_cache.cc:
  Fixed compiler warnings of converting double to uint
sql/sql_show.cc:
  Added cast to get rid of compiler warning
sql/sql_statistics.cc:
  Remove code that didn't do anything.
  (store_record() with record[0] is a no-op)
storage/xtradb/os/os0file.c:
  Added  __attribute__ ((unused))
support-files/compiler_warnings.supp:
  Ignore warnings from atomic_add_64_nv
  (was not able to fix this with a cast as the macro is a bit different between systems)
vio/viosocket.c:
  Added more DBUG_PRINT
2013-05-05 21:39:31 +03:00
Sergei Golubchik
a9035be5b7 10.0-base merge 2013-04-15 15:09:22 +02:00
Sergei Golubchik
3e638e80fb MDEV-4226 [PATCH] "Unused variable" warnings in the tarball 2013-04-04 10:49:20 +02:00
Michael Widenius
615d51b650 Speed up connection time:
-Change my_rnd() slightly to make it safer if two threads use it at the same time.
-Avoid some sprintf and strmov in vio.
-Changed thread_count to be automically incremented (instead of under LOCK_thread_count).
-Thread cache now uses LOCK_thread_cache instead of LOCK_thread_count.
-Moved delete thd out from LOCK_thread_count.
-Save some mysql_cond_broadcast(&COND_thread_count) calls.
-Removed call to getsockname() during connect.
-Initialize random generator without locks.

Other things:
-Added thread_safe_decrement32() and thread_safe_increment32()
-Removed sql_rnd_with_mutex() and get_thread_running()

Thanks to Yoshinori Matsunobu for the benchmark of connection speed and to
Domas Mituzas for the inspiration for many of the fixes.
 

include/violite.h:
  Change desc to a string pointer
mysql-test/suite/perfschema/r/all_instances.result:
  Added new mutex
mysys/my_rnd.c:
  Change my_rnd() slightly to make it safer if two threads use it at the same time.
sql/event_scheduler.cc:
  Changed thread_count to be automically incremented
  Moved some safe things out from LOCK_thread_count.
  Simplify deleting of THD for running thread.
sql/mysqld.cc:
  Changed thread_count to be automically incremented
  Thread cache now uses LOCK_thread_cache instead of LOCK_thread_count
  Added delete_running_thd()
  Moved delete thd out from LOCK_thread_count
  More DBUG_ENTER
  Only call  mysql_cond_broadcast(&COND_thread_count) if thread_count is 0
  Removed call to getsockname() (old not anymore needed check)
sql/mysqld.h:
  Removed sql_rnd_with_mutex() (not needed anymore)
  Removed not used function get_thread_running()
  Added thread_safe_decrement32() and thread_safe_increment32()
  Simplified dec_thread_running() and inc_thread_running()
sql/sql_class.cc:
  Removed thd_lock_thread_count() and thd_unlock_thread_count()
  Initialize random generator without locks
sql/sql_insert.cc:
  Changed thread_count to be automically incremented
sql/sql_parse.cc:
  Changed thread_count to be automically incremented
vio/vio.c:
  Don't generate 'desc' with sprintf/strmov. Assign a pointer instead.
  (Good enough as this is just for debugging)
2013-03-20 01:46:35 +02:00
Murthy Narkedimilli
fe85f54640 Bug 16395495 - OLD FSF ADDRESS IN GPL HEADER 2013-03-19 13:29:12 +01:00
Murthy Narkedimilli
d20a70fb55 Bug 16395495 - OLD FSF ADDRESS IN GPL HEADER 2013-03-19 13:29:12 +01:00
Murthy Narkedimilli
053d7e775c Updated/added copyright headers. 2013-02-25 15:26:00 +01:00
Murthy Narkedimilli
69d8812a61 Updated/added copyright headers. 2013-02-25 15:26:00 +01:00
Vladislav Vaintroub
41013f16a0 MDEV-156 Threadpool - add thd_wait_begin/thd_wait_end to the network IO functions 2013-02-19 20:44:33 +01:00
Harin Vadodaria
cc85d62c68 Bug#16235681: TURN OFF DEFAULT COMPRESSION WHILE USING
OPENSSL

Description: Merge from 5.1.
2013-02-19 12:19:10 +05:30
Harin Vadodaria
02c7c2a68c Bug#16235681: TURN OFF DEFAULT COMPRESSION WHILE USING
OPENSSL

Description: Merge from 5.1.
2013-02-19 12:19:10 +05:30
Harin Vadodaria
c401365423 Bug#16235681: TURN OFF DEFAULT COMPRESSION WHILE USING
OPENSSL

Description: Specify preference to disable compression
             while using OpenSSL library. OpenSSL uses
             zlib compression by default which may
             lead to some problems.
2013-02-19 12:17:31 +05:30
Harin Vadodaria
d1aeebd592 Bug#16235681: TURN OFF DEFAULT COMPRESSION WHILE USING
OPENSSL

Description: Specify preference to disable compression
             while using OpenSSL library. OpenSSL uses
             zlib compression by default which may
             lead to some problems.
2013-02-19 12:17:31 +05:30
unknown
701419b02f Merge MariaDB 10.0-base to MariaDB 10.0 2012-12-18 15:01:58 +01:00
Vladislav Vaintroub
77269f589e MDEV-3901: Wrong SSL error messages
Fixed typo (missing comma)
2012-12-01 16:33:22 +01:00
unknown
c5cef4b166 Merge MariaDB 5.1.66 -> 5.2.12 2012-11-08 15:24:35 +02:00
unknown
7c23d6d0c6 Merge MySQL 5.1.66 -> MariaDB 5.1.65 2012-11-06 11:52:55 +02:00
Vladislav Vaintroub
cdb54f480d MDEV-3822 :10.0-serg fails on windows buildslaves
Fix mismerged code from 5.6 (named-pipe related).  viopipe.c, which was introduced in 5.6  is now copied almost identically into 10.0 

The unused vio::pipe_overlapped is removed.
2012-11-04 21:04:04 +01:00
Sergei Golubchik
40e94a3734 merge with 5.5 2012-11-03 12:28:51 +01:00
Sergei Golubchik
e1f681c99b 10.0-base -> 10.0-monty 2012-10-19 20:38:59 +02:00
Sergei Golubchik
ee9afef271 mysql-5.5.28 2012-10-16 13:04:42 +02:00
unknown
52c84d144d MDEV-3802: Millisecond timeout support in non-blocking client library + fix incorrect blocking.
After the merge of VIO stuff from MySQL 5.6, there were some bugs left
in the non-blocking client library:

 - vio_io_wait() was introduced without any support for non-blocking operation,
   so async queries could turn into sync.

 - Timeouts were changed to milliseconds, but this was not reflected in the
   non-blocking API, also semantics was changed so signed -1 was used for
   "no timeout" rather than unsigned 0.

Fix by implementing and using my_io_wait_async() in the non-blocking case. And
by introducing a new mysql_get_timeout_value_ms() API function that provides
the timeout with millisecond granularity. The old mysql_get_timeout_value()
is kept and fixed to work correctly, converting the timeout to whole seconds.
2012-10-12 11:00:01 +02:00
Sergei Golubchik
474fe6d9d9 fixes for test failures
and small collateral changes

mysql-test/lib/My/Test.pm:
  somehow with "print" we get truncated writes sometimes
mysql-test/suite/perfschema/r/digest_table_full.result:
  md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/perfschema/r/dml_handler.result:
  host table is not ported over yet
mysql-test/suite/perfschema/r/information_schema.result:
  host table is not ported over yet
mysql-test/suite/perfschema/r/nesting.result:
  this differs, because we don't rewrite general log queries, and multi-statement
  packets are logged as a one entry. this result file is identical to what mysql-5.6.5
  produces with the --log-raw option.
mysql-test/suite/perfschema/r/relaylog.result:
  MariaDB modifies the binlog index file directly, while MySQL 5.6 has a feature "crash-safe binlog index" and modifies a special "crash-safe" shadow copy of the index file and then moves it over. That's why this test shows "NONE" index file writes in MySQL and "MANY" in MariaDB.
mysql-test/suite/perfschema/r/server_init.result:
  MariaDB initializes the "manager" resources from the "manager" thread, and starts this thread only when --flush-time is not 0. MySQL 5.6 initializes "manager" resources unconditionally on server startup.
mysql-test/suite/perfschema/r/stage_mdl_global.result:
  this differs, because MariaDB disables query cache when query_cache_size=0. MySQL does not
  do that, and this causes useless mutex locks and waits.
mysql-test/suite/perfschema/r/statement_digest.result:
  md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/perfschema/r/statement_digest_consumers.result:
  md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/perfschema/r/statement_digest_long_query.result:
  md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result:
  will be updated to match 5.6 when alfranio.correia@oracle.com-20110512172919-c1b5kmum4h52g0ni and anders.song@greatopensource.com-20110105052107-zoab0bsf5a6xxk2y are merged
mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result:
  will be updated to match 5.6 when anders.song@greatopensource.com-20110105052107-zoab0bsf5a6xxk2y is merged
2012-09-27 20:09:46 +02:00
Vladislav Vaintroub
ae325ec6ce Compile 10.0 on Windows 2012-08-30 11:36:24 +02:00
Sergei Golubchik
1fd8150a5b 5.1 merge
increase xtradb verson from 13.0 to 13.01
2012-08-22 16:13:54 +02:00
Sergei Golubchik
cefc30b166 merge with MySQL 5.1.65 2012-08-22 11:40:39 +02:00
Michael Widenius
f1159b18d9 More fixes 2012-08-17 16:46:34 +03:00
Michael Widenius
60589aeee0 Next part of merge. See TODO for details 2012-08-14 17:23:34 +03:00
Venkata Sidagam
3f8a9984f6 Bug #13115401: -SSL-KEY VALUE IS NOT VALIDATED AND IT ALLOWS INSECURE
CONNECTIONS IF SPE

Merged from mysql-5.1 to mysql-5.5
2012-08-11 15:52:11 +05:30
Venkata Sidagam
cd5a42085f Bug #13115401: -SSL-KEY VALUE IS NOT VALIDATED AND IT ALLOWS INSECURE
CONNECTIONS IF SPE

Merged from mysql-5.1 to mysql-5.5
2012-08-11 15:52:11 +05:30
Venkata Sidagam
18087b049e Bug #13115401: -SSL-KEY VALUE IS NOT VALIDATED AND IT ALLOWS INSECURE
CONNECTIONS IF SPE

Problem description: -ssl-key value is not validated, you can assign any bogus 
text to --ssl-key and it is not verified that it exists, and more importantly, 
it allows the client to connect to mysqld.

Fix: Added proper validations checks for --ssl-key.

Note:
1) Documentation changes require for 5.1, 5.5, 5.6 and trunk in the sections
   listed below and the details are :

 http://dev.mysql.com/doc/refman/5.6/en/ssl-options.html#option_general_ssl
    and
 REQUIRE SSL section of
 http://dev.mysql.com/doc/refman/5.6/en/grant.html

2) Client having with option '--ssl', should able to get ssl connection. This 
will be implemented as part of separate fix in 5.6 and trunk.
2012-08-11 15:43:04 +05:30
Venkata Sidagam
40319e9b44 Bug #13115401: -SSL-KEY VALUE IS NOT VALIDATED AND IT ALLOWS INSECURE
CONNECTIONS IF SPE

Problem description: -ssl-key value is not validated, you can assign any bogus 
text to --ssl-key and it is not verified that it exists, and more importantly, 
it allows the client to connect to mysqld.

Fix: Added proper validations checks for --ssl-key.

Note:
1) Documentation changes require for 5.1, 5.5, 5.6 and trunk in the sections
   listed below and the details are :

 http://dev.mysql.com/doc/refman/5.6/en/ssl-options.html#option_general_ssl
    and
 REQUIRE SSL section of
 http://dev.mysql.com/doc/refman/5.6/en/grant.html

2) Client having with option '--ssl', should able to get ssl connection. This 
will be implemented as part of separate fix in 5.6 and trunk.
2012-08-11 15:43:04 +05:30
Sergei Golubchik
d11829654c merge with MySQL 5.5.27
manually checked every change, reverted incorrect or stupid changes.
2012-08-09 17:22:00 +02:00
Sergei Golubchik
0522307ed1 mysql-5.5 merge 2012-06-14 20:05:31 +02:00
Sergei Golubchik
280fcf0808 5.1 merge 2012-05-18 14:23:05 +02:00
Sergei Golubchik
0a8c9b98f6 merge with mysql-5.1.63 2012-05-17 12:12:33 +02:00
Georgi Kodinov
bef6c0c161 merge 5.1->5.5 2012-05-15 13:18:42 +03:00
Georgi Kodinov
22e4b62e03 merge 5.1->5.5 2012-05-15 13:18:42 +03:00
Georgi Kodinov
fcb033053d Bug #11761822: yassl rejects valid certificate which openssl accepts
Applied the fix that updates yaSSL to 2.2.1 and fixes parsing this 
particular certificate.
Added a test case with the certificate itself.
2012-05-15 13:12:22 +03:00
Georgi Kodinov
e4e1901569 Bug #11761822: yassl rejects valid certificate which openssl accepts
Applied the fix that updates yaSSL to 2.2.1 and fixes parsing this 
particular certificate.
Added a test case with the certificate itself.
2012-05-15 13:12:22 +03:00
Sergei Golubchik
431e042b5d c 2012-05-21 15:30:25 +02:00
Joerg Bruehe
5be07ceadd Merge 5.5.24 back into main 5.5.
This is a weave merge, but without any conflicts.
In 14 source files, the copyright year needed to be updated to 2012.
2012-05-07 22:20:42 +02:00
Joerg Bruehe
ad1e123f47 Merge 5.5.24 back into main 5.5.
This is a weave merge, but without any conflicts.
In 14 source files, the copyright year needed to be updated to 2012.
2012-05-07 22:20:42 +02:00
Tatjana Azundris Nuernberg
7d059dcbcd BUG#13431369 - MAIN.VARIABLES-NOTEMBEDDED CRASHES THE SERVER SPORADICALLY ON WINDOWS
On shutdown(), Windows can drop traffic still queued for sending even if that
wasn't specifically requested. As a result, fatal errors (those after
signaling which the server will drop the connection) were sometimes only
seen as "connection lost" on the client side, because the server-side
shutdown() erraneously discarded the correct error message before sending
it.

If on Windows, we now use the Windows API to access the (non-broken) equivalent
of shutdown().

Backport from trunk
2012-02-19 09:00:52 +00:00
Tatjana Azundris Nuernberg
9965af5c6a BUG#13431369 - MAIN.VARIABLES-NOTEMBEDDED CRASHES THE SERVER SPORADICALLY ON WINDOWS
On shutdown(), Windows can drop traffic still queued for sending even if that
wasn't specifically requested. As a result, fatal errors (those after
signaling which the server will drop the connection) were sometimes only
seen as "connection lost" on the client side, because the server-side
shutdown() erraneously discarded the correct error message before sending
it.

If on Windows, we now use the Windows API to access the (non-broken) equivalent
of shutdown().

Backport from trunk
2012-02-19 09:00:52 +00:00
Tatjana Azundris Nuernberg
b6b47f8824 BUG#13431369 - MAIN.VARIABLES-NOTEMBEDDED CRASHES THE SERVER SPORADICALLY ON WINDOWS
On shutdown(), Windows can drop traffic still queued for sending even if that
wasn't specifically requested. As a result, fatal errors (those after
signaling which the server will drop the connection) were sometimes only
seen as "connection lost" on the client side, because the server-side
shutdown() erraneously discarded the correct error message before sending
it.

If on Windows, we now use the Windows API to access the (non-broken) equivalent
of shutdown().

Backport from trunk

include/violite.h:
  export mysql_socket_shutdown(). It lives in vio in the backport.
sql/mysqld.cc:
  Go through our own shutdown() rather than straight to the POSIX one.
vio/viosocket.c:
  Define mysql_socket_shutdown(). On UNIXoid systems, it's just a wrapper for shutdown(), but
  on Window, it uses DisconnectEx, which is magic.
2012-02-17 19:02:17 +00:00
Tatjana Azundris Nuernberg
da2cc0cdf6 BUG#13431369 - MAIN.VARIABLES-NOTEMBEDDED CRASHES THE SERVER SPORADICALLY ON WINDOWS
On shutdown(), Windows can drop traffic still queued for sending even if that
wasn't specifically requested. As a result, fatal errors (those after
signaling which the server will drop the connection) were sometimes only
seen as "connection lost" on the client side, because the server-side
shutdown() erraneously discarded the correct error message before sending
it.

If on Windows, we now use the Windows API to access the (non-broken) equivalent
of shutdown().

Backport from trunk
2012-02-17 19:02:17 +00:00
Vladislav Vaintroub
4e8bb265fe Update copyright notices 2012-02-28 18:53:05 +01:00
Vladislav Vaintroub
62dcaf8c29 merge 5.5 2012-02-27 19:32:44 +01:00
unknown
f6b68a1070 Merge MWL#192: Non-blocking client library, into MariaDB 5.5. 2012-02-21 22:15:44 +01:00
Vladislav Vaintroub
398c935db3 further reduce diffs to 5.5, monty review 2012-01-24 19:18:22 +01:00
Vladislav Vaintroub
b7cf6abe52 merge 2012-01-24 01:59:03 +01:00
Sergei Golubchik
1433621c14 fixes for non-debug builds (CMAKE_BUILD_TYPE=Release or RelWithDebInfo)
client/CMakeLists.txt:
  1. -rdynamic is a linker flag.
  2. it should be used in all builds, not debug only
libmysql/get_password.c:
  prefer a standard function, when possible
  (otherwise a plugin will need to load it from the client)
2012-01-17 09:11:20 +01:00
Sergei Golubchik
4f435bddfd 5.3 merge 2012-01-13 15:50:02 +01:00
unknown
17940b652d MWL#192: non-blocking client API, after-review fixes.
Main change is that non-blocking operation is now an option that must be
explicitly enabled with mysql_option(mysql, MYSQL_OPT_NONBLOCK, ...)
before any non-blocing operation can be used.

Also the CLIENT_REMEMBER_OPTIONS flag is now always enabled and thus
effectively ignored (it was not really useful anyway, and this simplifies
things when non-blocking mysql_real_connect() fails).
2012-01-06 12:43:18 +01:00
Vladislav Vaintroub
68d6d4fc2b merge 2011-12-29 12:54:40 +01:00
Vladislav Vaintroub
4c6426fc75 Fix LPBUG# : allow chain certificate files to work.
Contributed by Maarten Vanraes (AL13N)

Fix things so that chains of certificates work in the server and client
certificate files.

This only really works for OpenSSL-based builds, as yassl is unable to read
multiple certificates from a file.  The patch below to yassl/src/ssl.cpp
doesn't fix that, but just arranges that the viosslfactories.c patch won't
have any ill effects in a yassl build.
2011-12-27 01:14:54 +01:00
Vladislav Vaintroub
e91bbca5fb Initial threadpool implementation for MariaDB 5.5 2011-12-08 19:17:49 +01:00
Michael Widenius
efcfb195e3 Merge with 5.1 2011-11-30 22:57:18 +02:00
Michael Widenius
47575bd0e0 Fixed compiler warnings
dbug/tests.c:
  Added __attribute__((unused)) to get rid of compiler warning
server-tools/instance-manager/guardian.cc:
  Added __attribute__((unused)) to get rid of compiler warning
sql/filesort.cc:
  Added __attribute__((unused)) to get rid of compiler warning
sql/slave.cc:
  Added __attribute__((unused)) to get rid of compiler warning
sql/sql_load.cc:
  Added __attribute__((unused)) to get rid of compiler warning
sql/sql_table.cc:
  Added __attribute__((unused)) to get rid of compiler warning
storage/maria/ma_blockrec.c:
  Added __attribute__((unused)) to get rid of compiler warning
storage/maria/ma_check.c:
  Added missing cast
storage/maria/ma_loghandler.c:
  Added __attribute__((unused)) to get rid of compiler warning
storage/maria/ma_recovery.c:
  Added __attribute__((unused)) to get rid of compiler warning
storage/pbxt/src/cache_xt.cc:
  Added __attribute__((unused)) to get rid of compiler warning
storage/xtradb/fil/fil0fil.c:
  Removed not used variable
storage/xtradb/handler/ha_innodb.cc:
  Use unused variable
vio/viosocket.c:
  Remove usage of not used variable
vio/viosslfactories.c:
  Added cast
2011-11-30 00:34:05 +02:00
Michael Widenius
6920457142 Merge with MariaDB 5.1 2011-11-24 18:48:58 +02:00
Michael Widenius
a8d03ab235 Initail merge with MySQL 5.1 (XtraDB still needs to be merged)
Fixed up copyright messages.
2011-11-21 19:13:14 +02:00
Sergei Golubchik
0e007344ea mysql-5.5.18 merge 2011-11-03 19:17:05 +01:00
Sergei Golubchik
76f0b94bb0 merge with 5.3
sql/sql_insert.cc:
  CREATE ... IF NOT EXISTS may do nothing, but
  it is still not a failure. don't forget to my_ok it.
  ******
  CREATE ... IF NOT EXISTS may do nothing, but
  it is still not a failure. don't forget to my_ok it.
sql/sql_table.cc:
  small cleanup
  ******
  small cleanup
2011-10-19 21:45:18 +02:00
unknown
a5b881594d MWL#192: Non-blocking client API for libmysqlclient.
All client functions that can block on I/O have alternate _start() and
_cont() versions that do not block but return control back to the
application, which can then issue I/O wait in its own fashion and later
call back into the library to continue the operation.

Works behind the scenes by spawning a co-routine/fiber to run the
blocking operation and suspend it while waiting for I/O. This
co-routine/fiber use is invisible to applications.

For i368/x86_64 on GCC, uses very fast assembler co-routine support. On
Windows uses native Win32 Fibers. Falls back to POSIX ucontext on other
platforms. Assembler routines for more platforms are relatively easy to
add by extending mysys/my_context.c, eg. similar to the Lua lcoco
library.

For testing, mysqltest and mysql_client_test are extended with the
option --non-blocking-api. This causes the programs to use the
non-blocking API for database access. mysql-test-run.pl has a similar
option --non-blocking-api that uses this, as well as additional
testcases.

An example program tests/async_queries.c is included that uses the new
non-blocking API with libevent to show how, in a single-threaded
program, to issue many queries in parallel against a database.


client/async_example.c:
  Fix const warning
  ******
  Fix bug with wrong timeout value for poll().
include/Makefile.am:
  Fix missing include for `make dist`
include/mysql.h:
  Add prototypes for all non-blocking API calls.
include/mysql.h.pp:
  Add prototypes for all non-blocking API calls.
mysys/my_context.c:
  Fix type warning for makecontext() function pointer argument.
sql-common/mysql_async.c:
  Fix crashes in the non-blocking API for functions that can take MYSQL argument
  that is NULL.
tests/Makefile.am:
  Add header file to `make dist`
tests/mysql_client_test.c:
  Replace blocking calls with wrappers around the non-blocking calls, used in
  mysql_client_test to test the new non-blocking API.
tests/nonblock-wrappers.h:
  Replace blocking calls with wrappers around the non-blocking calls, used in
  mysql_client_test to test the new non-blocking API.
2011-09-20 12:49:25 +02:00
Kent Boortz
027b5f1ed4 Updated/added copyright headers 2011-07-03 17:47:37 +02:00
Kent Boortz
b6e6097c95 Updated/added copyright headers 2011-07-03 17:47:37 +02:00
Sergei Golubchik
b4a0b2c2f8 post-merge fixes.
most tests pass.
5.3 merge is next
2011-07-02 22:12:12 +02:00
Sergei Golubchik
9809f05199 5.5-merge 2011-07-02 22:08:51 +02:00
Kent Boortz
68f00a5686 Updated/added copyright headers 2011-06-30 17:37:13 +02:00
Kent Boortz
1400d7a2cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
Kent Boortz
44135d4725 Updated/added copyright headers 2011-06-30 17:31:31 +02:00
Kent Boortz
e5ce023f57 Updated/added copyright headers 2011-06-30 17:31:31 +02:00
Tatjana Azundris Nuernberg
20791d83de build fixes for -Werror (11745920) 2011-05-27 11:02:10 +01:00
Tatjana Azundris Nuernberg
cf80c6cb64 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.

include/violite.h:
  new_VioSSLConnectorFd/sslaccept/sslconnect return more elaborate status
libmysql/errmsg.c:
  SSL errors now extended, more specific
mysql-test/r/openssl_1.result:
  SSL errors now extended, more specific
sql-common/client.c:
  Do more detailed error reporting for setup, connect, and
  server cert verifying phases.
sql/sql_acl.cc:
  sslaccept() signature has changed
vio/viossl.c:
  Save the error code and return it to callers of sslaccept
  and sslconnect.
vio/viosslfactories.c:
  new_VioSSLConnectorFd(): return error code to caller
2011-05-19 10:47:43 +01:00
Kent Boortz
789aa8c485 Updated/added copyright headers 2011-07-04 01:25:49 +02:00
Kent Boortz
02e07e3b51 Updated/added copyright headers 2011-06-30 17:46:53 +02:00
Kent Boortz
0f03af653c Updated/added copyright headers 2011-07-04 01:25:49 +02:00
Kent Boortz
9da00ebec9 Updated/added copyright headers 2011-06-30 17:46:53 +02:00
Tatjana Azundris Nuernberg
c111ca4e52 build fixes for -Werror (11745920) 2011-05-27 11:02:10 +01: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
Vladislav Vaintroub
5f267b47de Fix bugs found by application verifier :
- Fix  active lock in freed memory in ha_archive (share mutex was not released prior to free())
- Do not attempt vio_fastsend or vio_keepalive on named pipes and shared memory.
2011-05-14 18:42:07 +02:00
Luis Soares
a85150c364 BUG#11762616: BUG#55229: 'POSTION'
Manual merge from mysql-5.1 into mysql-5.5.

Conflicts
=========
Text conflict in mysql-test/suite/rpl/t/rpl_row_until.test
Text conflict in sql/handler.h
Text conflict in storage/archive/ha_archive.cc
2011-05-06 00:50:31 +01:00
Luis Soares
6f3e97a6cb BUG#11762616: BUG#55229: 'POSTION'
Manual merge from mysql-5.1 into mysql-5.5.

Conflicts
=========
Text conflict in mysql-test/suite/rpl/t/rpl_row_until.test
Text conflict in sql/handler.h
Text conflict in storage/archive/ha_archive.cc
2011-05-06 00:50:31 +01:00
Luis Soares
8a08fd4341 BUG#11762616: BUG#55229: 'POSTION'
Fix for all "postion" in Oracle files (s/postion/position). 
Updated the copyright notices where needed.
2011-05-06 00:46:53 +01:00
Luis Soares
ed6aae83c3 BUG#11762616: BUG#55229: 'POSTION'
Fix for all "postion" in Oracle files (s/postion/position). 
Updated the copyright notices where needed.
2011-05-06 00:46:53 +01:00
Davi Arnaut
5f49c7d6b7 FIONREAD is located in sys/filio.h on Solaris. 2011-04-29 18:48:23 -03:00
Davi Arnaut
2b5b3e1ea7 FIONREAD is located in sys/filio.h on Solaris. 2011-04-29 18:48:23 -03:00
Alexander Nozdrin
31e7450c60 A patch for Bug#12325375: THE SERVER ON WINXP DOES NOT ALLOW CONNECTIONS
IF NO DNS-SERVER AVAILABLE.

The thing is that on Windows XP getnameinfo() returns WSANO_DATA
when hostname-lookup is not available. The problem was that
this error code was treated as serious error and the client
connection got rejected.

The fix is to treat all errors from getnameinfo() as not ciritical,
but add IP-address to the host cache only for EAI_NONAME (or WSANO_DATA).
2011-04-08 14:23:36 +04:00
Alexander Nozdrin
6a29392289 A patch for Bug#12325375: THE SERVER ON WINXP DOES NOT ALLOW CONNECTIONS
IF NO DNS-SERVER AVAILABLE.

The thing is that on Windows XP getnameinfo() returns WSANO_DATA
when hostname-lookup is not available. The problem was that
this error code was treated as serious error and the client
connection got rejected.

The fix is to treat all errors from getnameinfo() as not ciritical,
but add IP-address to the host cache only for EAI_NONAME (or WSANO_DATA).
2011-04-08 14:23:36 +04:00
Vladislav Vaintroub
0eae06c430 Bug#473914: mysql_client_test fail with in debug compilaton on windows x64
Reason: inconsistent compilation, federatedx is compiled without SAFEMALLOC
flag, while anything else is compiled with SAFEMALLOC.

As a consequence, my_hash_init used inside federatedx initialization does not
provide correct caller info parameters (file, line) , so they are initialized with 
whatever is on stack. When info about allocated memory is output in
COM_DEBUG command, the server crashes trying to output string starting at
0xcccccccccccccccc.

The fix is to remove SAFEMALLOC  preprocessor flags 
from every CMakeLists.txt, except the top-level one.

Also, SAFEMALLOC is not defined by default now, instead
there is WITH_DEBUG_FULL CMake option which adds 
-DSAFEMALLOC to C and C++ flags in debug compilation. 
This option is off by  default, because 
1) Debug C runtime already has heap debugging builtin with 
 overwrite and leak detection
2)safemalloc considerably slows down the tests.


Note also  that 
- SAFEMALLOC is gone  in MySQL5.5
- On Windows, heap related overflows can also be found using free pageheap utility
(that is also part of application verifier). This is even more efficient if there are no other layers 
on top of Windows heap allocator, e.g  it is most efficient with release version.
2010-12-06 12:52:06 +01:00
Sergei Golubchik
65ca700def merge.
checkpoint.
does not compile.
2010-11-25 18:17:28 +01:00
Davi Arnaut
8664de2230 WL#5665: Removal of the autotools-based build system
The autotools-based build system has been superseded and
is being removed in order to ease the maintenance burden on
developers tweaking and maintaining the build system.

In order to support tools that need to extract the server
version, a new file that (only) contains the server version,
called VERSION, is introduced. The file contents are human
and machine-readable. The format is:

MYSQL_VERSION_MAJOR=5
MYSQL_VERSION_MINOR=5
MYSQL_VERSION_PATCH=8
MYSQL_VERSION_EXTRA=-rc

The CMake based version extraction in cmake/mysql_version.cmake
is changed to extract the version from this file. The configure
to CMake wrapper is retained for backwards compatibility and to
support the BUILD/ scripts. Also, a new a makefile target
show-dist-name that prints the server version is introduced.

VERSION:
  Add top-level version file.
cmake/mysql_version.cmake:
  Get version information from the top-level VERSION file.
  Do not cache the version components (MAJOR_VERSION, etc).
  Add MYSQL_RPM_VERSION as a replacement for MYSQL_U_SCORE_VERSION.
2010-11-20 12:47:50 -02:00
Davi Arnaut
f6deb00a56 WL#5665: Removal of the autotools-based build system
The autotools-based build system has been superseded and
is being removed in order to ease the maintenance burden on
developers tweaking and maintaining the build system.

In order to support tools that need to extract the server
version, a new file that (only) contains the server version,
called VERSION, is introduced. The file contents are human
and machine-readable. The format is:

MYSQL_VERSION_MAJOR=5
MYSQL_VERSION_MINOR=5
MYSQL_VERSION_PATCH=8
MYSQL_VERSION_EXTRA=-rc

The CMake based version extraction in cmake/mysql_version.cmake
is changed to extract the version from this file. The configure
to CMake wrapper is retained for backwards compatibility and to
support the BUILD/ scripts. Also, a new a makefile target
show-dist-name that prints the server version is introduced.
2010-11-20 12:47:50 -02:00
unknown
0de9a4abab MWL#74: Shared libmysqld.so library.
Switch makefiles to use libtool to build libmysqld.so, as well as all its
dependencies.

The previous MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS() declaration is removed,
as it does not work well with a libtool build. Instead, plugins that need it
can specify an alternate object in MYSQL_PLUGIN_STATIC() that will be used for
embedded library. The plugin must then take care itself of compiling the
special object for embedded, rebuilding the source files previously listed in
MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS() with @plugin_embedded_defs@ in
CFLAGS/CXXFLAGS. The extra target @XXX_embedded_static_target@ is available
for the special object, this will be empty when --without-embedded-server.

All in-tree plugins are changed to build their static targets with libtool.
Additional plugins that want to work with libmysqld.so will need to be
similarly modified to build with libtool (or otherwise provide an -fPIC
object). Dynamically loaded plugins are not affected.

The old libraries like libmysys.a, libmyisam.a and similar libraries, which
were installed by `make install` though this is of little use, are still built
and installed to not break package scripts etc. that expect them. These
libraries are kept static to avoid introducing new .so dependencies.

The patch also fixes a handfull of duplicate symbol linker errors, where we
included some object twice during linking; these for one reason or another did
not produce errors before but caused problems on some platforms with this
patch (eg. Mac OS X linker is more strict for shared objects).

This patch only does what is necessary to build libmysqld.so. There are some
more cleanups that are possible now that we are using libtool more fully,
which could done in subsequent patches (though we may not bother as we are
switching from autotools to CMake anyway):

 - In libmysql_r/, we should be able to just link libmysys.la etc, instead of
   symlinking and re-compiling sources into the directory.

 - In libmysql/, we can similarly avoid symlinking and recompiling sources if
   we instead build a libmysys_nothread.la library with appropriate CFLAGS and
   link that.

 - In sql/, we can build a separate target libmysql_int.la with appropriate
   CFLAGS for embedded and use that in libmysqld/ instead of symlinking
   sources.

 - libmysys.a, libmyisam.a and similar libraries could be installed as .so
   also to save on code size; or alternatively could be not installed at all.


client/Makefile.am:
  Updated for using libtool
config/ac-macros/plugins.m4:
  Replace MUSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS with mechanism for plugins
  to specify alternate object for embedded.
configure.in:
  Fix linking duplicate objects related to THREAD_LOBJECTS.
dbug/Makefile.am:
  Updated for using libtool
extra/Makefile.am:
  Fix relative paths.
libmysqld/Makefile.am:
  Build libmysqld.la using libtool
libmysqld/examples/Makefile.am:
  Updated to use libtool
mysys/Makefile.am:
  Updated to use libtool.
  Fix linking duplicate objects related to THREAD_LOBJECTS.
mysys/my_uuid.c:
  Fix conflicting global mutex name by making it static.
regex/Makefile.am:
  Updated to use libtool
sql/Makefile.am:
  Updated to use libtool
sql/item_func.cc:
  Fix conflicting mutex name.
sql/mysql_priv.h:
  Fix conflicting mutex name
sql/mysqld.cc:
  Fix conflicting mutex name.
  Add missing call of my_uuid_end().
storage/archive/Makefile.am:
  Updated to use libtool
storage/archive/plug.in:
  Updated to use libtool
storage/blackhole/Makefile.am:
  Updated to use libtool
storage/blackhole/plug.in:
  Updated to use libtool
storage/csv/Makefile.am:
  Updated to use libtool
storage/csv/plug.in:
  Updated to use libtool
storage/example/Makefile.am:
  Updated to use libtool
storage/federated/Makefile.am:
  Updated to use libtool
storage/federated/plug.in:
  Updated to use libtool
storage/federatedx/Makefile.am:
  Updated to use libtool
storage/federatedx/plug.in:
  Updated to use libtool
storage/heap/Makefile.am:
  Updated to use libtool
storage/heap/plug.in:
  Updated to use libtool
storage/innobase/Makefile.am:
  Updated to use libtool
storage/innobase/plug.in.disabled:
  Updated to use libtool
storage/innodb_plugin/Makefile.am:
  Updated to use libtool
storage/maria/CMakeLists.txt:
  Fix linking duplicate object in maria_dump_log, causes failure on Mac OS X
storage/maria/Makefile.am:
  Updated to use libtool
  Fix linking duplicate object in maria_dump_log, causes link failure on Mac OS X
storage/maria/ma_loghandler.c:
  Move maria_dump_log code to separate file to fix duplicate object link failures.
storage/maria/ma_loghandler.h:
  Move maria_dump_log code to separate file to fix duplicate object link failures.
storage/maria/maria_dump_log.c:
  Move maria_dump_log code to separate file to fix duplicate object link failures.
storage/maria/plug.in:
  Updated to use libtool
storage/myisam/Makefile.am:
  Updated to use libtool
storage/myisam/plug.in:
  Updated to use libtool
storage/myisammrg/Makefile.am:
  Updated to use libtool
storage/myisammrg/plug.in:
  Updated to use libtool
storage/pbxt/plug.in:
  Updated to use libtool
storage/pbxt/src/Makefile.am:
  Updated to use libtool
storage/xtradb/Makefile.am:
  Updated to use libtool
storage/xtradb/plug.in:
  Updated to use libtool
strings/Makefile.am:
  Updated to use libtool
unittest/unit.pl:
  Don't attempt to run libtool internal files as unit tests.
vio/Makefile.am:
  Updated to use libtool
2010-11-17 13:24:20 +01:00
Michael Widenius
ad6d95d3cb Merge with MySQL 5.1.50
- Changed to still use bcmp() in certain cases becasue
  - Faster for short unaligneed strings than memcmp()
  - Bettern when using valgrind
- Changed to use my_sprintf() instead of sprintf() to get higher portability for old systems
- Changed code to use MariaDB version of select->skip_record()
- Removed -%::SCCS/s.% from Makefile.am:s to remove automake warnings
2010-08-27 17:12:44 +03:00
Mats Kindahl
b0836bd309 Merging with mysql-5.5-stage. 2010-08-16 14:50:27 +02:00
Mats Kindahl
cd34770558 Merging with mysql-5.5-stage. 2010-08-16 14:50:27 +02:00
Alexander Nozdrin
8b645bed97 Patch for Bug#55854 (MySQL AB should not be AUTHOR, copyright incorrect).
Fixing copyright text.
2010-08-12 19:19:57 +04:00
Alexander Nozdrin
13ec2a1625 Patch for Bug#55854 (MySQL AB should not be AUTHOR, copyright incorrect).
Fixing copyright text.
2010-08-12 19:19:57 +04:00
Davi Arnaut
711c318c07 Merge of mysql-trunk-bugfixing into mysql-trunk-merge. 2010-07-15 10:47:50 -03:00
Davi Arnaut
649390ac81 Merge of mysql-trunk-bugfixing into mysql-trunk-merge. 2010-07-15 10:47:50 -03:00
Davi Arnaut
07e7b4d6fe WL#5486: Remove code for unsupported platforms
Remove Netware specific code.
2010-07-15 08:13:30 -03: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
f56dd32bf7 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.

client/mysqldump.c:
  Pass my_free directly as its signature is compatible with the
  callback type -- which wasn't the case for free_table_ent.
2010-07-08 18:20:08 -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
54a5c00de9 Unset the execute bit where it's not needed. 2010-07-03 20:17:03 -03:00
Davi Arnaut
245645e225 Unset the execute bit where it's not needed. 2010-07-03 20:17:03 -03:00
Mats Kindahl
aaf2bdde94 WL#5363: Thread Pool Service Interface
In order to allow thread schedulers to be dynamically loaded,
it is necessary to make the following changes to the server:

- Two new service interfaces

- Modifications to InnoDB to inform the thread scheduler of state changes.

- Changes to the VIO subsystem for checking if data is available on a socket.

- Elimination of remains of the old thread pool implementation.

The two new service interfaces introduces are:

my_thread_scheduler
  A service interface to register a thread
  scheduler.

thd_wait
  A service interface to inform thread scheduler
  that the thread is about to start waiting.

In addition, the patch adds code that:

- Add a call to thd_wait for table locks in mysys
  thd_lock.c by introducing a set function that
  can be used to set a callback to be used when
  waiting on a lock and resuming from waiting.

- Calling the mysys set function from the server
  to set the callbacks correctly.
2010-06-07 16:01:39 +02:00
Mats Kindahl
b1dcf448ea WL#5363: Thread Pool Service Interface
In order to allow thread schedulers to be dynamically loaded,
it is necessary to make the following changes to the server:

- Two new service interfaces

- Modifications to InnoDB to inform the thread scheduler of state changes.

- Changes to the VIO subsystem for checking if data is available on a socket.

- Elimination of remains of the old thread pool implementation.

The two new service interfaces introduces are:

my_thread_scheduler
  A service interface to register a thread
  scheduler.

thd_wait
  A service interface to inform thread scheduler
  that the thread is about to start waiting.

In addition, the patch adds code that:

- Add a call to thd_wait for table locks in mysys
  thd_lock.c by introducing a set function that
  can be used to set a callback to be used when
  waiting on a lock and resuming from waiting.

- Calling the mysys set function from the server
  to set the callbacks correctly.
2010-06-07 16:01:39 +02:00
Alexander Nozdrin
9003fb7cad Fix for Bug#52923 (Inadequate documentation of "Can't get hostname for your address" error).
The thing is that on some platforms (e.g. Mac OS X) sockaddr_in / sockaddr_in6
contain a non-standard field (sin_len / sin6_len), that must be set.

The problem was that only standard fields were set, thus getnameinfo() returned
EAI_SYSTEM instead of EAI_NONAME.

The fix is to introduce configure-time checks (for GNU auto-tools and CMake) for
those additional fields and to set them if they are available.
2010-05-21 17:17:01 +04:00
Alexander Nozdrin
75e552d509 Fix for Bug#52923 (Inadequate documentation of "Can't get hostname for your address" error).
The thing is that on some platforms (e.g. Mac OS X) sockaddr_in / sockaddr_in6
contain a non-standard field (sin_len / sin6_len), that must be set.

The problem was that only standard fields were set, thus getnameinfo() returned
EAI_SYSTEM instead of EAI_NONAME.

The fix is to introduce configure-time checks (for GNU auto-tools and CMake) for
those additional fields and to set them if they are available.
2010-05-21 17:17:01 +04:00
Alexander Nozdrin
759d5bc535 Another incarnation of the patch for Bug#30708
(make relies GNU extentions). The patch was partially
backport from 6.0.

Original comment:
bug#30708: make relies GNU extensions.  Now that we no longer use
BitKeeper we can safely remove the SCCS handling with no loss of
functionality.
2010-05-19 17:00:23 +04:00
Alexander Nozdrin
091bcacc79 Another incarnation of the patch for Bug#30708
(make relies GNU extentions). The patch was partially
backport from 6.0.

Original comment:
bug#30708: make relies GNU extensions.  Now that we no longer use
BitKeeper we can safely remove the SCCS handling with no loss of
functionality.
2010-05-19 17:00:23 +04:00
unknown
3e32ba3ff1 Fix some compiler warnings seen in Buildbot.
Add some extra error output and code cleanup in an attempt to fix/debug
a rare random testsuite problem in check_warnings, where the exit code
from mysqltest is somehow corrupted inside mysql-test-run.pl.

include/my_global.h:
  Fix compiler warnings on some platforms.
mysql-test/lib/My/SafeProcess.pm:
  Move dereference of $? subprocess exit code closer to where it is generated,
  to make the code more robust and on the chance that this will fix the
  occasional problems in check_warnings we see in Buildbot.
mysql-test/mysql-test-run.pl:
  When check_warnings failed, also log the mysqld server for which it failed.
sql/sql_lex.cc:
  Fix compiler warning about possibly uninitialised value, by rewriting a for()
  loop that is always executed at least once into a do .. while() loop with an
  assert.
sql/table.cc:
  Fix compiler warning about uninitialised value.
storage/federatedx/ha_federatedx.cc:
  Fix uninitialised variable.
storage/maria/ma_delete.c:
  Fix compiler warning about uninitialised value.
storage/maria/ma_loghandler.c:
  Fix compiler warning about uninitialised value.
storage/myisam/ft_stopwords.c:
  Fix compiler warning.
storage/myisam/mi_write.c:
  Fix compiler warning about possibly uninitialised value, by rewriting a while()
  loop that is always executed at least once into a do .. while() loop with an
  assert.
storage/xtradb/btr/btr0cur.c:
  Fix compiler warning about possibly uninitialised value.
support-files/compiler_warnings.supp:
  Fix warning suppression to cover all cases in yassl.
vio/viossl.c:
  Fix compiler warning.
2010-03-10 11:32:14 +01:00
Michael Widenius
4847e50ddb Changed version number from RC to stable
Fixed bug in Yassle to get correct error messages in case of errors
Provide better error messages in case of ssl connect failure
Updated out-of-date ssl certificates to fix failing mysql-test-system (certificates now active for 10 years)
Fixed bug in query_cache that could cause asserts and hangs in DEBUG builds.
Fixed bug where one connection did not see changes done by another connection.

configure.in:
  Changed version number from RC to stable
extra/yassl/src/yassl_error.cpp:
  Fixed bug in Yassle to get correct error messages in case of errors
  - 'error' is an enum that hold more error numbers than the enum was defined for
include/violite.h:
  Added error output string for sslaccept() and sslconnect() to get reason for connect failure
mysql-test/mysql-test-run.pl:
  Write failed test cases if mysql-test-run fails because of too many errors
mysql-test/r/grant.result:
  Update results to reflect new certificates
mysql-test/r/openssl_1.result:
  Update results to reflect new certificates
mysql-test/std_data/cacert.pem:
  Update ssl certificate
mysql-test/std_data/client-cert.pem:
  Update ssl certificate
mysql-test/std_data/client-key.pem:
  Update ssl certificate
mysql-test/std_data/server-cert.pem:
  Update ssl certificate
mysql-test/std_data/server-key.pem:
  Update ssl certificate
mysql-test/t/grant.test:
  Update test to reflect new certificates
mysql-test/t/openssl_1.test:
  Update test to reflect new certificates
mysql-test/t/query_cache_debug.test:
  Remove 'big_test' as test is now fast
sql-common/client.c:
  Give a better error message if ssl connect fails
sql/net_serv.cc:
  Fixed compiler warnings
sql/slave.cc:
  Give a better error message in logs if ssl connect fails
sql/sql_cache.cc:
  debug_wait_for_kill() now removes the set watch variable after kill signal
  This is needed as invalidate_table() may be called twice for one query.
  Ensure that net->query_cache_query is reset after query. This fixes assert in
  query_cache_end_of_result() if query_cache_query holds results from previous query.
  Removed DBUG_ASSERT(0), as this code can be run by query_cache_debug.test
sql/sql_connect.cc:
  Give a better error message if ssl connect fails
sql/sql_parse.cc:
  Fixed bug where one connection did not see changes done by another connection.
  For statements that changes tables, close_thread_tables() MUST be called before
  sending OK as a table handler may not make the changes available for other connections
  before unlock_tables().
vio/viossl.c:
  Give a better error message if ssl connect fails
2010-01-29 12:42:31 +02:00
Michael Widenius
d8ecbbe634 Merge with MySQL 5.1.42
- Marked a couple of tests with --big
- Fixed xtradb/handler/ha_innodb.cc to call explain_filename()

storage/xtradb/handler/ha_innodb.cc:
  Call explain_filename() to get proper names for partitioned tables
2010-01-15 17:27:55 +02:00
Vladislav Vaintroub
541edcc2e4 merge 2009-12-25 16:49:21 +01:00
Vladislav Vaintroub
e8bdef8fcd merge 2009-12-25 16:49:21 +01:00
Sergei Golubchik
1ad5bb1a69 WL#4738 streamline/simplify @@variable creation process
Bug#16565 mysqld --help --verbose does not order variablesBug#20413 sql_slave_skip_counter is not shown in show variables
Bug#20415 Output of mysqld --help --verbose is incomplete
Bug#25430 variable not found in SELECT @@global.ft_max_word_len;
Bug#32902 plugin variables don't know their names
Bug#34599 MySQLD Option and Variable Reference need to be consistent in formatting!
Bug#34829 No default value for variable and setting default does not raise error
Bug#34834 ? Is accepted as a valid sql mode
Bug#34878 Few variables have default value according to documentation but error occurs  
Bug#34883 ft_boolean_syntax cant be assigned from user variable to global var.
Bug#37187 `INFORMATION_SCHEMA`.`GLOBAL_VARIABLES`: inconsistent status
Bug#40988 log_output_basic.test succeeded though syntactically false.
Bug#41010 enum-style command-line options are not honoured (maria.maria-recover fails)
Bug#42103 Setting key_buffer_size to a negative value may lead to very large allocations 
Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled
Bug#44797 plugins w/o command-line options have no disabling option in --help
Bug#46314 string system variables don't support expressions
Bug#46470 sys_vars.max_binlog_cache_size_basic_32 is broken
Bug#46586 When using the plugin interface the type "set" for options caused a crash.
Bug#47212 Crash in DBUG_PRINT in mysqltest.cc when trying to print octal number
Bug#48758 mysqltest crashes on sys_vars.collation_server_basic in gcov builds
Bug#49417 some complaints about mysqld --help --verbose output
Bug#49540 DEFAULT value of binlog_format isn't the default value
Bug#49640 ambiguous option '--skip-skip-myisam' (double skip prefix)
Bug#49644 init_connect and \0
Bug#49645 init_slave and multi-byte characters
Bug#49646 mysql --show-warnings crashes when server dies


CMakeLists.txt:
  Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled
client/mysql.cc:
  don't crash with --show-warnings when mysqld dies
config/ac-macros/plugins.m4:
  Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled
include/my_getopt.h:
  comments
include/my_pthread.h:
  fix double #define
mysql-test/mysql-test-run.pl:
  run sys_vars suite by default
  properly recognize envirinment variables (e.g. MTR_MAX_SAVE_CORE) set to 0
  escape gdb command line arguments
mysql-test/suite/sys_vars/r/rpl_init_slave_func.result:
  init_slave+utf8 bug
mysql-test/suite/sys_vars/t/rpl_init_slave_func.test:
  init_slave+utf8 bug
mysys/my_getopt.c:
  Bug#34599 MySQLD Option and Variable Reference need to be consistent in formatting!
  Bug#46586 When using the plugin interface the type "set" for options caused a crash.
  Bug#49640 ambiguous option '--skip-skip-myisam' (double skip prefix)
mysys/typelib.c:
  support for flagset
sql/ha_ndbcluster.cc:
  backport from telco tree
sql/item_func.cc:
  Bug#49644 init_connect and \0
  Bug#49645 init_slave and multi-byte characters
sql/sql_builtin.cc.in:
  Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled
sql/sql_plugin.cc:
  Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled
  Bug#32902 plugin variables don't know their names
  Bug#44797 plugins w/o command-line options have no disabling option in --help
sql/sys_vars.cc:
  all server variables are defined here
storage/myisam/ft_parser.c:
  remove unnecessary updates of param->quot
storage/myisam/ha_myisam.cc:
  myisam_* variables belong here
strings/my_vsnprintf.c:
  %o and %llx
unittest/mysys/my_vsnprintf-t.c:
  %o and %llx tests
vio/viosocket.c:
  bugfix: fix @@wait_timeout to work with socket timeouts (vs. alarm thread)
2009-12-22 10:35:56 +01:00
Sergei Golubchik
ae2768ce9c WL#4738 streamline/simplify @@variable creation process
Bug#16565 mysqld --help --verbose does not order variablesBug#20413 sql_slave_skip_counter is not shown in show variables
Bug#20415 Output of mysqld --help --verbose is incomplete
Bug#25430 variable not found in SELECT @@global.ft_max_word_len;
Bug#32902 plugin variables don't know their names
Bug#34599 MySQLD Option and Variable Reference need to be consistent in formatting!
Bug#34829 No default value for variable and setting default does not raise error
Bug#34834 ? Is accepted as a valid sql mode
Bug#34878 Few variables have default value according to documentation but error occurs  
Bug#34883 ft_boolean_syntax cant be assigned from user variable to global var.
Bug#37187 `INFORMATION_SCHEMA`.`GLOBAL_VARIABLES`: inconsistent status
Bug#40988 log_output_basic.test succeeded though syntactically false.
Bug#41010 enum-style command-line options are not honoured (maria.maria-recover fails)
Bug#42103 Setting key_buffer_size to a negative value may lead to very large allocations 
Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled
Bug#44797 plugins w/o command-line options have no disabling option in --help
Bug#46314 string system variables don't support expressions
Bug#46470 sys_vars.max_binlog_cache_size_basic_32 is broken
Bug#46586 When using the plugin interface the type "set" for options caused a crash.
Bug#47212 Crash in DBUG_PRINT in mysqltest.cc when trying to print octal number
Bug#48758 mysqltest crashes on sys_vars.collation_server_basic in gcov builds
Bug#49417 some complaints about mysqld --help --verbose output
Bug#49540 DEFAULT value of binlog_format isn't the default value
Bug#49640 ambiguous option '--skip-skip-myisam' (double skip prefix)
Bug#49644 init_connect and \0
Bug#49645 init_slave and multi-byte characters
Bug#49646 mysql --show-warnings crashes when server dies
2009-12-22 10:35:56 +01:00
Vladislav Vaintroub
07bfd2617d merge 2009-12-16 15:34:11 +01:00
Vladislav Vaintroub
2ff2d1873a merge 2009-12-16 15:34:11 +01:00
Alexander Nozdrin
99890516ea Auto-merge from mysql-trunk. 2009-12-16 11:25:21 +03:00
Alexander Nozdrin
642f075569 Auto-merge from mysql-trunk. 2009-12-16 11:25:21 +03:00
Alexander Nozdrin
78c61d6b83 Remove .cvsignore files (attempt #2). 2009-12-16 11:24:30 +03:00
Alexander Nozdrin
2ae8acc294 Remove .cvsignore files (attempt #2). 2009-12-16 11:24:30 +03:00
Alexander Nozdrin
aceea2342f Manual merge from mysql-trunk-merge.
Conflicts:
  - extra/comp_err.c
  - mysql-test/collections/default.experimental
  - mysql-test/r/archive.result
  - mysql-test/r/select.result
  - mysql-test/suite/binlog/r/binlog_unsafe.result
  - mysql-test/suite/binlog/t/binlog_unsafe.test
  - mysql-test/suite/rpl/t/disabled.def
  - mysql-test/t/archive.test
  - mysql-test/t/select.test
  - sql/item.cc
  - sql/item.h
  - sql/item_timefunc.cc
  - sql/sql_base.cc
  - sql/sql_delete.cc
  - sql/sql_load.cc
  - sql/sql_partition.cc
  - sql/sql_table.cc
  - storage/innobase/handler/ha_innodb.cc
  - vio/vio.c
2009-12-12 23:38:59 +03:00
Alexander Nozdrin
bc2d4e620a Manual merge from mysql-trunk-merge.
Conflicts:
  - extra/comp_err.c
  - mysql-test/collections/default.experimental
  - mysql-test/r/archive.result
  - mysql-test/r/select.result
  - mysql-test/suite/binlog/r/binlog_unsafe.result
  - mysql-test/suite/binlog/t/binlog_unsafe.test
  - mysql-test/suite/rpl/t/disabled.def
  - mysql-test/t/archive.test
  - mysql-test/t/select.test
  - sql/item.cc
  - sql/item.h
  - sql/item_timefunc.cc
  - sql/sql_base.cc
  - sql/sql_delete.cc
  - sql/sql_load.cc
  - sql/sql_partition.cc
  - sql/sql_table.cc
  - storage/innobase/handler/ha_innodb.cc
  - vio/vio.c
2009-12-12 23:38:59 +03:00
Vladislav Vaintroub
a6f6932e26 merge 2009-12-11 21:17:17 +01:00
Vladislav Vaintroub
91d9e6b670 merge 2009-12-11 21:17:17 +01:00
Alexander Nozdrin
5676713687 Manual merge from mysql-trunk.
Conflicts:
  - client/mysqltest.cc
  - mysql-test/collections/default.experimental
  - mysql-test/suite/rpl/t/disabled.def
  - sql/mysqld.cc
  - sql/opt_range.cc
  - sql/sp.cc
  - sql/sql_acl.cc
  - sql/sql_partition.cc
  - sql/sql_table.cc
2009-12-11 12:39:38 +03:00
Alexander Nozdrin
69cfd5c8ec Manual merge from mysql-trunk.
Conflicts:
  - client/mysqltest.cc
  - mysql-test/collections/default.experimental
  - mysql-test/suite/rpl/t/disabled.def
  - sql/mysqld.cc
  - sql/opt_range.cc
  - sql/sp.cc
  - sql/sql_acl.cc
  - sql/sql_partition.cc
  - sql/sql_table.cc
2009-12-11 12:39:38 +03:00
Vladislav Vaintroub
9fcef3c45b On Linux, support -Wl,--no-undefined (only client shared library)
and --Wl,--as-needed (all shared modules). The later will remove
unused dependencies (also from gcc and C++ runtime)
2009-12-07 02:16:05 +01:00