Commit graph

4648 commits

Author SHA1 Message Date
Nirbhay Choubey
ffdc4bc8cd Merge of patch for Bug#13928675 from mysql-5.1. 2012-08-07 19:07:13 +05:30
Nirbhay Choubey
5ad8292c63 Bug#13928675 MYSQL CLIENT COPYRIGHT NOTICE MUST
SHOW 2012 INSTEAD OF 2011

* Added a new macro to hold the current year :
  COPYRIGHT_NOTICE_CURRENT_YEAR
* Modified ORACLE_WELCOME_COPYRIGHT_NOTICE macro
  to take the initial year as parameter and pick
  current year from the above mentioned macro.
2012-08-07 18:58:19 +05:30
Sergei Golubchik
0117a92fed MDEV-419 ensure that all HAVE_XXX constants can be set by cmake
add missing checks to configure.cmake
remove dead code and unused HAVE_xxx constants from the sources
2012-07-31 19:29:07 +02:00
Vladislav Vaintroub
257fd9d3d9 MDEV-417 - fix typo that prevented use of atomic instructions on Windows
use correct macro for Microsoft compiler. It is _MSC_VER , not _MSV_VER
2012-07-30 20:13:23 +02:00
Thayumanavar
fa0d2df5ff Bug#13699303 - THREAD POOL PLUGIN IGNORES TIMEOUT.
PROBLEM: 
mysql provides a feature where in a session which is 
idle for a period specified by the wait_timeout variable
(whose value is in seconds), the session is closed
This feature is not present when we use thread pool.
FIX:
This patch implements the interface functions which is 
required to implement the wait_timeout functionality
in the thread pool plugin.
2012-07-25 16:24:18 +05:30
Georgi Kodinov
06f6e4fe95 Bug #12998841: libmysql divulges plaintext password upon request in 5.5
1. Clear text password client plugin disabled by default.
2. Added an environment variable LIBMYSQL_ENABLE_CLEARTEXT_PLUGIN, that
when set to something starting with '1', 'Y' or 'y' will enable the clear
text
plugin for all connections.
3. Added a new mysql_options() option : MYSQL_ENABLE_CLEARTEXT_PLUGIN
that takes an my_bool argument. When the value of the argument is non-zero
the clear text plugin is enabled for this connection only.
4. Added an enable-cleartext-plugin config file option that takes a numeric

argument. If the numeric value of the numeric argument is non-zero the
clear
text plugin is enabled for the connection
5. Added a boolean command line option "--enable_cleartext_plugin" to
mysql, mysqlslap and mysqladmin. When specified it will call mysql_options
with the effect of #3
6. Added a new CLEARTEXT option to the connect command in mysqltest.
When specified it will enable the cleartext plugin for usage.
7. Added test cases and updated existing ones that need the clear text
plugin.
2012-07-05 09:55:20 +03:00
Georgi Kodinov
e65c291807 merge bug#13708485 5.1->5.5 2012-06-29 16:54:55 +03:00
Jon Olav Hauglid
66ef5b0d48 Bug#14238406 NEW COMPILATION WARNINGS WITH GCC 4.7 (-WERROR=NARROWING)
Manual merge from mysql-5.1 to mysql-5.5
2012-06-29 13:36:01 +02:00
Jon Olav Hauglid
1ede2dd814 Bug#14238406 NEW COMPILATION WARNINGS WITH GCC 4.7 (-WERROR=NARROWING)
This patch fixes various compilation warnings of the type
"error: narrowing conversion of 'x' from 'datatype1' to
'datatype2'
2012-06-29 13:25:57 +02:00
Georgi Kodinov
107c894a54 Bug #13708485: malformed resultset packet crashes client
Several fixes :

* sql-common/client.c
Added a validity check of the fields metadata packet sent 
by the server.
Now libmysql will check if the length of the data sent by
the server matches what's expected by the protocol before
using the data.

* client/mysqltest.cc
Fixed the error handling code in mysqltest to avoid sending
new commands when the reading the result set failed (and 
there are unread data in the pipe).

* sql_common.h + libmysql/libmysql.c + sql-common/client.c
unpack_fields() now generates a proper error when it fails.
Added a new argument to this function to support the error 
generation.

* sql/protocol.cc
Added a debug trigger to cause the server to send a NULL
insted of the packet expected by the client for testing 
purposes.
2012-06-28 18:38:55 +03:00
Michael Widenius
aa67a198e8 automatic merge with 5.5 2012-06-27 17:22:23 +03:00
Sergey Petrunya
8c762965d3 Merge 5.3 -> 5.5 2012-06-20 15:01:28 +04:00
Sergey Petrunya
90fbd8b22b Merge 5.2->5.3 2012-06-18 22:38:11 +04:00
Michael Widenius
9ebda8764d Fixes after Serg's review of %M extenstions
- Changed output to be error "error-text" instead of error - error-text


extra/perror.c:
  Move my_handler_errors.h into include
include/my_handler_errors.h:
  Move my_handler_errors.h into include
mysql-test/r/errors.result:
  Updated result
mysql-test/r/innodb_mysql_sync.result:
  Updated result
mysql-test/r/myisam-system.result:
  Updated result
mysql-test/r/myisampack.result:
  Updated result
mysql-test/r/partition_innodb_plugin.result:
  Updated result
mysql-test/r/ps_1general.result:
  Updated result
mysql-test/r/trigger.result:
  Updated result
mysql-test/r/type_bit.result:
  Updated result
mysql-test/r/type_bit_innodb.result:
  Updated result
mysql-test/r/type_blob.result:
  Updated result
mysql-test/suite/archive/archive.result:
  Updated result
mysql-test/suite/binlog/r/binlog_index.result:
  Updated result
mysql-test/suite/binlog/r/binlog_ioerr.result:
  Updated result
mysql-test/suite/csv/csv.result:
  Updated result
mysql-test/suite/engines/iuds/r/type_bit_iuds.result:
  Updated result
mysql-test/suite/federated/federated_bug_35333.result:
  Updated result
mysql-test/suite/innodb/r/innodb-create-options.result:
  Updated result
mysql-test/suite/innodb/r/innodb-index.result:
  Updated result
mysql-test/suite/innodb/r/innodb-zip.result:
  Updated result
mysql-test/suite/innodb/r/innodb.result:
  Updated result
mysql-test/suite/innodb/r/innodb_bug13635833.result:
  Updated result
mysql-test/suite/innodb/r/innodb_bug21704.result:
  Updated result
mysql-test/suite/innodb/r/innodb_bug46000.result:
  Updated result
mysql-test/suite/parts/r/partition_bit_innodb.result:
  Updated result
mysql-test/suite/parts/r/partition_bit_myisam.result:
  Updated result
mysql-test/suite/percona/percona_innodb_fake_changes.result:
  Updated result
mysql-test/suite/perfschema/r/misc.result:
  Updated result
mysql-test/suite/perfschema/r/privilege.result:
  Updated result
mysql-test/suite/rpl/r/rpl_EE_err.result:
  Updated result
mysql-test/suite/rpl/r/rpl_binlog_errors.result:
  Updated result
mysql-test/suite/rpl/r/rpl_drop_db.result:
  Updated result
sql/share/errmsg-utf8.txt:
  Removed 'column' from error text that was used in different context
strings/my_vsnprintf.c:
  Move my_handler_errors.h into include
  Minor cleanups
  Changed output of %M to be error "error-text" instead of error - error-text
unittest/mysys/my_vsnprintf-t.c:
  Updated error text
2012-06-17 15:34:39 +03:00
Sergei Golubchik
0522307ed1 mysql-5.5 merge 2012-06-14 20:05:31 +02:00
Igor Babaev
7b32d88c05 Fixed LP bug #1008293.
One of the reported problems manifested itself in the scenario when one
thread tried to to get statistics on a key cache while the second thread
had not finished initialization of the key cache structure yet. 
The problem was resolved by forcing serialization of such operations
on key caches.

To serialize function calls to perform certain operations over a key cache
a new mutex associated with the key cache now is used. It is stored in the
field op_lock of the KEY_CACHE structure. It is locked when the operation
is performed. Some of the serialized key cache operations utilize calls 
for other key cache operations. To avoid recursive locking of op_lock
the new functions that perform the operations of key cache initialization,
destruction and re-partitioning with an additional parameter were introduced.
The parameter says whether the operation over op_lock are to be performed or
are to be omitted. The old functions for the operations of key cache 
initialization, destruction,and  re-partitioning  now just call the
corresponding new functions with the additional parameter set to true
requesting to use op_lock while all other calls of these new function
have this parameter set to false. 

Another problem reported in the bug entry concerned the operation of
assigning an index to a key cache. This operation can be called
while the key cache structures are not initialized yet. In this
case any call of flush_key_blocks() should return without any actions.

No test case is provided with this patch.
2012-06-11 22:12:47 -07:00
Michael Widenius
59b4ee1454 Merge with 5.5 2012-05-31 11:46:30 +03:00
Michael Widenius
aa81e025a8 Added text for errno in error messages by:
- Adding %M my_sprintf() modifier that prints error number - system-error-text
- Modified mysys, mysql_client and SQL error messages to use %M instead of %d
- Added my_strerror()
Updated handler errors to 5.6 error numbers
Updated text for a few error messages (to match 5.6)
Increased length of command name in error output

extra/comp_err.c:
  Added support for %M
include/my_base.h:
  Updated handler errors to 5.6 error numbers
include/my_sys.h:
  Added my_strerror()
libmysql/errmsg.c:
  Updated error messages to use %M
mysql-test/r/errors.result:
  Updated result as error message have changed
mysql-test/r/innodb_mysql_sync.result:
  Updated result with text for errno
mysql-test/r/myisam-system.result:
  Updated result with text for errno
mysql-test/r/myisam.result:
  Updated result as error message have changed
mysql-test/r/myisampack.result:
  Updated result with text for errno
mysql-test/r/mysql.result:
  Updated result with text for errno
mysql-test/r/mysql_upgrade.result:
  Updated result with text for errno
mysql-test/r/partition_datatype.result:
  Updated result as error message have changed
mysql-test/r/partition_innodb_plugin.result:
  Updated result with text for errno
mysql-test/r/ps_1general.result:
  Updated result with text for errno
mysql-test/r/trigger.result:
  Updated result with text for errno
mysql-test/r/type_bit.result:
  Updated result as error message have changed
mysql-test/r/type_bit_innodb.result:
  Updated result as error message have changed
mysql-test/r/type_blob.result:
  Updated result as error message have changed
mysql-test/suite/archive/archive.result:
  Updated result with text for errno
mysql-test/suite/binlog/r/binlog_index.result:
  Updated result with text for errno
mysql-test/suite/binlog/r/binlog_ioerr.result:
  Updated result with text for errno
mysql-test/suite/csv/csv.result:
  Updated result with text for errno
mysql-test/suite/federated/federated_bug_35333.result:
  Updated result with text for errno
mysql-test/suite/innodb/r/innodb-create-options.result:
  Updated result with text for errno
mysql-test/suite/innodb/r/innodb-index.result:
  Updated result with text for errno
mysql-test/suite/innodb/r/innodb-zip.result:
  Updated result as error message have changed
mysql-test/suite/innodb/r/innodb.result:
  Updated result with text for errno
mysql-test/suite/innodb/r/innodb_bug21704.result:
  Updated result with text for errno
mysql-test/suite/innodb/r/innodb_bug46000.result:
  Updated result with text for errno
mysql-test/suite/innodb/r/innodb_bug53591.result:
  Updated result as error message have changed
mysql-test/suite/innodb/r/innodb_corrupt_bit.result:
  New error numbers
mysql-test/suite/innodb/r/innodb_prefix_index_liftedlimit.result:
  Updated result as error message have changed
mysql-test/suite/innodb/t/innodb-create-options.test:
  Added regexp to avoid system error text
mysql-test/suite/innodb/t/innodb-zip.test:
  Added regexp to avoid system error text
mysql-test/suite/maria/maria-recovery2.result:
  Updated supression rule
mysql-test/suite/maria/maria-recovery2.test:
  Updated supression rule
mysql-test/suite/maria/maria.result:
  Updated result as error message have changed
mysql-test/suite/parts/r/partition_bit_innodb.result:
  
  Updated result as error message have changed
mysql-test/suite/parts/r/partition_bit_myisam.result:
  
  Updated result as error message have changed
mysql-test/suite/percona/percona_innodb_fake_changes.result:
  Updated result with text for errno
mysql-test/suite/perfschema/r/dml_cond_instances.result:
  Updated result as error message have changed
mysql-test/suite/perfschema/r/dml_events_waits_current.result:
  Updated result as error message have changed
mysql-test/suite/perfschema/r/dml_events_waits_history.result:
  Updated result as error message have changed
mysql-test/suite/perfschema/r/dml_events_waits_history_long.result:
  Updated result as error message have changed
mysql-test/suite/perfschema/r/dml_ews_by_instance.result:
  Updated result as error message have changed
mysql-test/suite/perfschema/r/dml_ews_by_thread_by_event_name.result:
  Updated result as error message have changed
mysql-test/suite/perfschema/r/dml_ews_global_by_event_name.result:
  Updated result as error message have changed
mysql-test/suite/perfschema/r/dml_file_instances.result:
  Updated result as error message have changed
mysql-test/suite/perfschema/r/dml_file_summary_by_event_name.result:
  Updated result as error message have changed
mysql-test/suite/perfschema/r/dml_file_summary_by_instance.result:
  Updated result as error message have changed
mysql-test/suite/perfschema/r/dml_mutex_instances.result:
  Updated result as error message have changed
mysql-test/suite/perfschema/r/dml_performance_timers.result:
  Updated result as error message have changed
mysql-test/suite/perfschema/r/dml_rwlock_instances.result:
  Updated result as error message have changed
mysql-test/suite/perfschema/r/dml_threads.result:
  Updated result as error message have changed
mysql-test/suite/perfschema/r/misc.result:
  Updated result with text for errno
mysql-test/suite/perfschema/r/privilege.result:
  Updated result with text for errno
mysql-test/suite/rpl/r/rpl_EE_err.result:
  Updated result with text for errno
mysql-test/suite/rpl/r/rpl_binlog_errors.result:
  Updated result with text for errno
mysql-test/suite/rpl/r/rpl_drop_db.result:
  Updated result with text for errno
mysys/errors.c:
  Updated error messages to use %M
  Changed all errors to use Errcode: consistenly
mysys/my_handler_errors.h:
  Updated handler errors to 5.6 error numbers
sql/share/errmsg-utf8.txt:
  Updated error messages to use %M
sql/sys_vars.cc:
  Added error number to ER_EVENT_SET_VAR_ERROR
strings/my_vsnprintf.c:
  Added %M my_sprintf() modifier that prints error number - system-error-text
  Simplify code
  Movied common code to function
  Removed some casts that was not necessary when reading integer/unsigned int stored in longlong
  Added my_strerror()
unittest/mysys/my_vsnprintf-t.c:
  Added testing of %M
2012-05-30 00:37:55 +03:00
Sergei Golubchik
ec586f529c Building RPMs with CPack
configure with cmake -DRPM=distro
2012-05-22 11:04:32 +02:00
Sergei Golubchik
7f6f53a8df 5.2 merge 2012-05-20 14:57:29 +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
Sergei Golubchik
329daad2d3 more portable fix for lp:942266 - 5.5 builds fail with systemtap-sdt-dev installed on Ubuntu
include <limits> early, before min/max macros are defined.
2012-05-11 09:18:00 +02: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
Sergei Golubchik
91527014c2 MDEV-207 Install headers required to build external storage plugins
5.5 version. for cmake, not autotools.
2012-05-05 08:27:17 +02:00
Sergei Golubchik
44cf9ee5f7 5.3 merge 2012-05-04 07:16:38 +02:00
Sergei Golubchik
5701d53190 MDEV-207 Install headers required to build external storage plugins
install all private headers in mysql/private/
2012-04-23 09:45:27 +02:00
Sergei Golubchik
f860b2aad4 merge 2012-04-07 15:58:46 +02:00
Sergei Golubchik
a3073ecd96 merge 2012-04-05 23:07:18 +02:00
Sergei Golubchik
cbd52a42ee merge 2012-04-05 12:01:52 +02:00
Sergei Golubchik
dea3544b2d mysql-5.1.62 merge 2012-04-05 10:49:38 +02:00
unknown
34ed8f3379 lp:886550 Wrong installation path for some include files.
Now install all includes in a flat hierarchy under
$PREFIX/include/mysq/, same as 5.3. User can override with
-DINSTALL_INCLUDEDIR
2012-04-03 08:00:57 +02:00
Michael Widenius
bea887e663 Define dummy my_init_stacktrace() to allow one to call it without #ifdef HAVE_STACKTRACE
Fixed compilation problem on windows.


configure.cmake:
  Added test for pthread_attr_getguardsize
include/my_stacktrace.h:
  Define dummy my_init_stacktrace() to allow one to call it without #ifdef HAVE_STACKTRACE
sql/mysqld.cc:
  Move my_setstacksize() to fix compilation problem on windows
  Don't disable core on signal just becasue platform doesn't handle stack trace
2012-04-03 15:48:56 +03:00
Sergei Golubchik
0d5adca0de debug_sync is now a service, available to dynamically loaded plugins.
new make target - abi_update

libservices/HOWTO:
  remove references to Makefile.am
  small tweaks
2012-03-28 19:26:00 +02:00
Sergei Golubchik
20e706689d mysql-5.5.22 merge
mysql-test/suite/innodb/t/group_commit_crash.test:
  remove autoincrement to avoid rbr being used for insert ... select
mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test:
  remove autoincrement to avoid rbr being used for insert ... select
mysys/my_addr_resolve.c:
  a pointer to a buffer is returned to the caller -> the buffer cannot be on the stack
mysys/stacktrace.c:
  my_vsnprintf() is ok here, in 5.5
2012-03-28 01:04:46 +02:00
Sergei Golubchik
d92009231d a couple of minor post-5.5-merge cleanups
include/mysql_com.h:
  remove "shutdown levels" that aren't shutdown levels from mysql_enum_shutdown_level
mysys/my_addr_resolve.c:
  my_snprintf in 5.5 (but not in 5.3) supports %p
sql/item_func.cc:
  use a method (that exists only in 5.5) instead of directly accessing a member
sql/item_subselect.cc:
  use a method (that exists only in 5.5) instead of directly accessing a member
sql/opt_subselect.cc:
  use a method (that exists only in 5.5) instead of directly accessing a member
sql/sql_select.cc:
  use a method (that exists only in 5.5) instead of directly accessing a member
2012-03-26 12:33:49 +02:00
unknown
99aa3d465e Merge MariaDB 5.3 into latest MariaDB 5.5 2012-03-24 18:25:00 +01:00
unknown
335de5db18 Merge mariadb 5.3->mariadb 5.5 2012-03-24 18:21:22 +01:00
Alexey Botchkov
5c01f1ac14 MDEV-15 Log all sql errors.
modified for MySQL 5.5. Logger service moved to the
        plugin/sql_errlog directory to be properly used later.

plugin/sql_errlog/sql_errlog.c:
  Fixes for bugs #956427 (SQL_ERROR_LOG plugin produces bogus warnings about sql-error-log-size-limit value) and #956463 (Server crashes if SQL_ERROR_LOG fails to initialize) they're also MDEV-184 and MDEV-183
    
  The sql_error_log_deinit() should be prepared for the logger_file to be NULL.
  The logger_file_size_limit upper limit wasn't properly set.
2012-03-24 11:24:20 +01:00
unknown
c895e235f3 Do not use Valgrind client requests in a normal release build, they have a small but noticable performance impact. 2012-03-22 12:31:09 +01:00
Sergei Golubchik
e6c213897d merge 2012-03-21 19:15:29 +01:00
Sergei Golubchik
c88e2679c6 merge 2012-03-21 18:30:34 +01:00
Sergei Golubchik
44ea4e7c1f restore my_safe_printf_stderr for "crash-safe sigsegv handler"
use vsnprintf()
use write() on windows, not WriteFile or fwrite()
localtime_r is still a problem
2012-03-14 21:16:24 +01:00
Alexey Botchkov
e3e2b4e1d1 MDEV-15 Log SQL errors.
mysys/my_logger.c was moved to sql/sql_logger.c
        Logger service was rewritten with file functions instead of stream, so it
        can handle huge files.
2012-03-14 16:37:49 +04:00
Alexey Botchkov
07a82c58a7 MDEV-15 Log all SQL errors.
Added the logger service that provides us with the rotating logs.
              The plugin SQL_ERROR_LOG added. It logs the errors using the 'logger service'
                      for the rotating log files.
              the example record from the log:
                2012-03-09 15:07:29 root[root] @ localhost [] ERROR 1146: Table 'test.xyz' doesn't exist : select * from test.xyz
2012-03-14 00:55:56 +04:00
Sergei Golubchik
00f2e3139f alternative method of resolving addresses for safemalloc and crash handler.
don't link with libbfd, exec addr2line, if it's available at run time
2012-03-13 13:34:24 +01:00
Sergei Golubchik
3f17890892 disable EXTRA_DEBUG in non-dbug builds 2012-03-13 13:27:14 +01:00
Sergei Golubchik
4933d21e5d merge with mysql-5.5.21 2012-03-09 08:06:59 +01:00
Sergei Golubchik
1c530b36d1 mdev-20: INSTALL PLUGIN SONAME 2012-03-05 21:48:06 +01:00
Annamalai Gurusami
7e36c4bdb0 Bug#13635833: MULTIPLE CRASHES IN FOREIGN KEY CODE WITH CONCURRENT DDL/DML
There are two threads.  In one thread, dml operation is going on 
involving cascaded update operation.  In another thread, alter 
table add foreign key constraint is happening.  Under these 
circumstances, it is possible for the dml thread to access a 
dict_foreign_t object that has been freed by the ddl thread.  
The debug sync test case provides the sequence of operations.  
Without fix, the test case will crash the server (because of 
newly added assert).  With fix, the alter table stmt will return 
an error message.  
      
Backporting the fix from MySQL 5.5 to 5.1

rb:961
rb:947
2012-03-01 11:05:51 +05:30
Michael Widenius
e4e85cd2ef Fixed lp:925377 "Querying myisam table metadata while 'alter table..enable keys' is running may corrupt the table"
Fixed wrong mutex order bug in Aria when flush_log_for_bitmap() was called when table is not yet marked for change.

include/my_base.h:
  Added flag that table is opened only for status
mysql-test/r/myisam-big.result:
  Test case for lp:925377
mysql-test/t/myisam-big.test:
  Test case for lp:925377
sql/sql_base.cc:
  If thd->version == 0 (happens only when we are opening a table that is flushed under  MYSQL_LOCK_IGNORE_FLUSH), open the table in HA_OPEN_FOR_STATUS mode
storage/maria/ma_bitmap.c:
  Fixed wrong mutex order bug in Aria when flush_log_for_bitmap() was called when table is not yet marked for change.
storage/maria/ma_dbug.c:
  Ignore last_version <= 1 as these are either flushed or only opened for status
storage/maria/ma_open.c:
  Use last_version=1 as a marker that table was opened with HA_OPEN_FOR_STATUS.
  In this case we just open a new version of the table in read only mode.
storage/myisam/mi_create.c:
  Update prototype
storage/myisam/mi_dbug.c:
  Ignore last_version <= 1 as these are either flushed or only opened for status
storage/myisam/mi_open.c:
  Use last_version=1 as a marker that table was opened with HA_OPEN_FOR_STATUS.
  If HA_OPEN_FOR_STATUS is used, we will not assert if there is an old not-to-be-used version of the table existing.
  In this case we just open a new version of the table in read only mode.
storage/myisam/myisamdef.h:
  Updated prototype
2012-02-28 23:18:52 +02:00
Annamalai Gurusami
c1615df32c Bug#13635833: MULTIPLE CRASHES IN FOREIGN KEY CODE WITH CONCURRENT DDL/DML
There are two threads.  In one thread, dml operation is going on 
involving cascaded update operation.  In another thread, alter 
table add foreign key constraint is happening.  Under these 
circumstances, it is possible for the dml thread to access a 
dict_foreign_t object that has been freed by the ddl thread.  
The debug sync test case provides the sequence of operations.  
Without fix, the test case will crash the server (because of 
newly added assert).  With fix, the alter table stmt will return 
an error message.  
      
rb:947
approved by Jimmy Yang
2012-02-27 17:23:56 +05:30
Michael Widenius
15c5a2686f Merge with MariaDB 5.2 2012-02-21 01:58:50 +02:00
Michael Widenius
038b739c98 Merge with MariaDB 5.1 and MySQL 5.1.61 2012-02-20 17:49:21 +02:00
Michael Widenius
ae07ec6cbf Merge with MYSQL 5.1.61
Fixed README with link to source
Merged InnoDB change to XtraDB

README:
  Added information of where to find MariaDB code
storage/archive/ha_archive.cc:
  Removed memset() of rows, a MariaDB checksum's doesn't touch not used data.
2012-02-20 16:23:18 +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
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
Georgi Kodinov
9f18fc5a06 merged mysql-5.5->mysql-5.5-security 2012-02-17 11:55:36 +02:00
Georgi Kodinov
387721101c merge mysql-5.1->mysql-5.1-security 2012-02-17 11:52:41 +02:00
Joerg Bruehe
8674517dd4 Upmerge the AIX compile fix into 5.5. 2012-02-16 16:03:43 +01:00
Joerg Bruehe
d18a6702aa Merge compile fix for AIX into delivery tree. 2012-02-16 15:55:53 +01:00
MySQL Build Team
7a35cb9150 Updated/added copyright headers 2012-02-16 10:48:16 +01:00
Kent Boortz
6a003dd8ef Updated/added copyright headers 2012-02-15 17:21:38 +01:00
MySQL Build Team
7177a2b9d7 Updated/added copyright headers 2012-02-15 17:13:47 +01:00
Vladislav Vaintroub
c0a4377575 Fix build error on Ubuntu 11.10, if systemtap is installed.
The error is due to conflict between min/max macros in my_global.h
and system header < limits>, indirectly included via generated 
probes_mysql_dtrace.h

Temporarily undefined min/max for the inclusion of the probes_mysq_dtrace.h
2012-02-29 18:25:25 +01:00
Vladislav Vaintroub
62dcaf8c29 merge 5.5 2012-02-27 19:32:44 +01:00
unknown
f0c682858f Merge MWL#192: non-blocking client library into MariaDB. 2012-02-26 16:11:44 +01:00
unknown
b8aa31c03d MWL#192 after-merge fixes.
Fix memory leak in one error case in mysqldump.
Fix that HAVE_VALGRIND_VALGRIND_H is now HAVE_VALGRIND in 5.5.
Fix that @have_ssl should not be set in embedded (introduced when
removing #undef HAVE_OPENSSL from my_global.h).
2012-02-23 15:42:21 +01:00
Sergei Golubchik
db39910f08 disable safemalloc for valgrind builds.
always try to use valgrind headers in debug builds.
define HAVE_valgrind for --with-valgrind
fix valgrind check in my_valgrind.h
2012-02-23 15:31:24 +01:00
unknown
9305f2b52f Merge latest MariaDB 5.5 into MWL#192: Non-blocking client library. 2012-02-22 12:14:34 +01:00
unknown
f2db5ef4ba Fix MWL#192 build error: Remove SSL special case for embedded server.
VIO has SSL in embedded server anyway, so we do not win anything by excluding it.

This was actually already done in this changeset:

    revision-id: kostja@sun.com-20100413150445-8x23keoxdiufgq76

"... Also, he removed the (probable) bug of embedded server never using SSL-dependent functions..."
But was apparenly lost by a mis-merge of WL#5030.
2012-02-22 11:44:53 +01:00
unknown
f6b68a1070 Merge MWL#192: Non-blocking client library, into MariaDB 5.5. 2012-02-21 22:15:44 +01:00
Sergei Golubchik
5bf311e1e8 fix the include guards and add missing gplv2 headers 2012-02-17 12:19:38 +01:00
Ashish Agarwal
f0955f9ec7 BUG#11754145 - 45702: IMPOSSIBE TO SPECIFY MYISAM_SORT_BUFFER > 4GB
ON 64 BIT MACHINES

PROBLEM: When sorting index during repair of
         myisam tables, due to improper casting
         of buffer size variables value of myisam_
         sort_buffer_size is not set greater than
         4GB.

SOLUTION: Proper casting of buffer size variable.
          myisam_buffer_size changed to unsigned
          long long to handle size > 4GB on
          linux as well as windows.
2012-02-02 18:17:14 +05:30
Igor Babaev
7b79d8a33f Merge 5.2->5.3 in preparation for the release of mariadb-5.3.4-rc. 2012-02-01 15:48:02 -08: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
Vladislav Vaintroub
19d13a3b17 portability fixes for FreeBSD 8 and 9 2012-01-23 17:12:25 +01:00
Alexander Barkov
31a1f8ef54 Merging Bug#11752408 from mysql-5.1 2012-01-23 13:23:50 +04:00
Alexander Barkov
e449cf48af Bug#11752408 - 43593: DUMP/BACKUP/RESTORE/UPGRADE TOOLS FAILS BECAUSE OF UTF8_GENERAL_CI
Introducing new collations:
utf8_general_mysql500_ci and ucs2_general_mysql500_ci,
to reproduce behaviour of utf8_general_ci and ucs2_general_ci
from mysql-5.1.23 (and earlier).

The collations are added to simplify upgrade from mysql-5.1.23 and earlier.

Note: The patch does not make new server start over old data automatically.
Some manual upgrade procedures are assumed.

Paul: please get in touch with me to discuss upgrade procedures
when documenting this bug.

modified:
  include/m_ctype.h
  mysql-test/r/ctype_utf8.result
  mysql-test/t/ctype_utf8.test
  mysys/charset-def.c
  strings/ctype-ucs2.c
  strings/ctype-utf8.c
2012-01-23 13:07:10 +04:00
Vladislav Vaintroub
74cac79218 - Fix rpl_checksum test. Use basename of file in error messages, not the o
nes prefixed with .\ or ./
- Add my_basename() to mysys.
- Do not compile files that are not needed on Windows (my_addr_resolve, an
d safemalloc related stuff it it is not used)
Avoids linker warnings about compilation of essentially empty files.
2012-01-20 01:57:58 +01:00
Joerg Bruehe
316a60af6d Compile fix needed for AIX,
to work around the lack of a bzero() prototype.

include/m_string.h:
  AIX does have bzero() in its system libraries,
  and the configure phase detects it, including the prototype
  (sets both HAVE_BZERO and HAVE_DECL_BZERO),
  but the declaration is missing when the source is compiled.
  Several attempts all failed.
  This patch takes the brute force approach to always map
  "bzero()" to "memset()" on AIX,
  like is done on platforms where "bzero()" is not found at all.
2012-01-19 17:05:47 +01:00
Sergei Golubchik
309ca7b447 fix the linking failure on windows 2012-01-18 22:09:20 +01:00
Sergei Golubchik
4cd19779c7 MDEV-69 SET optimizer_switch = REPLACE(...) causes ER_WRONG_VALUE_FOR_VAR
find_set() in typelib.c expected a zero-terminated string

include/typelib.h:
  disable unused flags
2012-01-17 10:55:27 +01:00
Georgi Kodinov
a72f7ee6a3 merged bug #11754014 2012-01-17 11:38:34 +02:00
Sergei Golubchik
38e3ae155d mysql-5.5 merge 2012-01-16 20:16:35 +01:00
Georgi Kodinov
10543a4a2e Bug #11754014: 45549: udf plugin_dir path separator inconsistency
and cryptic error 1126 message

The problem was that dlopen() related code was using just a subset 
of the path normalization routines used in other places.
Fixed the expansion of the pre-dlopen() behavior for plugins and UDFs
to use a platform-dependent consistent encoding of the paths.
Fixed the error dlopen() error handling to take the correct error message
and strip off the trailing newline character(s).
Fixed tests to do a platform independent replace of directories and to 
account for the traling slash.
2012-01-16 12:04:28 +02:00
Sergei Golubchik
4f435bddfd 5.3 merge 2012-01-13 15:50:02 +01:00
unknown
d5678e1778 Fix non-ssl build. 2012-01-08 10:13:39 +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
39ebfa51ef Fix MDEV-49 : version_compile_machine server variable is 'unknown' for x64 builds 2012-01-10 19:23:00 +01:00
Vladislav Vaintroub
305ae953db merge 2011-12-26 16:57:28 +01:00
Sergei Golubchik
db8f698c8a new configure option: NOT_FOR_DISTRIBUTION
fix safemalloc to compile w/o libbfd.

CMakeLists.txt:
  NOT_FOR_DISTRIBUTION option
cmake/readline.cmake:
  simplify libedit/readline detection.
  never use bundled libedit.
  use system readline v6 only if NOT_FOR_DISTRIBUTION=1
configure.cmake:
  use libbfd only if NOT_FOR_DISTRIBUTION=1
include/my_stacktrace.h:
  link with libbfd even w/o safemalloc.
2011-12-14 10:53:32 +01:00
Sergei Golubchik
6cc9d0ffa0 move safemalloc out of dbug.
remeber a real backtrace for every allocation.
make safemalloc to tract C++ new/delete too.
collateral fixes to make the test suite pass.
2011-12-12 22:58:24 +01:00
Sergei Golubchik
745c53ec06 5.2->5.3 merge 2011-12-12 13:00:33 +01:00
Michael Widenius
6d4224a31c Merge with 5.2.
no_error handling for select (used by INSERT ... SELECT) still needs to be fixed, but I will do that in a separate commit
2011-12-11 11:34:44 +02:00
Sergei Golubchik
37c81d81b3 another backtrace resolver that prints source file name and line number 2011-12-11 09:00:12 +01:00
Vladislav Vaintroub
e91bbca5fb Initial threadpool implementation for MariaDB 5.5 2011-12-08 19:17:49 +01:00
Sergei Golubchik
c753bedcb1 win64 sysvar portability fixes 2011-12-02 19:49:05 +01:00
Sergei Golubchik
cff0175d2a install my_valgrind.h too 2011-12-02 16:29:02 +01:00
Sergei Golubchik
d5fd757a42 1. add --plugin-dir and --default-auth to mysqltest.
2. dialog plugin now always returns mysql->password if non-empty and the first question is of password type
3. split get_tty_password into get_tty_password_buff and strdup.
4. dialog plugin now uses get_tty_password by default
5. dialog.test
6. moved small tests of individual plugins into a dedicated suite
2011-12-02 16:26:43 +01:00
Tor Didriksen
b522a6ce78 Bug#11761576 54082: HANDLE_SEGFAULT MAKES USE OF UNSAFE FUNCTIONS
handle_segfault is the signal handler code of mysqld.  however, it makes
calls to potentially unsafe functions localtime_r, fprintf, fflush.



include/my_stacktrace.h:
  Add safe versions of itoa() write() and snprintf().
libmysqld/CMakeLists.txt:
  Move signal handler to separate file.
mysys/stacktrace.c:
  Remove unsafe function calls.
sql/CMakeLists.txt:
  Move signal handler to separate file.
sql/mysqld.cc:
  Move signal handler to separate file.
sql/set_var.h:
  Add missing #include dependency.
sql/sys_vars.cc:
  Cleanup .h and .cc files.
sql/sys_vars.h:
  Cleanup .h and .cc files.
2011-12-02 14:16:48 +01:00
Michael Widenius
55f0e6bf0c Fixes for netware by Guenter Knauf 2011-12-02 00:34:59 +02:00
Michael Widenius
ffab2a90dc Patch to get MariaDB to compile on CYGWIN; By Guenter Knauf
Increased number of locks in thr_lock (used only when testing)


include/my_global.h:
  Patch for CYGWIN
mysys/my_getsystime.c:
  Patch for CYGWIN
mysys/thr_lock.c:
  Increase number of locks for testing
2011-12-02 00:24:58 +02:00
Tor Didriksen
9a15f2492b Bug#11761576 54082: HANDLE_SEGFAULT MAKES USE OF UNSAFE FUNCTIONS
handle_segfault is the signal handler code of mysqld.  however, it makes
calls to potentially unsafe functions localtime_r, fprintf, fflush.



include/my_stacktrace.h:
  Add safe versions of itoa() write() and snprintf().
libmysqld/CMakeLists.txt:
  Move signal handler to separate file.
mysys/stacktrace.c:
  Remove unsafe function calls.
sql/CMakeLists.txt:
  Move signal handler to separate file.
sql/Makefile.am:
  Move signal handler to separate file.
sql/mysqld.cc:
  Move signal handler to separate file.
sql/signal_handler.cc:
  Remove unsafe function calls.
2011-11-30 15:39:29 +01:00
Michael Widenius
a7f87effa5 Merge with 5.1 + fixes for build failures in 5.2
cmd-line-utils/libedit/map.c:
  Fixed compiler warning
cmd-line-utils/libedit/terminal.c:
  Fixed compiler warning
cmd-line-utils/libedit/tty.c:
  Fixed compiler warning
sql/sql_base.cc:
  Fixed memory leak found by valgrind
storage/maria/compat_aliases.cc:
  Ensure that recover_alias is also a set
storage/maria/ma_bitmap.c:
  Proper fix for compiler warning
support-files/compiler_warnings.supp:
  Fixed compiler warning
2011-11-29 22:48:24 +02:00
Michael Widenius
a19f4e3a3a Fixed that maria-recover works as expected.
- "" is now used if no option is set

include/maria.h:
  Added HA_RECOVER_ANY
storage/maria/ha_maria.cc:
  Insert of checking if maria_recover_options == 0, check if any bit is set.
  Fix maria_recover_names to match bitmap. This fixes that recover options works as expected.
storage/maria/ha_maria.h:
  Insert of checking if maria_recover_options == 0, check if any bit is set.
storage/maria/ma_check.c:
  Fixed wrong print
2011-11-29 15:32:25 +02:00
Vladislav Vaintroub
82adfe7b2a merge, fix Windows warnings 2011-11-29 02:00:24 +01:00
Sergei Golubchik
ac8dd6beb9 merged 2011-11-27 17:50:50 +01:00
Sergei Golubchik
dfc1901e80 compilation fixes
cmake/maintainer.cmake:
  don't do -Werror just yet
config.h.cmake:
  according to MSDN PSAPI_VERSION should be 1 in a portable application
mysys/my_thr_init.c:
  first, reset THR_KEY_mysys, and then free dbug data,
  because dbug data are automacially created on the next dbug call,
  unless THR_KEY_mysys is null.
2011-11-27 17:50:08 +01:00
Michael Widenius
a293d0788c Automatic merge 2011-11-24 22:48:35 +02:00
Michael Widenius
6920457142 Merge with MariaDB 5.1 2011-11-24 18:48:58 +02:00
Vladislav Vaintroub
a0331fecf9 Fix package names, by removing a trailing "-MariaDB" ,as we already have leading "mariadb-".
Hardcode -MariaDB suffix for MYSQL_SERVER_VERSION in mysql_version.h
2011-11-23 19:02:08 +01:00
Michael Widenius
7b368e3810 Merge with MySQL 5.1.60 2011-11-23 19:32:14 +02:00
Sergei Golubchik
d463515028 fix dialog plugin to work on windows 2011-11-22 21:55:11 +01:00
Sergei Golubchik
b81d8b2e5a Add support for signed sysvars.
Make max_user_connections signed, with min allowed value being -1.
2011-11-22 18:05:34 +01:00
Sergei Golubchik
d2755a2c9c 5.3->5.5 merge 2011-11-22 18:04:38 +01: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
unknown
42221abaed Fix bug lp:869036
Apart from the fix, the patch also adds few more unrelated test
cases for partial matching, and fixes few typos.

Analysis:
This bug uncovered that partial matching via rowid intersection
didn't handle the case when:
- the left IN argument has some NULLs,
- there are no non-null value matches, and there is no non-null
  column,
- the subquery columns that are not covered with the NULLs in
  the left IN argument contain at least one row, such that it
  has NULL values in all columns where the left IN operand has
  no NULLs.
In this case there is a partial match.

In addition the analysis of the related code uncovered incorrect
handling of few other related cases.

Solution:
The solution for the bug is to check if there exists a row with
NULLs in all columns other than the ones having NULL in the
let IN operand.

The check is implemented via checking whether the bitmaps that
store NULL information in class Ordered_key have a non-empty
intersection for the relevant columns.

The intersection itself is implemented via the function
bitmap_exists_intersection() in my_bitmap.c.
2011-11-17 01:25:10 +02:00
Sergei Golubchik
6edd76785c merge 2011-11-03 23:39:53 +01:00
Sergei Golubchik
0e007344ea mysql-5.5.18 merge 2011-11-03 19:17:05 +01:00
Igor Babaev
4b4dfd57f5 Merge. 2011-10-28 04:07:11 -07:00
Michael Widenius
fa36a7426b Fixed lp:879939 "assertion in ha_maria::enable_indexes with derived_with_keys=on"
Honor unique/not unique when creating keys for internal tempory tables.
Added new variables to be used to limit how keys are created for internal temporary tables.


include/maria.h:
  Added maria_max_key_length() and maria_max_key_segments()
include/myisam.h:
  Added myisam_max_key_length() and myisam_max_key_segments()
mysql-test/r/mysql.result:
  Drop all used tables
mysql-test/r/subselect4.result:
  Added test case for lp:879939
mysql-test/t/mysql.test:
  Drop all used tables
mysql-test/t/subselect4.test:
  Added test case for lp:879939
sql/mysql_priv.h:
  Added internal_tmp_table_max_key_length and internal_tmp_table_max_key_segments to be used to limit how keys for derived tables are created.
sql/mysqld.cc:
  Added internal_tmp_table_max_key_length and internal_tmp_table_max_key_segments to be used to limit how keys for derived tables are created.
sql/share/errmsg.txt:
  Added new error message for internal errors
sql/sql_select.cc:
  Give error if we try to create a wrong key (this error should never happen)
  Honor unique/not unique when creating keys for internal tempory tables.
storage/maria/ha_maria.cc:
  Added change_table_ptr() to ensure that external_ref points always to the correct table.
  (Not having this caused an assert in the included test)
storage/maria/ha_maria.h:
  Added change_table_ptr() to ensure that external_ref points always to the correct table.
storage/maria/ma_check.c:
  Fixed bug in Duplicate key error printing (now row position is printed correctly)
storage/maria/ma_create.c:
  maria_max_key_length() -> _ma_max_key_length()
storage/maria/ma_info.c:
  Added extern function maria_max_key_length() to calculate the max key length based on current block size.
storage/maria/ma_open.c:
  maria_max_key_length() -> _ma_max_key_length()
storage/maria/maria_def.h:
  maria_max_key_length() -> _ma_max_key_length()
storage/myisam/ha_myisam.cc:
  Added change_table_ptr() to ensure that external_ref points always to the correct table.
  (Not having this caused an assert in the included test)
storage/myisam/ha_myisam.h:
  Added change_table_ptr() to ensure that external_ref points always to the correct table.
2011-10-26 20:25:18 +03:00
Sergei Golubchik
90b43902b0 compilation warnings on Windows 2011-11-02 12:55:46 +01:00
Sergei Golubchik
aeaa112edb fixes for windows 2011-10-21 23:07:13 +02:00
Sergei Golubchik
533d274c03 intptr should be unsigned 2011-10-19 22:48:48 +02:00
Sergei Golubchik
86a2d70779 safe_mutex deadlock detector post-merge fixes 2011-10-19 21:53:14 +02: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
Georgi Kodinov
98231daa6f auto-merge mysql-5.0->mysql-5.0-security 2011-10-12 14:33:09 +03:00
Sergei Golubchik
ae63300801 merge 2011-10-11 12:55:42 +02:00
Sergei Golubchik
eeca1f8694 merge with 5.1 2011-10-07 00:18:30 +02:00
Sergei Golubchik
630b0b8779 support for plugins on windows
CMakeLists.txt:
  1. add -DSAFEMALLOC -DSAFE_MUTEX in the top-level CMakeLists.txt
     don't force plugins to copy-paste these lines in their CMakeLists.txt
  2.1 search plugin/* for plugins (not only storage/*),
  2.2 recognize MYSQL_PLUGIN (not only MYSQL_STORAGE_ENGINE),
  2.3 extract library names from the plug.in (don't force library names to
      be ha_<engine>.dll and <engine>.lib)
include/mysql/plugin.h:
  define MYSQL_PLUGIN_EXPORT appropriately
  (backport from 5.5)
libmysqld/CMakeLists.txt:
  remove unnecessary workaround
plugin/fulltext/CMakeLists.txt:
  build fulltext example plugin on windows
storage/maria/CMakeLists.txt:
  The library is called libmaria_s.lib, not maria.lib
storage/maria/unittest/CMakeLists.txt:
  The library is called libmaria_s.lib, not maria.lib
storage/myisam/CMakeLists.txt:
  The library is called libmyisam_s.lib, not myisam.lib
storage/mysql_storage_engine.cmake:
  introduce MYSQL_PLUGIN macro.
  don't force library names to be ha_<engine>.dll and <engine>.lib
storage/xtradb/CMakeLists.txt:
  remove a condition from include
win/README:
  don't use deprecated syntax
win/configure-mariadb.sh:
  don't use deprecated syntax
win/configure.js:
  1. support MYSQL_PLUGIN in addition to MYSQL_STORAGE_ENGINE.
  2. support plugin/* in addition to storage/*
2011-10-04 15:41:52 +02:00
Ashish Agarwal
236886d754 Bug#11759349 -- Merge of patch from mysql-5.1. 2011-09-27 17:44:31 +05:30
Ashish Agarwal
5dbcff9b9c BUG#11759349 - 51655: CREATE TABLE IN MEMORY ENGINE DOESN'T STORE
CREATE_TIME IN INFORMATION_SC

It was impossible to determine MEMORY table creation time,
since it wasn't stored/exposed.

With this patch creation time is saved and it is available via
I_S.TABLES.CREATE_TIME.

Note: it was decided that additional analysis is required before
implementing UPDATE_TIME. Thus this patch doesn't store UPDATE_TIME.
2011-09-27 17:38:51 +05:30
Michael Widenius
22e793639a Added new options to KILL. New syntax is KILL [HARD|SOFT] [CONNECTION|QUERY] [ID | USER user_name]
- If USER is given, all threads for that user is signaled
- If SOFT is used then the KILL will not be sent to the handler. This can be used to not interrupt critical things in the handler like 'REPAIR'.

Internally added more kill signals. This gives us more information of why a query/connection was killed.
- KILL_SERVER is used when server is going down. In this case the users gets ER_SHUTDOWN as the reason connection was killed.
- Changed signals to number in correct order, which makes it easier to test how the signal should affect the code.
- New error message ER_CONNECTION_KILLED if connection was killed by 'KILL CONNECTION'. Before we got error ER_SHUTDOWN.

Changed names of not used parameters KILL_QUERY & KILL_CONNCTION to mysql_kill() to not conflict with defines in the server


include/mysql.h.pp:
  Updated file
include/mysql_com.h:
  Changed names of not used parameters KILL_QUERY & KILL_CONNCTION to mysql_kill() to not conflict with defines in the server
mysql-test/r/kill.result:
  Added test of KILL USER
mysql-test/suite/rpl/r/rpl_stm_000001.result:
  Updated error code
mysql-test/suite/rpl/t/rpl_stm_000001.test:
  Updated error codes
mysql-test/t/flush_read_lock_kill.test:
  Updated error codes
mysql-test/t/kill.test:
  Added test of KILL USER
plugin/handler_socket/handlersocket/database.cpp:
  Removed THD:: from KILL
sql/debug_sync.cc:
  Removed THD:: from KILL
sql/event_scheduler.cc:
  Removed THD:: from KILL
sql/filesort.cc:
  Removed THD:: from KILL
sql/ha_ndbcluster_binlog.cc:
  Removed THD:: from KILL
sql/handler.cc:
  Removed THD:: from KILL
  Simplify code.
sql/lex.h:
  Added new keywords HARD | SOFT
sql/log.cc:
  Removed THD:: from KILL
  Added testing of new error ER_CONNECTION_KILLED
sql/log_event.cc:
  Removed THD:: from KILL
  Added testing of new error ER_CONNECTION_KILLED
sql/mysql_priv.h:
  Added new prototypes
sql/mysqld.cc:
  Removed THD:: from KILL
  Use KILL_SERVER_HARD signal on shutdown.
sql/scheduler.cc:
  Removed THD:: from KILL
  Simplify test if connection should be killed
sql/share/errmsg.txt:
  New error message ER_CONNECTION_KILLED
sql/slave.cc:
  Removed THD:: from KILL
sql/sp_head.cc:
  Removed THD:: from KILL
sql/sql_base.cc:
  Removed THD:: from KILL
sql/sql_cache.cc:
  Removed THD:: from KILL
sql/sql_class.cc:
  Removed THD:: from KILL
  Added killed_errno()
  Only signal kill to storage engine if HARD bit is set.
sql/sql_class.h:
  Move KILL options out from THD to make them easier to use in sql_yacc.yy
sql/sql_connect.cc:
  Removed THD:: from KILL
sql/sql_delete.cc:
  Removed THD:: from KILL
sql/sql_error.cc:
  Removed THD:: from KILL
sql/sql_insert.cc:
  Removed THD:: from KILL
  Simplifed testing if thread is killed.
sql/sql_lex.h:
  Added kill options to st_lex
sql/sql_load.cc:
  Removed THD:: from KILL
sql/sql_parse.cc:
  Added kill options to st_lex
  Simplifed and optimzed testing of thd->killed at end of query
  Added support for KILL USER
  Extended sql_kill() to allow use of more kill signals.
sql/sql_repl.cc:
  Removed THD:: from KILL
sql/sql_show.cc:
  Removed THD:: from KILL
  Simplied testing if query/connection was killed
sql/sql_table.cc:
  Removed THD:: from KILL
sql/sql_update.cc:
  Removed THD:: from KILL
sql/sql_yacc.yy:
  Added support for new KILL syntax: KILL [HARD|SOFT] [CONNECTION|QUERY] [ID | USER user_name]
storage/archive/ha_archive.cc:
  Simplify compilation
storage/maria/ha_maria.cc:
  Removed THD:: from KILL
2011-09-23 01:13:38 +03:00
Sergei Golubchik
3b31fbb5a9 portability fix: avoid anonymous structs and unions in C 2011-09-22 11:04:00 +02:00
Daniel Fischer
7450044eb7 merge from 5.5.16 2011-09-21 12:40:41 +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
unknown
40761a9a73 Merge from mysql-5.1.59-release 2011-09-15 18:48:54 +02:00
Michael Widenius
3fb22ac5e1 Merge with 5.2 2011-09-10 18:01:27 +03:00
Michael Widenius
8fb10c24d7 Fixed that automatic killing of delayed insert thread (in flush, alter table etc) will not abort auto-repair of MyISAM table.
Give more information when finding an error in a MyISAM table.
When killing system thread, use KILL_SYSTEM_THREAD instead of KILL_CONNECTION to make it easier to ignore the signal in sensitive context (like auto-repair)
Added new kill level: KILL_SERVER that will in the future to be used to signal killed by shutdown.
Add more warnings about killed connections when warning level > 3

include/myisamchk.h:
  Added counting of printed info/notes
mysys/mf_iocache.c:
  Remove duplicate assignment
sql/handler.cc:
  Added test of KILL_SERVER
sql/log.cc:
  Ignore new 'kill' error ER_NEW_ABORTING_CONNECTION when requesting query error code.
sql/mysqld.cc:
  Add more warnings for killed connections when warning level > 3
sql/scheduler.cc:
  Added checks for new kill signals
sql/slave.cc:
  Ignore new kill signal ER_NEW_ABORTING_CONNECTION
sql/sp_head.cc:
  Fixed assignment to bool
  Added testing of new kill signals
sql/sql_base.cc:
  Use KILL_SYSTEM_THREAD to auto-kill system threads
sql/sql_class.cc:
  Add more warnings for killed connections when warning level > 3
  thd_killed() now ignores KILL_BAD_DATA and THD::KILL_SYSTEM_THREAD as these should not abort sensitive operations.
sql/sql_class.h:
  Added KILL_SYSTEM_THREAD and KILL_SERVER
sql/sql_connect.cc:
  Added handling of KILL_SERVER
sql/sql_insert.cc:
  Use KILL_SYSTEM_THREAD to auto-kill system threads
  Added handling of KILL_SERVER
sql/sql_parse.cc:
  Add more warnings for killed connections when warning level > 3
  Added checking that thd->abort_on_warning is reset at end of query.
sql/sql_show.cc:
  Update condition for when a query is 'killed'
storage/myisam/ha_myisam.cc:
  Added counting of info/notes printed
storage/myisam/mi_check.c:
  Always print an an error if we find data errors when checking/repairing a MyISAM table.
  When a repair was killed, don't retry repair.
  Added assert if sort_get_next_record() returned an error without an error message.
  Removed nonsence check "if (sort_param->read_cache.error < 0)" in repair.
storage/myisam/myisamchk.c:
  Added counting of notes printed
storage/pbxt/src/thread_xt.cc:
  Better error message.
2011-09-09 19:44:07 +03:00
unknown
b152c4c71d Merge 5.2->5.3 2011-09-02 15:10:10 +03:00
Michael Widenius
13e4d54795 Fixed lp:814238 "safe_mutex issues must be assertions in debug binary"
Added --debug-assert-on-error variable which, if set, will cause safe_mutex to assert if it founds an error.

include/my_sys.h:
  Added my_assert_on_error
mysys/my_static.c:
  Added my_assert_on_error
mysys/thr_mutex.c:
  Assert when found wrong mutex usage if my_assert_on_error is set
sql/mysqld.cc:
  Added setting of my_assert_on_error
2011-09-02 12:41:20 +03:00
Michael Widenius
31c8c95bb2 Added logging of all errors from my_read/my_write/my_pread/my_pwrite/my_open & my_malloc to mysqld error log if one sets log-warning to 10 or 11
The idea is that my_global_flags is ored to the MyFlags parameter for the above functions if the MY_WME flag is not set.
As the my_global_flags has ME_JUST_INFO (mark error as 'note') and possible ME_NOREFRESH (write error to log) this will force mysqld to log the not critical error to the log as a note.


 

include/my_sys.h:
  Moved MY_SYNC_DIR to ensure it never clashes with ME_JUST_INFO
  Added my_global_flags
mysql-test/Makefile.am:
  Removed not used bugs directory
mysys/my_init.c:
  Added my_global_flags, a variable that is ored to MyFlags in a those mysys functions we want extra logging.
mysys/my_malloc.c:
  Added support for my_global_flags
mysys/my_open.c:
  Added support for my_global_flags
mysys/my_pread.c:
  Added support for my_global_flags
mysys/my_read.c:
  Added support for my_global_flags
mysys/my_static.c:
  Added my_global_flags
mysys/my_write.c:
  Added support for my_global_flags
sql/mysqld.cc:
  Set my_global_flags for warning levels 10 & 11
sql/sql_base.cc:
  Don't increment unhandled errors for notes or warnings.
2011-09-02 01:22:34 +03:00
Marko Mäkelä
247ada63af Bug#12547647 UPDATE LOGGING COULD EXCEED LOG PAGE SIZE
This fix was accidentally pushed to mysql-5.1 after the 5.1.59 clone-off in
bzr revision id marko.makela@oracle.com-20110829081642-z0w992a0mrc62s6w
with the fix of Bug#12704861 Corruption after a crash during BLOB update
but not merged to mysql-5.5 and upwards.

In the Barracuda formats, the clustered index record no longer
contains a prefix of off-page columns. Because of this, the undo log
must contain these prefixes, so that purge and multi-versioning will
continue to work. However, this also means that an undo log record can
become too big to fit in an undo log page. (It is a limitation of the
undo log that undo records cannot span across multiple pages.)

In case the checks for undo log size fail when CREATE TABLE or CREATE
INDEX is executed, we need a fallback that blocks a modification
operation when the undo log record would exceed the maximum size.

trx_undo_free_last_page_func(): Renamed from trx_undo_free_page_in_rollback().
Define the trx_t parameter only in debug builds.

trx_undo_free_last_page(): Wrapper for trx_undo_free_last_page_func().
Pass the trx_t parameter only in debug builds.

trx_undo_truncate_end_func(): Renamed from trx_undo_truncate_end().
Define the trx_t parameter only in debug builds. Rewrite a for(;;) loop
as a while loop for clarity.

trx_undo_truncate_end(): Wrapper for from trx_undo_truncate_end_func().
Pass the trx_t parameter only in debug builds.

trx_undo_erase_page_end(): Return TRUE if the page was non-empty
to begin with. Refuse to erase empty pages.

trx_undo_report_row_operation(): If the page for which the undo log
was too big was empty, free the undo page and return DB_TOO_BIG_RECORD.

rb:749 approved by Inaam Rana
2011-09-01 21:48:04 +03:00
Tor Didriksen
3a493ae70f merge 5.1 => 5.5 2011-08-29 11:34:48 +02:00
Tor Didriksen
f610c56587 BUG#12911710 - VALGRIND FAILURE IN ROW-DEBUG:PERFSCHEMA.SOCKET_SUMMARY_BY_INSTANCE_FUNC
Converting the number zero to binary and back yielded the number zero,
but with no digits, i.e. zero precision.
This made the multiply algorithm go haywire in various ways.


include/decimal.h:
  Document struct st_decimal_t
mysql-test/r/type_newdecimal.result:
  New test case (valgrind warnings)
mysql-test/t/type_newdecimal.test:
  New test case (valgrind warnings)
sql/my_decimal.h:
  Remove the HAVE_purify enabled/disabled code.
strings/decimal.c:
  Make a proper zero, with non-zero precision.
2011-08-29 11:24:36 +02:00
Jimmy Yang
95fa7fab3b Fix bug #11830883, SUPPORT "CORRUPTED" BIT FOR INNODB TABLES AND INDEXES.
Also addressed issues in bug #11745133, where we could mark a table
corrupted instead of crashing the server when found a corrupted buffer/page
if the table created with innodb_file_per_table on.
2011-08-16 18:07:59 -07:00
Mats Kindahl
cf5e5f837a Merging into mysql-5.5.16-release. 2011-08-15 20:12:11 +02:00
Alexander Nozdrin
6e5bbf5138 Cherry-picking WL#5710 from mysql-5.5 to mysql-5.5.16-release.
Original revision id:
# revno: 3489 [merge]
# revision-id: tatjana.nuernberg@oracle.com-20110811120945-c6x9a5d2du8s9oj2
# parent: tatjana.nuernberg@oracle.com-20110811112736-so8r813hs8dmf7nr
# parent: chuck.bell@oracle.com-20110810183949-2s9uxcuoux2p668e
# committer: Tatjana Azundris Nuernberg <tatjana.nuernberg@oracle.com>
# branch nick: 55-9
# timestamp: Thu 2011-08-11 13:09:45 +0100
# message:
#   auto-merge

This merge revision also has a patch for Bug 12664445, which has been also
taken to 5.5.16.
2011-08-15 18:29:38 +04:00
Ramil Kalimullin
c7087cd53c Manual merge from mysql-5.1. 2011-08-09 11:42:07 +04:00
Chuck Bell
a38fc8d47e WL#5710 : mysql_plugin - enable or disable plugins
This patch adds a new client utility that enables or disables plugin
features. The utility disables or enables a plugin using values (name,
soname, and symbols) provided via a configuration file by the same name.
For example, to ENABLE the daemon_example plugin, the utility will read
the daemon_example.ini configuration file and use the values contained to
enable or disable the plugin.
2011-07-19 10:17:58 -04:00
Sergei Golubchik
4e46d8e5bf merge with xtradb-5.5.15
fix test cases
2011-07-18 23:04:24 +02:00
Sergei Golubchik
d4d7a8fa62 applied percona patches to InnoDB as of 5.5.15 2011-07-17 11:28:48 +02:00
Tor Didriksen
93915d0d50 merge 5.0-security => 5.1-security 2011-07-15 14:08:14 +02:00
Tor Didriksen
cfcd49b467 Bug#12406055 BUFFER OVERFLOW OF VARIABLE 'BUFF' IN STRING::SET_REAL
The buffer was simply too small.
In 5.5 and trunk, the size is 311 + 31,
in 5.1 and below, the size is 331


client/sql_string.cc:
  Increase buffer size in String::set(double, ...)
include/m_string.h:
  Increase FLOATING_POINT_BUFFER
mysql-test/r/type_float.result:
  New test cases.
mysql-test/t/type_float.test:
  New test cases.
sql/sql_string.cc:
  Increase buffer size in String::set(double, ...)
sql/unireg.h:
  Move definition of FLOATING_POINT_BUFFER
2011-07-15 14:07:38 +02:00
Sergei Golubchik
54ab9ea20f xtradb 5.5.13 2011-07-14 21:22:41 +02:00
Sergei Golubchik
a844635637 use PSI wrappers in aria and other non-MySQL code 2011-07-13 21:10:18 +02:00
Sergei Golubchik
c97f938bcf move authentication_windows_client and mysql_clear_password clear client auth plugins
out of libmysql into separate dynamic plugins in the plugin/ directory.

move dialog and auth_socket plugins out of the plugin directory with examples into
dedicated directories in plugin/
2011-07-12 14:34:47 +02:00
Luis Soares
624ed50ef3 BUG#12695969
Manually merged from mysql-5.0 into mysql-5.1.

conflicts
=========

include/Makefile.am
2011-07-12 02:13:36 +01:00
Luis Soares
b9dd956ab4 BUG#12695969
Follow-up patch that adds the newly added header file to
Makefile.am noinst_HEADERS.
2011-07-12 02:10:28 +01:00
Luis Soares
25df755040 BUG#12695969
Manually merged from mysql-5.1:

  - fixed mysqlbinlog copyright year: 2001 --> 2000
  - fixed address in license header

conflicts
=========

 - client/mysqlbinlog.cc
 - include/welcome_copyright_notice.h
2011-07-11 17:19:56 +01:00
Luis Soares
e018925a64 BUG#12695969
Manually merged mysql-5.0 into mysql-5.1.

conflicts
=========
client/mysqlibinlog.cc
2011-07-11 17:13:27 +01:00
Luis Soares
686182b273 BUG#12695969: FIX OUTDATED COPYRIGHT NOTICES IN REPLACTION
CLIENT TOOLS
      
The fix is to backport part of revision:
        
  - alexander.nozdrin@oracle.com-20101006150613-ls60rb2tq5dpyb5c
      
from mysql-5.5. In detail, we add the oracle welcome notice
header file proposed in the original patch and include/use it
in client/mysqlbinlog.cc, replacing the existing and obsolete
notice.
2011-07-11 17:11:41 +01:00
Sergei Golubchik
172f5e28ba add safemalloc back
... but differently

client/mysqltest.cc:
  my_safe_print_str() don't append \n anymore
dbug/dbug.c:
  restore safemalloc as a part of dbug suite
dbug/user.r:
  restore 'S' flag documentation
include/my_dbug.h:
  restore safemalloc as a part of dbug suite
include/my_sys.h:
  move valgrind defines to a dedicated header
mysys/my_malloc.c:
  use new safemalloc
mysys/stacktrace.c:
  don't append \n. let the calller do it, if needed
sql/mysqld.cc:
  my_safe_print_str() don't append \n anymore
2011-07-10 19:55:54 +02:00
Sergei Golubchik
02b8232629 small dbug cleanup 2011-07-10 19:50:29 +02:00
Sergei Golubchik
a00b384934 remove remnants of safemalloc and
very old halloca() support
2011-07-10 19:49:28 +02:00
Vladislav Vaintroub
7ff45c1379 merge 2011-07-10 13:41:30 +02:00
Vladislav Vaintroub
46465327e7 merge 2011-07-10 13:39:37 +02:00
Vladislav Vaintroub
3d4ff9a239 Post-fix for LP808233 : replace uint with "unsigned int" in mysql.h.pp, too 2011-07-10 13:38:15 +02:00
Vladislav Vaintroub
066fb9d289 merge 2011-07-10 13:01:00 +02:00
Vladislav Vaintroub
3b393c929b Fix LPBUG#808233 - undefined uint in typelib.h 2011-07-10 12:48:13 +02:00
Vladislav Vaintroub
d25f8cdc55 LPBUG#808233: Undefined uint in typelib.h
Fix is to replace uint in public header with unsigned int.  uint is not guaranteed to be defined by system headers.
2011-07-10 12:27:42 +02:00
Georgi Kodinov
21d088e44a merge mysql-5.1->mysql-5.5 2011-07-07 12:42:14 +03:00
unknown
7d605ec45f Merge from mysql-5.5.14-release 2011-07-06 01:13:50 +02:00
Vladislav Vaintroub
f9cb1467b8 merge Windows performance patches into 5.3 2011-07-05 21:46:53 +02:00
Kent Boortz
027b5f1ed4 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
Michael Widenius
ec3c26a515 Fixed compilation & test issues found by buildbot
include/Makefile.am:
  Added missing \
mysql-test/mysql-test-run.pl:
  Suppress warning when ha_archive is not compiled
mysql-test/r/variables-big.result:
  Updated results
2011-07-02 17:37:59 +03:00
Michael Widenius
3c78bfe7f1 Added progress reporting for alter table, LOAD DATA INFILE and for aria tables: check table, repair table, analyze table.
- The client gets a progress report message that triggers a callback function if requested with mysql_options(MYSQL_PROGRESS_CALLBACK, function)
- Added Progress field last to 'show processlist'
- Stage, Max_stage and Progress field added to information_schema.progresslist
- The 'mysql' client by defaults enables progress reports when the output is a tty.
- Added progress_report_time time variable to configure how often progress reports is sent to client
Added read only system variable 'in_transaction' which is 1 if we have executed a BEGIN statement.


client/client_priv.h:
  Added OPT_REPORT_PROGRESS
client/mysql.cc:
  Added option --progress-reports (on by default if not batch mode)
  Progress reports is written to stdout for long running commands
include/Makefile.am:
  Added mysql/service_progress_report.h
include/myisamchk.h:
  Added variables to be able to do progress reporting in Aria and later in MyISAM
include/mysql.h:
  Added new mysql_options() parameter: MYSQL_PROGRESS_CALLBACK
include/mysql.h.pp:
  Added new mysql_options() parameter: MYSQL_PROGRESS_CALLBACK
include/mysql/plugin.h:
  Added functions for reporting progress.
include/mysql/plugin_auth.h.pp:
  Added functions for reporting progress.
include/mysql_com.h:
  Added CLIENT_PROGRESS mysql_real_connect() flag.
include/sql_common.h:
  Added callback function for reporting progress
mysql-test/r/old-mode.result:
  Ensure that SHOW PROGRESSLIST doesn't have the Progress column in old mode.
mysql-test/suite/funcs_1/datadict/datadict_priv.inc:
  Added new column
mysql-test/suite/funcs_1/datadict/processlist_priv.inc:
  Test all new PROCESSLIST columns
mysql-test/suite/funcs_1/r/is_columns_is.result:
  Updated results
mysql-test/suite/funcs_1/r/is_columns_is_embedded.result:
  Updated results
mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result:
  Updated results
mysql-test/suite/funcs_1/r/is_tables_is_embedded.result:
  Updated results
mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result:
  Updated results
mysql-test/suite/funcs_1/r/processlist_priv_ps.result:
  Updated results
mysql-test/suite/funcs_1/r/processlist_val_no_prot.result:
  Updated results
mysql-test/suite/funcs_1/r/processlist_val_ps.result:
  Updated results
mysql-test/suite/pbxt/r/pbxt_locking.result:
  Updated results
mysql-test/suite/pbxt/r/skip_name_resolve.result:
  Updated results
mysql-test/t/old-mode.test:
  Ensure that SHOW PROGRESSLIST doesn't have the Progress column in old mode.
plugin/handler_socket/handlersocket/Makefile.am:
  Added -lmysqlservices
scripts/mytop.sh:
  Made 'State' field width dynamic.
  Added 'Progress' to process list display.
sql-common/client.c:
  Added handling of progress messages.
  Removed check_license() function.
sql/mysql_priv.h:
  Added opt_progress_report_time
sql/mysqld.cc:
  Added progress_report_time time variable to configure how often progress reports is sent to client
sql/protocol.cc:
  Added net_send_progress_packet()
sql/protocol.h:
  New prototypes
sql/set_var.cc:
  Added variables progress_report_time and in_transaction
sql/sql_acl.cc:
  Safety fix: Made client_capabilities ulonglong
sql/sql_class.cc:
  Added interface functions for progress reporting
sql/sql_class.h:
  Added varibles in THD for progress reporting.
  Added CF_REPORT_PROGRESS
sql/sql_load.cc:
  Added progress reporting for LOAD DATA INFILE
sql/sql_parse.cc:
  Added CF_REPORT_PROGRESS for top level commands for which it's safe to send progress reports to client
sql/sql_show.cc:
  Added Progress field last to 'show processlist'
  Stage, Max_stage and Progress field added to information_schema.progresslist
sql/sql_table.cc:
  Added progress reporting for ALTER TABLE
  Added THD as argument to copy_data_between_tables()
storage/maria/ha_maria.cc:
  Added progress reporting for check table, repair table, analyze table
  Fixed a bug in start_bulk_insert() that caused alter table to always run with all keys enabled.
storage/maria/ma_check.c:
  Added progress reporting
  Remember old state before starting repair. This removes some warnings from optimize_table if create-with-sort fails.
storage/maria/ma_check_standalone.h:
  Added dummy reporting function for standalone Aria programs.
storage/maria/ma_sort.c:
  Added progress reporting
storage/maria/maria_chk.c:
  Updated version
storage/maria/maria_def.h:
  Added new prototypes
tests/mysql_client_test.c:
  Added test case for progress reporting
2011-07-01 15:08:30 +03:00
Kent Boortz
bb3723835e Updated/added copyright headers 2011-06-30 21:27:04 +02:00
Kent Boortz
68f00a5686 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
Georgi Kodinov
ca57b15b42 Bug #12633140 : AUDIT PLUGIN SOURCE FILES HAVE OUT OF DATE
COPYRIGHT NOTICE

Fixed copyright headers of updated files.
2011-06-13 15:08:28 +03:00
Vladislav Vaintroub
532784a09b merge 2011-06-12 16:26:43 +02:00
Vladislav Vaintroub
fe054adfca Backport fix for MySQL bug #56405 :
use native windows condition variables and rwlocks in mysys, if Windows supports it.
2011-06-12 16:09:28 +02:00
Vladislav Vaintroub
4171483b53 Backport Fix for Bug#24509 - 2048 file descriptor limit on windows needs increasing.
The patch replaces the use of the POSIX I/O interfaces in mysys on Windows with 
the Win32 API calls (CreateFile, WriteFile, etc). The Windows HANDLE for the open
 file is stored in the my_file_info struct, along with a flag for append mode 
(because the Windows API does not support opening files in append mode in all cases)
The default max open files has been increased to 16384 and can be increased further
by setting --max-open-files=<value> during the server start.

Noteworthy benefit of this patch is that it removes limits from the table_cache size - 
allowing for more simultaneus users
2011-06-12 15:52:07 +02:00
Sergei Golubchik
f1a5c49c4e various fixes for buildbot failures 2011-06-10 15:42:55 +02:00
Sergei Golubchik
9b98cae4cc merge with 5.1-micro 2011-06-07 18:13:02 +02:00
Sergei Golubchik
4d128777dd revert a suggested "optimization" that introduced a bug
compilation error in mysys/my_getsystime.c fixed
some redundant code removed
sec_to_time, time_to_sec, from_unixtime, unix_timestamp, @@timestamp now
  use decimal, not double for numbers with a fractional part.
purge_master_logs_before_date() fixed
many bugs in corner cases fixed

mysys/my_getsystime.c:
  compilation failure fixed
sql/sql_parse.cc:
  don't cut corners. it backfires.
2011-06-06 20:28:15 +02:00
Sergey Vojtovich
95963dd20a BUG#12611785 - AUDIT INTERFACE STRICT-ALIASING WARNINGS
The types mysql_event_general/mysql_event_connection are
being cast to the incompatible type mysql_event. The way
mysql_event and the other types are designed are prone to
strict aliasing violations and can break things depending
on how compilers optimizes this code.

This patch fixes audit interface, so it confirms to strict-
aliasing rules. It introduces incompatible changes to audit
interface:
- mysql_event type has been removed;
- event_class has been removed from mysql_event_generic and
  mysql_event_connection types;
- st_mysql_audit::event_notify() second argument is event_class;
- st_mysql_audit::event_notify() third argument is event of type
  (const void *).

"Writing Audit Plugins" section of manual should be updated:
http://dev.mysql.com/doc/refman/5.5/en/writing-audit-plugins.html

include/mysql/plugin_audit.h:
  event_class has been moved out of mysql_event types.
include/mysql/plugin_audit.h.pp:
  event_class has been moved out of mysql_event types.
plugin/audit_null/audit_null.c:
  event_class has been moved out of mysql_event types.
sql/sql_audit.cc:
  event_class has been moved out of mysql_event types.
2011-06-03 11:27:11 +04:00
Igor Babaev
6dab04bda0 Merge. 2011-06-01 20:49:37 -07:00
Jimmy Yang
9e2b7fa7d5 Implement worklog #5743 InnoDB: Lift the limit of index key prefixes.
With this change, the index prefix column length lifted from 767 bytes
to 3072 bytes if "innodb_large_prefix" is set to "true".

rb://603 approved by Marko
2011-05-31 02:12:32 -07:00
Vladislav Vaintroub
b519f2b626 Fix compile errors and warnings and test errors introduced by microseconds push.
Also, change windows timespec definition to be Unix-ish - simplifies handling a lot.
2011-05-28 16:57:58 +02:00
Michael Widenius
f197991f41 Merge with 5.1-microseconds
A lot of small fixes and new test cases.

client/mysqlbinlog.cc:
  Cast removed
client/mysqltest.cc:
  Added missing DBUG_RETURN
include/my_pthread.h:
  set_timespec_time_nsec() now only takes one argument
mysql-test/t/date_formats.test:
  Remove --disable_ps_protocl as now also ps supports microseconds
mysys/my_uuid.c:
  Changed to use my_interval_timer() instead of my_getsystime()
mysys/waiting_threads.c:
  Changed to use my_hrtime()
sql/field.h:
  Added bool special_const_compare() for fields that may convert values before compare (like year)
sql/field_conv.cc:
  Added test to get optimal copying of identical temporal values.
sql/item.cc:
  Return that item_int is equal if it's positive, even if unsigned flag is different.
  Fixed Item_cache_str::save_in_field() to have identical null check as other similar functions
  Added proper NULL check to Item_cache_int::save_in_field()
sql/item_cmpfunc.cc:
  Don't call convert_constant_item() if there is nothing that is worth converting.
  Simplified test when years should be converted
sql/item_sum.cc:
  Mark cache values in Item_sum_hybrid as not constants to ensure they are not replaced by other cache values in compare_datetime()
sql/item_timefunc.cc:
  Changed sec_to_time() to take a my_decimal argument to ensure we don't loose any sub seconds.
  Added Item_temporal_func::get_time() (This simplifies some things)
sql/mysql_priv.h:
  Added Lazy_string_decimal()
sql/mysqld.cc:
  Added my_decimal constants max_seconds_for_time_type, time_second_part_factor
sql/table.cc:
  Changed expr_arena to be of type CONVENTIONAL_EXECUTION to ensure that we don't loose any items that are created by fix_fields()
sql/tztime.cc:
  TIME_to_gmt_sec() now sets *in_dst_time_gap in case of errors
  This is needed to be able to detect if timestamp is 0
storage/maria/lockman.c:
  Changed from my_getsystime() to set_timespec_time_nsec()
storage/maria/ma_loghandler.c:
  Changed from my_getsystime() to my_hrtime()
storage/maria/ma_recovery.c:
  Changed from my_getsystime() to mmicrosecond_interval_timer()
storage/maria/unittest/trnman-t.c:
  Changed from my_getsystime() to mmicrosecond_interval_timer()
storage/xtradb/handler/ha_innodb.cc:
  Added support for new time,datetime and timestamp
unittest/mysys/thr_template.c:
  my_getsystime() -> my_interval_timer()
unittest/mysys/waiting_threads-t.c:
  my_getsystime() -> my_interval_timer()
2011-05-28 05:11:32 +03:00
Davi Arnaut
0509883160 BUG 11763056 - 55721: AIX 5.1.50 build failing, cannot locate bzero
The problem is that although AIX implements bzero, its prototype
is not declared by default. Since AC_CHECK_FUNC(bzero) succeeds
even though a prototype is not declared, this breaks compilation
in C++ files where a prototype is required.

The solution is to only use bzero if a prototype is also declared.

configure.in:
  Check if bzero is declared. No need to specify the includes,
  unisted.h and strings.h are already part of AC_INCLUDES_DEFAULT.
2011-05-27 08:09:25 -03:00
Tatjana Azundris Nuernberg
e1b79597f6 auto-merge Bug#11745920 2011-05-26 13:33:21 +01:00
Igor Babaev
deb3b9a174 Downported InnoDB support of Index Condition Pushdown from MySQL-5.6 code line. 2011-05-25 16:01:56 -07:00