Commit graph

462 commits

Author SHA1 Message Date
Igor Babaev
7f52af655a Merge. 2010-12-10 23:23:34 -08:00
Michael Widenius
e68ff46653 Fixed compiler and gmake warnings
- Removed SCCS rule from Makefile.am
- Made dummy rule in sql_yacc.yy to get rid of compiler warning about not used label.
Don't use maintainer mode with valgrind (as we don't want to initialize all variables)

config/ac-macros/maintainer.m4:
  Don't use maintainer mode with valgrind (as we don't want to initialize all variables)
  Force initialization of variables when using -Werror (To get rid of compiler warnings)
configure.in:
  Don't use maintainer mode with valgrind (as we don't want to initialize all variables)
sql/sql_yacc.yy:
  Made dummy rule in sql_yacc.yy to get rid of compiler warning about not used label.
2010-11-29 11:27:52 +02:00
Michael Widenius
1a6373e8e2 Merge with MySQL 5.1.53
Open issues:
- A better fix for #57688; Igor is working on this
- Test failure in index_merge_innodb.test ; Igor promised to look at this
- Some Innodb tests fails (need to merge with latest xtradb) ; Kristian promised to look at this.
 - Failing tests: innodb_plugin.innodb_bug56143 innodb_plugin.innodb_bug56632 innodb_plugin.innodb_bug56680 innodb_plugin.innodb_bug57255 
- Werror is disabled;  Should be enabled after merge with xtradb.
2010-11-25 00:57:34 +02:00
Michael Widenius
b52020221e Merge with MySQL 5.1.52 2010-11-23 23:39:59 +02:00
unknown
0de9a4abab MWL#74: Shared libmysqld.so library.
Switch makefiles to use libtool to build libmysqld.so, as well as all its
dependencies.

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

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

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

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

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

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

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

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

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


client/Makefile.am:
  Updated for using libtool
config/ac-macros/plugins.m4:
  Replace MUSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS with mechanism for plugins
  to specify alternate object for embedded.
configure.in:
  Fix linking duplicate objects related to THREAD_LOBJECTS.
dbug/Makefile.am:
  Updated for using libtool
extra/Makefile.am:
  Fix relative paths.
libmysqld/Makefile.am:
  Build libmysqld.la using libtool
libmysqld/examples/Makefile.am:
  Updated to use libtool
mysys/Makefile.am:
  Updated to use libtool.
  Fix linking duplicate objects related to THREAD_LOBJECTS.
mysys/my_uuid.c:
  Fix conflicting global mutex name by making it static.
regex/Makefile.am:
  Updated to use libtool
sql/Makefile.am:
  Updated to use libtool
sql/item_func.cc:
  Fix conflicting mutex name.
sql/mysql_priv.h:
  Fix conflicting mutex name
sql/mysqld.cc:
  Fix conflicting mutex name.
  Add missing call of my_uuid_end().
storage/archive/Makefile.am:
  Updated to use libtool
storage/archive/plug.in:
  Updated to use libtool
storage/blackhole/Makefile.am:
  Updated to use libtool
storage/blackhole/plug.in:
  Updated to use libtool
storage/csv/Makefile.am:
  Updated to use libtool
storage/csv/plug.in:
  Updated to use libtool
storage/example/Makefile.am:
  Updated to use libtool
storage/federated/Makefile.am:
  Updated to use libtool
storage/federated/plug.in:
  Updated to use libtool
storage/federatedx/Makefile.am:
  Updated to use libtool
storage/federatedx/plug.in:
  Updated to use libtool
storage/heap/Makefile.am:
  Updated to use libtool
storage/heap/plug.in:
  Updated to use libtool
storage/innobase/Makefile.am:
  Updated to use libtool
storage/innobase/plug.in.disabled:
  Updated to use libtool
storage/innodb_plugin/Makefile.am:
  Updated to use libtool
storage/maria/CMakeLists.txt:
  Fix linking duplicate object in maria_dump_log, causes failure on Mac OS X
storage/maria/Makefile.am:
  Updated to use libtool
  Fix linking duplicate object in maria_dump_log, causes link failure on Mac OS X
storage/maria/ma_loghandler.c:
  Move maria_dump_log code to separate file to fix duplicate object link failures.
storage/maria/ma_loghandler.h:
  Move maria_dump_log code to separate file to fix duplicate object link failures.
storage/maria/maria_dump_log.c:
  Move maria_dump_log code to separate file to fix duplicate object link failures.
storage/maria/plug.in:
  Updated to use libtool
storage/myisam/Makefile.am:
  Updated to use libtool
storage/myisam/plug.in:
  Updated to use libtool
storage/myisammrg/Makefile.am:
  Updated to use libtool
storage/myisammrg/plug.in:
  Updated to use libtool
storage/pbxt/plug.in:
  Updated to use libtool
storage/pbxt/src/Makefile.am:
  Updated to use libtool
storage/xtradb/Makefile.am:
  Updated to use libtool
storage/xtradb/plug.in:
  Updated to use libtool
strings/Makefile.am:
  Updated to use libtool
unittest/unit.pl:
  Don't attempt to run libtool internal files as unit tests.
vio/Makefile.am:
  Updated to use libtool
2010-11-17 13:24:20 +01:00
Igor Babaev
0b72fd88a1 Merge. 2010-10-30 06:07:45 -07:00
Georgi Kodinov
fd46de026d merge to 5.1-security 2010-10-29 14:02:49 +03:00
Calvin Sun
16feea4109 Bug#52062: Compiler warning in os0file.c on windows 64-bit
On Windows, the parameter for number of bytes passed into WriteFile()
and ReadFile() is DWORD. Casting is needed to silence the warning on
64-bit Windows.

Also, adding several asserts to ensure the variable for number of bytes
is no more than 32 bits, even on 64-bit Windows.

This is for built-in InnoDB.

rb://415
Approved by: Inaam
2010-10-27 23:18:59 -05:00
Igor Babaev
4f75a8254a Merge 5.3-mwl128 -> 5.3 2010-10-27 16:31:22 -07:00
Vasil Dimov
4bf273c8f1 Merge mysql-5.1-bugteam -> mysql-5.1-innodb 2010-10-27 16:39:22 +03:00
Inaam Rana
26738c280f Bug #57611 ibdata file and continuous growing undo logs
rb://498

Fix handling of update_undo_logs at trx commit. Previously, when
rseg->update_undo_list grows beyond 500 the update_undo_logs were
marked with state TRX_UNDO_TO_FREE which should have been
TRX_UNDO_TO_PURGE.

Approved by: Sunny Bains
2010-10-26 16:54:18 -04:00
Jimmy Yang
e8f228e7eb Fix Bug #57616 Sig 11 in dict_load_table() when failed to load
index or foreign key

Approved by Sunny Bains
2010-10-20 19:56:42 -07:00
Jimmy Yang
1e09ea9549 Fix bug #57616 Sig 11 in dict_load_table() when failed to load index
or foreign key

Fix approved by Sunny Bains
2010-10-20 19:14:25 -07:00
Davi Arnaut
7406b38efa Bug#45288: pb2 returns a lot of compilation warnings
Ensure that fdatasync is properly declared as on Mac OS X, the
function is available but there is no prototype. Also, port a
fix for a warning from the InnoDB plugin over to the builtin. 

configure.in:
  Check that fdatasync is declared.
mysys/my_sync.c:
  Use fdatasync only if it is declared.
storage/innobase/include/ut0dbg.h:
  Port over from the plugin a fix for a warning.
2010-10-19 14:48:03 -02:00
Davi Arnaut
8875c2c2e0 Bug#45288: pb2 returns a lot of compilation warnings on linux
Tag unused arguments.

Approved by: Marko (via IRC)
2010-10-19 12:09:28 -02:00
Sergei Golubchik
745cc74c33 5.1.51 merge 2010-10-19 15:58:35 +02:00
Marko Mäkelä
a8f2f7af32 Bug #56680 wrong InnoDB results from a case-insensitive covering index
row_search_for_mysql(): When a secondary index record might not be
visible in the current transaction's read view and we consult the
clustered index and optionally some undo log records, return the
relevant columns of the clustered index record to MySQL instead of the
secondary index record.

REC_INFO_DELETED_FLAG: Move the definition from rem0rec.ic to rem0rec.h.

ibuf_insert_to_index_page_low(): New function, refactored from
ibuf_insert_to_index_page().

ibuf_insert_to_index_page(): When we are inserting a record in place
of a delete-marked record and some fields of the record differ, update
that record just like row_ins_sec_index_entry_by_modify() would do.

mysql_row_templ_t: Add clust_rec_field_no.

row_sel_store_mysql_rec(), row_sel_push_cache_row_for_mysql(): Add the
flag rec_clust, for returning data at clust_rec_field_no instead of
rec_field_no. Resurrect the debug assertion that the record not be
marked for deletion. (Bug #55626)

buf_LRU_free_block(): Refactored from
buf_LRU_search_and_free_block(). This is needed for the
innodb_change_buffering_debug diagnostics.

[UNIV_DEBUG || UNIV_IBUF_DEBUG] ibuf_debug, buf_page_get_gen(),
buf_flush_page_try():
Implement innodb_change_buffering_debug=1 for evicting pages from the
buffer pool, so that change buffering will be attempted more
frequently.
2010-10-19 08:58:53 +03:00
Vasil Dimov
902b13fa57 Fix Bug#57252 disabling innobase_stats_on_metadata disables ANALYZE
In order to fix this bug we need to distinguish whether ha_innobase::info()
has been called from ::analyze() or not. Rename ::info() to ::info_low()
and add a boolean parameter that tells whether the call is from ::analyze()
or not. Create a new simple ::info() that just calls
::info_low(false => not called from analyze). From ::analyze() instead of
::info() call ::info_low(true => called from analyze).

Approved by:	Jimmy (rb://487)
2010-10-18 13:48:11 +03:00
Vasil Dimov
3e56680632 Merge mysql-5.1-bugteam -> mysql-5.1-innodb 2010-10-15 17:38:39 +03:00
Vasil Dimov
4c14da7975 Fix Bug#56143 too many foreign keys causes output of show create table to become invalid
Just remove the check whether the file is "too big".
A similar code exists in ha_innobase::update_table_comment() but that
method does not seem to be used.
2010-10-13 20:18:59 +03:00
unknown
498ee6bd19 Fix bug #57345 2010-10-11 22:13:47 +02:00
Marko Makela
bda9e4570b Merge Bug #57345, Bug #56982, Bug#53307 test from mysql-5.1-innodb 2010-10-11 21:28:51 +02:00
Jimmy Yang
820e1bc6f4 A more complete fix for bug #57345 btr_pcur_store_position abort for load
with concurrent lock/unlock tables

Approved by Marko
2010-10-11 05:36:13 -07:00
Marko Mäkelä
df29195345 Bug #56947 InnoDB leaks memory when failing to create a table
No mysql-test case. Tested by creating a table, removing a *.frm file and
attempting to create the table again. Code coverage tested by
instrumentation. Tested with Valgrind.
2010-10-11 11:01:47 +03:00
Martin Hansson
30f57b3323 Bug#56423: Different count with SELECT and CREATE SELECT queries
This is a regression from the fix for bug no 38999. A storage engine capable
of reading only a subset of a table's columns updates corresponding bits in
the read buffer to signal that it has read NULL values for the corresponding
columns. It cannot, and should not, update any other bits. Bug no 38999
occurred because the implementation of UPDATE statements compare the NULL bits
using memcmp, inadvertently comparing bits that were never requested from the
storage engine. The regression was caused by the storage engine trying to
alleviate the situation by writing to all NULL bits, even those that it had no
knowledge of. This has devastating effects for the index merge algorithm,
which relies on all NULL bits, except those explicitly requested, being left
unchanged.

The fix reverts the fix for bug no 38999 in both InnoDB and InnoDB plugin and
changes the server's method of comparing records. For engines that always read
entire rows, we proceed as usual. For engines capable of reading only select
columns, the record buffers are now compared on a column by column basis. An
assertion was also added so that non comparable buffers are never read. Some
relevant copy-pasted code was also consolidated in a new function.
2010-10-07 10:13:11 +02:00
Jimmy Yang
cf2c8701b4 Fix Bug #57255 Cascade Delete results in "Got error -1 from storage engine".
rb://477 approved by Marko
2010-10-06 03:41:26 -07:00
Georgi Kodinov
292a72a043 merged mysql-5.1 into mysql-5.1-bugteam 2010-10-05 11:11:56 +03:00
Marko Mäkelä
678bc90ed8 Bug#56716 InnoDB locks a record gap without locking the table
row_search_for_mysql(): Acquire an intention lock on the table
before locking the first record gap.
2010-10-04 13:05:21 +03:00
Vasil Dimov
eaaea8eb7d Fix Bug#56340 innodb updates index stats too frequently after non-index updates
This is a simple optimization issue. All stats are related to only indexed
columns, index size or number of rows in the whole table. UPDATEs that touch
only non-indexed columns cannot affect stats and we can avoid calling the
function row_update_statistics_if_needed() which may result in unnecessary I/O.

Approved by:	Marko (rb://466)
2010-09-30 15:48:44 +03:00
Vasil Dimov
05a0ad8dcb (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
handler/ha_innodb.cc: In function 'bool innodb_show_status(handlerton*, THD*, bool (*)(THD*, const char*, uint, const char*, uint, const char*, uint))':
handler/ha_innodb.cc:7539:7: error: variable 'result' set but not used [-Werror=unused-but-set-variable]
2010-09-14 18:25:41 +03:00
Vasil Dimov
de12861681 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
handler/ha_innodb.cc: In function 'void innobase_drop_database(handlerton*, char*)':
handler/ha_innodb.cc:5969:6: error: variable 'error' set but not used [-Werror=unused-but-set-variable]
2010-09-14 18:22:30 +03:00
Vasil Dimov
bed81fec77 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
trx/trx0undo.c: In function 'trx_undo_set_state_at_prepare':
trx/trx0undo.c:1798:16: error: variable 'page_hdr' set but not used [-Werror=unused-but-set-variable]
2010-09-14 17:55:44 +03:00
Vasil Dimov
33c7ab2b98 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
trx/trx0undo.c: In function 'trx_undo_truncate_end':
trx/trx0undo.c:1015:14: error: variable 'rseg' set but not used [-Werror=unused-but-set-variable]
2010-09-14 17:53:49 +03:00
Vasil Dimov
e3de88c3f8 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
trx/trx0trx.c: In function 'trx_prepare_off_kernel':
trx/trx0trx.c:1830:11: error: variable 'update_hdr_page' set but not used [-Werror=unused-but-set-variable]
2010-09-14 15:30:26 +03:00
Vasil Dimov
9d74ab6033 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
trx/trx0sys.c: In function 'trx_sys_create_doublewrite_buf':
trx/trx0sys.c:168:10: error: variable 'new_page' set but not used [-Werror=unused-but-set-variable]
2010-09-14 15:28:48 +03:00
Vasil Dimov
d1b9cca52c (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warnings:
trx/trx0roll.c: In function 'trx_undo_arr_remove_info':
trx/trx0roll.c:717:9: error: variable 'n' set but not used [-Werror=unused-but-set-variable]
trx/trx0roll.c:716:9: error: variable 'n_used' set but not used [-Werror=unused-but-set-variable]
2010-09-14 15:21:32 +03:00
Vasil Dimov
94ce8492b6 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
trx/trx0purge.c: In function 'trx_purge_rec_release':
trx/trx0purge.c:1007:18: error: variable 'arr' set but not used [-Werror=unused-but-set-variable]
2010-09-14 15:19:04 +03:00
Vasil Dimov
00686b4e11 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
trx/trx0purge.c: In function 'trx_purge_rseg_get_next_history_log':
trx/trx0purge.c:599:15: error: variable 'seg_hdr' set but not used [-Werror=unused-but-set-variable]
2010-09-14 15:17:48 +03:00
Vasil Dimov
3d4dcf266f (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
trx/trx0purge.c: In function 'trx_purge_add_update_undo_to_history':
trx/trx0purge.c:254:16: error: variable 'page_header' set but not used [-Werror=unused-but-set-variable]
trx/trx0purge.c:252:15: error: variable 'seg_header' set but not used [-Werror=unused-but-set-variable]
2010-09-14 15:04:03 +03:00
Vasil Dimov
00c6e219c6 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
row/row0vers.c: In function 'row_vers_impl_x_locked_off_kernel':
row/row0vers.c:62:9: error: variable 'err' set but not used [-Werror=unused-but-set-variable]
2010-09-14 14:50:13 +03:00
Vasil Dimov
c283946dd6 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
row/row0upd.c: In function 'row_upd_in_place_in_select':
row/row0upd.c:2040:9: error: variable 'err' set but not used [-Werror=unused-but-set-variable]
2010-09-14 14:46:13 +03:00
Vasil Dimov
67c388410b (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
row/row0umod.c: In function 'row_undo_mod_clust_low':
row/row0umod.c:92:9: error: variable 'success' set but not used [-Werror=unused-but-set-variable]
2010-09-14 14:09:36 +03:00
Vasil Dimov
1bdcd70fad (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
row/row0purge.c: In function 'row_purge_step':
row/row0purge.c:660:9: error: variable 'err' set but not used [-Werror=unused-but-set-variable]

(row_purge() always returns DB_SUCCESS)
2010-09-14 13:56:29 +03:00
Vasil Dimov
a82e39e728 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
que/que0que.c: In function 'que_thr_dec_refer_count':
que/que0que.c:805:11: error: variable 'sess' set but not used [-Werror=unused-but-set-variable]
2010-09-14 13:39:52 +03:00
Vasil Dimov
d4bd5e0089 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
que/que0que.c: In function 'que_run_threads_low':
que/que0que.c:1295:9: error: variable 'cumul_resource' set but not used [-Werror=unused-but-set-variable]
2010-09-14 13:38:21 +03:00
Vasil Dimov
5e4febf4f3 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warnings:
os/os0file.c: In function 'os_file_create':
os/os0file.c:1318:14: error: variable 'purpose_str' set but not used [-Werror=unused-but-set-variable]
os/os0file.c:1317:14: error: variable 'type_str' set but not used [-Werror=unused-but-set-variable]
2010-09-14 13:01:25 +03:00
Vasil Dimov
1813340bd6 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
log/log0recv.c: In function 'recv_synchronize_groups':
log/log0recv.c:403:10: error: variable 'limit_lsn' set but not used [-Werror=unused-but-set-variable]
2010-09-14 12:46:23 +03:00
Vasil Dimov
27c84cf762 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
log/log0recv.c: In function 'recv_recovery_from_checkpoint_start':
log/log0recv.c:2509:10: error: variable 'archived_lsn' set but not used [-Werror=unused-but-set-variable]
2010-09-14 12:41:00 +03:00
Vasil Dimov
8e942b3265 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
lock/lock0lock.c: In function 'lock_print_info_all_transactions':
lock/lock0lock.c:4299:10: error: variable 'page' set but not used [-Werror=unused-but-set-variable]
2010-09-14 12:37:03 +03:00
Vasil Dimov
e63ef8a33f Remove redundant variable 2010-09-14 12:11:00 +03:00