summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <tsmith@ramayana.hindu.god>2007-11-20 10:53:19 -0700
committerunknown <tsmith@ramayana.hindu.god>2007-11-20 10:53:19 -0700
commita3dc40e24affdef5c09e4e9a144ada5f9c14680d (patch)
tree21747ca103bd9a3c41f06ba1d1e27672465dfaaa /sql
parent49934f490a91cad206f68c1cc54e18dd6453f02a (diff)
downloadmariadb-git-a3dc40e24affdef5c09e4e9a144ada5f9c14680d.tar.gz
Applied InnoDB snapshot innodb-5.0-ss2095
Fixes the following bugs: - Bug #29560: InnoDB >= 5.0.30 hangs on adaptive hash rw-lock 'waiting for an X-lock' Fixed a race condition in the rw_lock where an os_event_reset() can overwrite an earlier os_event_set() triggering an indefinite wait. NOTE: This fix for windows is different from that for other platforms. NOTE2: This bug is introduced in the scalability fix to the sync0arr which was applied to 5.0 only. Therefore, it need not be applied to the 5.1 tree. If we decide to port the scalability fix to 5.1 then this fix should be ported as well. - Bug #32125: Database crash due to ha_innodb.cc:3896: ulint convert_search_mode_to_innobase When unknown find_flag is encountered in convert_search_mode_to_innobase() do not call assert(0); instead queue a MySQL error using my_error() and return the error code PAGE_CUR_UNSUPP. Change the functions that call convert_search_mode_to_innobase() to handle that error code by "canceling" execution and returning appropriate error code further upstream. innobase/include/db0err.h: Applied InnoDB snapshot innodb-5.0-ss2095 Revision r2091: branches/5.0: Merge r2088 from trunk: log for r2088: Fix Bug#32125 (http://bugs.mysql.com/32125) "Database crash due to ha_innodb.cc:3896: ulint convert_search_mode_to_innobase": When unknown find_flag is encountered in convert_search_mode_to_innobase() do not call assert(0); instead queue a MySQL error using my_error() and return the error code PAGE_CUR_UNSUPP. Change the functions that call convert_search_mode_to_innobase() to handle that error code by "canceling" execution and returning appropriate error code further upstream. Approved by: Heikki innobase/include/os0sync.h: Applied InnoDB snapshot innodb-5.0-ss2095 Revision r2082: branches/5.0: bug#29560 Fixed a race condition in the rw_lock where an os_event_reset() can overwrite an earlier os_event_set() triggering an indefinite wait. NOTE: This fix for windows is different from that for other platforms. NOTE2: This bug is introduced in the scalability fix to the sync0arr which was applied to 5.0 only. Therefore, it need not be applied to the 5.1 tree. If we decide to port the scalability fix to 5.1 then this fix should be ported as well. Reviewed by: Heikki innobase/include/page0cur.h: Applied InnoDB snapshot innodb-5.0-ss2095 Revision r2091: branches/5.0: Merge r2088 from trunk: log for r2088: Fix Bug#32125 (http://bugs.mysql.com/32125) "Database crash due to ha_innodb.cc:3896: ulint convert_search_mode_to_innobase": When unknown find_flag is encountered in convert_search_mode_to_innobase() do not call assert(0); instead queue a MySQL error using my_error() and return the error code PAGE_CUR_UNSUPP. Change the functions that call convert_search_mode_to_innobase() to handle that error code by "canceling" execution and returning appropriate error code further upstream. Approved by: Heikki innobase/include/sync0rw.h: Applied InnoDB snapshot innodb-5.0-ss2095 Revision r2082: branches/5.0: bug#29560 Fixed a race condition in the rw_lock where an os_event_reset() can overwrite an earlier os_event_set() triggering an indefinite wait. NOTE: This fix for windows is different from that for other platforms. NOTE2: This bug is introduced in the scalability fix to the sync0arr which was applied to 5.0 only. Therefore, it need not be applied to the 5.1 tree. If we decide to port the scalability fix to 5.1 then this fix should be ported as well. Reviewed by: Heikki innobase/include/sync0rw.ic: Applied InnoDB snapshot innodb-5.0-ss2095 Revision r2082: branches/5.0: bug#29560 Fixed a race condition in the rw_lock where an os_event_reset() can overwrite an earlier os_event_set() triggering an indefinite wait. NOTE: This fix for windows is different from that for other platforms. NOTE2: This bug is introduced in the scalability fix to the sync0arr which was applied to 5.0 only. Therefore, it need not be applied to the 5.1 tree. If we decide to port the scalability fix to 5.1 then this fix should be ported as well. Reviewed by: Heikki innobase/include/sync0sync.ic: Applied InnoDB snapshot innodb-5.0-ss2095 Revision r2082: branches/5.0: bug#29560 Fixed a race condition in the rw_lock where an os_event_reset() can overwrite an earlier os_event_set() triggering an indefinite wait. NOTE: This fix for windows is different from that for other platforms. NOTE2: This bug is introduced in the scalability fix to the sync0arr which was applied to 5.0 only. Therefore, it need not be applied to the 5.1 tree. If we decide to port the scalability fix to 5.1 then this fix should be ported as well. Reviewed by: Heikki innobase/os/os0sync.c: Applied InnoDB snapshot innodb-5.0-ss2095 Revision r2082: branches/5.0: bug#29560 Fixed a race condition in the rw_lock where an os_event_reset() can overwrite an earlier os_event_set() triggering an indefinite wait. NOTE: This fix for windows is different from that for other platforms. NOTE2: This bug is introduced in the scalability fix to the sync0arr which was applied to 5.0 only. Therefore, it need not be applied to the 5.1 tree. If we decide to port the scalability fix to 5.1 then this fix should be ported as well. Reviewed by: Heikki innobase/srv/srv0srv.c: Applied InnoDB snapshot innodb-5.0-ss2095 Revision r2082: branches/5.0: bug#29560 Fixed a race condition in the rw_lock where an os_event_reset() can overwrite an earlier os_event_set() triggering an indefinite wait. NOTE: This fix for windows is different from that for other platforms. NOTE2: This bug is introduced in the scalability fix to the sync0arr which was applied to 5.0 only. Therefore, it need not be applied to the 5.1 tree. If we decide to port the scalability fix to 5.1 then this fix should be ported as well. Reviewed by: Heikki innobase/sync/sync0arr.c: Applied InnoDB snapshot innodb-5.0-ss2095 Revision r2082: branches/5.0: bug#29560 Fixed a race condition in the rw_lock where an os_event_reset() can overwrite an earlier os_event_set() triggering an indefinite wait. NOTE: This fix for windows is different from that for other platforms. NOTE2: This bug is introduced in the scalability fix to the sync0arr which was applied to 5.0 only. Therefore, it need not be applied to the 5.1 tree. If we decide to port the scalability fix to 5.1 then this fix should be ported as well. Reviewed by: Heikki innobase/sync/sync0rw.c: Applied InnoDB snapshot innodb-5.0-ss2095 Revision r2082: branches/5.0: bug#29560 Fixed a race condition in the rw_lock where an os_event_reset() can overwrite an earlier os_event_set() triggering an indefinite wait. NOTE: This fix for windows is different from that for other platforms. NOTE2: This bug is introduced in the scalability fix to the sync0arr which was applied to 5.0 only. Therefore, it need not be applied to the 5.1 tree. If we decide to port the scalability fix to 5.1 then this fix should be ported as well. Reviewed by: Heikki innobase/sync/sync0sync.c: Applied InnoDB snapshot innodb-5.0-ss2095 Revision r2082: branches/5.0: bug#29560 Fixed a race condition in the rw_lock where an os_event_reset() can overwrite an earlier os_event_set() triggering an indefinite wait. NOTE: This fix for windows is different from that for other platforms. NOTE2: This bug is introduced in the scalability fix to the sync0arr which was applied to 5.0 only. Therefore, it need not be applied to the 5.1 tree. If we decide to port the scalability fix to 5.1 then this fix should be ported as well. Reviewed by: Heikki sql/ha_innodb.cc: Applied InnoDB snapshot innodb-5.0-ss2095 Revision r2091: branches/5.0: Merge r2088 from trunk: log for r2088: Fix Bug#32125 (http://bugs.mysql.com/32125) "Database crash due to ha_innodb.cc:3896: ulint convert_search_mode_to_innobase": When unknown find_flag is encountered in convert_search_mode_to_innobase() do not call assert(0); instead queue a MySQL error using my_error() and return the error code PAGE_CUR_UNSUPP. Change the functions that call convert_search_mode_to_innobase() to handle that error code by "canceling" execution and returning appropriate error code further upstream. Approved by: Heikki Revision r2095: branches/5.0: Merge r2093 from trunk: convert_search_mode_to_innobase(): Add the missing case label HA_READ_MBR_EQUAL that was forgotten in r2088.
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_innodb.cc45
1 files changed, 37 insertions, 8 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index 6b5e89848c3..fa68da87661 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -522,6 +522,9 @@ convert_error_code_to_mysql(
mark_transaction_to_rollback(thd, TRUE);
return(HA_ERR_LOCK_TABLE_FULL);
+ } else if (error == DB_UNSUPPORTED) {
+
+ return(HA_ERR_UNSUPPORTED);
} else {
return(-1); // Unknown error
}
@@ -3713,11 +3716,22 @@ convert_search_mode_to_innobase(
and comparison of non-latin1 char type fields in
innobase_mysql_cmp() to get PAGE_CUR_LE_OR_EXTENDS to
work correctly. */
-
- default: assert(0);
+ case HA_READ_MBR_CONTAIN:
+ case HA_READ_MBR_INTERSECT:
+ case HA_READ_MBR_WITHIN:
+ case HA_READ_MBR_DISJOINT:
+ case HA_READ_MBR_EQUAL:
+ my_error(ER_TABLE_CANT_HANDLE_SPKEYS, MYF(0));
+ return(PAGE_CUR_UNSUPP);
+ /* do not use "default:" in order to produce a gcc warning:
+ enumeration value '...' not handled in switch
+ (if -Wswitch or -Wall is used)
+ */
}
- return(0);
+ my_error(ER_CHECK_NOT_IMPLEMENTED, MYF(0), "this functionality");
+
+ return(PAGE_CUR_UNSUPP);
}
/*
@@ -3855,11 +3869,18 @@ ha_innobase::index_read(
last_match_mode = (uint) match_mode;
- innodb_srv_conc_enter_innodb(prebuilt->trx);
+ if (mode != PAGE_CUR_UNSUPP) {
- ret = row_search_for_mysql((byte*) buf, mode, prebuilt, match_mode, 0);
+ innodb_srv_conc_enter_innodb(prebuilt->trx);
- innodb_srv_conc_exit_innodb(prebuilt->trx);
+ ret = row_search_for_mysql((byte*) buf, mode, prebuilt,
+ match_mode, 0);
+
+ innodb_srv_conc_exit_innodb(prebuilt->trx);
+ } else {
+
+ ret = DB_UNSUPPORTED;
+ }
if (ret == DB_SUCCESS) {
error = 0;
@@ -5174,8 +5195,16 @@ ha_innobase::records_in_range(
mode2 = convert_search_mode_to_innobase(max_key ? max_key->flag :
HA_READ_KEY_EXACT);
- n_rows = btr_estimate_n_rows_in_range(index, range_start,
- mode1, range_end, mode2);
+ if (mode1 != PAGE_CUR_UNSUPP && mode2 != PAGE_CUR_UNSUPP) {
+
+ n_rows = btr_estimate_n_rows_in_range(index, range_start,
+ mode1, range_end,
+ mode2);
+ } else {
+
+ n_rows = 0;
+ }
+
dtuple_free_for_mysql(heap1);
dtuple_free_for_mysql(heap2);