Commit graph

6369 commits

Author SHA1 Message Date
Inaam Rana
8e6d41e278 merge from mysql-5.1 2011-12-01 09:47:12 -05:00
Inaam Rana
f22437ab50 Bug#13414773 -INNODB_FAST_SHUTDOWN=2, ASSERT STATE == BUF_BLOCK_ZIP_PAGE
We can have dirty pages during a fast shutdown. Relax the assertion.
2011-12-01 09:41:52 -05:00
Michael Widenius
efcfb195e3 Merge with 5.1 2011-11-30 22:57:18 +02:00
Michael Widenius
6378bdbf47 Fixed compiler warning and errors
mysql-test/suite/funcs_1/t/is_engines_federated.test:
  Corrected path
storage/xtradb/fil/fil0fil.c:
  Fixed compiler warning
2011-11-30 20:57:09 +02:00
Michael Widenius
692fcba403 Fixed compiler warnings and other bugs found by buildbot.
client/mysqltest.cc:
  Free mutex after usage (fixes valgrind warnings in embedded server)
mysql-test/include/gis_keys.inc:
  Fixed failure in innodb.gis_test
mysql-test/r/gis.result:
  Updated result
mysql-test/suite/innodb/r/innodb_gis.result:
  Updated results
mysql-test/suite/innodb/t/innodb_bug38231.test:
  Added handling of timeouts (happend on some servers in buildbot)
mysql-test/suite/innodb_plugin/r/innodb_gis.result:
  Updated results
mysql-test/suite/innodb_plugin/t/innodb.test:
  Use error names instead of numbers
mysql-test/suite/innodb_plugin/t/innodb_misc1.test:
  This test requires utf8
mysql-test/suite/innodb_plugin/t/innodb_mysql.test:
  This test requires Xtradb
sql/sql_base.cc:
  Don't print table names for placeholders.
sql/sql_show.cc:
  Temporary fix:
  Save and restore db and table_name in mysqld_show_create (to get rid of valgrind warning)
  A better solution that needs to be investgated is to not change these fields in mysql_derived_prepare()
sql/sql_view.cc:
  Fixed valgrind warning
storage/xtradb/handler/ha_innodb.cc:
  Don't access THD directly
2011-11-30 18:44:51 +02:00
Sergei Golubchik
ca5b1b5431 test both federated and federatedX in the federated suite.
mysql-test/lib/My/Options.pm:
  My::Options::is_set() now matches both option names and values!
mysql-test/lib/mtr_cases.pm:
  1. don't merge --plugin-load here, it's too early
  2. don't skip combinations that set --plugin-load just because the test needs another --plugin-load.
     Skip *only* if test's --plugin-load matches *exactly* --plugin-load of one of the combinations.
  3. if skipping all combinations but one, still assign the test to the combination
mysql-test/mysql-test-run.pl:
  1. remove dead code - don't set variables that aren't used.
  2. bugfix: allow one-letter combination names
  3. in the command line, merge all --plugin-load options in one
storage/federated/ha_federated.cc:
  bugfix: garbage character in the generated SELECT query
2011-11-30 11:37:28 +01:00
unknown
be505e3ebf Cherrypick into XtraDB: Bug#13002783 PARTIALLY UNINITIALIZED CASCADE UPDATE VECTOR
We merged the test case for this into MariaDB 5.1, but the fix
was not yet part of XtraDB.
2011-11-30 13:53:25 +01:00
Vladislav Vaintroub
5d67eb6b5c Fix Aria unit tests on Windows.
Replace statements connected with bitwise OR with series of "if"s.
The later is guaranteed to execute in order, bitwise OR does not have
specific order for statement execution.
2011-11-30 00:26:32 +01:00
Michael Widenius
47575bd0e0 Fixed compiler warnings
dbug/tests.c:
  Added __attribute__((unused)) to get rid of compiler warning
server-tools/instance-manager/guardian.cc:
  Added __attribute__((unused)) to get rid of compiler warning
sql/filesort.cc:
  Added __attribute__((unused)) to get rid of compiler warning
sql/slave.cc:
  Added __attribute__((unused)) to get rid of compiler warning
sql/sql_load.cc:
  Added __attribute__((unused)) to get rid of compiler warning
sql/sql_table.cc:
  Added __attribute__((unused)) to get rid of compiler warning
storage/maria/ma_blockrec.c:
  Added __attribute__((unused)) to get rid of compiler warning
storage/maria/ma_check.c:
  Added missing cast
storage/maria/ma_loghandler.c:
  Added __attribute__((unused)) to get rid of compiler warning
storage/maria/ma_recovery.c:
  Added __attribute__((unused)) to get rid of compiler warning
storage/pbxt/src/cache_xt.cc:
  Added __attribute__((unused)) to get rid of compiler warning
storage/xtradb/fil/fil0fil.c:
  Removed not used variable
storage/xtradb/handler/ha_innodb.cc:
  Use unused variable
vio/viosocket.c:
  Remove usage of not used variable
vio/viosslfactories.c:
  Added cast
2011-11-30 00:34:05 +02:00
Michael Widenius
a7f87effa5 Merge with 5.1 + fixes for build failures in 5.2
cmd-line-utils/libedit/map.c:
  Fixed compiler warning
cmd-line-utils/libedit/terminal.c:
  Fixed compiler warning
cmd-line-utils/libedit/tty.c:
  Fixed compiler warning
sql/sql_base.cc:
  Fixed memory leak found by valgrind
storage/maria/compat_aliases.cc:
  Ensure that recover_alias is also a set
storage/maria/ma_bitmap.c:
  Proper fix for compiler warning
support-files/compiler_warnings.supp:
  Fixed compiler warning
2011-11-29 22:48:24 +02:00
Nirbhay Choubey
756416f645 Merge of patch for bug#11756764 from mysql-5.1. 2011-11-29 19:31:51 +05:30
Michael Widenius
a19f4e3a3a Fixed that maria-recover works as expected.
- "" is now used if no option is set

include/maria.h:
  Added HA_RECOVER_ANY
storage/maria/ha_maria.cc:
  Insert of checking if maria_recover_options == 0, check if any bit is set.
  Fix maria_recover_names to match bitmap. This fixes that recover options works as expected.
storage/maria/ha_maria.h:
  Insert of checking if maria_recover_options == 0, check if any bit is set.
storage/maria/ma_check.c:
  Fixed wrong print
2011-11-29 15:32:25 +02:00
Nirbhay Choubey
c67a91f11a Bug#11756764 48726: MYSQLD KEEPS CRASHING WITH SIGSEGV
WITH MYISAM_USE_MMAP ENABLED

MySQL server can crash due to segmentation fault when
started with myisam_use_mmap.

The reason behind this being, while making a request to
unmap (munmap) the previously mapped memory (mmap), the
size passed was 7 bytes larger than the size requested at
the time of mapping. This can eventually unmap the adjacent
memory mapped block, belonging to some other memory-map pool.
Hence the subsequent call to mmap can map a region which was
still a valid memory mapped area.

Fixed by removing the extra 7-byte margin which was erroneously
added to the size, used for unmappping.


storage/myisam/mi_close.c:
  Bug#11756764 48726: MYSQLD KEEPS CRASHING WITH SIGSEGV
                      WITH MYISAM_USE_MMAP ENABLED
  
  Added a condition to call _mi_unmap_file() in case
  of compressed records. mi_munmap_file() is called
  otherwise.
storage/myisam/mi_packrec.c:
  Bug#11756764 48726: MYSQLD KEEPS CRASHING WITH SIGSEGV
                      WITH MYISAM_USE_MMAP ENABLED
  
  mi_dynmap_file() function, after successfully executing
  mmap, stores the total size in info->s->mapped_length
  variable. Now, if mi_dynmap_file() is invoked with a size
  with an extra 7-byte margin (MEMMAP_EXTRA_MARGIN),
  the margin will eventually also get stored in mapped_length.
  So, un-mapping function can simply use the value stored in
  mapped_length in order to unmap the previously mapped
  region.
2011-11-29 17:59:35 +05:30
Alexey Botchkov
cdde6187d1 bug 857066 Wrong result with ST_DISJOINT when using an index.
DISJOINT can't be properly optimized with the RTree keys in MyISAM also.

per-file comments:
  storage/myisam/rt_index.c
bug 857066 Wrong result with ST_DISJOINT when using an index.
        don't optimize DISJOINT with the RTree keys.
2011-11-29 15:27:52 +04:00
Vladislav Vaintroub
82adfe7b2a merge, fix Windows warnings 2011-11-29 02:00:24 +01:00
Vladislav Vaintroub
0c3b78438b Fix Windows build, and a conversion truncation warning. 2011-11-29 01:10:17 +01:00
Alexey Botchkov
18d9f8d429 bug 857066 Wrong result with ST_DISJOINT when using an index
the ST_DISJOINT can't be properly optimized with the RTree key
        at the moment.

per-file comments:
  storage/maria/ma_rt_index.c
bug 857066 Wrong result with ST_DISJOINT when using an index
        disabled optimization for the DISJOINT case.
2011-11-29 02:11:13 +04:00
Sergei Golubchik
e79847d16a after merge fixes
sql/sql_base.cc:
  fix a memory leak
storage/xtradb/handler/ha_innodb.cc:
  fix for a visual studio
storage/xtradb/row/row0ins.c:
  valgrind complains about uninitialized variable.
  incorrect errors in the innodb.test too
2011-11-28 15:08:12 +01:00
Vladislav Vaintroub
835d8b6242 merge 2011-11-28 01:23:13 +01:00
Sergei Golubchik
ac8dd6beb9 merged 2011-11-27 17:50:50 +01:00
Sergei Golubchik
effed09bd7 5.3->5.5 merge 2011-11-27 17:46:20 +01:00
Vladislav Vaintroub
7e55deea9b Fix MariaDB wasnings on Windows (rmdir not defined unless direct.h is included) 2011-11-26 23:08:46 +01:00
Vladislav Vaintroub
64e308e28d Fix build and packaging on Windows:
- build executables we have in 5.3 (mysql_install_db.exe, mysq_upgrade_service.exe, upgrade wizard), and MSI

- add some missing headers to windows specific source files. 
This needs to be done since 5.5 is using WIN32_LEAN_AND_MEAN preprocessor constant thus windows.h 
no more includes whiole Windows

- do not deliver perl scripts  (mysql_install_db.pl & friends)  -they do not work, are not documented, and we 
have native executables for this functionality. do not pack echo.exe, replace.exe  into MSI, they 
are not needed. Do not build resolveip on Windows, it is not used.

- precache results of  of system checks in cmake/os/WindowsCache.cmake (like it is alreay done for  majority of tests
to speed up cmake run with VS)

- make feedback plugin DEFAULT on Windows (so MSI works if user enables plugin), 
fix null pointer access in PSI_register
2011-11-26 23:07:53 +01:00
Vladislav Vaintroub
6be24a771a Avoid mysqld dependency on libaio.so by linking xtradb statically to libaio.
A variable XTRADB_PREFER_STATIC_LIBAIO should be set to 1 (or TRUE
 or ON) for static linking.

Even if mysqld can avoid dependency on shared libaio, shared libraries 
libmysqld.so or ha_innodb.so cannot link without it.

Given that the patch primarily addresses building tar.gz package, and 
shared libraries mentioned above deemed less important than mysqld
executable, we accept shared lib dependency on libaio.so
2011-11-25 20:50:14 +01:00
Michael Widenius
a293d0788c Automatic merge 2011-11-24 22:48:35 +02:00
Michael Widenius
1670845c3b Fixed that one can use --maria-recover=backup,force
(Before we only allowed one option)
2011-11-24 19:23:20 +02:00
Michael Widenius
6920457142 Merge with MariaDB 5.1 2011-11-24 18:48:58 +02:00
Michael Widenius
d26aefb077 Fixes for build failuers found by buildbot
mysql-test/mysql-test-run.pl:
  Rename MYSQLD -> MYSQLD_SIMPLE_CMD to avoid conflict with new MYSQLD variable from MySQL 5.1
mysql-test/r/innodb_file_format.result:
  Remove old duplicated test
mysql-test/suite/pbxt/r/endspace.result:
  Update test to last version
mysql-test/suite/pbxt/r/heap.result:
  Removed heap test (not part of pbxt)
mysql-test/suite/pbxt/r/select_safe.result:
  Updated results after error message change
mysql-test/suite/pbxt/r/view_grant.result:
  Removed view test (not part of pbxt)
mysql-test/suite/pbxt/t/endspace.test:
  Update test to last version
mysql-test/suite/pbxt/t/heap.test:
  Removed heap test (not part of pbxt)
mysql-test/suite/pbxt/t/view_grant.test:
  Removed view test (not part of pbxt)
mysql-test/t/innodb_file_format.test:
  Remove old duplicated test
mysql-test/t/mysqld_option_err.test:
  Use renamed variable
sql/my_decimal.h:
  Fixed wrong define
storage/maria/ma_loghandler.c:
  Fixed compiler warning
2011-11-24 16:04:19 +02:00
Michael Widenius
7b368e3810 Merge with MySQL 5.1.60 2011-11-23 19:32:14 +02:00
Sergei Golubchik
7189f09aa6 compiler warnings/errors 2011-11-23 18:25:07 +01:00
Ashish Agarwal
0fa7fe90b4 BUG#11751793 - 42784: Merge from mysql-5.1 to mysql-5.5 2011-11-23 18:50:29 +05:30
Ashish Agarwal
a00f87bf15 BUG#11751793 - 42784: ARCHIVE TABLES CAUSE 100% CPU USAGE
AND HANG IN SHOW TABLE STATUS.

ISSUE: Table corruption due to concurrent queries.
       Different threads running insert and check
       query leads to table corruption. Not properly locked,
       rows are inserted in between check query.

SOLUTION: In check query mutex lock is acquired
          for a longer time to handle concurrent
          insert and check query.

NOTE: Additionally we backported the fix for CHECKSUM
      issue(bug#11758979).
2011-11-23 18:33:29 +05:30
Sergei Golubchik
d2755a2c9c 5.3->5.5 merge 2011-11-22 18:04:38 +01:00
Michael Widenius
ccb2c805de Merge of XtraDB for 5.1.59 2011-11-21 19:19:37 +02:00
Michael Widenius
a8d03ab235 Initail merge with MySQL 5.1 (XtraDB still needs to be merged)
Fixed up copyright messages.
2011-11-21 19:13:14 +02:00
Vasil Dimov
de479ab3b6 Followup to vasil.dimov@oracle.com-20111118115710-1xlezv0nbjz6s2ps
Fix merge issues after discussing with Marko.
2011-11-21 15:26:24 +02:00
Marko Mäkelä
7a48b3df7f Bug#13340047 LATCHING ORDER VIOLATION IN IBUF_SET_ENTRY_COUNTER() - cleanup
Remove btr_cur_t::ibuf_cnt. The only dependence on cursor->ibuf_cnt
was ibuf_set_entry_counter(). That code path was removed in the
original bug fix (marko.makela@oracle.com-20111107072802-dgwagejlpub0rjkd).

rb:819 approved by Jimmy Yang
2011-11-22 13:14:55 +02:00
unknown
ec889cd2e2 Merge XtraDB from Percona-Server-5.1.59-13 into MariaDB 5.1. 2011-11-21 14:21:13 +01:00
Jimmy Yang
5f3d3cdbf5 Fix Bug #13405367 - 60212 SERVER CRASH WITH CORRUPT FETCH BUFFER
rb://608 approved by Sunny Bains
2011-11-20 18:21:20 -08:00
Inaam Rana
a8e291cca8 merge bug#13390506 from mysql-5.1 2011-11-18 11:20:17 -05:00
Inaam Rana
f28e7bd064 Bug#13390506 - VALGRIND FAILURE AFTER THE FIX FOR 13371000
rb://816
approved by: Marko Makela
  
The title is misleading. This bug was actually introduced by
bug 12635227 and was unearthed by a later optimization.
We need to free buf_page_t structs that we are allocating using
malloc() at shutdown.
2011-11-18 10:59:10 -05:00
Vasil Dimov
63e381e98d Merge mysql-5.1 -> mysql-5.5
I manually checked that all the conflicting InnoDB changes are in 5.5 already.
Two things I am not sure about - I commented them with XXX in this patch.
I will further check with the authors of the changesets whether these things
should be present or not.
2011-11-18 13:57:10 +02:00
unknown
93773656e8 Merge from mysql-5.5.18-release 2011-11-17 09:00:58 +01:00
Karen Langford
e1df69f75a Merge from mysql-5.1.60-release 2011-11-17 00:26:16 +01:00
Sergei Golubchik
557f0d3ad0 5.2->5.3 merge 2011-11-12 18:08:12 +01:00
Sergei Golubchik
27095a24f6 5.1 merge 2011-11-12 16:47:14 +01:00
unknown
7ab789ef33 Remove unused variable detected by GCC 4.6.1. 2011-11-12 12:03:27 +02:00
Marko Mäkelä
1f746cb03c Merge mysql-5.1 to mysql-5.5. 2011-11-10 13:08:42 +02:00
Marko Mäkelä
a0a51251e4 Bug#11759688 52020: InnoDB can still deadlock on just INSERT...ON DUPLICATE KEY
a.k.a. Bug#7975 deadlock without any locking, simple select and update

Bug#7975 was reintroduced when the storage engine API was made
pluggable in MySQL 5.1. Instead of looking at thd->lex directly, we
rely on handler::extra(). But, we were looking at the wrong extra()
flag, and we were ignoring the TRX_DUP_REPLACE flag in places where we
should obey it.

innodb_replace.test: Add tests for hopefully all affected statement
types, so that bug should never ever resurface. This kind of tests
should have been added when fixing Bug#7975 in MySQL 5.0.3 in the
first place.

rb:806 approved by Sunny Bains
2011-11-10 12:49:31 +02:00
Sergei Golubchik
04f3ecf632 typos fixed
(thanks viva64.com)
2011-11-08 23:07:19 +01:00
Marko Mäkelä
0dc19044ec Merge mysql-5.1 to mysql-5.5. 2011-11-08 14:30:58 +02:00
Marko Mäkelä
77eb01b827 Bug#13358468 ASSERTION FAILURE IN BTR_PCUR_GET_BLOCK
btr_pcur_restore_position_func(): When the cursor was positioned at
the tree infimum or supremum, initialize pos_state and latch_mode. The
assertion failed, because pos_state was BTR_PCUR_WAS_POSITIONED.  In
the test failure of WL#5874, the purge thread attempted to restore the
cursor position on the infimum record (the clustered index was empty).

btr_pcur_detach(), btr_pcur_is_detached(): Unused functions, remove.

rb:804 approved by Inaam Rana
2011-11-08 14:15:22 +02:00
Marko Mäkelä
941a6640aa Replace void pointer arithmetics with byte pointer arithmetics. 2011-11-08 08:54:52 +02:00
Marko Mäkelä
19b9de6bd5 Merge mysql-5.1 to mysql-5.5. 2011-11-07 13:51:11 +02:00
Marko Mäkelä
b003b6294c Add debug assertions to catch Bug#13345378 earlier.
In all callers of row_sel_convert_mysql_key_to_innobase(), assert
that the converted key is empty or nonempty when it should be.
2011-11-07 13:37:19 +02:00
Marko Mäkelä
6852a32642 Bug#13340047 LATCHING ORDER VIOLATION IN IBUF_SET_ENTRY_COUNTER()
ibuf_insert_low(), the only caller of ibuf_set_entry_counter(), will
have latched an insert buffer bitmap page in bitmap_mtr before
invoking ibuf_set_entry_counter(). The latching order forbids any
further pages to be latched.

ibuf_set_entry_counter(): Renamed to ibuf_get_entry_counter(),
simplified the code and added comments.

Added the following symbols for predefined field numbers in change
buffer records:

#define IBUF_REC_FIELD_SPACE	0	/*!< in the pre-4.1 format,
					the page number. later, the space_id */
#define IBUF_REC_FIELD_MARKER	1	/*!< starting with 4.1, a marker
					consisting of 1 byte that is 0 */
#define IBUF_REC_FIELD_PAGE	2	/*!< starting with 4.1, the
					page number */
#define IBUF_REC_FIELD_METADATA	3	/* the metadata field */
#define IBUF_REC_FIELD_USER	4	/* first user field */

rb:802 approved by Sunny Bains
2011-11-07 09:28:02 +02:00
Igor Babaev
e0500dbc3a Merge. 2011-11-06 13:44:59 -08:00
Michael Widenius
5fe4a51cff Fixed lp:884101 "Crash in check_table_is_closed with concurrent workload"
storage/myisam/mi_dbug.c:
  Added mutex to protect open table list while traversing it
2011-11-04 10:14:25 +02:00
Sergei Golubchik
af32b02c06 few cmake/compiler warnings 2011-11-03 23:48:42 +01:00
Sergei Golubchik
6edd76785c merge 2011-11-03 23:39:53 +01:00
Sergei Golubchik
0e007344ea mysql-5.5.18 merge 2011-11-03 19:17:05 +01:00
Jimmy Yang
d0250efa7c Fix Bug #12941439 - WITH UNIV_SYNC_DEBUG, PERF SCHEMA, INITIALIZATION
OF 16G BUFFER POOL TAKES HOURS

rb://787 approved by Sunny
2011-11-03 04:07:00 -07:00
Sergey Petrunya
fd18146d36 Fix "unused variable addr" warning 2011-11-02 19:52:11 +04:00
Igor Babaev
0efacfcfb2 Fixed a compilation error. 2011-10-31 01:36:28 -07:00
Igor Babaev
7dd42686fe Backported the fix and the test case for bug 59483 from the mysql-5.6 code line. 2011-10-30 06:17:07 -07:00
Igor Babaev
7bc6a83b02 Backported the fix and the test case for bug #58816 from mysql-5.6 code line. 2011-10-29 15:36:24 -07:00
Sergei Golubchik
3794110f02 fix the build and compiler warnings (few of which were real bugs)
for "cmake ." builds
2011-10-29 20:40:03 +02:00
Igor Babaev
4b4dfd57f5 Merge. 2011-10-28 04:07:11 -07:00
unknown
26387734fd Fix gcc 4.6 warning after merge with 5.1 2011-10-27 19:18:25 +03:00
unknown
dd564da398 5.1->5.2 merge (gcc 4.6 warnings and apple hwaddress fixes). 2011-10-27 17:51:30 +03:00
Marko Mäkelä
bd71cfc4fa Merge mysql-5.1 to mysql-5.5. 2011-10-27 15:23:58 +03:00
unknown
28e2777991 Fix gcc 4.6 warnings about assigned but not used variables.
Fixed my_gethwaddr.c to allow compilation on Mac OS X.
2011-10-27 15:22:52 +03:00
Marko Mäkelä
1d9c841c3b Bug #12884631 62146: TABLES ARE LOST FOR DDL
row_rename_table_for_mysql(): Return DB_ERROR instead of DB_SUCCESS
when fil_rename_tablespace() returns an error. This bug was introduced
in the InnoDB Plugin.

Approved by Sunny Bains over IM.
2011-10-27 14:58:12 +03:00
Jimmy Yang
93da33309f Fix Bug #11835889 - INNODB ASSERTS ON BAD FILE READ, INDEX TRANSLATION
TABLE ERROR, RECOVERY
            
rb://792 approved by Sunny Bains
2011-10-27 00:40:53 -07:00
Michael Widenius
fa36a7426b Fixed lp:879939 "assertion in ha_maria::enable_indexes with derived_with_keys=on"
Honor unique/not unique when creating keys for internal tempory tables.
Added new variables to be used to limit how keys are created for internal temporary tables.


include/maria.h:
  Added maria_max_key_length() and maria_max_key_segments()
include/myisam.h:
  Added myisam_max_key_length() and myisam_max_key_segments()
mysql-test/r/mysql.result:
  Drop all used tables
mysql-test/r/subselect4.result:
  Added test case for lp:879939
mysql-test/t/mysql.test:
  Drop all used tables
mysql-test/t/subselect4.test:
  Added test case for lp:879939
sql/mysql_priv.h:
  Added internal_tmp_table_max_key_length and internal_tmp_table_max_key_segments to be used to limit how keys for derived tables are created.
sql/mysqld.cc:
  Added internal_tmp_table_max_key_length and internal_tmp_table_max_key_segments to be used to limit how keys for derived tables are created.
sql/share/errmsg.txt:
  Added new error message for internal errors
sql/sql_select.cc:
  Give error if we try to create a wrong key (this error should never happen)
  Honor unique/not unique when creating keys for internal tempory tables.
storage/maria/ha_maria.cc:
  Added change_table_ptr() to ensure that external_ref points always to the correct table.
  (Not having this caused an assert in the included test)
storage/maria/ha_maria.h:
  Added change_table_ptr() to ensure that external_ref points always to the correct table.
storage/maria/ma_check.c:
  Fixed bug in Duplicate key error printing (now row position is printed correctly)
storage/maria/ma_create.c:
  maria_max_key_length() -> _ma_max_key_length()
storage/maria/ma_info.c:
  Added extern function maria_max_key_length() to calculate the max key length based on current block size.
storage/maria/ma_open.c:
  maria_max_key_length() -> _ma_max_key_length()
storage/maria/maria_def.h:
  maria_max_key_length() -> _ma_max_key_length()
storage/myisam/ha_myisam.cc:
  Added change_table_ptr() to ensure that external_ref points always to the correct table.
  (Not having this caused an assert in the included test)
storage/myisam/ha_myisam.h:
  Added change_table_ptr() to ensure that external_ref points always to the correct table.
2011-10-26 20:25:18 +03:00
Michael Widenius
9292953d5a Fixed that oqgraph and libmysqld/examples compiles on OpenSuse 11.4
.bzrignore:
  Ignore generated file emacs.h
libmysqld/CMakeLists.txt:
  Remove direct usage of 'dbug' library
  This fixes that 'BUILD/compile-dist' works
storage/oqgraph/CMakeLists.txt:
  Remove compiler option '-fno-rtti' as BOOST requires this
2011-10-26 15:24:07 +03:00
Marko Mäkelä
2c67d5066d Revert revno:3452.71.32 (Bug#12612184 fix).
Bug#12612184 RACE CONDITION AFTER BTR_CUR_PESSIMISTIC_UPDATE()

The fix introduced potentially more severe crash recovery problems
than the bug causes. Revert the fix for now.
2011-10-26 12:23:57 +03:00
Marko Mäkelä
91b5e9352a Revert most of revno 3560.9.1 (Bug#12704861)
This was an attempt to address problems with the Bug#12612184 fix.
Even with this follow-up fix, crash recovery can be broken.
Let us fix the bug later.
2011-10-26 11:44:28 +03:00
Marko Mäkelä
7ef002e949 Merge mysql-5.1-security to mysql-5.5-security. 2011-10-25 18:06:05 +03:00
Marko Mäkelä
013ba71dfd Bug#13002783 PARTIALLY UNINITIALIZED CASCADE UPDATE VECTOR
In the ON UPDATE CASCADE clause of FOREIGN KEY constraints, the
calculated update vector was not fully initialized. This bug was
introduced in the InnoDB Plugin when implementing support for
ROW_FORMAT=DYNAMIC.

Additionally, the data type information was not initialized, but
apparently it has never been needed in this case.  Nevertheless, it is
not good programming practice to pass uninitialized values around.

calc_row_difference(): Declare the update field uninitialized in
Valgrind. Copy the data type information as well, except when the
field is SQL NULL. In the built-in InnoDB, initialize
ufield->extern_storage = FALSE (an initialization bug that had gone
unnoticed this far). The InnoDB Plugin and later have this flag to
dfield_t and have always initialized it properly.

row_ins_cascade_calc_update_vec(): Reduce the scope of some
pointers. Initialize orig_len. (This caused the bug in InnoDB Plugin
and later.)

row_ins_foreign_check_on_constraint(): Simplify a condition. Declare
the update vector uninitialized.

rb:771 approved by Jimmy Yang
2011-10-25 17:33:38 +03:00
Sergei Golubchik
90b43902b0 compilation warnings on Windows 2011-11-02 12:55:46 +01:00
Sergei Golubchik
7714adaef8 build on windows 2011-11-02 12:26:30 +01:00
Ashish Agarwal
3d24c28a40 bug#11758979 - 51252: ARCHIVE TABLES STILL FAIL UNDER STRESS
TESTS: CRASH, CORRUPTION, 4G MEMOR

Issue: Valgrind errors due to checksum and optimize
       query against archive tables with null columns.
       Table record buffer was not initialized.

Solution: Initialize the record buffer.
2011-10-22 17:04:38 +05:30
Sergei Golubchik
aeaa112edb fixes for windows 2011-10-21 23:07:13 +02:00
Ashish Agarwal
3e250dc83f bug#11758979 - 51252: ARCHIVE TABLES STILL FAIL UNDER STRESS
TESTS: CRASH, CORRUPTION, 4G MEMOR

Issue: Valgrind errors due to checksum and optimize 
       query angaist archive tables with null columns.
       Table record buffer was not initialized.

Solution: Initialize the record buffer.
2011-10-21 16:19:58 +05:30
Sergey Vojtovich
afdfc6acf9 Merge. 2011-10-21 09:35:07 +04:00
Sergey Vojtovich
e1c4021bde Merge. 2011-10-21 09:30:56 +04:00
Marko Mäkelä
f6064041d2 Merge mysql-5.1 to mysql-5.5. 2011-10-21 06:54:49 +03:00
Marko Mäkelä
8a0be8a541 Bug#13116045 Compilation failure using GCC 4.6.1 in btr/btr0cur.c
btr_record_not_null_field_in_rec(): Remove the parameter rec.
Use rec_offs_nth_sql_null() instead of rec_get_nth_field().

rb:788 approved by Jimmy Yang
2011-10-21 06:32:16 +03:00
Sergey Vojtovich
de8c70e70b BUG#11757032 - 49030: OPTIMIZE TABLE BREAKS MYISAM TABLE WHEN
USING MYISAM_USE_MMAP ON WINDOWS

When OPTIMIZE/REPAIR TABLE is switching to new data file,
old data file is removed while memory mapping is still
active.

With 5.1 implementation of nt_share_delete() it is not
permitted to remove mmaped file.

This fix disables memory mapping for mi_repair() operations.

mysql-test/r/myisam.result:
  A test case for BUG#11757032.
mysql-test/t/myisam.test:
  A test case for BUG#11757032.
storage/myisam/ha_myisam.cc:
  mi_repair*() functions family use file I/O even if memory
  mapping is available.
  
  Since mixing mmap I/O and file I/O may cause various artifacts,
  memory mapping must be disabled.
storage/myisam/mi_delete_all.c:
  Clean-up: do not attempt to remap file after truncate, since
  there is nothing to map.
2011-10-20 15:03:22 +04:00
Sergei Golubchik
42b8235788 cleanups 2011-10-19 22:50:45 +02:00
Sergei Golubchik
533d274c03 intptr should be unsigned 2011-10-19 22:48:48 +02:00
Sergei Golubchik
86a2d70779 safe_mutex deadlock detector post-merge fixes 2011-10-19 21:53:14 +02:00
Sergei Golubchik
76f0b94bb0 merge with 5.3
sql/sql_insert.cc:
  CREATE ... IF NOT EXISTS may do nothing, but
  it is still not a failure. don't forget to my_ok it.
  ******
  CREATE ... IF NOT EXISTS may do nothing, but
  it is still not a failure. don't forget to my_ok it.
sql/sql_table.cc:
  small cleanup
  ******
  small cleanup
2011-10-19 21:45:18 +02:00
unknown
255c04aed8 Compiler warning about assigned but not used variables fixed. 2011-10-18 13:44:12 +03:00
Marko Mäkelä
5dc19b9ce1 Merge mysql-5.1 to mysql-5.5. 2011-10-12 09:21:33 +03:00
Marko Mäkelä
6d59064948 Bug#13006367 62487: innodb takes 3 minutes to clean up the adaptive
hash index at shutdown

btr_search_disable(): Just drop the entire adaptive hash index,
without dropping every record separately.

buf_pool_clear_hash_index(): Renamed and simplified from
buf_pool_drop_hash_index(). Set block->index = NULL for every block in
the buffer pool. Do not release the btr_search_latch. The caller will
have to adjust other data structures.

Remove block->is_hashed. It is redundant, should be always equal to
block->index != NULL.

Remove btr_search_fully_disabled, btr_search_enabled_mutex, and
SYNC_SEARCH_SYS_CONF. We drop the AHI in one pass, without releasing
the btr_search_latch in between.

Replace void* with const rec_t* and add assertions on btr_search_latch
and btr_search_enabled to ha0ha.h, ha0ha.ic, ha0ha.c.

page_set_max_trx_id(): Ignore the adaptive hash index. I forgot to
push this in rb:750.

btr0sea.c: Always after acquiring btr_search_latch, check for
block->index==NULL or !btr_search_enabled. We can now set
block->index=NULL while only holding btr_search_latch in exclusive
mode. Always acquire btr_search_latch before reading block->index,
except in shortcuts when testing for block->index == NULL.

ha_clear(), ha_search(): Unused function, remove.

buf_page_peek_if_search_hashed(): Remove. This function may avoid
latching a page at the cost of doing a duplicate buf_pool->page_hash
lookup.

rb:775 approved by Inaam Rana
2011-10-12 09:00:49 +03:00
Sergei Golubchik
ae63300801 merge 2011-10-11 12:55:42 +02:00
Sergei Golubchik
298fc11b82 remove unnecessary define 2011-10-10 15:38:11 +02:00
Sergei Golubchik
eeca1f8694 merge with 5.1 2011-10-07 00:18:30 +02:00