tables
In case system doesn't have native pread/pwrite calls (e.g. Windows)
and there is CHECK TABLE runs concurrently with another statement that
reads from a table, the table may be reported as crashed.
This is fixed by locking file descriptor when my_seek is executed on
MyISAM index file and emulated pread/pwrite may be executed concurrently.
Affects MyISAM tables on platforms that do not have native
pread/pwrite calls (e.g. Windows).
No deterministic test case for this bug.
myisam/mi_check.c:
Key file descriptor is shared among threads and mixed set of
my_pread/my_pwrite and my_seek calls is possible. This is not
a problem on systems that have native pread/pwrite calls.
In case system doesn't have native pread/pwrite calls (e.g. Windows)
we must ensure that my_pread/my_pwrite are not executed at the same
time with my_seek. This is done by passing MY_THREADSAFE flag to
my_seek.
mysys/my_seek.c:
On platforms that do not have native pread/pwrite calls (e.g. Windows)
these calls are emulated as follow: lock fd, lseek, read, unlock fd.
In case file descriptor is shared among threads, where one thread
executes my_pread and another thread executes my_seek, we may read
from a wrong position. This may happen because my_seek doesn't lock
fd and thus may be executed by another thread after emulated pread
has done lseek and before it has done read.
To fix problem mentioned above we introduce new flag MY_THREADSAFE to
my_seek, which is meaningful only in case pread/pwrite calls are
emulated. If this flag is set, lseek operation is performed as follow:
lock fd, seek, unlock fd.
Recognize the --no-defaults, --defaults-file and --defaults-extra-file
options. Treat old --config-file argument as if --defaults-extra-file
had been specified instead.
Plus a few other defaults-related cleanups.
extra/my_print_defaults.c:
Make help text more accurate regarding how --config-file, --defaults-file, and --defaults-extra-file should be used. Flag --config-file as deprecated.
mysys/default.c:
Always print a newline after listing the default files, even if
--defaults-file= was set (in my_print_default_files()).
scripts/mysqld_multi.sh:
Recognize --no-defaults, --defaults-file and --defaults-extra-file options.
Treat old --config-file argument as if --defaults-extra-file had been specified
instead.
Improve find_groups() method, to honor --defaults-file, etc.
A few random drive-by cleanups, while I'm here.
errno
Vasil Dimov (at Oracle) noted that pthread_key_create() does not
set errno, so if it fails then we return the wrong error code.
Instead, capture the return value, which is the real error value,
and instead report that.
mysys/my_thr_init.c:
pthread functions don't set the global errno, which should be
obvious.
bug #27715: mysqld --character-sets-dir buffer overflow
bug ##26851: Mysql Client --pager Buffer Overflow
Using strmov() to copy an argument may cause overflow
if the argument's length is bigger than the buffer:
use strmake instead.
Also, we have to encrease the error message buffer size to fit
the longest message.
client/mysql.cc:
Fix for
bug #27715: mysqld --character-sets-dir buffer overflow
bug ##26851: Mysql Client --pager Buffer Overflow
- use strmake() instead of strmov() to avoid buffer overflow.
mysql-test/r/mysql.result:
Fix for
bug #27715: mysqld --character-sets-dir buffer overflow
bug ##26851: Mysql Client --pager Buffer Overflow
- test result.
mysql-test/t/mysql.test:
Fix for
bug #27715: mysqld --character-sets-dir buffer overflow
bug ##26851: Mysql Client --pager Buffer Overflow
- test case.
mysys/charset.c:
Fix for
bug #27715: mysqld --character-sets-dir buffer overflow
bug ##26851: Mysql Client --pager Buffer Overflow
- encrease error message buffer size to fit the (possible) longest message.
Fix for when memory pre-allocation fails.
mysys/my_alloc.c:
Added code to null-out the pre-alloc pointer if allocation fails. This is necessary for the next time this procedure is called.
mysql-test/r/variables-big.result:
Added "big" test for bug fix Bug #27322.
mysql-test/t/variables-big.test:
Added "big" test for bug fix Bug #27322.
into ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.0-marvel
client/mysqldump.c:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysys/my_malloc.c:
Auto merged
mysys/my_static.c:
Auto merged
mysys/safemalloc.c:
Auto merged
ndb/src/mgmclient/CommandInterpreter.cpp:
Auto merged
sql/ha_archive.cc:
Auto merged
sql/ha_innodb.cc:
Auto merged
sql/ha_ndbcluster.cc:
Auto merged
sql/handler.cc:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_func.h:
Auto merged
sql/log.cc:
Auto merged
sql/log_event.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql-common/client.c:
Auto merged
sql/sp.cc:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_update.cc:
Auto merged
sql/table.cc:
Auto merged
sql-common/my_time.c:
Auto merged
mysql-test/r/sp.result:
Merged from main 5.0
sql/sql_load.cc:
Merged from main 5.0
Back port of include change and copyright from 5.1
Makefile.am, zlib.m4:
Use separate libtool convenience library for the bundled
zlib to embed into executables and shared libraries created,
and one to install into the pkglib directory
zlib/Makefile.am:
Use separate libtool convenience library for the bundled
zlib to embed into executables and shared libraries created,
and one to install into the pkglib directory
config/ac-macros/zlib.m4:
Use separate libtool convenience library for the bundled
zlib to embed into executables and shared libraries created,
and one to install into the pkglib directory
mysys/my_memmem.c:
Back port of include change and copyright from 5.1
into pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/r/create.result:
Auto merged
mysql-test/r/type_datetime.result:
Auto merged
sql/field.h:
Auto merged
sql/item.h:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/item_sum.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
mysql-test/r/gis.result:
SCCS merged
mysql-test/t/gis.test:
SCCS merged
into ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.0-marvel
BitKeeper/deleted/.del-_dynrec.c~48dd758f5a5450df:
Auto merged
BitKeeper/deleted/.del-_page.c~148b1a613d052ee8:
Auto merged
BitKeeper/deleted/.del-_search.c~f509292aa1ff18ff:
Auto merged
BitKeeper/deleted/.del-close.c~fd62629496ee5bcc:
Auto merged
BitKeeper/deleted/.del-delete.c~65ee8daaa75a14b6:
Auto merged
BitKeeper/deleted/.del-my_tempnam.c~a8562f15dad3012f:
Auto merged
BitKeeper/deleted/.del-open.c~95b3b75042fae00a:
Auto merged
BitKeeper/deleted/.del-rkey.c~cc54c6498352f999:
Auto merged
client/mysql.cc:
Auto merged
client/mysqldump.c:
Auto merged
include/my_sys.h:
Auto merged
include/raid.h:
Auto merged
myisam/mi_close.c:
Auto merged
BitKeeper/deleted/.del-sort.c~e2e56b5a37ce86f4:
Auto merged
BitKeeper/deleted/.del-write.c~8f1918b1f6770e54:
Auto merged
myisam/mi_page.c:
Auto merged
myisam/myisamchk.c:
Auto merged
mysys/default.c:
Auto merged
mysys/mf_keycaches.c:
Auto merged
mysys/my_dup.c:
Auto merged
mysys/my_fopen.c:
Auto merged
mysys/my_handler.c:
Auto merged
mysys/my_malloc.c:
Auto merged
mysys/my_static.c:
Auto merged
mysys/my_write.c:
Auto merged
mysys/safemalloc.c:
Auto merged
mysys/tree.c:
Auto merged
mysys/typelib.c:
Auto merged
regex/regexec.c:
Auto merged
sql/item.cc:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/opt_range.cc:
Auto merged
sql/sql_repl.cc:
Auto merged
sql-common/my_time.c:
Auto merged
BitKeeper/deleted/.del-compiler_warnings.supp:
Delete: support-files/compiler_warnings.supp
client/mysqlbinlog.cc:
Manual merge from 4.1.
client/sql_string.cc:
Manual merge from 4.1.
extra/perror.c:
Manual merge from 4.1.
heap/_check.c:
Manual merge from 4.1.
heap/hp_delete.c:
Manual merge from 4.1.
heap/hp_hash.c:
Manual merge from 4.1.
heap/hp_open.c:
Manual merge from 4.1.
heap/hp_rkey.c:
Manual merge from 4.1.
heap/hp_rrnd.c:
Manual merge from 4.1.
heap/hp_write.c:
Manual merge from 4.1.
libmysql/libmysql.c:
Manual merge from 4.1.
libmysqld/libmysqld.c:
Manual merge from 4.1.
myisam/mi_delete.c:
Manual merge from 4.1.
myisam/mi_dynrec.c:
Manual merge from 4.1.
myisam/mi_keycache.c:
Manual merge from 4.1.
myisam/mi_statrec.c:
Manual merge from 4.1.
myisammrg/myrg_extra.c:
Manual merge from 4.1.
mysys/hash.c:
Manual merge from 4.1.
mysys/list.c:
Manual merge from 4.1.
mysys/mf_iocache.c:
Manual merge from 4.1.
mysys/mf_keycache.c:
Manual merge from 4.1.
mysys/my_alloc.c:
Manual merge from 4.1.
mysys/my_fstream.c:
Manual merge from 4.1.
mysys/my_getwd.c:
Manual merge from 4.1.
mysys/my_lib.c:
Manual merge from 4.1.
mysys/my_lread.c:
Manual merge from 4.1.
mysys/my_lwrite.c:
Manual merge from 4.1.
mysys/my_pread.c:
Manual merge from 4.1.
mysys/my_read.c:
Manual merge from 4.1.
mysys/my_realloc.c:
Manual merge from 4.1.
mysys/my_seek.c:
Manual merge from 4.1.
mysys/raid.cc:
Manual merge from 4.1.
mysys/thr_lock.c:
Manual merge from 4.1.
ndb/src/mgmclient/CommandInterpreter.cpp:
Manual merge from 4.1.
sql/ha_archive.cc:
Manual merge from 4.1.
sql/ha_innodb.cc:
Manual merge from 4.1.
sql/ha_ndbcluster.cc:
Manual merge from 4.1.
sql/item_subselect.cc:
Manual merge from 4.1.
sql/log.cc:
Manual merge from 4.1.
sql/log_event.cc:
Manual merge from 4.1.
sql/mysqld.cc:
Manual merge from 4.1.
sql/net_serv.cc:
Manual merge from 4.1.
sql/slave.cc:
Manual merge from 4.1.
sql/sql_cache.cc:
Manual merge from 4.1.
sql/sql_class.cc:
Manual merge from 4.1.
sql/sql_delete.cc:
Manual merge from 4.1.
sql/sql_parse.cc:
Manual merge from 4.1.
sql/sql_prepare.cc:
Manual merge from 4.1.
sql-common/client.c:
Manual merge from 4.1.
sql/sql_select.cc:
Manual merge from 4.1.
sql/sql_table.cc:
Manual merge from 4.1.
sql/sql_update.cc:
Manual merge from 4.1.
sql/strfunc.cc:
Manual merge from 4.1.
sql/table.cc:
Manual merge from 4.1.
sql/tztime.cc:
Manual merge from 4.1.
sql/unireg.cc:
Manual merge from 4.1.
tests/mysql_client_test.c:
Manual merge from 4.1.
losing it's .MYD
When OPTIMIZE TABLE is completed it attempts to rename temporary
file to original name. This step may fail on windows when a file
is opened. As a result data file might be deleted and optimized
copy of file (table_name.MYD) remains.
This situation is handled properly by my_delete_allow_opened, so
use it instead of my_delete when attempting to rename a file on
windows.
No suitable test case for this bug.
mysys/my_redel.c:
Attempting to delete an opened file and to immediately create
a new one with the same name may result in my_redel failure on
windows. It may fail because file is not deleted until it is
closed.
This situation is handled properly by my_delete_allow_opened, so
use it instead of my_delete.
client/mysql.cc:
Fixed to be as in 5.0 and above.
client/mysqldump.c:
Fixed to be as in 5.0 and above.
include/my_sys.h:
Fixed to be as in 5.0 and above.
mysys/my_static.c:
Fixed to be as in 5.0 and above.
Pass ME_NOREFRESH flag to an error handler in my_malloc() and _mymalloc() in case of memory allocation failure, so that it gets logged to the error log.
mysys/my_malloc.c:
Pass ME_NOREFRESH flag to an error handler in my_malloc() in case of memory allocation failure, so that it gets logged to the error log.
mysys/safemalloc.c:
Pass ME_NOREFRESH flag to an error handler in _mymalloc() in case of memory allocation failure, so that it gets logged to the error log.
fixed differently: wake up select_thread with THR_SERVER_ALARM instead
mysys/thr_alarm.c:
reverted linuxthreads thr_client_alarm fix (not future-proof)
(in thr_alarm.cc it happened too late).
mysys/thr_alarm.c:
move thr_client_alarm initialization to mysqld.cc
(here it happened too late)
sql/mysqld.cc:
move thr_client_alarm initialization to mysqld.cc
(in thr_alarm.cc it happened too late).
moved thr_kill_signal initialization to init_signals()
- Rework the windows implementation in 'create_temp_file' to be
thread safe by using GetTempFileName instad of fiddling
with "environ"
mysys/mf_tempfile.c:
- Update windows implementation of 'create_temp_file' to use
GetTempFileName in favor of fiddeling with "environ" in an unsafe way
- Remove the implementation that is supposed to be used if not
windows, not mkstemp or tmpnam exists as it not longer compiles it
can't be used anywhere.
- Update function comment for 'create_temp_file'
mysys/my_static.c:
Remove unused variable
mysys/my_static.h:
Remove unused variable
mysys/default.c:
Fixed bug.
ndb/src/mgmclient/CommandInterpreter.cpp:
Added parenthesis around the expression.
sql/mysqld.cc:
Fixed compiler warnings.
Added a missing component in options struct (bug).
sql-common/my_time.c:
Removed garbage.
sql/sql_table.cc:
A possible use of a variable uninitialized.
support-files/compiler_warnings.supp:
BitKeeper file /home/my/bk/mysql-4.1-main/support-files/compiler_warnings.supp
- Mis-matched SAFEMALLOC defines caused misleading error message.
client/mysqlbinlog.cc:
Bug#23736 Pointer free error in mysqlbinlog
- Re-worked the Load_log_processor so that it frees it's resources before
my_end is called. This is necessary because SAFEMALLOC's _my_free calls
pthread_mutex_lock() using THR_LOCK_malloc which is cleaned up in my_end().
include/my_sys.h:
Bug#23736 Pointer free error in mysqlbinlog
- Define DYNAMIC_ARRAY beofore MY_TMPDIR
- Add DYNAMIC_ARRAY to MY_TMP_DIR
mysys/array.c:
Bug#23736 Pointer free error in mysqlbinlog
- SAFEMALLOC should not be unconditionally undef'd.
mysys/mf_tempdir.c:
Bug#23736 Pointer free error in mysqlbinlog
- Use struct's DYNAMIC_ARRAY.
- Use DYNAMIC_ARRAY:delete_dynamic function instead of my_free
into mysql.com:/home/kent/bk/tmp/mysql-5.0-build
VC++Files/mysys/mysys.vcproj:
Auto merged
VC++Files/mysys/mysys_ia64.dsp:
Auto merged
mysys/Makefile.am:
Auto merged
BitKeeper/deleted/.del-my_semaphore.c:
Auto merged
VC++Files/mysys/mysys.dsp:
SCCS merged
- When attempting to associate a Windows File handle to a C run-time file
handle there is an upper bound. Once reached, the newly created handles
will cause a memory leak since they are not properly associated with a
handle that can later be cleaned up.
mysys/my_open.c:
Bug#25222 Win32 HANDLE leak in my_sopen()
- Check for failure in _open_osfhandle and close allocated HANDLE on failure.
into pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
BitKeeper/etc/ignore:
auto-union
client/mysqltest.c:
Auto merged
extra/comp_err.c:
Auto merged
include/my_time.h:
Auto merged
mysql-test/r/innodb.result:
Auto merged
mysql-test/r/mysqltest.result:
Auto merged
mysql-test/r/type_blob.result:
Auto merged
mysql-test/t/mysqltest.test:
Auto merged
sql/item.cc:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_cmpfunc.h:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/log.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_load.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/tztime.cc:
Auto merged
client/mysql_upgrade.c:
Manual merge
mysql-test/mysql-test-run.pl:
Manual merge
mysql-test/r/ctype_cp932.result:
Manual merge
mysql-test/r/mysqlbinlog.result:
Manual merge
mysql-test/t/ctype_cp932.test:
Manual merge
mysql-test/t/mysql.test:
Manual merge
mysql-test/t/mysqlbinlog.test:
Manual merge
Fixed a couple of usage of not initialized warnings (unlikely cases)
client/mysqldump.c:
Fixed compiler warnings from 'max' build
client/mysqltest.c:
Removed compiler warnings
cmd-line-utils/readline/xmalloc.c:
Fixed compiler warnings from 'max' build
extra/comp_err.c:
Fixed compiler warnings from 'max' build
extra/yassl/include/openssl/ssl.h:
Changed prototype for SSL_set_fd() to fix compiler warnings (and possible errors) on windows 64 bit
extra/yassl/include/socket_wrapper.hpp:
Moved socket_t to ssl.h, to be able to removed compiler warnings on windows 64 bit
extra/yassl/src/ssl.cpp:
Changed prototype for SSL_set_fd() to fix compiler warnings (and possible errors) on windows 64 bit
extra/yassl/taocrypt/src/integer.cpp:
Fixed compiler warnings
include/my_global.h:
Added my_offsetof() macro from 5.1 to get rid of compiler warnings
innobase/include/ut0byte.ic:
Fixed compiler warnings on win64
innobase/include/ut0ut.ic:
Fixed compiler warnings on win64
libmysql/libmysql.def:
Fixed compiler warnings on win64
myisam/mi_packrec.c:
Fixed compiler warnings on win64
myisam/myisamchk.c:
Fixed compiler warnings from 'max' build
mysys/base64.c:
Fixed compiler warnings on win64
mysys/mf_keycache.c:
Fixed compiler warnings from 'max' build
mysys/my_getopt.c:
Fixed compiler warnings from 'max' build
mysys/my_init.c:
Fixed compiler warnings from 'max' build
mysys/my_thr_init.c:
Fixed compiler warnings
mysys/ptr_cmp.c:
Fixed compiler warnings from 'max' build
ndb/include/kernel/signaldata/DictTabInfo.hpp:
Fixed compiler warnings
server-tools/instance-manager/mysql_connection.cc:
Fixed compiler warnings
server-tools/instance-manager/mysqlmanager.cc:
Fixed compiler warnings
sql/filesort.cc:
Initalize variable that was used unitialized in error conditions
sql/ha_berkeley.cc:
Moved get_auto_primary_key() here as int5store() gives (wrong) compiler warnings in win64
sql/ha_berkeley.h:
Moved get_auto_primary_key() to ha_berkeley.cc
sql/ha_innodb.cc:
Fixed compiler warnings
sql/item.cc:
Fixed compiler warnings from 'max' build
sql/item_timefunc.cc:
Fixed compiler warnings
sql/mysqld.cc:
Fixed compiler warnings
sql/sql_acl.cc:
Fixed compiler warnings from 'max' build
sql/sql_base.cc:
Fixed compiler warnings from 'max' build
sql/sql_insert.cc:
Initialize variable that may be used unitialized on error conditions (not fatal)
sql/sql_prepare.cc:
Fixed compiler warnings from 'max' build
sql/sql_select.cc:
Fixed compiler warnings
sql/sql_show.cc:
Fixed compiler warnings
sql/udf_example.def:
Fixed compiler warnings on win64
sql/unireg.cc:
Initialize variable that may be used unitialized on error conditions
strings/ctype-ucs2.c:
Fixed compiler warnings
strings/ctype-utf8.c:
Fixed compiler warnings
strings/decimal.c:
Fixed compiler warnings
support-files/compiler_warnings.supp:
Ignore warnings from sql_yacc.cc that are hard to remove
Ignore some not important warnings from windows 64 bit build
tools/mysqlmanager.c:
Fixed compiler warnings