Commit graph

122 commits

Author SHA1 Message Date
Annamalai Gurusami
c1615df32c Bug#13635833: MULTIPLE CRASHES IN FOREIGN KEY CODE WITH CONCURRENT DDL/DML
There are two threads.  In one thread, dml operation is going on 
involving cascaded update operation.  In another thread, alter 
table add foreign key constraint is happening.  Under these 
circumstances, it is possible for the dml thread to access a 
dict_foreign_t object that has been freed by the ddl thread.  
The debug sync test case provides the sequence of operations.  
Without fix, the test case will crash the server (because of 
newly added assert).  With fix, the alter table stmt will return 
an error message.  
      
rb:947
approved by Jimmy Yang
2012-02-27 17:23:56 +05:30
Vasil Dimov
a4fa485f5f Partial fix for Bug#11764622 57480: MEMORY LEAK WHEN HAVING 256+ TABLES
Port vasil.dimov@oracle.com-20111205082900-lx9om1joscejr25e from mysql-trunk
2011-12-29 16:14:45 +02:00
unknown
7532976dd9 Bug #13116225 LIVE DOWNGRADE CRASHES WITH INNODB_PAGE_SIZE=4K
This bug ensures that a live downgrade from an InnoDB 5.6 with WL5756 and
a database created with innodb-page-size=8k or 4k will make a version 5.5
installation politely refuse to start. Instead of crashing or giving some
indication about a corrupted database, it will indicate the page size
difference. 

This patch takes only that part of the Wl5756 patch that is needed to
protect against opening a tablespace that is stamped with a different
page size.

It also contains the change in dict_index_find_on_id_low() just in case
a database with another page size is created by recompiling a pre-WL5756
InnoDB.
2011-12-08 13:32:19 -06:00
Jimmy Yang
8bb893f5c3 Fix Bug #13083023 - 60229: BROKEN COMPATIBILITY: ERROR WHILE CREATE TABLE
WITH FOREIGN KEY CONSTRAI

rb://844 approved by marko
2011-12-07 18:44:52 -08:00
Jimmy Yang
07770e7e8e Fix Bug 12922077 - SEGV IN DICT_SET_CORRUPTED_INDEX_CACHE_ONLY(), DROP TABLE
rb://752 approved by Sunny Bains
2011-08-29 02:44:28 -07:00
Jimmy Yang
95fa7fab3b Fix bug #11830883, SUPPORT "CORRUPTED" BIT FOR INNODB TABLES AND INDEXES.
Also addressed issues in bug #11745133, where we could mark a table
corrupted instead of crashing the server when found a corrupted buffer/page
if the table created with innodb_file_per_table on.
2011-08-16 18:07:59 -07:00
Marko Mäkelä
7f03063418 Merge mysql-5.1 to mysql-5.5. Add a test case. 2011-08-15 12:18:34 +03:00
Jimmy Yang
9e2b7fa7d5 Implement worklog #5743 InnoDB: Lift the limit of index key prefixes.
With this change, the index prefix column length lifted from 767 bytes
to 3072 bytes if "innodb_large_prefix" is set to "true".

rb://603 approved by Marko
2011-05-31 02:12:32 -07:00
Marko Mäkelä
33a0d8690c A non-functional change related to Bug#11830883
page_rec_write_field(): Renamed from page_rec_write_index_page_no()
and inlined.
2011-05-09 11:12:26 +03:00
Jimmy Yang
7cb397c5e0 Merge from mysql-5.1-innodb to mysql-5.5-innodb 2011-05-04 03:47:30 -07:00
Jimmy Yang
3fa4aaac71 Fix bug #11796673 address backward compatibility on index with
large prefix (>=768). Table with such large prefix index will not
be loaded into memory (for its metadata), unless innodb_force_recovery
is on.

rb://604 Approved by Marko
2011-05-04 03:06:21 -07:00
unknown
6ed10ee5dd Bug#60309 - Bug#12356829: MYSQL 5.5.9 FOR MAC OSX HAS BUG WITH FOREIGN KEY CONSTRAINTS
The innoDB global variable srv_lower_case_table_names is set to the value of lower_case_table_names declared in mysqld.h server in ha_innodb.cc.  Since this variable can change at runtime, it is reset for each handler call to ::create, ::open, ::rename_table & ::delete_table.

But it is possible for tables to be implicitly opened before an explicit handler call is made when an engine is first started or restarted.  I was able to reproduce that with the testcase in this patch on a version of InnoDB from 2 weeks ago.  It seemed like the change buffer entries for the secondary key was getting put into pages after the restart.  (But I am not sure, I did not write down the call stack while it was reproducing.)  In the current code, the implicit open, which is actually a call to dict_load_foreigns(), does not occur with this testcase.

The change is to replace srv_lower_case_table_names by an interface function in innodb.cc that retrieves the server global variable when it is needed.
2011-04-26 12:55:52 -05:00
unknown
08f128f633 Bug#60196 / Bug#11831040
Setting lowercase_table_names to 2 on Windows causing Foreign Key problems

This problem was exposed by the fix for Bug#55222.  There was a codepath in dict0load.c,
dict_load_foreigns() that made sure the table name matched case sensitive in order to
load a referenced table into the dictionary as needed.  If an engine is rebooted which
accesses a table with foreign keys, and lower_case_table_names=2, then the table with
foreign keys will get an error when it is changed (insert/updated/delete).
Once the referenced tables are loaded into the dictionary cache by a select statement
on those tables, the same change would succeed because the affected code path would
not get followed.
2011-03-07 09:42:07 -06:00
Vasil Dimov
0047afa3b2 Merge mysql-5.5-innodb -> mysql-5.5 2011-02-17 13:57:26 +02:00
Jimmy Yang
321b238874 Merge a fix for Bug #53756 ALTER TABLE ADD PRIMARY KEY affects crash recovery
This was already pushed to mysql-5.1-innodb some time ago
(revision id jimmy.yang@oracle.com-20100907054137-tpuior7hez4f5ghl)
but it was not merged to the 5.5 trees.
2011-02-10 00:58:23 -08:00
Jimmy Yang
82d8ca01c8 Fix Bug #59048 truncate table or create index could leave index->page
to be FIL_NULL

rb://545 approved by Sunny Bains
2011-02-09 01:15:06 -08:00
Marko Mäkelä
27fbb7c18c Merge mysql-5.1-innodb to mysql-5.5-innodb. 2011-02-08 13:39:24 +02:00
unknown
aff195eb5a Bug#59699 - Hidden bug would cause a crash for unknown tablespace flags.
The bug would cause a crash of InnoDB if a non-standard or unknown table
flags existed in a SYS_TABLES record. This is important because the next
file version, Cheetah, will identify itself by expanding this field.  So
unless this is fixed, an older engine that tries to open a table in a
tablespace with a newer file version will crash instead of report an error
and refuse to open the table, as it should do.

Reviewed at RB://583.    Approved by Marko.
2011-02-04 08:59:30 -06:00
Jimmy Yang
5a0138e250 Merge from mysql-5.1-innodb to mysql-5.5-innodb 2011-01-14 23:24:47 -08:00
Jimmy Yang
9cd4d49840 Fix Bug#30423 "InnoDBs treatment of NULL in index stats causes bad
"rows examined" estimates". This change implements "innodb_stats_method"
with options of "nulls_equal", "nulls_unequal" and "null_ignored".
      
rb://553 approved by Marko
2011-01-14 09:02:28 -08:00
Vasil Dimov
be01dbf587 Merge mysql-5.5-innodb -> mysql-5.5 2011-02-08 19:28:00 +02:00
Jonathan Perkin
f13788c9fd Merge from mysql-5.5.9-release 2011-02-08 14:59:03 +01:00
Georgi Kodinov
1ecfdbf2bc merge 2011-01-10 15:09:57 +02:00
Jimmy Yang
000bdda32b merge from mysql-5.1-innodb to mysql-5.5-innodb 2011-01-05 05:47:15 -08:00
Jimmy Yang
fe8fbaaddb Fix Bug #59197 double quote in field comment prevents foreign key
constraint creation

rb://557 Approved by Sunny Bains
2011-01-04 22:44:12 -08:00
Jimmy Yang
c143ff4848 Fix Bug #59157 valgrind conditional jump warning from dict_load_foreign.
This is 5.1 built-in specific as the dict_table_t strcture is allocated
with mem_heap_zalloc since 5.1 plugin.

Approved by Sunny Bains
2011-01-04 22:31:46 -08:00
Vasil Dimov
909d7c299c PS-instrument the array of latches (rw locks) dict_table_stats_latches[].
This adds 64 new rows to performance_schema.rwlock_instances.

This patch will make perfschema.binlog_mix perfschema.binlog_row tests fail,
but they will be fixed by http://lists.mysql.com/commits/127862

Approved by:	Jimmy (rb://554)
2011-01-04 11:46:20 +02:00
unknown
5f80beebd0 55222 - Previous patch had a bug in unused code which was reactivated in
mysql-trunk-innodb in rev revno: 3367  Tue 2010-12-07 02:25:25-0800.
The crash happens only when lower_case_table_names=2, such as on MacOS,
when running the new testcase innodb-system-table-view.  Specifically,
it crashes when any query is made against the INFORMATION_SCHEMA.
INNODB_SYS_FOREIGN table.  The function dict_process_sys_foreign_rec()
is only used for displaying SYS_FOREIGN records so it does not need a
lookup version of those names to be allocated. In this patch, those new
function calls are deleted.
2010-12-09 10:42:35 -06:00
Jimmy Yang
9838f48476 Fix Bug #58643 InnoDB: too long table name
rb://531 approved by Sunny Bains
2010-12-05 18:42:23 -08:00
Marko Mäkelä
2a4aca3e68 Fix a compilation error that was introduced in the Bug #55222 fix
(bzr revision id kevin.lewis@oracle.com-20101130182552-hfydggaeeys3tjqx).
2010-12-01 10:36:54 +02:00
unknown
6d1760be87 Fix compiler warning for Bug#55222 patch. 2010-11-30 20:13:02 -06:00
unknown
2dde698e0e Bug#55222 - RB://517 - Approved by Sunny
InnoDB does not attempt to handle lower_case_table_names == 2 when looking
up foreign table names and referenced table name.  It turned that server
variable into a boolean and ignored the possibility of it being '2'.  

The setting lower_case_table_names == 2 means that it should be stored and
displayed in mixed case as given, but compared internally in lower case.
Normally the server deals with this since it stores table names.  But
InnoDB stores referential constraints for the server, so it needs to keep
track of both lower case and given names.

This solution creates two table name pointers for each foreign and referenced
table name.  One to display the name, and one to look it up.  Both pointers
point to the same allocated string unless this setting is 2.  So the overhead
added is not too much.

Two functions are created in dict0mem.c to populate the ..._lookup versions
of these pointers.  Both dict_mem_foreign_table_name_lookup_set() and
dict_mem_referenced_table_name_lookup_set() are called 5 times each.
2010-11-30 12:25:52 -06:00
Jimmy Yang
f64026427e Fix Bug #16290 Unclear error message when adding foreign key constraint
rb://502 approved by Sunny Bains
2010-11-14 23:08:04 -08:00
Vasil Dimov
631b5ef05e Merge mysql-5.1-innodb -> mysql-5.5-innodb 2010-11-11 13:25:35 +02:00
Jimmy Yang
a47989da36 Merge from mysql-5.1-innodb to mysql-5.5-innodb 2010-11-10 21:51:00 -08:00
Vasil Dimov
5bd300084b Merge mysql-5.5-innodb from bk-internal into my local repo 2010-11-10 10:52:45 +02:00
Vasil Dimov
99cd1a616f Merge mysql-5.1-innodb -> mysql-5.5-innodb 2010-11-03 12:07:16 +02:00
Marko Mäkelä
a5352c8970 Merge mysql-5.1-innodb to mysql-5.5-innodb. 2010-11-03 11:25:14 +02:00
Jimmy Yang
6f03e15cf9 Merge fix for bug#57616 from mysql-5.5-security to mysql-5.5-innodb. 2010-10-28 21:55:43 -07: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
35f5429eda Manual port Bug #Bug #54582 "stack overflow when opening many tables
linked with foreign keys at once" from mysql-5.1-security to
mysql-5.5-security again.

rb://391 approved by Heikki
2010-10-06 06:55:34 -07:00
Vasil Dimov
666c01419d (dict0dict.c:4458) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 18:47:15 +03:00
Vasil Dimov
80226874dd (dict0crea.c:630) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 18:46:24 +03:00
Jimmy Yang
9b3a3944e4 Merge from mysql-5.1-bugteam to mysql-5.1-security 2010-09-01 17:43:02 -07:00
Marko Mäkelä
938ce0efd7 Merge Bug#55832 fix from mysql-5.1-innodb:
------------------------------------------------------------
revno: 3550
revision-id: marko.makela@oracle.com-20100824081003-v4ecy0tga99cpxw2
parent: marko.makela@oracle.com-20100823102854-t1clrojqis2ley36
committer: Marko Mäkelä <marko.makela@oracle.com>
branch nick: 5.1-innodb
timestamp: Tue 2010-08-24 11:10:03 +0300
message:
  Bug#55832: selects crash too easily when innodb_force_recovery>3

  dict_update_statistics_low(): Create bogus statistics for those
  indexes that cannot be accessed because of the innodb_force_recovery
  setting.

  ha_innobase::info(): Calculate statistics for each index, even if
  innodb_force_recovery is set. Fill in bogus data for those indexes
  that are not accessed because of the innodb_force_recovery setting.
2010-08-24 11:34:19 +03:00
Marko Mäkelä
634af8f446 Bug#55832: selects crash too easily when innodb_force_recovery>3
dict_update_statistics_low(): Create bogus statistics for those
indexes that cannot be accessed because of the innodb_force_recovery
setting.

ha_innobase::info(): Calculate statistics for each index, even if
innodb_force_recovery is set. Fill in bogus data for those indexes
that are not accessed because of the innodb_force_recovery setting.
2010-08-23 13:28:54 +03:00
Sunny Bains
3daf6d3d73 Fix Bug #55027: assertion: mutex_own(&dict_sys->mutex) in dict_table_get_on_id()
The callers should indicate that the dictionary is locked or not using
the trx->dict_operation_lock_mode == RW_X_LATCH mode. Checking explicitly
for system tables is unnecessary.

Approved by Marko on IRC.
2010-08-20 12:57:04 +10:00
Marko Mäkelä
085bb22ab2 A non-functional change:
dict_load_index_low(): Rename the parameter "cached" to "allocated"
and clarify the comments.
2010-08-17 15:07:54 +03:00
Jimmy Yang
531c0eee52 Address bug #55465 ERROR 1280 (42000): Incorrect index name '<index name>',
adding a couple FK related messages.

rb://409 approved by Sunny Bains
2010-08-06 02:49:22 -07:00
Jimmy Yang
04970a2ff1 Fix Bug #54582 stack overflow when opening many tables linked with
foreign keys at once

rb://391 approved by Heikki
Z
2010-08-04 03:11:33 -07:00