Commit graph

2556 commits

Author SHA1 Message Date
Kent Boortz
ea19feebda Move DBG_* macros to after the variable declaration section in a
block, might expand to function calls (Bug#48331)
2009-11-25 16:48:29 +01:00
Vladislav Vaintroub
53cc3b7bf8 merge 2009-11-25 15:20:14 +01:00
Alexander Nozdrin
4b28a6ce84 Auto-merge from mysql-next-mr. 2009-11-25 16:46:45 +03:00
Alexander Nozdrin
2fa93b849d Auto-merge (pull) from mysql-next-mr. 2009-11-26 11:46:29 +03:00
Alexander Nozdrin
a8d553e0e3 Manual merge/pull from mysql-next-mr.
Conflicts:
  - sql/sql_insert.cc
2009-11-25 18:03:05 +03:00
Vladislav Vaintroub
2f3e777797 add --disable-shared equivalent
fix mtr (empty argument passed to mysqld)
2009-11-25 05:13:51 +01:00
Vladislav Vaintroub
a3e391dd3c merge 2009-11-25 01:50:10 +01:00
Marc Alff
6e01be7552 WL#2373 Use cycle counter for timing 2009-11-24 16:36:31 -07:00
Vladislav Vaintroub
afe4ee1e17 implement convenience libraries 2009-11-24 23:15:47 +00:00
Alexander Nozdrin
0a9d4e675a Auto-merge from mysql-next-mr. 2009-11-24 22:39:05 +03:00
Luis Soares
799333b590 BUG#42150: binlog_start_comment.test failed: Error writing file 'UNOPENED'
NOTE: backporting BUG#42150 into next-mr
      Includes latest Andrei's patch (see [2 Feb 18:40] Bugs System)
      and merge.test post-push fix (see [3 Feb 18:04] Bugs System)

The reason of the bug appeared to be overreacting on absense of a
binlog file although the file name had been presented in in the master
binlog index file.
By convention, there should have been only a warning printed and the rest of
`reset master' logics completed.  This did not happen on windows
due to incorrect value of my_errno returned from nt_share_delete().
      
Fixed with correcting my_errno assignment in nt_share_delete() to be ENOENT in 
he event of no binlog file. Some minor refactoring has been made.
2009-11-24 15:00:08 +00:00
Konstantin Osipov
4cff617c25 Backport of:
----------------------------------------------------------------------
ChangeSet@1.2571, 2008-04-08 12:30:06+02:00, vvaintroub@wva. +122 -0
  Bug#32082 : definition of VOID in my_global.h conflicts with Windows
  SDK headers
  
  VOID macro is now removed. Its usage is replaced with void cast.
  In some cases, where cast does not make much sense (pthread_*, printf, 
  hash_delete, my_seek), cast is ommited.
2009-11-24 16:54:59 +03:00
Alexey Kopytov
f16b372b37 Manual merge from the mysql-5.1-bugteam. 2009-11-24 11:31:36 +03:00
Alexey Kopytov
acf5330ab8 Manual merge from the mysql-5.1-bugteam. 2009-11-24 11:19:06 +03:00
Konstantin Osipov
26cd9abe4f A follow up for the fix for Bug#35164 (remove priorities on Windows). 2009-11-23 20:08:37 +03:00
Konstantin Osipov
7edfae4e86 Backport of:
-------------------------------------------------------------
revno: 2877
committer: Davi Arnaut <Davi.Arnaut@Sun.COM>
branch nick: 35164-6.0
timestamp: Wed 2008-10-15 19:53:18 -0300
message:
Bug#35164: Large number of invalid pthread_attr_setschedparam calls
Bug#37536: Thread scheduling causes performance degradation at low thread count
Bug#12702: Long queries take 100% of CPU and freeze other applications under Windows

The problem is that although having threads with different priorities
yields marginal improvements [1] in some platforms [2], relying on some
statically defined priorities (QUERY_PRIOR and WAIT_PRIOR) to play well
(or to work at all) with different scheduling practices and disciplines
is, at best, a shot in the dark as the meaning of priority values may
change depending on the scheduling policy set for the process.

Another problem is that increasing priorities can hurt other concurrent
(running on the same hardware) applications (such as AMP) by causing
starvation problems as MySQL threads will successively preempt lower
priority processes. This can be evidenced by Bug#12702.

The solution is to not change the threads priorities and rely on the
system scheduler to perform its job. This also enables a system admin
to increase or decrease the scheduling priority of the MySQL process,
if intended.

Furthermore, the internal wrappers and code for changing the priority
of threads is being removed as they are now unused and ancient.

1. Due to unintentional side effects. On Solaris this could artificially
help benchmarks as calling the priority changing syscall millions of
times is more beneficial than the actual setting of the priority.

2. Where it actually works. It has never worked on Linux as the default
scheduling policy SCHED_OTHER only accepts the static priority 0.
2009-11-23 19:57:31 +03:00
Georgi Kodinov
b75392782c Additional fix for bug #45613: handle failures from my_hash_insert
Testing for presence of stuff in a hash inside the function
that's filling in the hash creates chicken-and-egg type of problems.
This results in test suite failures in mysql-pe in debug mode and 
adds bad initialization dependency in 5.1.
Fixed by removing the debug code.
2009-11-23 17:32:10 +02:00
Alexander Nozdrin
828e2ddc43 Auto-merge from mysql-next-mr. 2009-11-23 17:09:36 +03:00
Kristofer Pettersson
8e80deb52f merge 2009-11-20 21:56:43 +01:00
Mikael Ronstrom
6e02272abb WL#5105, review fix 2009-11-20 20:01:43 +01:00
Mikael Ronstrom
202553ae7b WL#5137, Remove hash calculation from LOCK_open in open_table 2009-11-20 19:27:54 +01:00
Mikael Ronstrom
5a1ac83326 WL#5105, Optimize ptr_cmp on Solaris by using memcmp instead of native ptr_cmp 2009-11-20 18:53:56 +01:00
Marc Alff
22de5f4b1e Merge mysql-next-mr (revno 2923) --> mysql-next-mr-marc 2009-11-20 09:23:13 -07:00
Vladislav Vaintroub
134d5e3a31 merge 2009-11-20 16:41:07 +01:00
Kristofer Pettersson
3771d623b1 Bug#45613 handle failures from my_hash_insert
Not all my_hash_insert() calls are checked for return value.

This patch adds appropriate checks and failure responses
where needed.
2009-11-20 16:18:01 +01:00
Konstantin Osipov
d51a4fae32 Merge with next-mr 2009-11-20 17:18:37 +03:00
Georgi Kodinov
fe9341129b merge 2009-11-20 15:39:15 +02:00
Davi Arnaut
ecb6228c62 Manual merge of mysql-next-mr-runtime upstream. 2009-11-19 21:48:08 -02:00
Marc Alff
1848b862e1 Port the unit test framework to windows
Backport from 6.0.14 to 5.6.0

Original code from Guilhem Bichot
2009-11-17 21:29:26 -07:00
Marc Alff
3ff74fb5fa WL#3230 concurrent hash
Backport from 6.0.14 to 5.6.0

Original code from Sergei Golubchik
2009-11-17 19:31:40 -07:00
Marc Alff
1e46d6a032 WL#2595 kernel-independent atomic operations
Backport from 6.0.14 to 5.6.0

Original code from Sergei Golubchik
2009-11-17 17:11:32 -07:00
Alexey Botchkov
12043816fa merging. 2009-11-17 15:27:40 +04:00
Vladislav Vaintroub
2925dcd169 automerge 2009-11-13 13:26:16 +01:00
Davi Arnaut
a7bbc779ae Backport of Bug#15192 to mysql-next-mr
------------------------------------------------------------
revno: 2597.4.17
revision-id: sp1r-davi@mysql.com/endora.local-20080328174753-24337
parent: sp1r-anozdrin/alik@quad.opbmk-20080328140038-16479
committer: davi@mysql.com/endora.local
timestamp: Fri 2008-03-28 14:47:53 -0300
message:
  Bug#15192 "fatal errors" are caught by handlers in stored procedures

  The problem is that fatal errors (e.g.: out of memory) were being
  caught by stored procedure exception handlers which could cause
  the execution to not be stopped due to a continue handler.

  The solution is to not call any exception handler if the error is
  fatal and send the fatal error to the client.
2009-11-10 18:31:28 -02:00
Mikael Ronstrom
1edf7e71fe Review comments for LOCK_open patch 2009-11-10 15:09:44 +01:00
Alexander Nozdrin
dadf820743 Auto-merge from mysql-next-mr. 2009-11-10 10:31:33 +03:00
Vladislav Vaintroub
13cd7170cc WL#5161 : Cross-platform build with CMake 2009-11-09 12:32:48 +01:00
Andrei Elkin
69d6fcbd3b merging 5.1 main -> rpl+2. Some manual work required mostly due to bug46640 2009-11-06 18:35:04 +02:00
Alexander Nozdrin
2ca5b2c791 Manual merge from mysql-trunk-merge. 2009-11-06 17:20:27 +03:00
timothy.smith@sun.com
76903202dd Use C comments in C code 2009-11-05 21:22:17 +01:00
Alexander Nozdrin
411a6bfeb9 Auto-merge from mysql-next-mr. 2009-11-05 15:08:37 +03:00
Alexander Nozdrin
5ae8ae3a8e Manual merge from mysql-5.1. 2009-11-05 12:20:41 +03:00
Magne Mahre
6e916e03bd Bug#35224: mysqldump --help is very confusing
The presence of "--skip" parameters is obscure, when it should be
obvious from the text.
  
Now, for boolean options, when they're default to ON and the --skip
is more useful parameter, then tell the user of its existence.

Backported from 6.0-codebase, revid  2572.14.1
2009-11-03 10:22:22 +01:00
Sergei Golubchik
d101d144df WL#4903 Plugin Service API part I
(mysql-next-mr backport)
2009-11-02 21:05:42 +01:00
Alexander Nozdrin
8c95f3c53b Manual merge from mysql-next-mr. 2009-11-02 14:10:04 +03:00
Sergei Golubchik
6eaf0b5acb backport of dbug extensions from 6.0:
function/ syntax
  glob(7) wildcards
  unit tests
2009-10-30 19:13:58 +01:00
Alexander Nozdrin
ac7ba1bcaa Merge from mysql-next-mr. 2009-10-28 10:55:44 +03:00
Tatiana A. Nurnberg
2f069a2c9b Bug#46586: When using the plugin interface the type "set" for options caused a crash.
"What do you mean, there's a bug? There isn't even code!"

There was some token code for plug-in variables of the SET type,
but clearly this never worked, or was subject to massive bit rot
since. Bug-fixes ... fail-safes ... tests -- fais au mieux, mon chou!
2009-10-27 06:16:02 -07:00
Kristofer Pettersson
bda3647e62 Bug#46043 mysqld --skip-innodb does not skip InnoDB
The prefix --skip- didn't work on 64 bit big endian machines
because of how the value pointer was casted.
2009-11-09 23:28:31 +01:00
Alexander Nozdrin
c6aeab8cfe Automerge from mysql-next-mr. 2009-10-27 12:59:09 +03:00
Dmitry Lenev
dfa2acb141 Fix for bug #45143 "All connections hang on concurrent ALTER TABLE".
Concurrent execution of statements which require non-table-level
write locks on several instances of the same table (such as
SELECT ... FOR UPDATE which uses same InnoDB table twice or a DML
statement which invokes trigger which tries to update same InnoDB
table directly and through stored function) and statements which
required table-level locks on this table (e.g. LOCK TABLE ... WRITE,
ALTER TABLE, ...) might have resulted in a deadlock.

The problem occured when a thread tried to acquire write lock
(TL_WRITE_ALLOW_WRITE) on the table but had to wait since there was
a pending write lock (TL_WRITE, TL_WRITE_ALLOW_READ) on this table
and we failed to detect that this thread already had another instance
of write lock on it (so in fact we were trying to acquire recursive
lock) because there was also another thread holding write lock on the
table (also TL_WRITE_ALLOW_WRITE). When the latter thread released
its lock neither the first thread nor the thread trying to acquire
TL_WRITE/TL_WRITE_ALLOW_READ were woken up (as table was still write
locked by the first thread) so we ended up with a deadlock.

This patch solves this problem by ensuring that thread which
already has write lock on the table won't wait when it tries
to acquire second write lock on the same table.
2009-10-26 22:38:03 +03:00
Alexander Nozdrin
069d78c067 Merge from mysql-next-mr. 2009-10-23 15:22:21 +04:00
Luis Soares
58e2fde011 manual merge: mysql-5.1-rep+2-delivery1 --> mysql-5.1-rpl-merge
Conflicts
=========

Text conflict in .bzr-mysql/default.conf
Text conflict in libmysqld/CMakeLists.txt
Text conflict in libmysqld/Makefile.am
Text conflict in mysql-test/collections/default.experimental
Text conflict in mysql-test/extra/rpl_tests/rpl_row_sp006.test
Text conflict in mysql-test/suite/binlog/r/binlog_tmp_table.result
Text conflict in mysql-test/suite/rpl/r/rpl_loaddata.result
Text conflict in mysql-test/suite/rpl/r/rpl_loaddata_fatal.result
Text conflict in mysql-test/suite/rpl/r/rpl_row_create_table.result
Text conflict in mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result
Text conflict in mysql-test/suite/rpl/r/rpl_stm_log.result
Text conflict in mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result
Text conflict in mysql-test/suite/rpl_ndb/r/rpl_ndb_sp006.result
Text conflict in mysql-test/t/mysqlbinlog.test
Text conflict in sql/CMakeLists.txt
Text conflict in sql/Makefile.am
Text conflict in sql/log_event_old.cc
Text conflict in sql/rpl_rli.cc
Text conflict in sql/slave.cc
Text conflict in sql/sql_binlog.cc
Text conflict in sql/sql_lex.h
21 conflicts encountered.

NOTE
====
 mysql-5.1-rpl-merge has been made a mirror of mysql-next-mr:
 - "mysql-5.1-rpl-merge$ bzr pull ../mysql-next-mr"

 This is the first cset (merge/...) committed after pulling 
 from mysql-next-mr.
2009-10-22 23:30:28 +01:00
Alexander Barkov
344ddc85fa Merging mysql-next-mr-merge to mysql-next-mr. 2009-10-21 15:48:22 +05:00
Alexander Nozdrin
3fd2f50b6c Merge from mysql-trunk-merge. 2009-10-19 17:36:19 +04:00
Alexander Nozdrin
b930b18ec3 Merge from mysql-5.1. 2009-10-19 17:28:31 +04:00
Alexander Nozdrin
f3457a73d6 Merge from mysql-5.1. 2009-10-19 17:17:08 +04:00
Joerg Bruehe
5c95f2363a Upmerge the Windows compile fix from 5.0 to 5.1 2009-10-16 15:05:52 +02:00
Joerg Bruehe
0e5dd3712a Upmerge a Windows compile fix from 5.0 to 5.1. 2009-10-16 14:21:20 +02:00
Joerg Bruehe
9ceeabd9b2 Compile fix for Windows:
Use "#ifdef", not plain "#if".
2009-10-16 14:06:33 +02:00
Sergey Glukhov
7741d9b50d WL#751 Error message construction, backport 2009-10-15 17:23:43 +05:00
Alexander Barkov
f8a54c72ff Backporting WL#4164 Two-byte collation IDs 2009-10-15 15:17:32 +05:00
Konstantin Osipov
64dbe379d7 Backport of:
----------------------------------------------------------
revno: 2617.22.5
committer: Konstantin Osipov <kostja@sun.com>
branch nick: mysql-6.0-runtime
timestamp: Tue 2009-01-27 05:08:48 +0300
message:
  Remove non-prefixed use of HASH.
  Always use my_hash_init(), my_hash_inited(), my_hash_search(),
  my_hash_element(), my_hash_delete(), my_hash_free() rather
  than non-prefixed counterparts (hash_init(), etc).
  Remove the backward-compatible defines.
2009-10-14 20:37:38 +04:00
Konstantin Osipov
a1fbd5e0c3 Backport of:
----------------------------------------------------------
revno: 2630.22.39
committer: Konstantin Osipov <kostja@sun.com>
branch nick: mysql-6.0-runtime
timestamp: Wed 2008-10-08 23:44:34 +0400
message:
  Bug #34481 A typo in HugeTLB error Message.
2009-10-14 17:52:13 +04:00
Alexander Nozdrin
ca08f10ccd Manual merge from mysql-trunk-merge. 2009-10-14 12:25:39 +04:00
Alexander Nozdrin
32e51de7f5 Merge from mysql-5.1. 2009-10-14 11:17:49 +04:00
Alexander Nozdrin
0f51423532 Merge from mysql-5.1. 2009-10-13 13:42:38 +04:00
Alexey Botchkov
de7619823d Bug#47216 programs should quit if the file specified by --defaults-file option isn't found
added code to exit a tool if the forced config file wasn't found

per-file comments:
  client/mysql.cc
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysql_upgrade.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqladmin.cc
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqlcheck.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqldump.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqlimport.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqlshow.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqlslap.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  mysql-test/t/mysql.test
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
   test added
  sql/mysqld.cc
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  storage/myisam/myisamchk.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  storage/myisam/myisampack.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
2009-10-09 19:44:22 +05:00
Joerg Bruehe
7a69adf492 Upmerge (automerge) into 5.1 2009-10-09 15:21:45 +02:00
Alexander Nozdrin
84510f0375 Merge from mysql-next-mr. 2009-10-09 17:09:16 +04:00
Mikael Ronstrom
5e7733bc18 A minor change to MySQL's hash where calculation of hash can be done separately to avoid doing it under contended mutex locks 2009-10-09 14:22:22 +02:00
Joerg Bruehe
5184530308 Fix bug#47923 New "mf_keycache.c" requires thread support
The bug is a compilation issue:
Function "find_key_block()" had thread operations
which were not guarded by "#if THREAD", add that now.
2009-10-08 21:58:17 +02:00
Alexander Nozdrin
f4d27e81bb Merge from mysql-next-mr. 2009-10-08 11:42:38 +04:00
Magnus Blåudd
b64dbeed6e Bug#47857 strip_sp function in mysys/mf_strip.c never used and cause name clash
- Remove mf_strip.c and the declaration of 'strip_sp'
2009-10-06 13:04:51 +02:00
Alexander Barkov
a16a82d4eb Bsckporting WL#3764 Sinhala Collation
modified:
  mysql-test/r/ctype_utf8.result
  mysql-test/t/ctype_utf8.test
  mysys/charset-def.c
  strings/ctype-uca.c
2009-10-06 15:34:49 +05:00
Kristofer Pettersson
499121a080 Automerg 2009-10-06 09:40:30 +02:00
Kristofer Pettersson
dfed28e750 Bug#47768 pthread_cond_timedwait() is broken on windows
The pthread_cond_wait implementations for windows might
dead lock in some rare circumstances.

1) One thread (I) enter a timed wait and at a point in
   time ends up after mutex unlock and before
   WaitForMultipleObjects(...)
2) Another thread (II) enters pthread_cond_broadcast.
   Grabs the mutex and discovers one waiter. It set
   the broadcast event and closes the broadcast gate
   then unlocks the mutex.
3) A third thread (III) issues a pthread_cond_signal.
   It grabs the mutex, discovers one waiter, sets the
   signal event then unlock the mutex.
4) The first threads (I) enters WaitForMultipleObjects
   and finds out that the signal object is in a
   signalled state and exits the wait.
5) Thread (I) grabs the mutex and checks result status.
   The number of waiters is decreased and becomes equal
   to 0. The event returned was a signal event so the
   broadcast gate isn't opened. The mutex is released.
6) Thread (II) issues a new broadcast. The mutex is
   acquired but the number of waiters are 0 hence
   the broadcast gate remains closed.
7) Thread (I) enters the wait again but is blocked by
   the broadcast gate.

      This fix resolves the above issue by always resetting
      broadcast gate when there are no more waiters in th queue.
2009-10-06 09:38:44 +02:00
Georgi Kodinov
db35fb7961 automerge 2009-10-04 12:15:05 +03:00
Alexander Nozdrin
8e0204fb58 Merge from mysq-next-mr-wtf. 2009-10-02 16:14:59 +04:00
He Zhenxing
b92d459d11 Backport post fix compiler warnings and test failures for BUG#25192 BUG#12190 2009-10-02 16:40:06 +08:00
He Zhenxing
86c36aa1fd Backport BUG#25192 Using relay-log and relay-log-index without values produces unexpected results.
Options loaded from config files were added before command line
arguments, and they were parsed together, which could interprete
the following:
option-a
option-b
as --option-a=--option-b if 'option-a' requires a value, and 
caused confusing.

Because all options that requires a value are always given in
the form '--option=value', so it's an error if there is no 
'=value' part for such an option read from config file.

This patch added a separator to separate the arguments from 
config files and that from command line, so that they can be
handled differently. And report an error for options loaded
from config files that requires a value and is not given in the
form '--option=value'.
2009-10-02 16:25:53 +08:00
Ingo Struewing
0c522f7453 auto-merge 2009-10-01 15:54:11 +02:00
Joerg Bruehe
de0285a2e5 Merge "trunk-build" up into "next-mr". 2009-09-30 22:31:22 +02:00
Vladislav Vaintroub
6e6b84fd02 backport of
Revision: 
2597.72.1 revid:sp1r-Reggie@core.-20080403153947-15243
removed instances of __NT__ from code. We now only build "NT" binaries
2009-09-30 22:10:22 +02:00
Vladislav Vaintroub
9cf8d12c85 Backport of this changeset
http://lists.mysql.com/commits/59686

Cleanup pthread_self(), pthread_create(), pthread_join() implementation on Windows.
Prior implementation is was unnecessarily complicated and even differs in embedded
and non-embedded case.
      
Improvements in this patch:
* pthread_t is now the unique thread ID, instead of HANDLE returned by beginthread
      
This simplifies pthread_self() to be just straight GetCurrentThreadId().
prior it was much  art involved in passing the beginthread() handle from the caller
to the TLS structure in the child thread ( did not work for the main thread of
course)
      
* remove MySQL specific my_thread_init()/my_thread_end() from pthread_create.
No automagic is done on Unix on pthread_create(). Having the same on Windows will 
improve portability and avoid extra #ifdef's
      
* remove redefinition of getpid() - it was defined as GetCurrentThreadId()
2009-09-30 17:40:12 +02:00
Vladislav Vaintroub
2801599323 Backport http://lists.mysql.com/commits/57778
2677 Vladislav Vaintroub	2008-11-04
CMakeLists.txt files cleanup
- remove SAFEMALLOC and SAFE_MUTEX definitions that were 
present in *each* CMakeLists.txt. Instead, put them into top level 
CMakeLists.txt, but disable on Windows, because
a) SAFEMALLOC does not add any functionality that is not already
present in Debug C runtime ( and 2 safe malloc one on top of the other 
only unnecessarily slows down the server) 
      
b)SAFE_MUTEX does not work on Windows  and have been
explicitely  disabled on Windows with #undef previously.  Fortunately,
ntdll does  pretty good  job identifying l problems with 
CRITICAL_SECTIONs.
DebugBreak()s on using uninited critical section, unlocking unowned 
critical section)
      
-Also, remove occationally used -D_DEBUG (added by compiler 
anyway)
2009-09-30 15:35:01 +02:00
Alexander Barkov
482d3bfd80 Backporting WL#3759 Optimize identifier conversion in client-server protocol
This patch provides performance improvements:
- send_fields() when character_set_results = latin1
  is now about twice faster for column/table/database
  names, consisting on ASCII characters.

Changes:

- Protocol doesn't use "convert" temporary buffer anymore,
  and converts strings directly to "packet".

- General conversion optimization: quick conversion
  of ASCII strings was added.

modified files:

include/m_ctype.h
- Adding a new flag.
- Adding a new function prototype

libmysqld/lib_sql.cc
- Adding quick conversion method for embedded library:
  conversion is now done directly to result buffer,
  without using a temporary buffer.

mysys/charset.c
- Mark all dynamic ucs2 character sets as non-ASCII
- Mark some dymamic 7bit and 8bit charsets as non-ASCII
  (for example swe7 is not fully ASCII compatible).

sql/protocol.cc
- Adding quick method to convert a string directly
  into protocol buffer, without using a temporary buffer.

sql/protocol.h
- Adding a new method prototype

sql/sql_string.cc
  Optimization for conversion between two ASCII-compatible charsets:
- quickly convert ASCII strings,
  switch to mc_wc->wc_mb method only when a non-ASCII character is met.
- copy four ASCII characters at once on i386

strings/conf_to_src.c
- Marking non-ASCII character sets with a flag.

strings/ctype-extra.c
- Regenerating ctype-extra.c by running "conf_to_src".

strings/ctype-uca.c
- Marking UCS2 character set as non-ASCII.

strings/ctype-ucs2.c
- Marking UCS2 character set as non-ASCII.

strings/ctype.c
- A new function to detect if a 7bit or 8bit character set
  is ascii compatible.
2009-09-30 10:09:28 +05:00
Vladislav Vaintroub
46d04ebdef Backport of the patch
http://lists.mysql.com/commits/57725

Vladislav Vaintroub	2008-11-03
Cleanup CMakeLists.txt(s) - remove winsock2 (ws2_32) from 
TARGET_LINK_LIBRARIES. 
      
Every exe or dll linked with mysys needs ws2_32, because
mysys uses winsock function WSAStartup in my_init().
However, there is no need to explicitely add ws2_32 to
the list of TARGET_LINK_LIBRARIES multiple times. 
Visual Studio comes with a handy pragma that tells linker
to add library. So patch replaces bunch of ws2_32 in 
CMakeLists with  single pragma comment(lib,"ws2_32")
in my_init.c
      
Additionally, reference to non-existing "debug" library
has been removed from TARGET_LINK_LIBRARIES. The correct
name of the library is "dbug".
2009-09-30 03:39:37 +02:00
Vladislav Vaintroub
e6090f10bb Windows improvements : manual backport of
htttp://lists.mysql.com/commits/50957?f=plain
      
Always use TLS functions instead of __declspec(thread) to access 
thread local storage variables.
The change removes the necessity to recomplile the same source
files twice -  with USE_TLS for DLLs and without USE_TLS for EXEs.
Real benefit of this change is better readability and maintainability
of TLS functions within MySQL.
              
There is a performance loss using TlsXXX functions compared to __declspec 
but the difference is negligible in practice. In a sysbench-like benchmark 
I ran with with TlsGetValue, pthread_[get|set]_specific was called 600000000 
times and took 0.17sec of total 35min CPU time, or 0.008%.
2009-09-30 03:22:57 +02:00
Ingo Struewing
21586dfb08 WL#4259 - Debug Sync Facility
Backport from 6.0 to 5.1.
Only those sync points are included, which are used in debug_sync.test.

  The Debug Sync Facility allows to place synchronization points
  in the code:
  
  open_tables(...)
  
  DEBUG_SYNC(thd, "after_open_tables");
  
  lock_tables(...)
  
  When activated, a sync point can
  
  - Send a signal and/or
  - Wait for a signal
  
  Nomenclature:
  
  - signal:            A value of a global variable that persists
                       until overwritten by a new signal. The global
                       variable can also be seen as a "signal post"
                       or "flag mast". Then the signal is what is
                       attached to the "signal post" or "flag mast".
  
  - send a signal:     Assign the value (the signal) to the global
                       variable ("set a flag") and broadcast a
                       global condition to wake those waiting for
                       a signal.
  
  - wait for a signal: Loop over waiting for the global condition until
                       the global value matches the wait-for signal.
  
  Please find more information in the top comment in debug_sync.cc
  or in the worklog entry.
2009-09-29 17:38:40 +02:00
Magnus Blåudd
0b4b556911 Merge bug#42850 to 5.1 2009-09-28 14:40:45 +02:00
Magnus Blåudd
56b7b74b25 Merge bug#42850 to 5.0 2009-09-28 14:38:06 +02:00
Joerg Bruehe
650e68b7dc Merge 5.1-build up into 5.4-build ("trunk-build"). 2009-09-28 11:39:36 +02:00
Vladislav Vaintroub
281909362c merge mysql-next-mr-alik 2009-09-24 12:35:16 +02:00
Magnus Blåudd
40bd549b9b Bug#42850 race condition in my_thr_init.c
- Create the "dummy" thread joinable and wait for it to
   exit before continuing in 'my_thread_global_init'
 - This way we know that the pthread library is initialized
   by one thread only
2009-09-24 08:30:31 +02:00
Mats Kindahl
4ad8ef0602 WL#5016: Fix header file include guards
Adding header include file guards to files that are missing such.
2009-09-23 23:32:31 +02:00
Vladislav Vaintroub
ff3acc311f merge 2009-09-23 22:19:11 +02:00
Vladislav Vaintroub
47fedb97b4 merge 2009-09-23 22:15:22 +02:00
Mikael Ronstrom
cd0477e8e3 WL#5105, ptr_cmp optimised on Solaris, more efficient to use memcmp on Solaris than native impl. 2009-09-23 15:15:35 +02:00
Marc Alff
66ba77336a Merge mysql-next-mr (revno 2880) --> mysql-trunk-signal 2009-09-20 22:50:05 -06:00
Magnus Blåudd
f66231be11 Merge bug#42850 to 5.0 2009-09-28 14:40:20 +02:00
Alexey Kopytov
ddd00a7771 Automerge. 2009-09-18 11:54:38 +04:00
Alexey Kopytov
d39f0a72ad Bug #43606: 4GB Limit on huge_pages shared memory set-up
Large pages allocator could not allocate more than 4 GB due to
incorrect size alignment.
2009-09-18 11:19:02 +04:00
Alexander Nozdrin
5b3f34f41e Merge 5.1-bugteam -> trunk-alik. 2009-09-17 22:00:49 +04:00
Joerg Bruehe
67bcf54df6 Fix bug#46980
Option "--without-server" still not working in 5.1

The general approach is to make sure that source files
which require thread support are only compiled if the build
really needs thread support,
which means when the server is built or a thread-safe client
library.

This required several changes:
- Make sure the subdirectories "storage/" and "plugin/" are
  only processed if the server is built, not ifclient-only.
- Make the compilation of some modules which inherently
  require threading depend on thread supportin the build.
- Separate the handling of threading in "configure.in" from
  that of server issues, threading is also needed in a
  non-server build of a thread-safe client library.

Also, "libdbug" must get built even in a client-only build,
so "dbug/" must be in the list of client directories.

In addition, calls to thread functions in source files which
can be built without thread support must use the wrapper
functions which handle the non-threaded build.
So the modules "client/mysqlimport.c" and "client/mysqlslap.c"
must call "my_thread_end()" only via "mysql_thread_end()".
2009-09-17 18:34:24 +02:00
Staale Smedseng
5051100a1a Merge from 5.0 2009-09-17 17:25:52 +02:00
Staale Smedseng
38b6d49e82 Bug #43414 Parenthesis (and other) warnings compiling MySQL
with gcc 4.3.2
      
This is the fifth patch cleaning up more GCC warnings about
variables used before initialized using the new macro
UNINIT_VAR().
2009-09-17 17:10:30 +02:00
Marc Alff
08ffe21317 Merge mysql-next-mr --> mysql-trunk-signal 2009-09-17 03:20:11 -06:00
Alexander Nozdrin
df0dcab437 Merge from mysql-5.1-bugteam. 2009-09-16 10:52:43 +04:00
Vladislav Vaintroub
b5f83da900 fix compile error. definition of VOID in trunk still conflicts with windows headers. that was fixed in 6.0 2009-09-13 19:38:06 +02:00
Vladislav Vaintroub
72b91d4134 Downport
WL#1624 -determine MAC addresses on Windows.
Contribution  by Chris Runyan
2009-09-11 22:42:39 +02:00
Vladislav Vaintroub
4e92af9f43 This is the downport of
Bug#24509 - 2048 file descriptor limit on windows needs increasing, also 
WL#3049 - improved Windows I/O
                        
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.
                              
Another major change in this patch that almost all Windows specific file IO code
has been moved to a new file my_winfile.c, greatly reducing the amount of code 
in #ifdef blocks within mysys, thus improving readability.
                               
                                    
Minor enhancements:
- my_(f)stat() is changed to use __stati64 structure with  64 file size
and timestamps. It will return correct file size now (C runtime implementation
used to report outdated information)
- my_lock on Windows is prepared to handle additional timeout parameter
- after review : changed __WIN__ to _WIN32 in the new and changed code.
2009-09-11 22:26:35 +02:00
Georgi Kodinov
59069cac4a fixed compilation warnings 2009-09-24 16:21:46 +03:00
Marc Alff
d5fd452d7c WL#2110 (SIGNAL)
WL#2265 (RESIGNAL)

Manual merge of SIGNAL and RESIGNAL to mysql-trunk-signal,
plus required dependencies.
2009-09-10 03:18:29 -06:00
Ingo Struewing
8dcaefca21 Bug#17332 - changing key_buffer_size on a running server
can crash under load

Merge from 5.0, after backport from 5.1/5.4 to 5.0.
This makes the fixes for
Bug 44068 (RESTORE can disable the MyISAM Key Cache)
Bug 40944 (Backup: crash after myisampack)
available to 5.1.
2009-09-09 17:13:13 +02:00
Ingo Struewing
1b60803282 Bug#17332 - changing key_buffer_size on a running server
can crash under load

Backport from 5.1.
Does also include key cache fixes from:
Bug 44068 (RESTORE can disable the MyISAM Key Cache)
Bug 40944 (Backup: crash after myisampack)
2009-09-07 18:35:37 +02:00
Satya B
fc2243d69b merge mysql-5.0-bugteam to mysql-5.1-bugteam 2009-09-03 17:59:25 +05:30
Satya B
4a9e7e8e25 Fix for BUG#46591 - .frm file isn't sync'd with sync_frm enabled for
CREATE TABLE...LIKE...
      
The mysql server option 'sync_frm' is ignored when table is created with 
syntax CREATE TABLE .. LIKE.. 
      
Fixed by adding the MY_SYNC flag and calling my_sync() from my_copy() when
the flag is set.

In mysql_create_table(), when the 'sync_frm' is set, MY_SYNC flag is passed 
to my_copy(). 
      
Note: TestCase is not attached and can be tested manually using debugger.
2009-09-03 16:02:03 +05:30
Georgi Kodinov
bb4c5acfb3 merge 2009-09-02 15:33:18 +03:00
Davi Arnaut
f076ba2803 Manual merge. 2009-09-02 09:12:18 -03:00
Davi Arnaut
ca96ac5351 Post-merge fix. Observe C declaration placement rules. 2009-09-02 09:02:22 -03:00
Georgi Kodinov
8f5b17f529 Fixed win32 compilation warnings 2009-09-02 13:22:47 +03:00
Anurag Shekhar
600703e50a merging bugfix from 5.0 2009-08-31 13:26:09 +05:30
Anurag Shekhar
9b97856d82 merging with changes in bugteam branch. 2009-08-31 13:02:31 +05:30
Staale Smedseng
f59ef9eafa Merge from 5.0 for 43414 2009-08-28 18:21:54 +02:00
Staale Smedseng
2217de2513 Bug #43414 Parenthesis (and other) warnings compiling MySQL
with gcc 4.3.2
      
This patch fixes a number of GCC warnings about variables used
before initialized. A new macro UNINIT_VAR() is introduced for
use in the variable declaration, and LINT_INIT() usage will be
gradually deprecated. (A workaround is used for g++, pending a
patch for a g++ bug.)
      
GCC warnings for unused results (attribute warn_unused_result)
for a number of system calls (present at least in later
Ubuntus, where the usual void cast trick doesn't work) are
also fixed.
2009-08-28 17:51:31 +02:00
Davi Arnaut
a0e44ec1e8 Fix for a few assorted compiler warnings. 2009-08-28 12:06:59 -03:00
Anurag Shekhar
90032c1007 Bug #44723 Larger read_buffer_size values can cause performance
decrease for INSERTs


Bulk inserts (multiple row, CREATE ... SELECT, INSERT ... SELECT) into
MyISAM tables were performed inefficiently. This was mainly affecting
use cases where read_buffer_size was considerably large (>256K) and low
number of rows was inserted (e.g. 30-100).

The problem was that during I/O cache initialization (this happens
before each bulk insert) allocated I/O buffer was unnecessarily
initialized to '\0'.

This was happening because of mess in flag values. MyISAM informs I/O
cache to wait for free space (if out of disk space) by passing
MY_WAIT_IF_FULL flag. Since MY_WAIT_IF_FULL and MY_ZEROFILL have the
same values, memory allocator was initializing memory to '\0'.

The performance gain provided with this patch may only be visible with
non-debug binaries, since safemalloc always initializes allocated memory
to 0xA5A5...
2009-08-24 13:15:51 +05:30
Guilhem Bichot
8d1fdf09bb merge of 5.1-main into mysql-trunk.
Changes to ha_innodb.cc are not propagated to plugin, they will come back
via Oracle/Innobase if needed.
2009-08-12 15:44:34 +02:00
Sergey Vojtovich
7a77e3d05a Merge mysql-5.1-innodb_plugin to mysql-5.1. 2009-08-11 18:05:25 +05:00
Guilhem Bichot
c5ab943afe Creation of mysql-trunk = {summit + "Innodb plugin replacing the builtin"}:
bzr branch mysql-5.1-performance-version mysql-trunk # Summit
cd mysql-trunk
bzr merge mysql-5.1-innodb_plugin # which is 5.1 + Innodb plugin 
bzr rm innobase # remove the builtin
Next step: build, test fixes.
2009-08-04 13:25:19 +02:00
Ignacio Galarza
6df2af22ce Bug#17270 - mysql client tool could not find ../share/charsets folder and fails.
- Define and pass compile time path variables as pre-processor definitions to 
  mimic the makefile build.
- Set new CMake version and policy requirements explicitly.
- Changed DATADIR to MYSQL_DATADIR to avoid conflicting definition in 
  Platform SDK header ObjIdl.h which also defines DATADIR.
2009-07-31 15:22:02 -04:00
Ignacio Galarza
8ef28b4962 Auto-merge 2009-07-31 15:28:15 -04:00
Satya B
cae3c58a10 merging with mysql-5.1-bugteam branch 2009-07-27 11:50:13 +05:30
Satya B
ba7c6884d0 merge 5.0-bugteam to 5.1-bugteam 2009-07-24 12:15:06 +05:30
V Narayanan
54aecee9c0 merging with mysql-5.0-bugteam 2009-07-17 14:25:09 +05:30
Sergey Vojtovich
cc541211c8 Merge 5.1-bugteam -> 5.1-innodb_plugin. 2009-07-14 15:06:04 +05:00
V Narayanan
ce0bf2a475 Bug#43572 Handle failures from hash_init
This patch is a follow up to http://lists.mysql.com/commits/76678.
When an allocation failure occurs for the buffer in the dynamic
array, an error condition was being set. The dynamic array is
usable even if the memory allocation fails. Since in most cases
the thread can continue to work without any problems the error
condition should not be set here.

This patch adds logic to remove the error condition from being set
when the memory allocation for the buffer in dynamic array fails.
2009-07-12 11:18:53 +05:30
Kristofer Pettersson
bb4faa54cd Automerge 2009-06-25 15:58:59 +02:00
Kristofer Pettersson
75ba3c6a4b Bug#45336 --enable-foobar doesn't work for any plugin foobar.
Because of a regression introduced by bug#19027 the option --enable-foobar
doesn't work anymore for any plugin 'foobar'. The reason is that plugin
names are tristate options variables with optional parameters and integer
values are not accepted. Since the 'enable' prefix attempts to assign '1'
to the option the operation fails.

This patch translates any number n assigned to a plugin variable of type ENUM
to be the corresponding enumerated item. As a side effect --enable-foobar and
--disable-foobar will also start working again.
2009-06-25 15:55:26 +02:00
V Narayanan
1b454e345c Bug#43572 Handle failures from hash_init
The merge from http://lists.mysql.com/commits/76678 caused the 
growth_size parameter to the my_init_dynamic_array function to
be ignored. This patch corrects the problem.
2009-06-22 16:40:34 +05:30
V Narayanan
81dbbd68c1 merging with mysql-5.0-bugteam 2009-06-19 17:58:46 +05:30
V Narayanan
728d3c39de Bug#43572 Handle failures from hash_init
Failure to allocate memory for the hash->array element,
caused hash_init to return without initializing the other
members of the hash. Thus although the dynamic array
buffer may be allocated at a later point in the code, the
incompletely initialized hash caused fatal failures.

This patch moves the initialization of the other members
of the hash above the array allocation, so that the usage
of this hash will not result in fatal failures.
2009-06-19 17:29:21 +05:30
Mikael Ronstrom
506c7fd47d Merge MySQL 5.1.35 into MySQL 5.4 2009-06-11 12:07:59 +02:00
Vladislav Vaintroub
31b79618e3 Backport WL#3653 to 5.1 to enable bundled innodb plugin.
Remove custom DLL loader code from innodb plugin code, use 
symbols exported from mysqld.
2009-06-10 10:59:49 +02:00
Alfranio Correia
41fdbbf586 auto-merge 5.1-bugteam (local) --> 5.1-bugteam 2009-05-21 09:36:38 +01:00
Kristofer Pettersson
d9dc2c3d9b Auto merge 2009-05-15 09:36:42 +02:00
Kristofer Pettersson
8b39abe245 Bug#19027 MySQL 5.0 starts even with Fatal InnoDB errors
It is not possible to prevent the server from starting if a mandatory
built-in plugin fails to start. This can in some cases lead to data
corruption when the old table name space suddenly is used by a different
storage engine.

A boolean command line option in the form of --foobar is automatically
created for every existing plugin "foobar". By changing this command line
option from a boolean to a tristate { OFF, ON, FORCE } it is possible to
specify the plugin loading policy for each plugin.

The behavior is specified as follows:
   OFF   = Disable the plugin and start the server
   ON    = Enable the plugin and start the server even if an error occurrs
           during plugin initialization.
   FORCE = Enable the plugin but don't start the server if an error occurrs
           during plugin initialization.
2009-05-14 14:03:33 +02:00
Jim Winstead
2e7cdfd3e7 Merge from 5.0-bugteam 2009-05-13 08:48:00 -07:00
Joerg Bruehe
230f3f5208 Merge main 5.1 into 5.1-build
165 changesets with 23 conflicts:
Text conflict in mysql-test/r/lock_multi.result
Text conflict in mysql-test/t/lock_multi.test
Text conflict in mysql-test/t/mysqldump.test
Text conflict in sql/item_strfunc.cc
Text conflict in sql/log.cc
Text conflict in sql/log_event.cc
Text conflict in sql/parse_file.cc
Text conflict in sql/slave.cc
Text conflict in sql/sp.cc
Text conflict in sql/sp_head.cc
Text conflict in sql/sql_acl.cc
Text conflict in sql/sql_base.cc
Text conflict in sql/sql_class.cc
Text conflict in sql/sql_crypt.cc
Text conflict in sql/sql_db.cc
Text conflict in sql/sql_lex.cc
Text conflict in sql/sql_parse.cc
Text conflict in sql/sql_select.cc
Text conflict in sql/sql_table.cc
Text conflict in sql/sql_view.cc
Text conflict in storage/innobase/handler/ha_innodb.cc
Text conflict in storage/myisam/mi_packrec.c
Text conflict in tests/mysql_client_test.c

Updates to Innobase, taken from main 5.1:
bzr: ERROR: Some change isn't sane:
File mysql-test/r/innodb-semi-consistent.result is owned by Innobase and should not be updated.
File mysql-test/t/innodb-semi-consistent.test is owned by Innobase and should not be updated.
File storage/innobase/handler/ha_innodb.cc is owned by Innobase and should not be updated.
File storage/innobase/ibuf/ibuf0ibuf.c is owned by Innobase and should not be updated.
File storage/innobase/include/row0mysql.h is owned by Innobase and should not be updated.
File storage/innobase/include/srv0srv.h is owned by Innobase and should not be updated.
File storage/innobase/include/trx0trx.h is owned by Innobase and should not be updated.
File storage/innobase/include/trx0trx.ic is owned by Innobase and should not be updated.
File storage/innobase/lock/lock0lock.c is owned by Innobase and should not be updated.
File storage/innobase/page/page0cur.c is owned by Innobase and should not be updated.
File storage/innobase/row/row0mysql.c is owned by Innobase and should not be updated.
File storage/innobase/row/row0sel.c is owned by Innobase and should not be updated.
File storage/innobase/srv/srv0srv.c is owned by Innobase and should not be updated.
File storage/innobase/trx/trx0trx.c is owned by Innobase and should not be updated.
(Set env var 'ALLOW_UPDATE_INNOBASE_OWNED' to override.)
2009-05-08 21:04:07 +02:00
Jim Winstead
71cbbff7de The get_date() function in mysys interpreted the GETDATE_GMT option
backwards, which resulted in the incorrect time being reported at the
end of mysqldump. (Bug #44424, patch by Andrew Hutchings)
2009-05-07 11:17:07 -07:00
Vladislav Vaintroub
57b4295d2b Bug#43932 myisam index corruption with large index and large
key_buffer_size.

The cause of corruption was number overflow when multiplying 
two ulong values, number of used keycache blocks with size
of a single block. The result of multiplication exceeded ulong 
range (4G) and this lead to incorrectly calculated  buffer offset
in the key cache.

The fix is to use size_t for multiplication result.

This patch also fixes pointless cast in safemalloc 
(size of allocated block to uint), that creates lot of false
alarm warnings when using big keycache (> 4GB) in debug mode.
2009-04-29 13:51:10 +02:00
Alfranio Correia
8caf4bfc52 BUG#43949 Initialization of slave produces a warning message in Valgrind
In order to define the --slave-load-tmpdir, the init_relay_log_file()
was calling fn_format(MY_PACK_FILENAME) which internally was indirectly
calling strmov_overlapp() (through pack_dirname) and the following
warning message was being printed out while running in Valgrind:
"source and destination overlap in strcpy".

We fixed the issue by removing the flag MY_PACK_FILENAME as it was not
necessary. In a nutshell, with this flag the function fn_format() tried
to replace a directory by either "~", "." or "..". However, we wanted
exactly to remove such strings.

In this patch, we also refactored the functions init_relay_log_file()
and check_temp_dir(). The former was refactored to call the fn_format()
with the flag MY_SAFE_PATH along with the MY_RETURN_REAL_PATH,  in order
to avoid issues with long directories and return an absolute path,
respectively. The flag MY_SAFE_UNPACK_FILENAME was removed too as it was
responsible for removing "~", "." or ".." only from the file parameter
and we wanted to remove such strings from the directory parameter in
the fn_format(). This result is stored in an rli variable, which is then
processed by the other function in order to verify if the directory exists
and if we are able to create files in it.
2009-04-19 02:21:33 +01:00
Davi Arnaut
064c1b2cac Bug#43706: libmysqld segfaults when re-intialised
Bug#44091: libmysqld gets stuck waiting on mutex on initialization

The problem was that libmysqld wasn't enforcing a certain
initialization and deinitialization order for the mysys
library. Another problem was that the global object used
for management of log event handlers (aka LOGGER) wasn't
being prepared for a possible reutilization.

What leads to the hang/crash reported is that a failure
to load the language file triggers a double call of the
cleanup functions, causing an already destroyed mutex to
be used.

The solution is enforce a order on the initialization and
deinitialization of the mysys library within the libmysqld
library and to ensure that the global LOGGER object reset
it's internal state during cleanup.
2009-04-09 12:25:25 -03:00
Alexander Barkov
83a7814264 Bug#42649 THR_LOCK_charset global mutex abused by InnoDB
The patch was originally proposed by Mikael and reviewed by Bar.
2009-04-07 11:48:38 +05:00
MySQL Build Team
00ebbd793a Ensure that all dtrace files are properly removed during make clean 2009-04-05 22:18:21 +02:00
Georgi Kodinov
706a0a39ed merged 5.0-bugteam -> 5.1-bugteam 2009-03-24 15:58:52 +02:00
Georgi Kodinov
ef4ab5cfaa fixed compilation warnings. addendum to the fix for bug 29125 2009-03-20 16:27:53 +02:00
Georgi Kodinov
4a3c0d800a Fixed a prototype to match the actual function signature (addendum to the
fix for 29125).
2009-03-20 13:35:00 +02:00
Davi Arnaut
2417701e46 Bug#43461: invalid comparison with string literal in default.c
Don't compare string literals as it results in unspecified behavior.
2009-03-19 17:20:15 -03:00
Ignacio Galarza
22b919cc50 auto-merge 2009-03-19 09:59:10 -04:00
Ignacio Galarza
e82390130e auto-merge 2009-03-19 09:44:58 -04:00
Ignacio Galarza
8fd4c59ff6 auto-merge 2009-03-19 09:42:36 -04:00
MC Brown
8578e16ce3 Fixing some issues in the build when using DTrace probes
Probe definition file is now a separate file that is copied during
build to the correct location, this enforces dependency requirements
correctly and allows builds to work when using the current or separate
build directories
2009-03-18 10:04:15 +00:00
Ignacio Galarza
428e28e00c auto-merge 2009-03-17 16:29:24 -04:00
Tatiana A. Nurnberg
6efe0c341d 36446: fix Windows warning 2009-03-17 18:24:35 +01:00
Tatiana A. Nurnberg
2849db95fc manual merge 2009-03-16 20:54:50 +01:00
Tatiana A. Nurnberg
611a09f596 Bug#36446: Attempt to set @@join_buffer_size to its minimum value produces spurious warning
If a sys-var has a base and a block-size>1, and then a
user-supplied value >= minimum ended up below minimum
thanks to block-size alignment, we threw a warning.
This meant for instance that when getting, then setting
the minimum, we'd see a warning. This was needlessly
confusing. (updated patch)
2009-03-16 16:11:45 +01:00
Alexey Kopytov
b00996e85f Manual merge of patch for bug #40552 into the team tree.
Replaced a call to load_defaults() in sql_plugin.cc with 
its thread-safe version.
2009-03-16 13:37:13 +03:00
Chad MILLER
078a9762ad Merge bugteam and fix for 42675. 2009-03-18 18:38:30 -04:00
Chad MILLER
2443683f50 Fix indentation. tab -> spaces 2009-03-17 15:43:00 -04:00
Chad MILLER
926c530c7d Bug#42675: Dangling pointer leads to a client crash (mysys/my_error.c \
patch enclosed)
  
One call to my_error_unregister_all() would free pointers, but leave one
pointer to just-freed memory still assigned.  That's the bug.  Subsequent
calls of this function would try to follow pointers into deallocated, 
garbage memory and almost certainly SEGV.

Now, after freeing a linked list, unset the initial pointer.
2009-03-17 15:31:07 -04:00
Georgi Kodinov
cd7d25f4b9 merge of bug 42434 to 5.1-bugteam 2009-03-11 18:13:42 +02:00
Georgi Kodinov
5b9a33aafe Bug #42434: license of mysys MD5 implementation is not GPL-compatible
Took the Xfree implementation (based on the same rewrite as the NDB one)
and added it instead of the current implementation.
Added a macro to make the calls to MD5 more streamlined.
2009-03-09 20:57:03 +02:00
He Zhenxing
4cef9cc026 Merge BUG#22082 from 5.0-bugteam to 5.1-bugteam 2009-03-06 17:38:14 +08:00
He Zhenxing
e7605e338b BUG#22082 Slave hangs(holds mutex) on "disk full"
When disk is full, server may waiting for free space while
writing binlog, relay-log or MyISAM tables. The server will 
continue after user have freed some space. But the error
message printed was not quite clear about the how often the
error message is printed, and there will be a delay before
the server continue and user freeing space. And caused users
thinking that the server was hanging forever.

This patch fixed the problem by making the error messages
printed more clear. The error message is split into two part,
the first part will only be printed once, and the second part
will be printed very 10 times.

Message first part:
Disk is full writing '<filename>' (Errcode: <errorno>). Waiting
for someone to free space... (Expect up to 60 secs delay for 
server to continue after freeing disk space)

Message second part:
Retry in 60 secs, Message reprinted in 600 secs
2009-03-06 17:32:00 +08:00
Alexey Kopytov
752cbab9a4 Fix for bug #40552: Race condition around default_directories
in load_defaults() 

load_defaults(), my_search_option_files() and 
my_print_default_files()  utilized a global variable 
containing  a pointer to thread local memory. This could lead 
to race conditions when those functions were called with high 
concurrency. 

Fixed by changing the interface of the said functions to avoid 
the necessity for using a global variable.

Since we cannot change load_defaults() prototype for API
compatibility reasons, it was renamed my_load_defaults().
Now load_defaults() is a thread-unsafe wrapper around
a thread-safe version, my_load_defaults().
2009-02-27 11:26:06 +02:00
Alexey Botchkov
d5de8c76e6 merging. 2009-02-24 15:29:49 +04:00
Mikael Ronstrom
bccf56e535 Yet another attempt of getting DTrace builds done properly 2009-02-21 21:32:46 +01:00
Mikael Ronstrom
391fff8f73 A workaround to handle the problem with that
abs_top_srcdir doesn't work on some automake
platforms.

Done by copying the .d files to the build
directories.
2009-02-20 23:11:09 +01:00
Mikael Ronstrom
76afa7ce07 Changed to use top_srcdir instead of abs_top_srcdir since many
automake tools on Solaris seems to have a bug related to the
use of abs_top_srcdir
2009-02-20 01:06:32 +01:00
Mikael Ronstrom
f603e1b634 More readability for DTrace commands 2009-02-20 00:56:25 +01:00
Mikael Ronstrom
dd9119be20 Merged Performance Version 0.2.1 with latest 5.1 tree (last push 11 feb 14.01.13 2009) 2009-02-17 13:24:09 +01:00
Ignacio Galarza
2d9421c3bb Bug#29125 Windows Server X64: so many compiler warnings
- Remove bothersome warning messages.  This change focuses on the warnings 
that are covered by the ignore file: support-files/compiler_warnings.supp.
- Strings are guaranteed to be max uint in length
2009-02-13 11:41:47 -05:00
Ignacio Galarza
2b85c64d65 Bug#29125 Windows Server X64: so many compiler warnings
- Remove bothersome warning messages.  This change focuses on the warnings 
that are covered by the ignore file: support-files/compiler_warnings.supp.
- Strings are guaranteed to be max uint in length
2009-02-10 17:47:54 -05:00
Mikael Ronstrom
ec38999ae7 Reverted DTrace fix 2009-02-06 14:35:00 +01:00
Alexey Botchkov
9404e88dac merging 2009-02-05 10:33:06 +04:00
Alexey Botchkov
cf0d0a5e96 Bug#37995 Error message truncation in test "innodb" in embedded mode.
code backported from 6.0


per-file messages:
  include/my_global.h
    Remove SC_MAXWIDTH. This is unused and irrelevant nowadays.
  include/my_sys.h
    Remove errbuf declaration and unused definitions.
  mysys/my_error.c
    Remove errbuf definition and move and adjust ERRMSGSIZE.
  mysys/my_init.c
    Declare buffer on the stack and use my_snprintf.
  mysys/safemalloc.c
    Use size explicitly. It's more than enough for the message at hand.
  sql/sql_error.cc
    Use size explicitly. It's more than enough for the message at hand.
  sql/sql_parse.cc
    Declare buffer on the stack. Use my_snprintf as it will result in
    less stack space being used than by a system provided sprintf --
    this allows us to put the buffer on the stack without causing much
    trouble. Also, the use of errbuff here was not thread-safe as the
    function can be entered concurrently from multiple threads.
  sql/sql_table.cc
    Use MYSQL_ERRMSG_SIZE. Extra space is not needed as my_snprintf will
    nul terminate strings.
  storage/myisam/ha_myisam.cc
Use MYSQL_ERRMSG_SIZE.
  sql/share/errmsg.txt
    Error message truncation in test "innodb" in embedded mode
    filename in the error message can safely take up to 210 symbols.
2009-02-05 10:16:00 +04:00
Davi Arnaut
bc03c9ef19 Bug#40536: SELECT is blocked by INSERT DELAYED waiting on
upgrading lock, even with low_priority_updates

The problem is that there is no mechanism to control whether a
delayed insert takes a high or low priority lock on a table.

The solution is to modify the delayed insert thread ("handler")
to take into account the global value of low_priority_updates
when taking table locks. The value of low_priority_updates is
retrieved when the insert delayed thread is created and will
remain the same for the duration of the thread.
2009-02-03 15:16:24 -02:00
Mikael Ronstrom
b040b460ed Added support for rep; nop replacing PAUSE due to Solaris bug
Replaced abs_top_srcdir with top_srcdir, not sure it's an
improvement but at least it's known that abs_top_srcdir
in cases have a problem and this is a more common variable
to use for the same purpose.
2009-02-03 12:46:52 +01:00
Alexander Barkov
a491bcc4e5 Bug#41084 full-text index added to custom UCA collation not working
Problem:
Custom UCA collations didn't set the MY_CS_STRNXFRM flag,
which resulted in "prefix_search" method instead of
the required "seq_search".

Problem2: (not metioned in the bug report)
Custom UCA collations didn't also set the MY_CS_UNICODE flag,
so an attempt to compare a column with a custom UCA collation
to another column with a non-Unicode character set led to
the "illegal mix of collation" error.

Fix:
the two missing flags was added into collation initialization.

  Upgrade:

  - All fulltext indexes with custom UCA collations should be rebuilt.

  - Non-fulltext custom UCA indexes should likely be rebuild as well.
2009-02-02 17:25:42 +04:00
Luis Soares
14d4576bfe merge: 5.1 -> 5.1-rpl
conflicts:
  Text conflict in client/mysqltest.cc
  Text conflict in mysql-test/include/wait_until_connected_again.inc
  Text conflict in mysql-test/lib/mtr_report.pm
  Text conflict in mysql-test/mysql-test-run.pl
  Text conflict in mysql-test/r/events_bugs.result
  Text conflict in mysql-test/r/log_state.result
  Text conflict in mysql-test/r/myisam_data_pointer_size_func.result
  Text conflict in mysql-test/r/mysqlcheck.result
  Text conflict in mysql-test/r/query_cache.result
  Text conflict in mysql-test/r/status.result
  Text conflict in mysql-test/suite/binlog/r/binlog_index.result
  Text conflict in mysql-test/suite/binlog/r/binlog_innodb.result
  Text conflict in mysql-test/suite/rpl/r/rpl_packet.result
  Text conflict in mysql-test/suite/rpl/t/rpl_packet.test
  Text conflict in mysql-test/t/disabled.def
  Text conflict in mysql-test/t/events_bugs.test
  Text conflict in mysql-test/t/log_state.test
  Text conflict in mysql-test/t/myisam_data_pointer_size_func.test
  Text conflict in mysql-test/t/mysqlcheck.test
  Text conflict in mysql-test/t/query_cache.test
  Text conflict in mysql-test/t/rpl_init_slave_func.test
  Text conflict in mysql-test/t/status.test
2009-01-23 13:22:05 +01:00
Chad MILLER
05fb260b0c Merge fix for bug 38364. 2009-01-13 10:50:22 -05:00
Chad MILLER
e3716a3dc0 Bug#38364: gen_lex_hash segmentation fault in debug build
Bug#36428: MY_MUTEX_INIT_FAST is used before initialization

On some thread implementations, we need a fake mutex attri-
bute as a placeholder, which we define as a global variable,
"my_fast_mutexattr".  Well. that must be initialized before 
used in any mutexes, and the ordering of initializations in 
the API function  my_init()  was wrong.

Now, put my_thread_global_init(), which initializes the attri-
butes that mutexes require.
2009-01-12 14:48:02 -05:00
Tatiana A. Nurnberg
a7d03bf4ed Bug#31177: Server variables can't be set to their current values
Bounds-checks and blocksize corrections were applied to user-input,
but constants in the server were trusted implicitly. If these values
did not actually meet the requirements, the user could not set change
a variable, then set it back to the (wonky) factory default or maximum
by explicitly specifying it (SET <var>=<value> vs SET <var>=DEFAULT).

Now checks also apply to the server's presets. Wonky values and maxima
get corrected at startup. Consequently all non-offsetted values the user
sees are valid, and users can set the variable to that exact value if
they so desire.
2009-01-12 06:32:49 +01:00
Luis Soares
9d8c117598 merge: 5.1 -> 5.1-rpl
conflicts:
  Text conflict in mysql-test/lib/mtr_report.pm
  Text conflict in mysql-test/mysql-test-run.pl
2009-01-08 19:03:56 +00:00
Mikael Ronstrom
8195d7da05 Removed unnecessary variable setting, generated warning 2008-12-20 17:59:47 +01:00
Mikael Ronstrom
460cde4c6e Merge dtrace patch with latest performance version 2008-12-20 11:53:27 +01:00
Mikael Ronstrom
16a024c486 Backport of DTrace patches from 6.0 2008-12-20 11:01:41 +01:00
Alfranio Correia
3175a06a13 merge 5.1 --> 5.1-rpl 2008-12-13 19:42:12 +00:00