Commit graph

2271 commits

Author SHA1 Message Date
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
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
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
Sergey Vojtovich
7a77e3d05a Merge mysql-5.1-innodb_plugin to mysql-5.1. 2009-08-11 18:05:25 +05: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
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
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
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
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
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