You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10384 lines
296 KiB

20 years ago
20 years ago
20 years ago
branches/zip: Replace the constant 3/8 ratio that controls the LRU_old size with the settable global variable innodb_old_blocks_pct. The minimum and maximum values are 5 and 95 per cent, respectively. The default is 100*3/8, in line with the old behavior. ut_time_ms(): New utility function, to return the current time in milliseconds. TODO: Is there a more efficient timestamp function, such as rdtsc divided by a power of two? buf_LRU_old_threshold_ms: New variable, corresponding to innodb_old_blocks_time. The value 0 is the default behaviour: no timeout before making blocks 'new'. bpage->accessed, bpage->LRU_position, buf_pool->ulint_clock: Remove. bpage->access_time: New field, replacing bpage->accessed. Protected by buf_pool_mutex instead of bpage->mutex. Updated when a page is created or accessed the first time in the buffer pool. buf_LRU_old_ratio, innobase_old_blocks_pct: New variables, corresponding to innodb_old_blocks_pct buf_LRU_old_ratio_update(), innobase_old_blocks_pct_update(): Update functions for buf_LRU_old_ratio, innobase_old_blocks_pct. buf_page_peek_if_too_old(): Compare ut_time_ms() to bpage->access_time if buf_LRU_old_threshold_ms && bpage->old. Else observe buf_LRU_old_ratio and bpage->freed_page_clock. buf_pool_t: Add n_pages_made_young, n_pages_not_made_young, n_pages_made_young_old, n_pages_not_made_young, for statistics. buf_print(): Display buf_pool->n_pages_made_young, buf_pool->n_pages_not_made_young. This function is only for crash diagnostics. buf_print_io(): Display buf_pool->LRU_old_len and quantities derived from buf_pool->n_pages_made_young, buf_pool->n_pages_not_made_young. This function is invoked by SHOW ENGINE INNODB STATUS. rb://129 approved by Heikki Tuuri. This addresses Bug #45015.
16 years ago
20 years ago
branches/zip: Merge r6112:6125 from branches/5.1: (skipping r6122 and r6123, Jimmy says these are already present and need not be merged): ------------------------------------------------------------------------ r6122 | jyang | 2009-10-30 05:18:38 +0200 (Fri, 30 Oct 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb_bug44369.result M /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/mysql-test/innodb_bug46000.result M /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Chnage WARN_LEVEL_ERROR to WARN_LEVEL_WARN for push_warning_printf() call in innodb. Fix Bug#47233: Innodb calls push_warning(MYSQL_ERROR::WARN_LEVEL_ERROR) rb://170 approved by Marko. ------------------------------------------------------------------------ r6123 | jyang | 2009-10-30 05:43:06 +0200 (Fri, 30 Oct 2009) | 8 lines Changed paths: M /branches/5.1/os/os0proc.c branches/5.1: In os_mem_alloc_large(), if we fail to attach the shared memory, reset memory pointer ptr to NULL, and allocate memory from conventional pool. This is a port from branches/zip. Bug #48237 Error handling in os_mem_alloc_large appears to be incorrect rb://198 Approved by: Marko ------------------------------------------------------------------------ r6125 | vasil | 2009-10-30 10:31:23 +0200 (Fri, 30 Oct 2009) | 4 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: White-space fixup. ------------------------------------------------------------------------
16 years ago
branches/zip: Merge r5912:6112 from branches/5.1: (after this merge the innodb-autoinc test starts to fail, but I commit anyway because it would be easier to investigate the failure this way) ------------------------------------------------------------------------ r5952 | calvin | 2009-09-22 19:45:07 +0300 (Tue, 22 Sep 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: fix bug#42383: Can't create table 'test.bug39438' For embedded server, MySQL may pass in full path, which is currently disallowed. It is needed to relax the condition by accepting full paths in the embedded case. Approved by: Heikki (on IM) ------------------------------------------------------------------------ r6032 | vasil | 2009-10-01 15:55:49 +0300 (Thu, 01 Oct 2009) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix Bug#38996 Race condition in ANALYZE TABLE by serializing ANALYZE TABLE inside InnoDB. Approved by: Heikki (rb://175) ------------------------------------------------------------------------ r6045 | jyang | 2009-10-08 02:27:08 +0300 (Thu, 08 Oct 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug47777.result A /branches/5.1/mysql-test/innodb_bug47777.test branches/5.1: Fix bug #47777. Treat the Geometry data same as Binary BLOB in ha_innobase::store_key_val_for_row(), since the Geometry data is stored as Binary BLOB in Innodb. Review: rb://180 approved by Marko Makela. ------------------------------------------------------------------------ r6051 | sunny | 2009-10-12 07:05:00 +0300 (Mon, 12 Oct 2009) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Ignore negative values supplied by the user when calculating the next value to store in dict_table_t. Setting autoincrement columns top negative values is undefined behavior and this change should bring the behavior of InnoDB closer to what users expect. Added several tests to check. rb://162 ------------------------------------------------------------------------ r6052 | sunny | 2009-10-12 07:09:56 +0300 (Mon, 12 Oct 2009) | 4 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Reset the statement level autoinc counter on ROLLBACK. Fix the test results too. rb://164 ------------------------------------------------------------------------ r6053 | sunny | 2009-10-12 07:37:49 +0300 (Mon, 12 Oct 2009) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Copy the maximum AUTOINC value from the old table to the new table when MySQL does a CREATE INDEX ON T. This is required because MySQL does a table copy, rename and drops the old table. Fix Bug#47125: auto_increment start value is ignored if an index is created and engine=innodb rb://168 ------------------------------------------------------------------------ r6076 | vasil | 2009-10-14 19:30:12 +0300 (Wed, 14 Oct 2009) | 4 lines Changed paths: M /branches/5.1/row/row0mysql.c branches/5.1: Fix typo. ------------------------------------------------------------------------
16 years ago
20 years ago
20 years ago
branches/zip: Replace the constant 3/8 ratio that controls the LRU_old size with the settable global variable innodb_old_blocks_pct. The minimum and maximum values are 5 and 95 per cent, respectively. The default is 100*3/8, in line with the old behavior. ut_time_ms(): New utility function, to return the current time in milliseconds. TODO: Is there a more efficient timestamp function, such as rdtsc divided by a power of two? buf_LRU_old_threshold_ms: New variable, corresponding to innodb_old_blocks_time. The value 0 is the default behaviour: no timeout before making blocks 'new'. bpage->accessed, bpage->LRU_position, buf_pool->ulint_clock: Remove. bpage->access_time: New field, replacing bpage->accessed. Protected by buf_pool_mutex instead of bpage->mutex. Updated when a page is created or accessed the first time in the buffer pool. buf_LRU_old_ratio, innobase_old_blocks_pct: New variables, corresponding to innodb_old_blocks_pct buf_LRU_old_ratio_update(), innobase_old_blocks_pct_update(): Update functions for buf_LRU_old_ratio, innobase_old_blocks_pct. buf_page_peek_if_too_old(): Compare ut_time_ms() to bpage->access_time if buf_LRU_old_threshold_ms && bpage->old. Else observe buf_LRU_old_ratio and bpage->freed_page_clock. buf_pool_t: Add n_pages_made_young, n_pages_not_made_young, n_pages_made_young_old, n_pages_not_made_young, for statistics. buf_print(): Display buf_pool->n_pages_made_young, buf_pool->n_pages_not_made_young. This function is only for crash diagnostics. buf_print_io(): Display buf_pool->LRU_old_len and quantities derived from buf_pool->n_pages_made_young, buf_pool->n_pages_not_made_young. This function is invoked by SHOW ENGINE INNODB STATUS. rb://129 approved by Heikki Tuuri. This addresses Bug #45015.
16 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge revisions 5622:5912 from branches/5.1, except r5700 (changes to CMakeLists.txt) ------------------------------------------------------------------------ r5622 | vasil | 2009-08-03 15:27:00 +0300 (Mon, 03 Aug 2009) | 20 lines Changed paths: M /branches/5.1/Makefile.am branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2988 committer: Satya B <satya.bn@sun.com> branch nick: mysql-5.1-bugteam timestamp: Wed 2009-07-01 11:06:05 +0530 message: Fix build failure after applying Innodb snapshot 5.1-ss5282 After applying Innodb snapshot 5.1-ss5282, build was broken because of missing header file. Adding the header file to Makefile.am after informing the innodb developers. modified: storage/innobase/Makefile.am ------------------------------------------------------------------------ r5740 | jyang | 2009-09-03 06:33:47 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Sunny Bains. ------------------------------------------------------------------------ r5741 | jyang | 2009-09-03 07:16:01 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5757 | jyang | 2009-09-04 04:26:13 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h D /branches/5.1/mysql-test/innodb_bug46000.result D /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Revert change in 5740. Making the fix in a subsequent check in. ------------------------------------------------------------------------ r5760 | jyang | 2009-09-04 07:07:34 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc D /branches/5.1/mysql-test/innodb_bug44369.result D /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: This is to revert change 5741. A return status for create_table_def() needs to be fixed. ------------------------------------------------------------------------ r5797 | calvin | 2009-09-09 18:26:29 +0300 (Wed, 09 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: merge change from 5.1.38 HA_ERR_TOO_MANY_CONCURRENT_TRXS is added in 5.1.38. ------------------------------------------------------------------------ r5799 | calvin | 2009-09-09 20:47:31 +0300 (Wed, 09 Sep 2009) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: fix bug#46256 Allow tables to be dropped even if the collation is not found, but issue a warning. Could not find an easy way to add mysql-test since it requires changes to charsets and restarting the server. Tests were executed manually. Approved by: Heikki (on IM) ------------------------------------------------------------------------ r5805 | vasil | 2009-09-10 08:41:48 +0300 (Thu, 10 Sep 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix a compilation warning caused by c5799: handler/ha_innodb.cc: In function 'void innobase_get_cset_width(ulint, ulint*, ulint*)': handler/ha_innodb.cc:830: warning: format '%d' expects type 'int', but argument 2 has type 'ulint' ------------------------------------------------------------------------ r5834 | jyang | 2009-09-11 00:43:05 +0300 (Fri, 11 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5895 | jyang | 2009-09-15 03:39:21 +0300 (Tue, 15 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Marko Makela. ------------------------------------------------------------------------
16 years ago
branches/zip: Merge revisions 5622:5912 from branches/5.1, except r5700 (changes to CMakeLists.txt) ------------------------------------------------------------------------ r5622 | vasil | 2009-08-03 15:27:00 +0300 (Mon, 03 Aug 2009) | 20 lines Changed paths: M /branches/5.1/Makefile.am branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2988 committer: Satya B <satya.bn@sun.com> branch nick: mysql-5.1-bugteam timestamp: Wed 2009-07-01 11:06:05 +0530 message: Fix build failure after applying Innodb snapshot 5.1-ss5282 After applying Innodb snapshot 5.1-ss5282, build was broken because of missing header file. Adding the header file to Makefile.am after informing the innodb developers. modified: storage/innobase/Makefile.am ------------------------------------------------------------------------ r5740 | jyang | 2009-09-03 06:33:47 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Sunny Bains. ------------------------------------------------------------------------ r5741 | jyang | 2009-09-03 07:16:01 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5757 | jyang | 2009-09-04 04:26:13 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h D /branches/5.1/mysql-test/innodb_bug46000.result D /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Revert change in 5740. Making the fix in a subsequent check in. ------------------------------------------------------------------------ r5760 | jyang | 2009-09-04 07:07:34 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc D /branches/5.1/mysql-test/innodb_bug44369.result D /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: This is to revert change 5741. A return status for create_table_def() needs to be fixed. ------------------------------------------------------------------------ r5797 | calvin | 2009-09-09 18:26:29 +0300 (Wed, 09 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: merge change from 5.1.38 HA_ERR_TOO_MANY_CONCURRENT_TRXS is added in 5.1.38. ------------------------------------------------------------------------ r5799 | calvin | 2009-09-09 20:47:31 +0300 (Wed, 09 Sep 2009) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: fix bug#46256 Allow tables to be dropped even if the collation is not found, but issue a warning. Could not find an easy way to add mysql-test since it requires changes to charsets and restarting the server. Tests were executed manually. Approved by: Heikki (on IM) ------------------------------------------------------------------------ r5805 | vasil | 2009-09-10 08:41:48 +0300 (Thu, 10 Sep 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix a compilation warning caused by c5799: handler/ha_innodb.cc: In function 'void innobase_get_cset_width(ulint, ulint*, ulint*)': handler/ha_innodb.cc:830: warning: format '%d' expects type 'int', but argument 2 has type 'ulint' ------------------------------------------------------------------------ r5834 | jyang | 2009-09-11 00:43:05 +0300 (Fri, 11 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5895 | jyang | 2009-09-15 03:39:21 +0300 (Tue, 15 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Marko Makela. ------------------------------------------------------------------------
16 years ago
20 years ago
branches/zip: Merge revisions 5622:5912 from branches/5.1, except r5700 (changes to CMakeLists.txt) ------------------------------------------------------------------------ r5622 | vasil | 2009-08-03 15:27:00 +0300 (Mon, 03 Aug 2009) | 20 lines Changed paths: M /branches/5.1/Makefile.am branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2988 committer: Satya B <satya.bn@sun.com> branch nick: mysql-5.1-bugteam timestamp: Wed 2009-07-01 11:06:05 +0530 message: Fix build failure after applying Innodb snapshot 5.1-ss5282 After applying Innodb snapshot 5.1-ss5282, build was broken because of missing header file. Adding the header file to Makefile.am after informing the innodb developers. modified: storage/innobase/Makefile.am ------------------------------------------------------------------------ r5740 | jyang | 2009-09-03 06:33:47 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Sunny Bains. ------------------------------------------------------------------------ r5741 | jyang | 2009-09-03 07:16:01 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5757 | jyang | 2009-09-04 04:26:13 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h D /branches/5.1/mysql-test/innodb_bug46000.result D /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Revert change in 5740. Making the fix in a subsequent check in. ------------------------------------------------------------------------ r5760 | jyang | 2009-09-04 07:07:34 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc D /branches/5.1/mysql-test/innodb_bug44369.result D /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: This is to revert change 5741. A return status for create_table_def() needs to be fixed. ------------------------------------------------------------------------ r5797 | calvin | 2009-09-09 18:26:29 +0300 (Wed, 09 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: merge change from 5.1.38 HA_ERR_TOO_MANY_CONCURRENT_TRXS is added in 5.1.38. ------------------------------------------------------------------------ r5799 | calvin | 2009-09-09 20:47:31 +0300 (Wed, 09 Sep 2009) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: fix bug#46256 Allow tables to be dropped even if the collation is not found, but issue a warning. Could not find an easy way to add mysql-test since it requires changes to charsets and restarting the server. Tests were executed manually. Approved by: Heikki (on IM) ------------------------------------------------------------------------ r5805 | vasil | 2009-09-10 08:41:48 +0300 (Thu, 10 Sep 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix a compilation warning caused by c5799: handler/ha_innodb.cc: In function 'void innobase_get_cset_width(ulint, ulint*, ulint*)': handler/ha_innodb.cc:830: warning: format '%d' expects type 'int', but argument 2 has type 'ulint' ------------------------------------------------------------------------ r5834 | jyang | 2009-09-11 00:43:05 +0300 (Fri, 11 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5895 | jyang | 2009-09-15 03:39:21 +0300 (Tue, 15 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Marko Makela. ------------------------------------------------------------------------
16 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge 2437:2485 from branches/5.1: (r2478 was skipped for the obvious reason) ------------------------------------------------------------------------ r2464 | vasil | 2008-05-19 17:59:42 +0300 (Mon, 19 May 2008) | 9 lines branches/5.1: Fix Bug#36600 SHOW STATUS takes a lot of CPU in buf_get_latched_pages_number by removing the Innodb_buffer_pool_pages_latched variable from SHOW STATUS output in non-UNIV_DEBUG compilation. Approved by: Heikki ------------------------------------------------------------------------ r2466 | calvin | 2008-05-20 01:37:14 +0300 (Tue, 20 May 2008) | 12 lines branches/5.1: Fix Bug#11894 innodb_file_per_table crashes w/ Windows .sym symbolic link hack The crash was due to un-handled error 3 (path not found). In the case of file per table, change the call to os_file_handle_error_no_exit() from os_file_handle_error(). Also, checks for full path pattern during table create (Windows only), which is used in symbolic link and temp table creation. Approved by: Heikki ------------------------------------------------------------------------ r2478 | sunny | 2008-05-23 08:29:08 +0300 (Fri, 23 May 2008) | 3 lines branches/5.1: Fix for bug# 36793. This is a back port from branches/zip. This code has been tested on a big-endian machine too. ------------------------------------------------------------------------ r2480 | vasil | 2008-05-27 11:40:07 +0300 (Tue, 27 May 2008) | 11 lines branches/5.1: Fix Bug#36819 ut_usectime does not handle errors from gettimeofday by retrying gettimeofday() several times if it fails in ut_usectime(). If it fails on all calls then return error to the caller to be handled at higher level. Update the variable innodb_row_lock_time_max in SHOW STATUS output only if ut_usectime() was successful. ------------------------------------------------------------------------ r2482 | sunny | 2008-05-28 12:18:35 +0300 (Wed, 28 May 2008) | 5 lines branches/5.1: Fix for Bug#35602, "Failed to read auto-increment value from storage engine". The test for REPLACE was an error of ommission since it's classified as a simple INSERT. For REPLACE statements we don't acquire the special AUTOINC lock for AUTOINC_NEW_STYLE_LOCKING with this fix. ------------------------------------------------------------------------ r2485 | vasil | 2008-05-28 16:01:14 +0300 (Wed, 28 May 2008) | 9 lines branches/5.1: Fix Bug#36149 Read buffer overflow in srv0start.c found during "make test" Use strncmp(3) instead of memcmp(3) to avoid reading past end of the string if it is empty (*str == '\0'). This bug is _not_ a buffer overflow. Discussed with: Sunny (via IM) ------------------------------------------------------------------------
18 years ago
20 years ago
branches/zip: Merge 2437:2485 from branches/5.1: (r2478 was skipped for the obvious reason) ------------------------------------------------------------------------ r2464 | vasil | 2008-05-19 17:59:42 +0300 (Mon, 19 May 2008) | 9 lines branches/5.1: Fix Bug#36600 SHOW STATUS takes a lot of CPU in buf_get_latched_pages_number by removing the Innodb_buffer_pool_pages_latched variable from SHOW STATUS output in non-UNIV_DEBUG compilation. Approved by: Heikki ------------------------------------------------------------------------ r2466 | calvin | 2008-05-20 01:37:14 +0300 (Tue, 20 May 2008) | 12 lines branches/5.1: Fix Bug#11894 innodb_file_per_table crashes w/ Windows .sym symbolic link hack The crash was due to un-handled error 3 (path not found). In the case of file per table, change the call to os_file_handle_error_no_exit() from os_file_handle_error(). Also, checks for full path pattern during table create (Windows only), which is used in symbolic link and temp table creation. Approved by: Heikki ------------------------------------------------------------------------ r2478 | sunny | 2008-05-23 08:29:08 +0300 (Fri, 23 May 2008) | 3 lines branches/5.1: Fix for bug# 36793. This is a back port from branches/zip. This code has been tested on a big-endian machine too. ------------------------------------------------------------------------ r2480 | vasil | 2008-05-27 11:40:07 +0300 (Tue, 27 May 2008) | 11 lines branches/5.1: Fix Bug#36819 ut_usectime does not handle errors from gettimeofday by retrying gettimeofday() several times if it fails in ut_usectime(). If it fails on all calls then return error to the caller to be handled at higher level. Update the variable innodb_row_lock_time_max in SHOW STATUS output only if ut_usectime() was successful. ------------------------------------------------------------------------ r2482 | sunny | 2008-05-28 12:18:35 +0300 (Wed, 28 May 2008) | 5 lines branches/5.1: Fix for Bug#35602, "Failed to read auto-increment value from storage engine". The test for REPLACE was an error of ommission since it's classified as a simple INSERT. For REPLACE statements we don't acquire the special AUTOINC lock for AUTOINC_NEW_STYLE_LOCKING with this fix. ------------------------------------------------------------------------ r2485 | vasil | 2008-05-28 16:01:14 +0300 (Wed, 28 May 2008) | 9 lines branches/5.1: Fix Bug#36149 Read buffer overflow in srv0start.c found during "make test" Use strncmp(3) instead of memcmp(3) to avoid reading past end of the string if it is empty (*str == '\0'). This bug is _not_ a buffer overflow. Discussed with: Sunny (via IM) ------------------------------------------------------------------------
18 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge 2929:3458 from branches/5.1 (resolving conflict in c3257, note also that r3363 reverted r2933 so there are not changes in mysql-test/innodb-autoinc.result with the current merge): ------------------------------------------------------------------------ r2933 | calvin | 2008-10-30 02:57:31 +0200 (Thu, 30 Oct 2008) | 10 lines Changed paths: M /branches/5.1/mysql-test/innodb-autoinc.result branches/5.1: correct the result file innodb-autoinc.result Change the followings: auto_increment_increment auto_increment_offset to auto-increment-increment auto-increment-offset ------------------------------------------------------------------------ r2981 | marko | 2008-11-07 14:54:10 +0200 (Fri, 07 Nov 2008) | 5 lines Changed paths: M /branches/5.1/row/row0mysql.c branches/5.0: row_mysql_store_col_in_innobase_format(): Correct a misleading comment. In the UTF-8 encoding, ASCII takes 1 byte per character, while the "latin1" character set (normally ISO-8859-1, but in MySQL it actually refers to the Windows Code Page 1252 a.k.a. CP1252, WinLatin1) takes 1 to 3 bytes (1 to 2 bytes for the ISO-8859-1 subset). ------------------------------------------------------------------------ r3114 | calvin | 2008-11-14 20:31:48 +0200 (Fri, 14 Nov 2008) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: fix bug#40386: Not flushing query cache after truncate ha_statistics.records can not be 0 unless the table is empty, set to 1 instead. The original problem of bug#29507 is fixed in the server. Additional test was done with the fix of bug#29507 in the server. Approved by: Heikki (on IM) ------------------------------------------------------------------------ r3257 | inaam | 2008-11-24 22:06:50 +0200 (Mon, 24 Nov 2008) | 13 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/srv/srv0srv.c M /branches/5.1/trx/trx0trx.c branches/5.1 bug#40760 The config param innodb_thread_concurrency is dynamically set and is read when a thread enters/exits innodb. If the value is changed between the enter and exit time the behaviour becomes erratic. The fix is not to use srv_thread_concurrency when exiting, instead use the flag trx->declared_to_be_inside_innodb. rb://57 Approved by: Marko ------------------------------------------------------------------------ r3363 | calvin | 2008-12-04 19:00:20 +0200 (Thu, 04 Dec 2008) | 13 lines Changed paths: M /branches/5.1/mysql-test/innodb-autoinc.result branches/5.1: revert the changes in r2933 The changes in r2933 causes test failure on Linux. More investigation is needed for Windows. Change the followings in innodb-autoinc.result: auto-increment-increment auto-increment-offset back to: auto_increment_increment auto_increment_offset ------------------------------------------------------------------------ r3412 | vasil | 2008-12-05 10:46:18 +0200 (Fri, 05 Dec 2008) | 7 lines Changed paths: M /branches/5.1/trx/trx0undo.c branches/5.1: Add the traditional 2 spaces after the timestamp so the message does not look like: 070223 13:26:01InnoDB: Warning: canno.... ------------------------------------------------------------------------ r3458 | vasil | 2008-12-09 11:21:08 +0200 (Tue, 09 Dec 2008) | 51 lines Changed paths: M /branches/5.1/mysql-test/innodb_bug34300.test branches/5.1: Merge a change from MySQL to fix the failing innodb_bug34300 mysql-test: main.innodb_bug34300 [ fail ] mysqltest: At line 11: query 'SET @@max_allowed_packet=16777216' failed: 1621: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value Aborting: main.innodb_bug34300 failed in default mode. The changeset is this: ------------------------------------------------------------ revno: 2709.1.10 committer: Staale Smedseng <staale.smedseng@sun.com> branch nick: b22891-51-bugteam timestamp: Thu 2008-11-20 08:51:48 +0100 message: A fix for Bug#22891 "session level max_allowed_packet can be set but is ignored". This patch makes @@session.max_allowed_packed and @@session.net_buffer_length read-only as suggested in the bug report. The user will have to use SET GLOBAL (and reconnect) to alter the session values of these variables. The error string ER_VARIABLE_IS_READONLY is introduced. Tests are modified accordingly. modified: mysql-test/r/func_compress.result mysql-test/r/max_allowed_packet_basic.result mysql-test/r/max_allowed_packet_func.result mysql-test/r/net_buffer_length_basic.result mysql-test/r/packet.result mysql-test/r/union.result mysql-test/r/variables.result mysql-test/t/func_compress.test mysql-test/t/innodb_bug34300.test mysql-test/t/max_allowed_packet_basic.test mysql-test/t/max_allowed_packet_func.test mysql-test/t/net_buffer_length_basic.test mysql-test/t/packet.test mysql-test/t/union.test mysql-test/t/variables.test sql/set_var.cc sql/set_var.h sql/share/errmsg.txt ------------------------------------------------------------ ------------------------------------------------------------------------
17 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge 2537:2605 from branches/5.1: ------------------------------------------------------------------------ r2545 | vasil | 2008-07-25 17:24:23 +0300 (Fri, 25 Jul 2008) | 37 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix Bug#38185 ha_innobase::info can hold locks even when called with HA_STATUS_NO_LOCK The fix is to call fsp_get_available_space_in_free_extents() from ha_innobase::info() only if HA_STATUS_NO_LOCK is not present in the flag *AND* change get_schema_tables_record() in MySQL's sql/sql_show.cc to call ::info() *without* HA_STATUS_NO_LOCK whenever a user issues SELECT FROM information_schema.tables; Without the change to sql/sql_show.cc this patch would lead to Bug#32440 resurfacing. I.e. delete_length would never be updated in ::info() and will remain 0 forever, resulting in the free space not being shown anywhere. This is the change to sql/sql_show.cc for reference, it needs to be committed to the MySQL repo before or at the same time with this change to ha_innodb.cc: --- patch begins here --- --- sql/sql_show.cc.orig 2008-07-23 09:32:14.000000000 +0300 +++ sql/sql_show.cc 2008-07-23 09:32:19.000000000 +0300 @@ -3549,8 +3549,7 @@ static int get_schema_tables_record(THD if(file) { - file->info(HA_STATUS_VARIABLE | HA_STATUS_TIME | HA_STATUS_AUTO | - HA_STATUS_NO_LOCK); + file->info(HA_STATUS_VARIABLE | HA_STATUS_TIME | HA_STATUS_AUTO); enum row_type row_type = file->get_row_type(); switch (row_type) { case ROW_TYPE_NOT_USED: --- patch ends here --- Approved by: Heikki ------------------------------------------------------------------------ r2603 | marko | 2008-08-21 16:25:05 +0300 (Thu, 21 Aug 2008) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/ha_prototypes.h M /branches/5.1/row/row0sel.c branches/5.1: Identify SELECT statements by thd_sql_command() == SQLCOM_SELECT instead of parsing the query string. This fixes MySQL Bug #37885 without us having to implement lexical analysis of SQL comments in yet another place. thd_is_select(): A new predicate. row_search_for_mysql(): Use thd_is_select(). Approved by Heikki. ------------------------------------------------------------------------
17 years ago
branches/zip: Merge 2537:2605 from branches/5.1: ------------------------------------------------------------------------ r2545 | vasil | 2008-07-25 17:24:23 +0300 (Fri, 25 Jul 2008) | 37 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix Bug#38185 ha_innobase::info can hold locks even when called with HA_STATUS_NO_LOCK The fix is to call fsp_get_available_space_in_free_extents() from ha_innobase::info() only if HA_STATUS_NO_LOCK is not present in the flag *AND* change get_schema_tables_record() in MySQL's sql/sql_show.cc to call ::info() *without* HA_STATUS_NO_LOCK whenever a user issues SELECT FROM information_schema.tables; Without the change to sql/sql_show.cc this patch would lead to Bug#32440 resurfacing. I.e. delete_length would never be updated in ::info() and will remain 0 forever, resulting in the free space not being shown anywhere. This is the change to sql/sql_show.cc for reference, it needs to be committed to the MySQL repo before or at the same time with this change to ha_innodb.cc: --- patch begins here --- --- sql/sql_show.cc.orig 2008-07-23 09:32:14.000000000 +0300 +++ sql/sql_show.cc 2008-07-23 09:32:19.000000000 +0300 @@ -3549,8 +3549,7 @@ static int get_schema_tables_record(THD if(file) { - file->info(HA_STATUS_VARIABLE | HA_STATUS_TIME | HA_STATUS_AUTO | - HA_STATUS_NO_LOCK); + file->info(HA_STATUS_VARIABLE | HA_STATUS_TIME | HA_STATUS_AUTO); enum row_type row_type = file->get_row_type(); switch (row_type) { case ROW_TYPE_NOT_USED: --- patch ends here --- Approved by: Heikki ------------------------------------------------------------------------ r2603 | marko | 2008-08-21 16:25:05 +0300 (Thu, 21 Aug 2008) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/ha_prototypes.h M /branches/5.1/row/row0sel.c branches/5.1: Identify SELECT statements by thd_sql_command() == SQLCOM_SELECT instead of parsing the query string. This fixes MySQL Bug #37885 without us having to implement lexical analysis of SQL comments in yet another place. thd_is_select(): A new predicate. row_search_for_mysql(): Use thd_is_select(). Approved by Heikki. ------------------------------------------------------------------------
17 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge revisions 5622:5912 from branches/5.1, except r5700 (changes to CMakeLists.txt) ------------------------------------------------------------------------ r5622 | vasil | 2009-08-03 15:27:00 +0300 (Mon, 03 Aug 2009) | 20 lines Changed paths: M /branches/5.1/Makefile.am branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2988 committer: Satya B <satya.bn@sun.com> branch nick: mysql-5.1-bugteam timestamp: Wed 2009-07-01 11:06:05 +0530 message: Fix build failure after applying Innodb snapshot 5.1-ss5282 After applying Innodb snapshot 5.1-ss5282, build was broken because of missing header file. Adding the header file to Makefile.am after informing the innodb developers. modified: storage/innobase/Makefile.am ------------------------------------------------------------------------ r5740 | jyang | 2009-09-03 06:33:47 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Sunny Bains. ------------------------------------------------------------------------ r5741 | jyang | 2009-09-03 07:16:01 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5757 | jyang | 2009-09-04 04:26:13 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h D /branches/5.1/mysql-test/innodb_bug46000.result D /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Revert change in 5740. Making the fix in a subsequent check in. ------------------------------------------------------------------------ r5760 | jyang | 2009-09-04 07:07:34 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc D /branches/5.1/mysql-test/innodb_bug44369.result D /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: This is to revert change 5741. A return status for create_table_def() needs to be fixed. ------------------------------------------------------------------------ r5797 | calvin | 2009-09-09 18:26:29 +0300 (Wed, 09 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: merge change from 5.1.38 HA_ERR_TOO_MANY_CONCURRENT_TRXS is added in 5.1.38. ------------------------------------------------------------------------ r5799 | calvin | 2009-09-09 20:47:31 +0300 (Wed, 09 Sep 2009) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: fix bug#46256 Allow tables to be dropped even if the collation is not found, but issue a warning. Could not find an easy way to add mysql-test since it requires changes to charsets and restarting the server. Tests were executed manually. Approved by: Heikki (on IM) ------------------------------------------------------------------------ r5805 | vasil | 2009-09-10 08:41:48 +0300 (Thu, 10 Sep 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix a compilation warning caused by c5799: handler/ha_innodb.cc: In function 'void innobase_get_cset_width(ulint, ulint*, ulint*)': handler/ha_innodb.cc:830: warning: format '%d' expects type 'int', but argument 2 has type 'ulint' ------------------------------------------------------------------------ r5834 | jyang | 2009-09-11 00:43:05 +0300 (Fri, 11 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5895 | jyang | 2009-09-15 03:39:21 +0300 (Tue, 15 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Marko Makela. ------------------------------------------------------------------------
16 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge revisions 2702:2722 from branches/5.1: ------------------------------------------------------------------------ r2702 | sunny | 2008-09-30 11:41:56 +0300 (Tue, 30 Sep 2008) | 13 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Since handler::get_auto_increment() doesn't allow us to return the cause of failure we have to inform MySQL using the sql_print_warning() function to return the cause for autoinc failure. Previously we simply printed the error code, this patch prints the text string representing the following two error codes: DB_LOCK_WAIT_TIMEOUT DB_DEADLOCK. Bug#35498 Cannot get table test/table1 auto-inccounter value in ::info Approved by Marko. ------------------------------------------------------------------------ r2709 | vasil | 2008-10-01 10:13:13 +0300 (Wed, 01 Oct 2008) | 10 lines Changed paths: M /branches/5.1/include/lock0lock.h M /branches/5.1/lock/lock0lock.c A /branches/5.1/mysql-test/innodb_bug38231.result A /branches/5.1/mysql-test/innodb_bug38231.test M /branches/5.1/row/row0mysql.c branches/5.1: Fix Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK In TRUNCATE TABLE and discard tablespace: do not remove table-level S and X locks and do not assert on such locks not being wait locks. Leave such locks alone. Approved by: Heikki (rb://14) ------------------------------------------------------------------------ r2710 | vasil | 2008-10-01 14:13:58 +0300 (Wed, 01 Oct 2008) | 6 lines Changed paths: M /branches/5.1/include/sync0sync.ic branches/5.1: Silence a compilation warning in UNIV_DEBUG. Approved by: Marko (via IM) ------------------------------------------------------------------------ r2719 | vasil | 2008-10-03 18:17:28 +0300 (Fri, 03 Oct 2008) | 49 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug39438-master.opt A /branches/5.1/mysql-test/innodb_bug39438.result A /branches/5.1/mysql-test/innodb_bug39438.test branches/5.1: Fix Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch In ha_innobase::info() - do not try to get the free space for a tablespace which has been discarded with ALTER TABLE ... DISCARD TABLESPACE or if the .ibd file is missing for some other reason. ibd_file_missing and tablespace_discarded are manipulated only in row_discard_tablespace_for_mysql() and in row_import_tablespace_for_mysql() and the manipulation is protected/surrounded by row_mysql_lock_data_dictionary()/row_mysql_unlock_data_dictionary() thus we do the same in ha_innobase::info() when checking the values of those members to avoid race conditions. I have tested the code-path with UNIV_DEBUG and UNIV_SYNC_DEBUG. Looks like it is not possible to avoid mysqld printing warnings in the mysql-test case and thus this test innodb_bug39438 must be added to the list of exceptional test cases that are allowed to print warnings. For this, the following patch must be applied to the mysql source tree: --- cut --- === modified file 'mysql-test/lib/mtr_report.pl' --- mysql-test/lib/mtr_report.pl 2008-08-12 10:26:23 +0000 +++ mysql-test/lib/mtr_report.pl 2008-10-01 11:57:41 +0000 @@ -412,7 +412,10 @@ # When trying to set lower_case_table_names = 2 # on a case sensitive file system. Bug#37402. - /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ + /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ or + + # this test is expected to print warnings + ($testname eq 'main.innodb_bug39438') ) { next; # Skip these lines --- cut --- The mysql-test is currently somewhat disabled (see inside innodb_bug39438.test), after the above patch has been applied to the mysql source tree, the test can be enabled. rb://20 Reviewed by: Inaam, Calvin Approved by: Heikki ------------------------------------------------------------------------ r2720 | vasil | 2008-10-03 19:52:39 +0300 (Fri, 03 Oct 2008) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Print a warning if an attempt is made to get the free space for a table whose .ibd file is missing or the tablespace has been discarded. This is a followup to r2719. Suggested by: Inaam ------------------------------------------------------------------------ r2721 | sunny | 2008-10-04 02:08:23 +0300 (Sat, 04 Oct 2008) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: We need to send the messages to the client because handler::get_auto_increment() doesn't allow a way to return the specific error for why it failed. rb://18 ------------------------------------------------------------------------ r2722 | sunny | 2008-10-04 02:48:04 +0300 (Sat, 04 Oct 2008) | 18 lines Changed paths: M /branches/5.1/dict/dict0mem.c M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/dict0mem.h M /branches/5.1/include/row0mysql.h M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test M /branches/5.1/row/row0mysql.c branches/5.1: This bug has always existed but was masked by other errors. The fix for bug# 38839 triggered this bug. When the offset and increment are > 1 we need to calculate the next value taking into consideration the two variables. Previously we simply assumed they were 1 particularly offset was never used. MySQL does its own calculation and that's probably why it seemed to work in the past. We would return what we thought was the correct next value and then MySQL would recalculate the actual value from that and return it to the caller (e.g., handler::write_row()). Several new tests have been added that try and catch some edge cases. The tests exposed a wrap around error in MySQL next value calculation which was filed as bug#39828. The tests will need to be updated once MySQL fix that bug. One good side effect of this fix is that dict_table_t size has been reduced by 8 bytes because we have moved the autoinc_increment field to the row_prebuilt_t structure. See review-board for a detailed discussion. rb://3 ------------------------------------------------------------------------
17 years ago
branches/zip: Merge revisions 2702:2722 from branches/5.1: ------------------------------------------------------------------------ r2702 | sunny | 2008-09-30 11:41:56 +0300 (Tue, 30 Sep 2008) | 13 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Since handler::get_auto_increment() doesn't allow us to return the cause of failure we have to inform MySQL using the sql_print_warning() function to return the cause for autoinc failure. Previously we simply printed the error code, this patch prints the text string representing the following two error codes: DB_LOCK_WAIT_TIMEOUT DB_DEADLOCK. Bug#35498 Cannot get table test/table1 auto-inccounter value in ::info Approved by Marko. ------------------------------------------------------------------------ r2709 | vasil | 2008-10-01 10:13:13 +0300 (Wed, 01 Oct 2008) | 10 lines Changed paths: M /branches/5.1/include/lock0lock.h M /branches/5.1/lock/lock0lock.c A /branches/5.1/mysql-test/innodb_bug38231.result A /branches/5.1/mysql-test/innodb_bug38231.test M /branches/5.1/row/row0mysql.c branches/5.1: Fix Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK In TRUNCATE TABLE and discard tablespace: do not remove table-level S and X locks and do not assert on such locks not being wait locks. Leave such locks alone. Approved by: Heikki (rb://14) ------------------------------------------------------------------------ r2710 | vasil | 2008-10-01 14:13:58 +0300 (Wed, 01 Oct 2008) | 6 lines Changed paths: M /branches/5.1/include/sync0sync.ic branches/5.1: Silence a compilation warning in UNIV_DEBUG. Approved by: Marko (via IM) ------------------------------------------------------------------------ r2719 | vasil | 2008-10-03 18:17:28 +0300 (Fri, 03 Oct 2008) | 49 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug39438-master.opt A /branches/5.1/mysql-test/innodb_bug39438.result A /branches/5.1/mysql-test/innodb_bug39438.test branches/5.1: Fix Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch In ha_innobase::info() - do not try to get the free space for a tablespace which has been discarded with ALTER TABLE ... DISCARD TABLESPACE or if the .ibd file is missing for some other reason. ibd_file_missing and tablespace_discarded are manipulated only in row_discard_tablespace_for_mysql() and in row_import_tablespace_for_mysql() and the manipulation is protected/surrounded by row_mysql_lock_data_dictionary()/row_mysql_unlock_data_dictionary() thus we do the same in ha_innobase::info() when checking the values of those members to avoid race conditions. I have tested the code-path with UNIV_DEBUG and UNIV_SYNC_DEBUG. Looks like it is not possible to avoid mysqld printing warnings in the mysql-test case and thus this test innodb_bug39438 must be added to the list of exceptional test cases that are allowed to print warnings. For this, the following patch must be applied to the mysql source tree: --- cut --- === modified file 'mysql-test/lib/mtr_report.pl' --- mysql-test/lib/mtr_report.pl 2008-08-12 10:26:23 +0000 +++ mysql-test/lib/mtr_report.pl 2008-10-01 11:57:41 +0000 @@ -412,7 +412,10 @@ # When trying to set lower_case_table_names = 2 # on a case sensitive file system. Bug#37402. - /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ + /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ or + + # this test is expected to print warnings + ($testname eq 'main.innodb_bug39438') ) { next; # Skip these lines --- cut --- The mysql-test is currently somewhat disabled (see inside innodb_bug39438.test), after the above patch has been applied to the mysql source tree, the test can be enabled. rb://20 Reviewed by: Inaam, Calvin Approved by: Heikki ------------------------------------------------------------------------ r2720 | vasil | 2008-10-03 19:52:39 +0300 (Fri, 03 Oct 2008) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Print a warning if an attempt is made to get the free space for a table whose .ibd file is missing or the tablespace has been discarded. This is a followup to r2719. Suggested by: Inaam ------------------------------------------------------------------------ r2721 | sunny | 2008-10-04 02:08:23 +0300 (Sat, 04 Oct 2008) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: We need to send the messages to the client because handler::get_auto_increment() doesn't allow a way to return the specific error for why it failed. rb://18 ------------------------------------------------------------------------ r2722 | sunny | 2008-10-04 02:48:04 +0300 (Sat, 04 Oct 2008) | 18 lines Changed paths: M /branches/5.1/dict/dict0mem.c M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/dict0mem.h M /branches/5.1/include/row0mysql.h M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test M /branches/5.1/row/row0mysql.c branches/5.1: This bug has always existed but was masked by other errors. The fix for bug# 38839 triggered this bug. When the offset and increment are > 1 we need to calculate the next value taking into consideration the two variables. Previously we simply assumed they were 1 particularly offset was never used. MySQL does its own calculation and that's probably why it seemed to work in the past. We would return what we thought was the correct next value and then MySQL would recalculate the actual value from that and return it to the caller (e.g., handler::write_row()). Several new tests have been added that try and catch some edge cases. The tests exposed a wrap around error in MySQL next value calculation which was filed as bug#39828. The tests will need to be updated once MySQL fix that bug. One good side effect of this fix is that dict_table_t size has been reduced by 8 bytes because we have moved the autoinc_increment field to the row_prebuilt_t structure. See review-board for a detailed discussion. rb://3 ------------------------------------------------------------------------
17 years ago
branches/zip: Merge revisions 2702:2722 from branches/5.1: ------------------------------------------------------------------------ r2702 | sunny | 2008-09-30 11:41:56 +0300 (Tue, 30 Sep 2008) | 13 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Since handler::get_auto_increment() doesn't allow us to return the cause of failure we have to inform MySQL using the sql_print_warning() function to return the cause for autoinc failure. Previously we simply printed the error code, this patch prints the text string representing the following two error codes: DB_LOCK_WAIT_TIMEOUT DB_DEADLOCK. Bug#35498 Cannot get table test/table1 auto-inccounter value in ::info Approved by Marko. ------------------------------------------------------------------------ r2709 | vasil | 2008-10-01 10:13:13 +0300 (Wed, 01 Oct 2008) | 10 lines Changed paths: M /branches/5.1/include/lock0lock.h M /branches/5.1/lock/lock0lock.c A /branches/5.1/mysql-test/innodb_bug38231.result A /branches/5.1/mysql-test/innodb_bug38231.test M /branches/5.1/row/row0mysql.c branches/5.1: Fix Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK In TRUNCATE TABLE and discard tablespace: do not remove table-level S and X locks and do not assert on such locks not being wait locks. Leave such locks alone. Approved by: Heikki (rb://14) ------------------------------------------------------------------------ r2710 | vasil | 2008-10-01 14:13:58 +0300 (Wed, 01 Oct 2008) | 6 lines Changed paths: M /branches/5.1/include/sync0sync.ic branches/5.1: Silence a compilation warning in UNIV_DEBUG. Approved by: Marko (via IM) ------------------------------------------------------------------------ r2719 | vasil | 2008-10-03 18:17:28 +0300 (Fri, 03 Oct 2008) | 49 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug39438-master.opt A /branches/5.1/mysql-test/innodb_bug39438.result A /branches/5.1/mysql-test/innodb_bug39438.test branches/5.1: Fix Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch In ha_innobase::info() - do not try to get the free space for a tablespace which has been discarded with ALTER TABLE ... DISCARD TABLESPACE or if the .ibd file is missing for some other reason. ibd_file_missing and tablespace_discarded are manipulated only in row_discard_tablespace_for_mysql() and in row_import_tablespace_for_mysql() and the manipulation is protected/surrounded by row_mysql_lock_data_dictionary()/row_mysql_unlock_data_dictionary() thus we do the same in ha_innobase::info() when checking the values of those members to avoid race conditions. I have tested the code-path with UNIV_DEBUG and UNIV_SYNC_DEBUG. Looks like it is not possible to avoid mysqld printing warnings in the mysql-test case and thus this test innodb_bug39438 must be added to the list of exceptional test cases that are allowed to print warnings. For this, the following patch must be applied to the mysql source tree: --- cut --- === modified file 'mysql-test/lib/mtr_report.pl' --- mysql-test/lib/mtr_report.pl 2008-08-12 10:26:23 +0000 +++ mysql-test/lib/mtr_report.pl 2008-10-01 11:57:41 +0000 @@ -412,7 +412,10 @@ # When trying to set lower_case_table_names = 2 # on a case sensitive file system. Bug#37402. - /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ + /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ or + + # this test is expected to print warnings + ($testname eq 'main.innodb_bug39438') ) { next; # Skip these lines --- cut --- The mysql-test is currently somewhat disabled (see inside innodb_bug39438.test), after the above patch has been applied to the mysql source tree, the test can be enabled. rb://20 Reviewed by: Inaam, Calvin Approved by: Heikki ------------------------------------------------------------------------ r2720 | vasil | 2008-10-03 19:52:39 +0300 (Fri, 03 Oct 2008) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Print a warning if an attempt is made to get the free space for a table whose .ibd file is missing or the tablespace has been discarded. This is a followup to r2719. Suggested by: Inaam ------------------------------------------------------------------------ r2721 | sunny | 2008-10-04 02:08:23 +0300 (Sat, 04 Oct 2008) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: We need to send the messages to the client because handler::get_auto_increment() doesn't allow a way to return the specific error for why it failed. rb://18 ------------------------------------------------------------------------ r2722 | sunny | 2008-10-04 02:48:04 +0300 (Sat, 04 Oct 2008) | 18 lines Changed paths: M /branches/5.1/dict/dict0mem.c M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/dict0mem.h M /branches/5.1/include/row0mysql.h M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test M /branches/5.1/row/row0mysql.c branches/5.1: This bug has always existed but was masked by other errors. The fix for bug# 38839 triggered this bug. When the offset and increment are > 1 we need to calculate the next value taking into consideration the two variables. Previously we simply assumed they were 1 particularly offset was never used. MySQL does its own calculation and that's probably why it seemed to work in the past. We would return what we thought was the correct next value and then MySQL would recalculate the actual value from that and return it to the caller (e.g., handler::write_row()). Several new tests have been added that try and catch some edge cases. The tests exposed a wrap around error in MySQL next value calculation which was filed as bug#39828. The tests will need to be updated once MySQL fix that bug. One good side effect of this fix is that dict_table_t size has been reduced by 8 bytes because we have moved the autoinc_increment field to the row_prebuilt_t structure. See review-board for a detailed discussion. rb://3 ------------------------------------------------------------------------
17 years ago
branches/zip: Merge revisions 2702:2722 from branches/5.1: ------------------------------------------------------------------------ r2702 | sunny | 2008-09-30 11:41:56 +0300 (Tue, 30 Sep 2008) | 13 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Since handler::get_auto_increment() doesn't allow us to return the cause of failure we have to inform MySQL using the sql_print_warning() function to return the cause for autoinc failure. Previously we simply printed the error code, this patch prints the text string representing the following two error codes: DB_LOCK_WAIT_TIMEOUT DB_DEADLOCK. Bug#35498 Cannot get table test/table1 auto-inccounter value in ::info Approved by Marko. ------------------------------------------------------------------------ r2709 | vasil | 2008-10-01 10:13:13 +0300 (Wed, 01 Oct 2008) | 10 lines Changed paths: M /branches/5.1/include/lock0lock.h M /branches/5.1/lock/lock0lock.c A /branches/5.1/mysql-test/innodb_bug38231.result A /branches/5.1/mysql-test/innodb_bug38231.test M /branches/5.1/row/row0mysql.c branches/5.1: Fix Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK In TRUNCATE TABLE and discard tablespace: do not remove table-level S and X locks and do not assert on such locks not being wait locks. Leave such locks alone. Approved by: Heikki (rb://14) ------------------------------------------------------------------------ r2710 | vasil | 2008-10-01 14:13:58 +0300 (Wed, 01 Oct 2008) | 6 lines Changed paths: M /branches/5.1/include/sync0sync.ic branches/5.1: Silence a compilation warning in UNIV_DEBUG. Approved by: Marko (via IM) ------------------------------------------------------------------------ r2719 | vasil | 2008-10-03 18:17:28 +0300 (Fri, 03 Oct 2008) | 49 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug39438-master.opt A /branches/5.1/mysql-test/innodb_bug39438.result A /branches/5.1/mysql-test/innodb_bug39438.test branches/5.1: Fix Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch In ha_innobase::info() - do not try to get the free space for a tablespace which has been discarded with ALTER TABLE ... DISCARD TABLESPACE or if the .ibd file is missing for some other reason. ibd_file_missing and tablespace_discarded are manipulated only in row_discard_tablespace_for_mysql() and in row_import_tablespace_for_mysql() and the manipulation is protected/surrounded by row_mysql_lock_data_dictionary()/row_mysql_unlock_data_dictionary() thus we do the same in ha_innobase::info() when checking the values of those members to avoid race conditions. I have tested the code-path with UNIV_DEBUG and UNIV_SYNC_DEBUG. Looks like it is not possible to avoid mysqld printing warnings in the mysql-test case and thus this test innodb_bug39438 must be added to the list of exceptional test cases that are allowed to print warnings. For this, the following patch must be applied to the mysql source tree: --- cut --- === modified file 'mysql-test/lib/mtr_report.pl' --- mysql-test/lib/mtr_report.pl 2008-08-12 10:26:23 +0000 +++ mysql-test/lib/mtr_report.pl 2008-10-01 11:57:41 +0000 @@ -412,7 +412,10 @@ # When trying to set lower_case_table_names = 2 # on a case sensitive file system. Bug#37402. - /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ + /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ or + + # this test is expected to print warnings + ($testname eq 'main.innodb_bug39438') ) { next; # Skip these lines --- cut --- The mysql-test is currently somewhat disabled (see inside innodb_bug39438.test), after the above patch has been applied to the mysql source tree, the test can be enabled. rb://20 Reviewed by: Inaam, Calvin Approved by: Heikki ------------------------------------------------------------------------ r2720 | vasil | 2008-10-03 19:52:39 +0300 (Fri, 03 Oct 2008) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Print a warning if an attempt is made to get the free space for a table whose .ibd file is missing or the tablespace has been discarded. This is a followup to r2719. Suggested by: Inaam ------------------------------------------------------------------------ r2721 | sunny | 2008-10-04 02:08:23 +0300 (Sat, 04 Oct 2008) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: We need to send the messages to the client because handler::get_auto_increment() doesn't allow a way to return the specific error for why it failed. rb://18 ------------------------------------------------------------------------ r2722 | sunny | 2008-10-04 02:48:04 +0300 (Sat, 04 Oct 2008) | 18 lines Changed paths: M /branches/5.1/dict/dict0mem.c M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/dict0mem.h M /branches/5.1/include/row0mysql.h M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test M /branches/5.1/row/row0mysql.c branches/5.1: This bug has always existed but was masked by other errors. The fix for bug# 38839 triggered this bug. When the offset and increment are > 1 we need to calculate the next value taking into consideration the two variables. Previously we simply assumed they were 1 particularly offset was never used. MySQL does its own calculation and that's probably why it seemed to work in the past. We would return what we thought was the correct next value and then MySQL would recalculate the actual value from that and return it to the caller (e.g., handler::write_row()). Several new tests have been added that try and catch some edge cases. The tests exposed a wrap around error in MySQL next value calculation which was filed as bug#39828. The tests will need to be updated once MySQL fix that bug. One good side effect of this fix is that dict_table_t size has been reduced by 8 bytes because we have moved the autoinc_increment field to the row_prebuilt_t structure. See review-board for a detailed discussion. rb://3 ------------------------------------------------------------------------
17 years ago
branches/zip: Merge revisions 2702:2722 from branches/5.1: ------------------------------------------------------------------------ r2702 | sunny | 2008-09-30 11:41:56 +0300 (Tue, 30 Sep 2008) | 13 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Since handler::get_auto_increment() doesn't allow us to return the cause of failure we have to inform MySQL using the sql_print_warning() function to return the cause for autoinc failure. Previously we simply printed the error code, this patch prints the text string representing the following two error codes: DB_LOCK_WAIT_TIMEOUT DB_DEADLOCK. Bug#35498 Cannot get table test/table1 auto-inccounter value in ::info Approved by Marko. ------------------------------------------------------------------------ r2709 | vasil | 2008-10-01 10:13:13 +0300 (Wed, 01 Oct 2008) | 10 lines Changed paths: M /branches/5.1/include/lock0lock.h M /branches/5.1/lock/lock0lock.c A /branches/5.1/mysql-test/innodb_bug38231.result A /branches/5.1/mysql-test/innodb_bug38231.test M /branches/5.1/row/row0mysql.c branches/5.1: Fix Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK In TRUNCATE TABLE and discard tablespace: do not remove table-level S and X locks and do not assert on such locks not being wait locks. Leave such locks alone. Approved by: Heikki (rb://14) ------------------------------------------------------------------------ r2710 | vasil | 2008-10-01 14:13:58 +0300 (Wed, 01 Oct 2008) | 6 lines Changed paths: M /branches/5.1/include/sync0sync.ic branches/5.1: Silence a compilation warning in UNIV_DEBUG. Approved by: Marko (via IM) ------------------------------------------------------------------------ r2719 | vasil | 2008-10-03 18:17:28 +0300 (Fri, 03 Oct 2008) | 49 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug39438-master.opt A /branches/5.1/mysql-test/innodb_bug39438.result A /branches/5.1/mysql-test/innodb_bug39438.test branches/5.1: Fix Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch In ha_innobase::info() - do not try to get the free space for a tablespace which has been discarded with ALTER TABLE ... DISCARD TABLESPACE or if the .ibd file is missing for some other reason. ibd_file_missing and tablespace_discarded are manipulated only in row_discard_tablespace_for_mysql() and in row_import_tablespace_for_mysql() and the manipulation is protected/surrounded by row_mysql_lock_data_dictionary()/row_mysql_unlock_data_dictionary() thus we do the same in ha_innobase::info() when checking the values of those members to avoid race conditions. I have tested the code-path with UNIV_DEBUG and UNIV_SYNC_DEBUG. Looks like it is not possible to avoid mysqld printing warnings in the mysql-test case and thus this test innodb_bug39438 must be added to the list of exceptional test cases that are allowed to print warnings. For this, the following patch must be applied to the mysql source tree: --- cut --- === modified file 'mysql-test/lib/mtr_report.pl' --- mysql-test/lib/mtr_report.pl 2008-08-12 10:26:23 +0000 +++ mysql-test/lib/mtr_report.pl 2008-10-01 11:57:41 +0000 @@ -412,7 +412,10 @@ # When trying to set lower_case_table_names = 2 # on a case sensitive file system. Bug#37402. - /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ + /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ or + + # this test is expected to print warnings + ($testname eq 'main.innodb_bug39438') ) { next; # Skip these lines --- cut --- The mysql-test is currently somewhat disabled (see inside innodb_bug39438.test), after the above patch has been applied to the mysql source tree, the test can be enabled. rb://20 Reviewed by: Inaam, Calvin Approved by: Heikki ------------------------------------------------------------------------ r2720 | vasil | 2008-10-03 19:52:39 +0300 (Fri, 03 Oct 2008) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Print a warning if an attempt is made to get the free space for a table whose .ibd file is missing or the tablespace has been discarded. This is a followup to r2719. Suggested by: Inaam ------------------------------------------------------------------------ r2721 | sunny | 2008-10-04 02:08:23 +0300 (Sat, 04 Oct 2008) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: We need to send the messages to the client because handler::get_auto_increment() doesn't allow a way to return the specific error for why it failed. rb://18 ------------------------------------------------------------------------ r2722 | sunny | 2008-10-04 02:48:04 +0300 (Sat, 04 Oct 2008) | 18 lines Changed paths: M /branches/5.1/dict/dict0mem.c M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/dict0mem.h M /branches/5.1/include/row0mysql.h M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test M /branches/5.1/row/row0mysql.c branches/5.1: This bug has always existed but was masked by other errors. The fix for bug# 38839 triggered this bug. When the offset and increment are > 1 we need to calculate the next value taking into consideration the two variables. Previously we simply assumed they were 1 particularly offset was never used. MySQL does its own calculation and that's probably why it seemed to work in the past. We would return what we thought was the correct next value and then MySQL would recalculate the actual value from that and return it to the caller (e.g., handler::write_row()). Several new tests have been added that try and catch some edge cases. The tests exposed a wrap around error in MySQL next value calculation which was filed as bug#39828. The tests will need to be updated once MySQL fix that bug. One good side effect of this fix is that dict_table_t size has been reduced by 8 bytes because we have moved the autoinc_increment field to the row_prebuilt_t structure. See review-board for a detailed discussion. rb://3 ------------------------------------------------------------------------
17 years ago
branches/zip: Merge revisions 2702:2722 from branches/5.1: ------------------------------------------------------------------------ r2702 | sunny | 2008-09-30 11:41:56 +0300 (Tue, 30 Sep 2008) | 13 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Since handler::get_auto_increment() doesn't allow us to return the cause of failure we have to inform MySQL using the sql_print_warning() function to return the cause for autoinc failure. Previously we simply printed the error code, this patch prints the text string representing the following two error codes: DB_LOCK_WAIT_TIMEOUT DB_DEADLOCK. Bug#35498 Cannot get table test/table1 auto-inccounter value in ::info Approved by Marko. ------------------------------------------------------------------------ r2709 | vasil | 2008-10-01 10:13:13 +0300 (Wed, 01 Oct 2008) | 10 lines Changed paths: M /branches/5.1/include/lock0lock.h M /branches/5.1/lock/lock0lock.c A /branches/5.1/mysql-test/innodb_bug38231.result A /branches/5.1/mysql-test/innodb_bug38231.test M /branches/5.1/row/row0mysql.c branches/5.1: Fix Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK In TRUNCATE TABLE and discard tablespace: do not remove table-level S and X locks and do not assert on such locks not being wait locks. Leave such locks alone. Approved by: Heikki (rb://14) ------------------------------------------------------------------------ r2710 | vasil | 2008-10-01 14:13:58 +0300 (Wed, 01 Oct 2008) | 6 lines Changed paths: M /branches/5.1/include/sync0sync.ic branches/5.1: Silence a compilation warning in UNIV_DEBUG. Approved by: Marko (via IM) ------------------------------------------------------------------------ r2719 | vasil | 2008-10-03 18:17:28 +0300 (Fri, 03 Oct 2008) | 49 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug39438-master.opt A /branches/5.1/mysql-test/innodb_bug39438.result A /branches/5.1/mysql-test/innodb_bug39438.test branches/5.1: Fix Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch In ha_innobase::info() - do not try to get the free space for a tablespace which has been discarded with ALTER TABLE ... DISCARD TABLESPACE or if the .ibd file is missing for some other reason. ibd_file_missing and tablespace_discarded are manipulated only in row_discard_tablespace_for_mysql() and in row_import_tablespace_for_mysql() and the manipulation is protected/surrounded by row_mysql_lock_data_dictionary()/row_mysql_unlock_data_dictionary() thus we do the same in ha_innobase::info() when checking the values of those members to avoid race conditions. I have tested the code-path with UNIV_DEBUG and UNIV_SYNC_DEBUG. Looks like it is not possible to avoid mysqld printing warnings in the mysql-test case and thus this test innodb_bug39438 must be added to the list of exceptional test cases that are allowed to print warnings. For this, the following patch must be applied to the mysql source tree: --- cut --- === modified file 'mysql-test/lib/mtr_report.pl' --- mysql-test/lib/mtr_report.pl 2008-08-12 10:26:23 +0000 +++ mysql-test/lib/mtr_report.pl 2008-10-01 11:57:41 +0000 @@ -412,7 +412,10 @@ # When trying to set lower_case_table_names = 2 # on a case sensitive file system. Bug#37402. - /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ + /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ or + + # this test is expected to print warnings + ($testname eq 'main.innodb_bug39438') ) { next; # Skip these lines --- cut --- The mysql-test is currently somewhat disabled (see inside innodb_bug39438.test), after the above patch has been applied to the mysql source tree, the test can be enabled. rb://20 Reviewed by: Inaam, Calvin Approved by: Heikki ------------------------------------------------------------------------ r2720 | vasil | 2008-10-03 19:52:39 +0300 (Fri, 03 Oct 2008) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Print a warning if an attempt is made to get the free space for a table whose .ibd file is missing or the tablespace has been discarded. This is a followup to r2719. Suggested by: Inaam ------------------------------------------------------------------------ r2721 | sunny | 2008-10-04 02:08:23 +0300 (Sat, 04 Oct 2008) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: We need to send the messages to the client because handler::get_auto_increment() doesn't allow a way to return the specific error for why it failed. rb://18 ------------------------------------------------------------------------ r2722 | sunny | 2008-10-04 02:48:04 +0300 (Sat, 04 Oct 2008) | 18 lines Changed paths: M /branches/5.1/dict/dict0mem.c M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/dict0mem.h M /branches/5.1/include/row0mysql.h M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test M /branches/5.1/row/row0mysql.c branches/5.1: This bug has always existed but was masked by other errors. The fix for bug# 38839 triggered this bug. When the offset and increment are > 1 we need to calculate the next value taking into consideration the two variables. Previously we simply assumed they were 1 particularly offset was never used. MySQL does its own calculation and that's probably why it seemed to work in the past. We would return what we thought was the correct next value and then MySQL would recalculate the actual value from that and return it to the caller (e.g., handler::write_row()). Several new tests have been added that try and catch some edge cases. The tests exposed a wrap around error in MySQL next value calculation which was filed as bug#39828. The tests will need to be updated once MySQL fix that bug. One good side effect of this fix is that dict_table_t size has been reduced by 8 bytes because we have moved the autoinc_increment field to the row_prebuilt_t structure. See review-board for a detailed discussion. rb://3 ------------------------------------------------------------------------
17 years ago
branches/zip: Merge revisions 2702:2722 from branches/5.1: ------------------------------------------------------------------------ r2702 | sunny | 2008-09-30 11:41:56 +0300 (Tue, 30 Sep 2008) | 13 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Since handler::get_auto_increment() doesn't allow us to return the cause of failure we have to inform MySQL using the sql_print_warning() function to return the cause for autoinc failure. Previously we simply printed the error code, this patch prints the text string representing the following two error codes: DB_LOCK_WAIT_TIMEOUT DB_DEADLOCK. Bug#35498 Cannot get table test/table1 auto-inccounter value in ::info Approved by Marko. ------------------------------------------------------------------------ r2709 | vasil | 2008-10-01 10:13:13 +0300 (Wed, 01 Oct 2008) | 10 lines Changed paths: M /branches/5.1/include/lock0lock.h M /branches/5.1/lock/lock0lock.c A /branches/5.1/mysql-test/innodb_bug38231.result A /branches/5.1/mysql-test/innodb_bug38231.test M /branches/5.1/row/row0mysql.c branches/5.1: Fix Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK In TRUNCATE TABLE and discard tablespace: do not remove table-level S and X locks and do not assert on such locks not being wait locks. Leave such locks alone. Approved by: Heikki (rb://14) ------------------------------------------------------------------------ r2710 | vasil | 2008-10-01 14:13:58 +0300 (Wed, 01 Oct 2008) | 6 lines Changed paths: M /branches/5.1/include/sync0sync.ic branches/5.1: Silence a compilation warning in UNIV_DEBUG. Approved by: Marko (via IM) ------------------------------------------------------------------------ r2719 | vasil | 2008-10-03 18:17:28 +0300 (Fri, 03 Oct 2008) | 49 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug39438-master.opt A /branches/5.1/mysql-test/innodb_bug39438.result A /branches/5.1/mysql-test/innodb_bug39438.test branches/5.1: Fix Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch In ha_innobase::info() - do not try to get the free space for a tablespace which has been discarded with ALTER TABLE ... DISCARD TABLESPACE or if the .ibd file is missing for some other reason. ibd_file_missing and tablespace_discarded are manipulated only in row_discard_tablespace_for_mysql() and in row_import_tablespace_for_mysql() and the manipulation is protected/surrounded by row_mysql_lock_data_dictionary()/row_mysql_unlock_data_dictionary() thus we do the same in ha_innobase::info() when checking the values of those members to avoid race conditions. I have tested the code-path with UNIV_DEBUG and UNIV_SYNC_DEBUG. Looks like it is not possible to avoid mysqld printing warnings in the mysql-test case and thus this test innodb_bug39438 must be added to the list of exceptional test cases that are allowed to print warnings. For this, the following patch must be applied to the mysql source tree: --- cut --- === modified file 'mysql-test/lib/mtr_report.pl' --- mysql-test/lib/mtr_report.pl 2008-08-12 10:26:23 +0000 +++ mysql-test/lib/mtr_report.pl 2008-10-01 11:57:41 +0000 @@ -412,7 +412,10 @@ # When trying to set lower_case_table_names = 2 # on a case sensitive file system. Bug#37402. - /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ + /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ or + + # this test is expected to print warnings + ($testname eq 'main.innodb_bug39438') ) { next; # Skip these lines --- cut --- The mysql-test is currently somewhat disabled (see inside innodb_bug39438.test), after the above patch has been applied to the mysql source tree, the test can be enabled. rb://20 Reviewed by: Inaam, Calvin Approved by: Heikki ------------------------------------------------------------------------ r2720 | vasil | 2008-10-03 19:52:39 +0300 (Fri, 03 Oct 2008) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Print a warning if an attempt is made to get the free space for a table whose .ibd file is missing or the tablespace has been discarded. This is a followup to r2719. Suggested by: Inaam ------------------------------------------------------------------------ r2721 | sunny | 2008-10-04 02:08:23 +0300 (Sat, 04 Oct 2008) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: We need to send the messages to the client because handler::get_auto_increment() doesn't allow a way to return the specific error for why it failed. rb://18 ------------------------------------------------------------------------ r2722 | sunny | 2008-10-04 02:48:04 +0300 (Sat, 04 Oct 2008) | 18 lines Changed paths: M /branches/5.1/dict/dict0mem.c M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/dict0mem.h M /branches/5.1/include/row0mysql.h M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test M /branches/5.1/row/row0mysql.c branches/5.1: This bug has always existed but was masked by other errors. The fix for bug# 38839 triggered this bug. When the offset and increment are > 1 we need to calculate the next value taking into consideration the two variables. Previously we simply assumed they were 1 particularly offset was never used. MySQL does its own calculation and that's probably why it seemed to work in the past. We would return what we thought was the correct next value and then MySQL would recalculate the actual value from that and return it to the caller (e.g., handler::write_row()). Several new tests have been added that try and catch some edge cases. The tests exposed a wrap around error in MySQL next value calculation which was filed as bug#39828. The tests will need to be updated once MySQL fix that bug. One good side effect of this fix is that dict_table_t size has been reduced by 8 bytes because we have moved the autoinc_increment field to the row_prebuilt_t structure. See review-board for a detailed discussion. rb://3 ------------------------------------------------------------------------
17 years ago
branches/zip: Merge revisions 2702:2722 from branches/5.1: ------------------------------------------------------------------------ r2702 | sunny | 2008-09-30 11:41:56 +0300 (Tue, 30 Sep 2008) | 13 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Since handler::get_auto_increment() doesn't allow us to return the cause of failure we have to inform MySQL using the sql_print_warning() function to return the cause for autoinc failure. Previously we simply printed the error code, this patch prints the text string representing the following two error codes: DB_LOCK_WAIT_TIMEOUT DB_DEADLOCK. Bug#35498 Cannot get table test/table1 auto-inccounter value in ::info Approved by Marko. ------------------------------------------------------------------------ r2709 | vasil | 2008-10-01 10:13:13 +0300 (Wed, 01 Oct 2008) | 10 lines Changed paths: M /branches/5.1/include/lock0lock.h M /branches/5.1/lock/lock0lock.c A /branches/5.1/mysql-test/innodb_bug38231.result A /branches/5.1/mysql-test/innodb_bug38231.test M /branches/5.1/row/row0mysql.c branches/5.1: Fix Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK In TRUNCATE TABLE and discard tablespace: do not remove table-level S and X locks and do not assert on such locks not being wait locks. Leave such locks alone. Approved by: Heikki (rb://14) ------------------------------------------------------------------------ r2710 | vasil | 2008-10-01 14:13:58 +0300 (Wed, 01 Oct 2008) | 6 lines Changed paths: M /branches/5.1/include/sync0sync.ic branches/5.1: Silence a compilation warning in UNIV_DEBUG. Approved by: Marko (via IM) ------------------------------------------------------------------------ r2719 | vasil | 2008-10-03 18:17:28 +0300 (Fri, 03 Oct 2008) | 49 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug39438-master.opt A /branches/5.1/mysql-test/innodb_bug39438.result A /branches/5.1/mysql-test/innodb_bug39438.test branches/5.1: Fix Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch In ha_innobase::info() - do not try to get the free space for a tablespace which has been discarded with ALTER TABLE ... DISCARD TABLESPACE or if the .ibd file is missing for some other reason. ibd_file_missing and tablespace_discarded are manipulated only in row_discard_tablespace_for_mysql() and in row_import_tablespace_for_mysql() and the manipulation is protected/surrounded by row_mysql_lock_data_dictionary()/row_mysql_unlock_data_dictionary() thus we do the same in ha_innobase::info() when checking the values of those members to avoid race conditions. I have tested the code-path with UNIV_DEBUG and UNIV_SYNC_DEBUG. Looks like it is not possible to avoid mysqld printing warnings in the mysql-test case and thus this test innodb_bug39438 must be added to the list of exceptional test cases that are allowed to print warnings. For this, the following patch must be applied to the mysql source tree: --- cut --- === modified file 'mysql-test/lib/mtr_report.pl' --- mysql-test/lib/mtr_report.pl 2008-08-12 10:26:23 +0000 +++ mysql-test/lib/mtr_report.pl 2008-10-01 11:57:41 +0000 @@ -412,7 +412,10 @@ # When trying to set lower_case_table_names = 2 # on a case sensitive file system. Bug#37402. - /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ + /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ or + + # this test is expected to print warnings + ($testname eq 'main.innodb_bug39438') ) { next; # Skip these lines --- cut --- The mysql-test is currently somewhat disabled (see inside innodb_bug39438.test), after the above patch has been applied to the mysql source tree, the test can be enabled. rb://20 Reviewed by: Inaam, Calvin Approved by: Heikki ------------------------------------------------------------------------ r2720 | vasil | 2008-10-03 19:52:39 +0300 (Fri, 03 Oct 2008) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Print a warning if an attempt is made to get the free space for a table whose .ibd file is missing or the tablespace has been discarded. This is a followup to r2719. Suggested by: Inaam ------------------------------------------------------------------------ r2721 | sunny | 2008-10-04 02:08:23 +0300 (Sat, 04 Oct 2008) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: We need to send the messages to the client because handler::get_auto_increment() doesn't allow a way to return the specific error for why it failed. rb://18 ------------------------------------------------------------------------ r2722 | sunny | 2008-10-04 02:48:04 +0300 (Sat, 04 Oct 2008) | 18 lines Changed paths: M /branches/5.1/dict/dict0mem.c M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/dict0mem.h M /branches/5.1/include/row0mysql.h M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test M /branches/5.1/row/row0mysql.c branches/5.1: This bug has always existed but was masked by other errors. The fix for bug# 38839 triggered this bug. When the offset and increment are > 1 we need to calculate the next value taking into consideration the two variables. Previously we simply assumed they were 1 particularly offset was never used. MySQL does its own calculation and that's probably why it seemed to work in the past. We would return what we thought was the correct next value and then MySQL would recalculate the actual value from that and return it to the caller (e.g., handler::write_row()). Several new tests have been added that try and catch some edge cases. The tests exposed a wrap around error in MySQL next value calculation which was filed as bug#39828. The tests will need to be updated once MySQL fix that bug. One good side effect of this fix is that dict_table_t size has been reduced by 8 bytes because we have moved the autoinc_increment field to the row_prebuilt_t structure. See review-board for a detailed discussion. rb://3 ------------------------------------------------------------------------
17 years ago
branches/zip: Merge revisions 2702:2722 from branches/5.1: ------------------------------------------------------------------------ r2702 | sunny | 2008-09-30 11:41:56 +0300 (Tue, 30 Sep 2008) | 13 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Since handler::get_auto_increment() doesn't allow us to return the cause of failure we have to inform MySQL using the sql_print_warning() function to return the cause for autoinc failure. Previously we simply printed the error code, this patch prints the text string representing the following two error codes: DB_LOCK_WAIT_TIMEOUT DB_DEADLOCK. Bug#35498 Cannot get table test/table1 auto-inccounter value in ::info Approved by Marko. ------------------------------------------------------------------------ r2709 | vasil | 2008-10-01 10:13:13 +0300 (Wed, 01 Oct 2008) | 10 lines Changed paths: M /branches/5.1/include/lock0lock.h M /branches/5.1/lock/lock0lock.c A /branches/5.1/mysql-test/innodb_bug38231.result A /branches/5.1/mysql-test/innodb_bug38231.test M /branches/5.1/row/row0mysql.c branches/5.1: Fix Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK In TRUNCATE TABLE and discard tablespace: do not remove table-level S and X locks and do not assert on such locks not being wait locks. Leave such locks alone. Approved by: Heikki (rb://14) ------------------------------------------------------------------------ r2710 | vasil | 2008-10-01 14:13:58 +0300 (Wed, 01 Oct 2008) | 6 lines Changed paths: M /branches/5.1/include/sync0sync.ic branches/5.1: Silence a compilation warning in UNIV_DEBUG. Approved by: Marko (via IM) ------------------------------------------------------------------------ r2719 | vasil | 2008-10-03 18:17:28 +0300 (Fri, 03 Oct 2008) | 49 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug39438-master.opt A /branches/5.1/mysql-test/innodb_bug39438.result A /branches/5.1/mysql-test/innodb_bug39438.test branches/5.1: Fix Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch In ha_innobase::info() - do not try to get the free space for a tablespace which has been discarded with ALTER TABLE ... DISCARD TABLESPACE or if the .ibd file is missing for some other reason. ibd_file_missing and tablespace_discarded are manipulated only in row_discard_tablespace_for_mysql() and in row_import_tablespace_for_mysql() and the manipulation is protected/surrounded by row_mysql_lock_data_dictionary()/row_mysql_unlock_data_dictionary() thus we do the same in ha_innobase::info() when checking the values of those members to avoid race conditions. I have tested the code-path with UNIV_DEBUG and UNIV_SYNC_DEBUG. Looks like it is not possible to avoid mysqld printing warnings in the mysql-test case and thus this test innodb_bug39438 must be added to the list of exceptional test cases that are allowed to print warnings. For this, the following patch must be applied to the mysql source tree: --- cut --- === modified file 'mysql-test/lib/mtr_report.pl' --- mysql-test/lib/mtr_report.pl 2008-08-12 10:26:23 +0000 +++ mysql-test/lib/mtr_report.pl 2008-10-01 11:57:41 +0000 @@ -412,7 +412,10 @@ # When trying to set lower_case_table_names = 2 # on a case sensitive file system. Bug#37402. - /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ + /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ or + + # this test is expected to print warnings + ($testname eq 'main.innodb_bug39438') ) { next; # Skip these lines --- cut --- The mysql-test is currently somewhat disabled (see inside innodb_bug39438.test), after the above patch has been applied to the mysql source tree, the test can be enabled. rb://20 Reviewed by: Inaam, Calvin Approved by: Heikki ------------------------------------------------------------------------ r2720 | vasil | 2008-10-03 19:52:39 +0300 (Fri, 03 Oct 2008) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Print a warning if an attempt is made to get the free space for a table whose .ibd file is missing or the tablespace has been discarded. This is a followup to r2719. Suggested by: Inaam ------------------------------------------------------------------------ r2721 | sunny | 2008-10-04 02:08:23 +0300 (Sat, 04 Oct 2008) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: We need to send the messages to the client because handler::get_auto_increment() doesn't allow a way to return the specific error for why it failed. rb://18 ------------------------------------------------------------------------ r2722 | sunny | 2008-10-04 02:48:04 +0300 (Sat, 04 Oct 2008) | 18 lines Changed paths: M /branches/5.1/dict/dict0mem.c M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/dict0mem.h M /branches/5.1/include/row0mysql.h M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test M /branches/5.1/row/row0mysql.c branches/5.1: This bug has always existed but was masked by other errors. The fix for bug# 38839 triggered this bug. When the offset and increment are > 1 we need to calculate the next value taking into consideration the two variables. Previously we simply assumed they were 1 particularly offset was never used. MySQL does its own calculation and that's probably why it seemed to work in the past. We would return what we thought was the correct next value and then MySQL would recalculate the actual value from that and return it to the caller (e.g., handler::write_row()). Several new tests have been added that try and catch some edge cases. The tests exposed a wrap around error in MySQL next value calculation which was filed as bug#39828. The tests will need to be updated once MySQL fix that bug. One good side effect of this fix is that dict_table_t size has been reduced by 8 bytes because we have moved the autoinc_increment field to the row_prebuilt_t structure. See review-board for a detailed discussion. rb://3 ------------------------------------------------------------------------
17 years ago
branches/zip: Merge revisions 2702:2722 from branches/5.1: ------------------------------------------------------------------------ r2702 | sunny | 2008-09-30 11:41:56 +0300 (Tue, 30 Sep 2008) | 13 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Since handler::get_auto_increment() doesn't allow us to return the cause of failure we have to inform MySQL using the sql_print_warning() function to return the cause for autoinc failure. Previously we simply printed the error code, this patch prints the text string representing the following two error codes: DB_LOCK_WAIT_TIMEOUT DB_DEADLOCK. Bug#35498 Cannot get table test/table1 auto-inccounter value in ::info Approved by Marko. ------------------------------------------------------------------------ r2709 | vasil | 2008-10-01 10:13:13 +0300 (Wed, 01 Oct 2008) | 10 lines Changed paths: M /branches/5.1/include/lock0lock.h M /branches/5.1/lock/lock0lock.c A /branches/5.1/mysql-test/innodb_bug38231.result A /branches/5.1/mysql-test/innodb_bug38231.test M /branches/5.1/row/row0mysql.c branches/5.1: Fix Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK In TRUNCATE TABLE and discard tablespace: do not remove table-level S and X locks and do not assert on such locks not being wait locks. Leave such locks alone. Approved by: Heikki (rb://14) ------------------------------------------------------------------------ r2710 | vasil | 2008-10-01 14:13:58 +0300 (Wed, 01 Oct 2008) | 6 lines Changed paths: M /branches/5.1/include/sync0sync.ic branches/5.1: Silence a compilation warning in UNIV_DEBUG. Approved by: Marko (via IM) ------------------------------------------------------------------------ r2719 | vasil | 2008-10-03 18:17:28 +0300 (Fri, 03 Oct 2008) | 49 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug39438-master.opt A /branches/5.1/mysql-test/innodb_bug39438.result A /branches/5.1/mysql-test/innodb_bug39438.test branches/5.1: Fix Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch In ha_innobase::info() - do not try to get the free space for a tablespace which has been discarded with ALTER TABLE ... DISCARD TABLESPACE or if the .ibd file is missing for some other reason. ibd_file_missing and tablespace_discarded are manipulated only in row_discard_tablespace_for_mysql() and in row_import_tablespace_for_mysql() and the manipulation is protected/surrounded by row_mysql_lock_data_dictionary()/row_mysql_unlock_data_dictionary() thus we do the same in ha_innobase::info() when checking the values of those members to avoid race conditions. I have tested the code-path with UNIV_DEBUG and UNIV_SYNC_DEBUG. Looks like it is not possible to avoid mysqld printing warnings in the mysql-test case and thus this test innodb_bug39438 must be added to the list of exceptional test cases that are allowed to print warnings. For this, the following patch must be applied to the mysql source tree: --- cut --- === modified file 'mysql-test/lib/mtr_report.pl' --- mysql-test/lib/mtr_report.pl 2008-08-12 10:26:23 +0000 +++ mysql-test/lib/mtr_report.pl 2008-10-01 11:57:41 +0000 @@ -412,7 +412,10 @@ # When trying to set lower_case_table_names = 2 # on a case sensitive file system. Bug#37402. - /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ + /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ or + + # this test is expected to print warnings + ($testname eq 'main.innodb_bug39438') ) { next; # Skip these lines --- cut --- The mysql-test is currently somewhat disabled (see inside innodb_bug39438.test), after the above patch has been applied to the mysql source tree, the test can be enabled. rb://20 Reviewed by: Inaam, Calvin Approved by: Heikki ------------------------------------------------------------------------ r2720 | vasil | 2008-10-03 19:52:39 +0300 (Fri, 03 Oct 2008) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Print a warning if an attempt is made to get the free space for a table whose .ibd file is missing or the tablespace has been discarded. This is a followup to r2719. Suggested by: Inaam ------------------------------------------------------------------------ r2721 | sunny | 2008-10-04 02:08:23 +0300 (Sat, 04 Oct 2008) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: We need to send the messages to the client because handler::get_auto_increment() doesn't allow a way to return the specific error for why it failed. rb://18 ------------------------------------------------------------------------ r2722 | sunny | 2008-10-04 02:48:04 +0300 (Sat, 04 Oct 2008) | 18 lines Changed paths: M /branches/5.1/dict/dict0mem.c M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/dict0mem.h M /branches/5.1/include/row0mysql.h M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test M /branches/5.1/row/row0mysql.c branches/5.1: This bug has always existed but was masked by other errors. The fix for bug# 38839 triggered this bug. When the offset and increment are > 1 we need to calculate the next value taking into consideration the two variables. Previously we simply assumed they were 1 particularly offset was never used. MySQL does its own calculation and that's probably why it seemed to work in the past. We would return what we thought was the correct next value and then MySQL would recalculate the actual value from that and return it to the caller (e.g., handler::write_row()). Several new tests have been added that try and catch some edge cases. The tests exposed a wrap around error in MySQL next value calculation which was filed as bug#39828. The tests will need to be updated once MySQL fix that bug. One good side effect of this fix is that dict_table_t size has been reduced by 8 bytes because we have moved the autoinc_increment field to the row_prebuilt_t structure. See review-board for a detailed discussion. rb://3 ------------------------------------------------------------------------
17 years ago
branches/zip: Merge revisions 2702:2722 from branches/5.1: ------------------------------------------------------------------------ r2702 | sunny | 2008-09-30 11:41:56 +0300 (Tue, 30 Sep 2008) | 13 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Since handler::get_auto_increment() doesn't allow us to return the cause of failure we have to inform MySQL using the sql_print_warning() function to return the cause for autoinc failure. Previously we simply printed the error code, this patch prints the text string representing the following two error codes: DB_LOCK_WAIT_TIMEOUT DB_DEADLOCK. Bug#35498 Cannot get table test/table1 auto-inccounter value in ::info Approved by Marko. ------------------------------------------------------------------------ r2709 | vasil | 2008-10-01 10:13:13 +0300 (Wed, 01 Oct 2008) | 10 lines Changed paths: M /branches/5.1/include/lock0lock.h M /branches/5.1/lock/lock0lock.c A /branches/5.1/mysql-test/innodb_bug38231.result A /branches/5.1/mysql-test/innodb_bug38231.test M /branches/5.1/row/row0mysql.c branches/5.1: Fix Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK In TRUNCATE TABLE and discard tablespace: do not remove table-level S and X locks and do not assert on such locks not being wait locks. Leave such locks alone. Approved by: Heikki (rb://14) ------------------------------------------------------------------------ r2710 | vasil | 2008-10-01 14:13:58 +0300 (Wed, 01 Oct 2008) | 6 lines Changed paths: M /branches/5.1/include/sync0sync.ic branches/5.1: Silence a compilation warning in UNIV_DEBUG. Approved by: Marko (via IM) ------------------------------------------------------------------------ r2719 | vasil | 2008-10-03 18:17:28 +0300 (Fri, 03 Oct 2008) | 49 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug39438-master.opt A /branches/5.1/mysql-test/innodb_bug39438.result A /branches/5.1/mysql-test/innodb_bug39438.test branches/5.1: Fix Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch In ha_innobase::info() - do not try to get the free space for a tablespace which has been discarded with ALTER TABLE ... DISCARD TABLESPACE or if the .ibd file is missing for some other reason. ibd_file_missing and tablespace_discarded are manipulated only in row_discard_tablespace_for_mysql() and in row_import_tablespace_for_mysql() and the manipulation is protected/surrounded by row_mysql_lock_data_dictionary()/row_mysql_unlock_data_dictionary() thus we do the same in ha_innobase::info() when checking the values of those members to avoid race conditions. I have tested the code-path with UNIV_DEBUG and UNIV_SYNC_DEBUG. Looks like it is not possible to avoid mysqld printing warnings in the mysql-test case and thus this test innodb_bug39438 must be added to the list of exceptional test cases that are allowed to print warnings. For this, the following patch must be applied to the mysql source tree: --- cut --- === modified file 'mysql-test/lib/mtr_report.pl' --- mysql-test/lib/mtr_report.pl 2008-08-12 10:26:23 +0000 +++ mysql-test/lib/mtr_report.pl 2008-10-01 11:57:41 +0000 @@ -412,7 +412,10 @@ # When trying to set lower_case_table_names = 2 # on a case sensitive file system. Bug#37402. - /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ + /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ or + + # this test is expected to print warnings + ($testname eq 'main.innodb_bug39438') ) { next; # Skip these lines --- cut --- The mysql-test is currently somewhat disabled (see inside innodb_bug39438.test), after the above patch has been applied to the mysql source tree, the test can be enabled. rb://20 Reviewed by: Inaam, Calvin Approved by: Heikki ------------------------------------------------------------------------ r2720 | vasil | 2008-10-03 19:52:39 +0300 (Fri, 03 Oct 2008) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Print a warning if an attempt is made to get the free space for a table whose .ibd file is missing or the tablespace has been discarded. This is a followup to r2719. Suggested by: Inaam ------------------------------------------------------------------------ r2721 | sunny | 2008-10-04 02:08:23 +0300 (Sat, 04 Oct 2008) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: We need to send the messages to the client because handler::get_auto_increment() doesn't allow a way to return the specific error for why it failed. rb://18 ------------------------------------------------------------------------ r2722 | sunny | 2008-10-04 02:48:04 +0300 (Sat, 04 Oct 2008) | 18 lines Changed paths: M /branches/5.1/dict/dict0mem.c M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/dict0mem.h M /branches/5.1/include/row0mysql.h M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test M /branches/5.1/row/row0mysql.c branches/5.1: This bug has always existed but was masked by other errors. The fix for bug# 38839 triggered this bug. When the offset and increment are > 1 we need to calculate the next value taking into consideration the two variables. Previously we simply assumed they were 1 particularly offset was never used. MySQL does its own calculation and that's probably why it seemed to work in the past. We would return what we thought was the correct next value and then MySQL would recalculate the actual value from that and return it to the caller (e.g., handler::write_row()). Several new tests have been added that try and catch some edge cases. The tests exposed a wrap around error in MySQL next value calculation which was filed as bug#39828. The tests will need to be updated once MySQL fix that bug. One good side effect of this fix is that dict_table_t size has been reduced by 8 bytes because we have moved the autoinc_increment field to the row_prebuilt_t structure. See review-board for a detailed discussion. rb://3 ------------------------------------------------------------------------
17 years ago
branches/zip: Merge revisions 2702:2722 from branches/5.1: ------------------------------------------------------------------------ r2702 | sunny | 2008-09-30 11:41:56 +0300 (Tue, 30 Sep 2008) | 13 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Since handler::get_auto_increment() doesn't allow us to return the cause of failure we have to inform MySQL using the sql_print_warning() function to return the cause for autoinc failure. Previously we simply printed the error code, this patch prints the text string representing the following two error codes: DB_LOCK_WAIT_TIMEOUT DB_DEADLOCK. Bug#35498 Cannot get table test/table1 auto-inccounter value in ::info Approved by Marko. ------------------------------------------------------------------------ r2709 | vasil | 2008-10-01 10:13:13 +0300 (Wed, 01 Oct 2008) | 10 lines Changed paths: M /branches/5.1/include/lock0lock.h M /branches/5.1/lock/lock0lock.c A /branches/5.1/mysql-test/innodb_bug38231.result A /branches/5.1/mysql-test/innodb_bug38231.test M /branches/5.1/row/row0mysql.c branches/5.1: Fix Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK In TRUNCATE TABLE and discard tablespace: do not remove table-level S and X locks and do not assert on such locks not being wait locks. Leave such locks alone. Approved by: Heikki (rb://14) ------------------------------------------------------------------------ r2710 | vasil | 2008-10-01 14:13:58 +0300 (Wed, 01 Oct 2008) | 6 lines Changed paths: M /branches/5.1/include/sync0sync.ic branches/5.1: Silence a compilation warning in UNIV_DEBUG. Approved by: Marko (via IM) ------------------------------------------------------------------------ r2719 | vasil | 2008-10-03 18:17:28 +0300 (Fri, 03 Oct 2008) | 49 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug39438-master.opt A /branches/5.1/mysql-test/innodb_bug39438.result A /branches/5.1/mysql-test/innodb_bug39438.test branches/5.1: Fix Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch In ha_innobase::info() - do not try to get the free space for a tablespace which has been discarded with ALTER TABLE ... DISCARD TABLESPACE or if the .ibd file is missing for some other reason. ibd_file_missing and tablespace_discarded are manipulated only in row_discard_tablespace_for_mysql() and in row_import_tablespace_for_mysql() and the manipulation is protected/surrounded by row_mysql_lock_data_dictionary()/row_mysql_unlock_data_dictionary() thus we do the same in ha_innobase::info() when checking the values of those members to avoid race conditions. I have tested the code-path with UNIV_DEBUG and UNIV_SYNC_DEBUG. Looks like it is not possible to avoid mysqld printing warnings in the mysql-test case and thus this test innodb_bug39438 must be added to the list of exceptional test cases that are allowed to print warnings. For this, the following patch must be applied to the mysql source tree: --- cut --- === modified file 'mysql-test/lib/mtr_report.pl' --- mysql-test/lib/mtr_report.pl 2008-08-12 10:26:23 +0000 +++ mysql-test/lib/mtr_report.pl 2008-10-01 11:57:41 +0000 @@ -412,7 +412,10 @@ # When trying to set lower_case_table_names = 2 # on a case sensitive file system. Bug#37402. - /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ + /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ or + + # this test is expected to print warnings + ($testname eq 'main.innodb_bug39438') ) { next; # Skip these lines --- cut --- The mysql-test is currently somewhat disabled (see inside innodb_bug39438.test), after the above patch has been applied to the mysql source tree, the test can be enabled. rb://20 Reviewed by: Inaam, Calvin Approved by: Heikki ------------------------------------------------------------------------ r2720 | vasil | 2008-10-03 19:52:39 +0300 (Fri, 03 Oct 2008) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Print a warning if an attempt is made to get the free space for a table whose .ibd file is missing or the tablespace has been discarded. This is a followup to r2719. Suggested by: Inaam ------------------------------------------------------------------------ r2721 | sunny | 2008-10-04 02:08:23 +0300 (Sat, 04 Oct 2008) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: We need to send the messages to the client because handler::get_auto_increment() doesn't allow a way to return the specific error for why it failed. rb://18 ------------------------------------------------------------------------ r2722 | sunny | 2008-10-04 02:48:04 +0300 (Sat, 04 Oct 2008) | 18 lines Changed paths: M /branches/5.1/dict/dict0mem.c M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/dict0mem.h M /branches/5.1/include/row0mysql.h M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test M /branches/5.1/row/row0mysql.c branches/5.1: This bug has always existed but was masked by other errors. The fix for bug# 38839 triggered this bug. When the offset and increment are > 1 we need to calculate the next value taking into consideration the two variables. Previously we simply assumed they were 1 particularly offset was never used. MySQL does its own calculation and that's probably why it seemed to work in the past. We would return what we thought was the correct next value and then MySQL would recalculate the actual value from that and return it to the caller (e.g., handler::write_row()). Several new tests have been added that try and catch some edge cases. The tests exposed a wrap around error in MySQL next value calculation which was filed as bug#39828. The tests will need to be updated once MySQL fix that bug. One good side effect of this fix is that dict_table_t size has been reduced by 8 bytes because we have moved the autoinc_increment field to the row_prebuilt_t structure. See review-board for a detailed discussion. rb://3 ------------------------------------------------------------------------
17 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Replace the constant 3/8 ratio that controls the LRU_old size with the settable global variable innodb_old_blocks_pct. The minimum and maximum values are 5 and 95 per cent, respectively. The default is 100*3/8, in line with the old behavior. ut_time_ms(): New utility function, to return the current time in milliseconds. TODO: Is there a more efficient timestamp function, such as rdtsc divided by a power of two? buf_LRU_old_threshold_ms: New variable, corresponding to innodb_old_blocks_time. The value 0 is the default behaviour: no timeout before making blocks 'new'. bpage->accessed, bpage->LRU_position, buf_pool->ulint_clock: Remove. bpage->access_time: New field, replacing bpage->accessed. Protected by buf_pool_mutex instead of bpage->mutex. Updated when a page is created or accessed the first time in the buffer pool. buf_LRU_old_ratio, innobase_old_blocks_pct: New variables, corresponding to innodb_old_blocks_pct buf_LRU_old_ratio_update(), innobase_old_blocks_pct_update(): Update functions for buf_LRU_old_ratio, innobase_old_blocks_pct. buf_page_peek_if_too_old(): Compare ut_time_ms() to bpage->access_time if buf_LRU_old_threshold_ms && bpage->old. Else observe buf_LRU_old_ratio and bpage->freed_page_clock. buf_pool_t: Add n_pages_made_young, n_pages_not_made_young, n_pages_made_young_old, n_pages_not_made_young, for statistics. buf_print(): Display buf_pool->n_pages_made_young, buf_pool->n_pages_not_made_young. This function is only for crash diagnostics. buf_print_io(): Display buf_pool->LRU_old_len and quantities derived from buf_pool->n_pages_made_young, buf_pool->n_pages_not_made_young. This function is invoked by SHOW ENGINE INNODB STATUS. rb://129 approved by Heikki Tuuri. This addresses Bug #45015.
16 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge r5912:6112 from branches/5.1: (after this merge the innodb-autoinc test starts to fail, but I commit anyway because it would be easier to investigate the failure this way) ------------------------------------------------------------------------ r5952 | calvin | 2009-09-22 19:45:07 +0300 (Tue, 22 Sep 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: fix bug#42383: Can't create table 'test.bug39438' For embedded server, MySQL may pass in full path, which is currently disallowed. It is needed to relax the condition by accepting full paths in the embedded case. Approved by: Heikki (on IM) ------------------------------------------------------------------------ r6032 | vasil | 2009-10-01 15:55:49 +0300 (Thu, 01 Oct 2009) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix Bug#38996 Race condition in ANALYZE TABLE by serializing ANALYZE TABLE inside InnoDB. Approved by: Heikki (rb://175) ------------------------------------------------------------------------ r6045 | jyang | 2009-10-08 02:27:08 +0300 (Thu, 08 Oct 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug47777.result A /branches/5.1/mysql-test/innodb_bug47777.test branches/5.1: Fix bug #47777. Treat the Geometry data same as Binary BLOB in ha_innobase::store_key_val_for_row(), since the Geometry data is stored as Binary BLOB in Innodb. Review: rb://180 approved by Marko Makela. ------------------------------------------------------------------------ r6051 | sunny | 2009-10-12 07:05:00 +0300 (Mon, 12 Oct 2009) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Ignore negative values supplied by the user when calculating the next value to store in dict_table_t. Setting autoincrement columns top negative values is undefined behavior and this change should bring the behavior of InnoDB closer to what users expect. Added several tests to check. rb://162 ------------------------------------------------------------------------ r6052 | sunny | 2009-10-12 07:09:56 +0300 (Mon, 12 Oct 2009) | 4 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Reset the statement level autoinc counter on ROLLBACK. Fix the test results too. rb://164 ------------------------------------------------------------------------ r6053 | sunny | 2009-10-12 07:37:49 +0300 (Mon, 12 Oct 2009) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Copy the maximum AUTOINC value from the old table to the new table when MySQL does a CREATE INDEX ON T. This is required because MySQL does a table copy, rename and drops the old table. Fix Bug#47125: auto_increment start value is ignored if an index is created and engine=innodb rb://168 ------------------------------------------------------------------------ r6076 | vasil | 2009-10-14 19:30:12 +0300 (Wed, 14 Oct 2009) | 4 lines Changed paths: M /branches/5.1/row/row0mysql.c branches/5.1: Fix typo. ------------------------------------------------------------------------
16 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge r5912:6112 from branches/5.1: (after this merge the innodb-autoinc test starts to fail, but I commit anyway because it would be easier to investigate the failure this way) ------------------------------------------------------------------------ r5952 | calvin | 2009-09-22 19:45:07 +0300 (Tue, 22 Sep 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: fix bug#42383: Can't create table 'test.bug39438' For embedded server, MySQL may pass in full path, which is currently disallowed. It is needed to relax the condition by accepting full paths in the embedded case. Approved by: Heikki (on IM) ------------------------------------------------------------------------ r6032 | vasil | 2009-10-01 15:55:49 +0300 (Thu, 01 Oct 2009) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix Bug#38996 Race condition in ANALYZE TABLE by serializing ANALYZE TABLE inside InnoDB. Approved by: Heikki (rb://175) ------------------------------------------------------------------------ r6045 | jyang | 2009-10-08 02:27:08 +0300 (Thu, 08 Oct 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug47777.result A /branches/5.1/mysql-test/innodb_bug47777.test branches/5.1: Fix bug #47777. Treat the Geometry data same as Binary BLOB in ha_innobase::store_key_val_for_row(), since the Geometry data is stored as Binary BLOB in Innodb. Review: rb://180 approved by Marko Makela. ------------------------------------------------------------------------ r6051 | sunny | 2009-10-12 07:05:00 +0300 (Mon, 12 Oct 2009) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Ignore negative values supplied by the user when calculating the next value to store in dict_table_t. Setting autoincrement columns top negative values is undefined behavior and this change should bring the behavior of InnoDB closer to what users expect. Added several tests to check. rb://162 ------------------------------------------------------------------------ r6052 | sunny | 2009-10-12 07:09:56 +0300 (Mon, 12 Oct 2009) | 4 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Reset the statement level autoinc counter on ROLLBACK. Fix the test results too. rb://164 ------------------------------------------------------------------------ r6053 | sunny | 2009-10-12 07:37:49 +0300 (Mon, 12 Oct 2009) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Copy the maximum AUTOINC value from the old table to the new table when MySQL does a CREATE INDEX ON T. This is required because MySQL does a table copy, rename and drops the old table. Fix Bug#47125: auto_increment start value is ignored if an index is created and engine=innodb rb://168 ------------------------------------------------------------------------ r6076 | vasil | 2009-10-14 19:30:12 +0300 (Wed, 14 Oct 2009) | 4 lines Changed paths: M /branches/5.1/row/row0mysql.c branches/5.1: Fix typo. ------------------------------------------------------------------------
16 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge r5912:6112 from branches/5.1: (after this merge the innodb-autoinc test starts to fail, but I commit anyway because it would be easier to investigate the failure this way) ------------------------------------------------------------------------ r5952 | calvin | 2009-09-22 19:45:07 +0300 (Tue, 22 Sep 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: fix bug#42383: Can't create table 'test.bug39438' For embedded server, MySQL may pass in full path, which is currently disallowed. It is needed to relax the condition by accepting full paths in the embedded case. Approved by: Heikki (on IM) ------------------------------------------------------------------------ r6032 | vasil | 2009-10-01 15:55:49 +0300 (Thu, 01 Oct 2009) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix Bug#38996 Race condition in ANALYZE TABLE by serializing ANALYZE TABLE inside InnoDB. Approved by: Heikki (rb://175) ------------------------------------------------------------------------ r6045 | jyang | 2009-10-08 02:27:08 +0300 (Thu, 08 Oct 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug47777.result A /branches/5.1/mysql-test/innodb_bug47777.test branches/5.1: Fix bug #47777. Treat the Geometry data same as Binary BLOB in ha_innobase::store_key_val_for_row(), since the Geometry data is stored as Binary BLOB in Innodb. Review: rb://180 approved by Marko Makela. ------------------------------------------------------------------------ r6051 | sunny | 2009-10-12 07:05:00 +0300 (Mon, 12 Oct 2009) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Ignore negative values supplied by the user when calculating the next value to store in dict_table_t. Setting autoincrement columns top negative values is undefined behavior and this change should bring the behavior of InnoDB closer to what users expect. Added several tests to check. rb://162 ------------------------------------------------------------------------ r6052 | sunny | 2009-10-12 07:09:56 +0300 (Mon, 12 Oct 2009) | 4 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Reset the statement level autoinc counter on ROLLBACK. Fix the test results too. rb://164 ------------------------------------------------------------------------ r6053 | sunny | 2009-10-12 07:37:49 +0300 (Mon, 12 Oct 2009) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Copy the maximum AUTOINC value from the old table to the new table when MySQL does a CREATE INDEX ON T. This is required because MySQL does a table copy, rename and drops the old table. Fix Bug#47125: auto_increment start value is ignored if an index is created and engine=innodb rb://168 ------------------------------------------------------------------------ r6076 | vasil | 2009-10-14 19:30:12 +0300 (Wed, 14 Oct 2009) | 4 lines Changed paths: M /branches/5.1/row/row0mysql.c branches/5.1: Fix typo. ------------------------------------------------------------------------
16 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC. Throw warnings, not errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE, so that any table dump can be loaded. As of this change, InnoDB supports the following table formats: ROW_FORMAT=REDUNDANT the only format before MySQL/InnoDB 5.0.3 ROW_FORMAT=COMPACT the new default format of MySQL/InnoDB 5.0.3 ROW_FORMAT=DYNAMIC uncompressed, no prefix in the clustered index record for BLOBs ROW_FORMAT=COMPRESSED like ROW_FORMAT=DYNAMIC, but zlib compressed B-trees and BLOBs; the compressed page size is specified by KEY_BLOCK_SIZE in kilobytes (1, 2, 4, 8, or 16; default 8) KEY_BLOCK_SIZE=1, 2, 4, 8, or 16: implies ROW_FORMAT=COMPRESSED; ignored if ROW_FORMAT is not COMPRESSED KEY_BLOCK_SIZE=anything else: ignored The InnoDB row format is displayed in the 4th column (Row_format) of the output of SHOW TABLE STATUS. The Create_options column may show ROW_FORMAT= and KEY_BLOCK_SIZE=, but they do not necessarily have anything to do with InnoDB. The table format can also be queried like this: SELECT table_schema, table_name, row_format FROM information_schema.tables WHERE engine='innodb' and row_format in ('Compressed','Dynamic'); When Row_format='Compressed', KEY_BLOCK_SIZE should usually correspond to the compressed page size. But the .frm file could be manipulated to show any KEY_BLOCK_SIZE. For some reason, INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS does not include KEY_BLOCK_SIZE. It does include row_format (spelled in lowercase). This looks like a MySQL bug, because the table INFORMATION_SCHEMA.TABLES probably tries to replace SHOW TABLE STATUS. I reported this as Bug #35275 <http://bugs.mysql.com/35275>. ha_innobase::get_row_type(): Add ROW_TYPE_COMPRESSED, ROW_TYPE_DYNAMIC. ha_innobase::create(): Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC. Do not throw errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE, but issue warnings instead. ha_innobase::check_if_incompatible_data(): Return COMPATIBLE_DATA_NO if KEY_BLOCK_SIZE has been specified. innodb.result: Adjust the result for the warning issued for ROW_FORMAT=FIXED. innodb-zip.test: Add tests. Query INFORMATION_SCHEMA.TABLES for ROW_FORMAT.
18 years ago
20 years ago
branches/zip: Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC. Throw warnings, not errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE, so that any table dump can be loaded. As of this change, InnoDB supports the following table formats: ROW_FORMAT=REDUNDANT the only format before MySQL/InnoDB 5.0.3 ROW_FORMAT=COMPACT the new default format of MySQL/InnoDB 5.0.3 ROW_FORMAT=DYNAMIC uncompressed, no prefix in the clustered index record for BLOBs ROW_FORMAT=COMPRESSED like ROW_FORMAT=DYNAMIC, but zlib compressed B-trees and BLOBs; the compressed page size is specified by KEY_BLOCK_SIZE in kilobytes (1, 2, 4, 8, or 16; default 8) KEY_BLOCK_SIZE=1, 2, 4, 8, or 16: implies ROW_FORMAT=COMPRESSED; ignored if ROW_FORMAT is not COMPRESSED KEY_BLOCK_SIZE=anything else: ignored The InnoDB row format is displayed in the 4th column (Row_format) of the output of SHOW TABLE STATUS. The Create_options column may show ROW_FORMAT= and KEY_BLOCK_SIZE=, but they do not necessarily have anything to do with InnoDB. The table format can also be queried like this: SELECT table_schema, table_name, row_format FROM information_schema.tables WHERE engine='innodb' and row_format in ('Compressed','Dynamic'); When Row_format='Compressed', KEY_BLOCK_SIZE should usually correspond to the compressed page size. But the .frm file could be manipulated to show any KEY_BLOCK_SIZE. For some reason, INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS does not include KEY_BLOCK_SIZE. It does include row_format (spelled in lowercase). This looks like a MySQL bug, because the table INFORMATION_SCHEMA.TABLES probably tries to replace SHOW TABLE STATUS. I reported this as Bug #35275 <http://bugs.mysql.com/35275>. ha_innobase::get_row_type(): Add ROW_TYPE_COMPRESSED, ROW_TYPE_DYNAMIC. ha_innobase::create(): Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC. Do not throw errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE, but issue warnings instead. ha_innobase::check_if_incompatible_data(): Return COMPATIBLE_DATA_NO if KEY_BLOCK_SIZE has been specified. innodb.result: Adjust the result for the warning issued for ROW_FORMAT=FIXED. innodb-zip.test: Add tests. Query INFORMATION_SCHEMA.TABLES for ROW_FORMAT.
18 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge revisions 5233:5341 from branches/5.1: ------------------------------------------------------------------------ r5233 | marko | 2009-06-03 15:12:44 +0300 (Wed, 03 Jun 2009) | 11 lines branches/5.1: Merge the test case from r5232 from branches/5.0: ------------------------------------------------------------------------ r5232 | marko | 2009-06-03 14:31:04 +0300 (Wed, 03 Jun 2009) | 21 lines branches/5.0: Merge r3590 from branches/5.1 in order to fix Bug #40565 (Update Query Results in "1 Row Affected" But Should Be "Zero Rows"). Also, add a test case for Bug #40565. rb://128 approved by Heikki Tuuri ------------------------------------------------------------------------ ------------------------------------------------------------------------ r5243 | sunny | 2009-06-04 03:17:14 +0300 (Thu, 04 Jun 2009) | 14 lines branches/5.1: When the InnoDB and MySQL data dictionaries go out of sync, before the bug fix we would assert on missing autoinc columns. With this fix we allow MySQL to open the table but set the next autoinc value for the column to the MAX value. This effectively disables the next value generation. INSERTs will fail with a generic AUTOINC failure. However, the user should be able to read/dump the table, set the column values explicitly, use ALTER TABLE to set the next autoinc value and/or sync the two data dictionaries to resume normal operations. Fix Bug#44030 Error: (1500) Couldn't read the MAX(ID) autoinc value from the index (PRIMARY) rb://118 ------------------------------------------------------------------------ r5252 | sunny | 2009-06-04 10:16:24 +0300 (Thu, 04 Jun 2009) | 2 lines branches/5.1: The version of the result file checked in was broken in r5243. ------------------------------------------------------------------------ r5259 | vasil | 2009-06-05 10:29:16 +0300 (Fri, 05 Jun 2009) | 7 lines branches/5.1: Remove the word "Error" from the printout because the mysqltest suite interprets it as an error and thus the innodb-autoinc test fails. Approved by: Sunny (via IM) ------------------------------------------------------------------------ r5339 | marko | 2009-06-17 11:01:37 +0300 (Wed, 17 Jun 2009) | 2 lines branches/5.1: Add missing #include "mtr0log.h" so that the code compiles with -DUNIV_MUST_NOT_INLINE. (null merge; this had already been committed in branches/zip) ------------------------------------------------------------------------ r5340 | marko | 2009-06-17 12:11:49 +0300 (Wed, 17 Jun 2009) | 4 lines branches/5.1: row_unlock_for_mysql(): When the clustered index is unknown, refuse to unlock the record. (Bug #45357, caused by the fix of Bug #39320). rb://132 approved by Sunny Bains. ------------------------------------------------------------------------
17 years ago
branches/zip: Merge revisions 5233:5341 from branches/5.1: ------------------------------------------------------------------------ r5233 | marko | 2009-06-03 15:12:44 +0300 (Wed, 03 Jun 2009) | 11 lines branches/5.1: Merge the test case from r5232 from branches/5.0: ------------------------------------------------------------------------ r5232 | marko | 2009-06-03 14:31:04 +0300 (Wed, 03 Jun 2009) | 21 lines branches/5.0: Merge r3590 from branches/5.1 in order to fix Bug #40565 (Update Query Results in "1 Row Affected" But Should Be "Zero Rows"). Also, add a test case for Bug #40565. rb://128 approved by Heikki Tuuri ------------------------------------------------------------------------ ------------------------------------------------------------------------ r5243 | sunny | 2009-06-04 03:17:14 +0300 (Thu, 04 Jun 2009) | 14 lines branches/5.1: When the InnoDB and MySQL data dictionaries go out of sync, before the bug fix we would assert on missing autoinc columns. With this fix we allow MySQL to open the table but set the next autoinc value for the column to the MAX value. This effectively disables the next value generation. INSERTs will fail with a generic AUTOINC failure. However, the user should be able to read/dump the table, set the column values explicitly, use ALTER TABLE to set the next autoinc value and/or sync the two data dictionaries to resume normal operations. Fix Bug#44030 Error: (1500) Couldn't read the MAX(ID) autoinc value from the index (PRIMARY) rb://118 ------------------------------------------------------------------------ r5252 | sunny | 2009-06-04 10:16:24 +0300 (Thu, 04 Jun 2009) | 2 lines branches/5.1: The version of the result file checked in was broken in r5243. ------------------------------------------------------------------------ r5259 | vasil | 2009-06-05 10:29:16 +0300 (Fri, 05 Jun 2009) | 7 lines branches/5.1: Remove the word "Error" from the printout because the mysqltest suite interprets it as an error and thus the innodb-autoinc test fails. Approved by: Sunny (via IM) ------------------------------------------------------------------------ r5339 | marko | 2009-06-17 11:01:37 +0300 (Wed, 17 Jun 2009) | 2 lines branches/5.1: Add missing #include "mtr0log.h" so that the code compiles with -DUNIV_MUST_NOT_INLINE. (null merge; this had already been committed in branches/zip) ------------------------------------------------------------------------ r5340 | marko | 2009-06-17 12:11:49 +0300 (Wed, 17 Jun 2009) | 4 lines branches/5.1: row_unlock_for_mysql(): When the clustered index is unknown, refuse to unlock the record. (Bug #45357, caused by the fix of Bug #39320). rb://132 approved by Sunny Bains. ------------------------------------------------------------------------
17 years ago
branches/zip: Merge revisions 5233:5341 from branches/5.1: ------------------------------------------------------------------------ r5233 | marko | 2009-06-03 15:12:44 +0300 (Wed, 03 Jun 2009) | 11 lines branches/5.1: Merge the test case from r5232 from branches/5.0: ------------------------------------------------------------------------ r5232 | marko | 2009-06-03 14:31:04 +0300 (Wed, 03 Jun 2009) | 21 lines branches/5.0: Merge r3590 from branches/5.1 in order to fix Bug #40565 (Update Query Results in "1 Row Affected" But Should Be "Zero Rows"). Also, add a test case for Bug #40565. rb://128 approved by Heikki Tuuri ------------------------------------------------------------------------ ------------------------------------------------------------------------ r5243 | sunny | 2009-06-04 03:17:14 +0300 (Thu, 04 Jun 2009) | 14 lines branches/5.1: When the InnoDB and MySQL data dictionaries go out of sync, before the bug fix we would assert on missing autoinc columns. With this fix we allow MySQL to open the table but set the next autoinc value for the column to the MAX value. This effectively disables the next value generation. INSERTs will fail with a generic AUTOINC failure. However, the user should be able to read/dump the table, set the column values explicitly, use ALTER TABLE to set the next autoinc value and/or sync the two data dictionaries to resume normal operations. Fix Bug#44030 Error: (1500) Couldn't read the MAX(ID) autoinc value from the index (PRIMARY) rb://118 ------------------------------------------------------------------------ r5252 | sunny | 2009-06-04 10:16:24 +0300 (Thu, 04 Jun 2009) | 2 lines branches/5.1: The version of the result file checked in was broken in r5243. ------------------------------------------------------------------------ r5259 | vasil | 2009-06-05 10:29:16 +0300 (Fri, 05 Jun 2009) | 7 lines branches/5.1: Remove the word "Error" from the printout because the mysqltest suite interprets it as an error and thus the innodb-autoinc test fails. Approved by: Sunny (via IM) ------------------------------------------------------------------------ r5339 | marko | 2009-06-17 11:01:37 +0300 (Wed, 17 Jun 2009) | 2 lines branches/5.1: Add missing #include "mtr0log.h" so that the code compiles with -DUNIV_MUST_NOT_INLINE. (null merge; this had already been committed in branches/zip) ------------------------------------------------------------------------ r5340 | marko | 2009-06-17 12:11:49 +0300 (Wed, 17 Jun 2009) | 4 lines branches/5.1: row_unlock_for_mysql(): When the clustered index is unknown, refuse to unlock the record. (Bug #45357, caused by the fix of Bug #39320). rb://132 approved by Sunny Bains. ------------------------------------------------------------------------
17 years ago
branches/zip: Merge revisions 5233:5341 from branches/5.1: ------------------------------------------------------------------------ r5233 | marko | 2009-06-03 15:12:44 +0300 (Wed, 03 Jun 2009) | 11 lines branches/5.1: Merge the test case from r5232 from branches/5.0: ------------------------------------------------------------------------ r5232 | marko | 2009-06-03 14:31:04 +0300 (Wed, 03 Jun 2009) | 21 lines branches/5.0: Merge r3590 from branches/5.1 in order to fix Bug #40565 (Update Query Results in "1 Row Affected" But Should Be "Zero Rows"). Also, add a test case for Bug #40565. rb://128 approved by Heikki Tuuri ------------------------------------------------------------------------ ------------------------------------------------------------------------ r5243 | sunny | 2009-06-04 03:17:14 +0300 (Thu, 04 Jun 2009) | 14 lines branches/5.1: When the InnoDB and MySQL data dictionaries go out of sync, before the bug fix we would assert on missing autoinc columns. With this fix we allow MySQL to open the table but set the next autoinc value for the column to the MAX value. This effectively disables the next value generation. INSERTs will fail with a generic AUTOINC failure. However, the user should be able to read/dump the table, set the column values explicitly, use ALTER TABLE to set the next autoinc value and/or sync the two data dictionaries to resume normal operations. Fix Bug#44030 Error: (1500) Couldn't read the MAX(ID) autoinc value from the index (PRIMARY) rb://118 ------------------------------------------------------------------------ r5252 | sunny | 2009-06-04 10:16:24 +0300 (Thu, 04 Jun 2009) | 2 lines branches/5.1: The version of the result file checked in was broken in r5243. ------------------------------------------------------------------------ r5259 | vasil | 2009-06-05 10:29:16 +0300 (Fri, 05 Jun 2009) | 7 lines branches/5.1: Remove the word "Error" from the printout because the mysqltest suite interprets it as an error and thus the innodb-autoinc test fails. Approved by: Sunny (via IM) ------------------------------------------------------------------------ r5339 | marko | 2009-06-17 11:01:37 +0300 (Wed, 17 Jun 2009) | 2 lines branches/5.1: Add missing #include "mtr0log.h" so that the code compiles with -DUNIV_MUST_NOT_INLINE. (null merge; this had already been committed in branches/zip) ------------------------------------------------------------------------ r5340 | marko | 2009-06-17 12:11:49 +0300 (Wed, 17 Jun 2009) | 4 lines branches/5.1: row_unlock_for_mysql(): When the clustered index is unknown, refuse to unlock the record. (Bug #45357, caused by the fix of Bug #39320). rb://132 approved by Sunny Bains. ------------------------------------------------------------------------
17 years ago
branches/zip: Merge revisions 5233:5341 from branches/5.1: ------------------------------------------------------------------------ r5233 | marko | 2009-06-03 15:12:44 +0300 (Wed, 03 Jun 2009) | 11 lines branches/5.1: Merge the test case from r5232 from branches/5.0: ------------------------------------------------------------------------ r5232 | marko | 2009-06-03 14:31:04 +0300 (Wed, 03 Jun 2009) | 21 lines branches/5.0: Merge r3590 from branches/5.1 in order to fix Bug #40565 (Update Query Results in "1 Row Affected" But Should Be "Zero Rows"). Also, add a test case for Bug #40565. rb://128 approved by Heikki Tuuri ------------------------------------------------------------------------ ------------------------------------------------------------------------ r5243 | sunny | 2009-06-04 03:17:14 +0300 (Thu, 04 Jun 2009) | 14 lines branches/5.1: When the InnoDB and MySQL data dictionaries go out of sync, before the bug fix we would assert on missing autoinc columns. With this fix we allow MySQL to open the table but set the next autoinc value for the column to the MAX value. This effectively disables the next value generation. INSERTs will fail with a generic AUTOINC failure. However, the user should be able to read/dump the table, set the column values explicitly, use ALTER TABLE to set the next autoinc value and/or sync the two data dictionaries to resume normal operations. Fix Bug#44030 Error: (1500) Couldn't read the MAX(ID) autoinc value from the index (PRIMARY) rb://118 ------------------------------------------------------------------------ r5252 | sunny | 2009-06-04 10:16:24 +0300 (Thu, 04 Jun 2009) | 2 lines branches/5.1: The version of the result file checked in was broken in r5243. ------------------------------------------------------------------------ r5259 | vasil | 2009-06-05 10:29:16 +0300 (Fri, 05 Jun 2009) | 7 lines branches/5.1: Remove the word "Error" from the printout because the mysqltest suite interprets it as an error and thus the innodb-autoinc test fails. Approved by: Sunny (via IM) ------------------------------------------------------------------------ r5339 | marko | 2009-06-17 11:01:37 +0300 (Wed, 17 Jun 2009) | 2 lines branches/5.1: Add missing #include "mtr0log.h" so that the code compiles with -DUNIV_MUST_NOT_INLINE. (null merge; this had already been committed in branches/zip) ------------------------------------------------------------------------ r5340 | marko | 2009-06-17 12:11:49 +0300 (Wed, 17 Jun 2009) | 4 lines branches/5.1: row_unlock_for_mysql(): When the clustered index is unknown, refuse to unlock the record. (Bug #45357, caused by the fix of Bug #39320). rb://132 approved by Sunny Bains. ------------------------------------------------------------------------
17 years ago
branches/zip: Merge revisions 5233:5341 from branches/5.1: ------------------------------------------------------------------------ r5233 | marko | 2009-06-03 15:12:44 +0300 (Wed, 03 Jun 2009) | 11 lines branches/5.1: Merge the test case from r5232 from branches/5.0: ------------------------------------------------------------------------ r5232 | marko | 2009-06-03 14:31:04 +0300 (Wed, 03 Jun 2009) | 21 lines branches/5.0: Merge r3590 from branches/5.1 in order to fix Bug #40565 (Update Query Results in "1 Row Affected" But Should Be "Zero Rows"). Also, add a test case for Bug #40565. rb://128 approved by Heikki Tuuri ------------------------------------------------------------------------ ------------------------------------------------------------------------ r5243 | sunny | 2009-06-04 03:17:14 +0300 (Thu, 04 Jun 2009) | 14 lines branches/5.1: When the InnoDB and MySQL data dictionaries go out of sync, before the bug fix we would assert on missing autoinc columns. With this fix we allow MySQL to open the table but set the next autoinc value for the column to the MAX value. This effectively disables the next value generation. INSERTs will fail with a generic AUTOINC failure. However, the user should be able to read/dump the table, set the column values explicitly, use ALTER TABLE to set the next autoinc value and/or sync the two data dictionaries to resume normal operations. Fix Bug#44030 Error: (1500) Couldn't read the MAX(ID) autoinc value from the index (PRIMARY) rb://118 ------------------------------------------------------------------------ r5252 | sunny | 2009-06-04 10:16:24 +0300 (Thu, 04 Jun 2009) | 2 lines branches/5.1: The version of the result file checked in was broken in r5243. ------------------------------------------------------------------------ r5259 | vasil | 2009-06-05 10:29:16 +0300 (Fri, 05 Jun 2009) | 7 lines branches/5.1: Remove the word "Error" from the printout because the mysqltest suite interprets it as an error and thus the innodb-autoinc test fails. Approved by: Sunny (via IM) ------------------------------------------------------------------------ r5339 | marko | 2009-06-17 11:01:37 +0300 (Wed, 17 Jun 2009) | 2 lines branches/5.1: Add missing #include "mtr0log.h" so that the code compiles with -DUNIV_MUST_NOT_INLINE. (null merge; this had already been committed in branches/zip) ------------------------------------------------------------------------ r5340 | marko | 2009-06-17 12:11:49 +0300 (Wed, 17 Jun 2009) | 4 lines branches/5.1: row_unlock_for_mysql(): When the clustered index is unknown, refuse to unlock the record. (Bug #45357, caused by the fix of Bug #39320). rb://132 approved by Sunny Bains. ------------------------------------------------------------------------
17 years ago
branches/zip: Merge revisions 5233:5341 from branches/5.1: ------------------------------------------------------------------------ r5233 | marko | 2009-06-03 15:12:44 +0300 (Wed, 03 Jun 2009) | 11 lines branches/5.1: Merge the test case from r5232 from branches/5.0: ------------------------------------------------------------------------ r5232 | marko | 2009-06-03 14:31:04 +0300 (Wed, 03 Jun 2009) | 21 lines branches/5.0: Merge r3590 from branches/5.1 in order to fix Bug #40565 (Update Query Results in "1 Row Affected" But Should Be "Zero Rows"). Also, add a test case for Bug #40565. rb://128 approved by Heikki Tuuri ------------------------------------------------------------------------ ------------------------------------------------------------------------ r5243 | sunny | 2009-06-04 03:17:14 +0300 (Thu, 04 Jun 2009) | 14 lines branches/5.1: When the InnoDB and MySQL data dictionaries go out of sync, before the bug fix we would assert on missing autoinc columns. With this fix we allow MySQL to open the table but set the next autoinc value for the column to the MAX value. This effectively disables the next value generation. INSERTs will fail with a generic AUTOINC failure. However, the user should be able to read/dump the table, set the column values explicitly, use ALTER TABLE to set the next autoinc value and/or sync the two data dictionaries to resume normal operations. Fix Bug#44030 Error: (1500) Couldn't read the MAX(ID) autoinc value from the index (PRIMARY) rb://118 ------------------------------------------------------------------------ r5252 | sunny | 2009-06-04 10:16:24 +0300 (Thu, 04 Jun 2009) | 2 lines branches/5.1: The version of the result file checked in was broken in r5243. ------------------------------------------------------------------------ r5259 | vasil | 2009-06-05 10:29:16 +0300 (Fri, 05 Jun 2009) | 7 lines branches/5.1: Remove the word "Error" from the printout because the mysqltest suite interprets it as an error and thus the innodb-autoinc test fails. Approved by: Sunny (via IM) ------------------------------------------------------------------------ r5339 | marko | 2009-06-17 11:01:37 +0300 (Wed, 17 Jun 2009) | 2 lines branches/5.1: Add missing #include "mtr0log.h" so that the code compiles with -DUNIV_MUST_NOT_INLINE. (null merge; this had already been committed in branches/zip) ------------------------------------------------------------------------ r5340 | marko | 2009-06-17 12:11:49 +0300 (Wed, 17 Jun 2009) | 4 lines branches/5.1: row_unlock_for_mysql(): When the clustered index is unknown, refuse to unlock the record. (Bug #45357, caused by the fix of Bug #39320). rb://132 approved by Sunny Bains. ------------------------------------------------------------------------
17 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge r5912:6112 from branches/5.1: (after this merge the innodb-autoinc test starts to fail, but I commit anyway because it would be easier to investigate the failure this way) ------------------------------------------------------------------------ r5952 | calvin | 2009-09-22 19:45:07 +0300 (Tue, 22 Sep 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: fix bug#42383: Can't create table 'test.bug39438' For embedded server, MySQL may pass in full path, which is currently disallowed. It is needed to relax the condition by accepting full paths in the embedded case. Approved by: Heikki (on IM) ------------------------------------------------------------------------ r6032 | vasil | 2009-10-01 15:55:49 +0300 (Thu, 01 Oct 2009) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix Bug#38996 Race condition in ANALYZE TABLE by serializing ANALYZE TABLE inside InnoDB. Approved by: Heikki (rb://175) ------------------------------------------------------------------------ r6045 | jyang | 2009-10-08 02:27:08 +0300 (Thu, 08 Oct 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug47777.result A /branches/5.1/mysql-test/innodb_bug47777.test branches/5.1: Fix bug #47777. Treat the Geometry data same as Binary BLOB in ha_innobase::store_key_val_for_row(), since the Geometry data is stored as Binary BLOB in Innodb. Review: rb://180 approved by Marko Makela. ------------------------------------------------------------------------ r6051 | sunny | 2009-10-12 07:05:00 +0300 (Mon, 12 Oct 2009) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Ignore negative values supplied by the user when calculating the next value to store in dict_table_t. Setting autoincrement columns top negative values is undefined behavior and this change should bring the behavior of InnoDB closer to what users expect. Added several tests to check. rb://162 ------------------------------------------------------------------------ r6052 | sunny | 2009-10-12 07:09:56 +0300 (Mon, 12 Oct 2009) | 4 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Reset the statement level autoinc counter on ROLLBACK. Fix the test results too. rb://164 ------------------------------------------------------------------------ r6053 | sunny | 2009-10-12 07:37:49 +0300 (Mon, 12 Oct 2009) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Copy the maximum AUTOINC value from the old table to the new table when MySQL does a CREATE INDEX ON T. This is required because MySQL does a table copy, rename and drops the old table. Fix Bug#47125: auto_increment start value is ignored if an index is created and engine=innodb rb://168 ------------------------------------------------------------------------ r6076 | vasil | 2009-10-14 19:30:12 +0300 (Wed, 14 Oct 2009) | 4 lines Changed paths: M /branches/5.1/row/row0mysql.c branches/5.1: Fix typo. ------------------------------------------------------------------------
16 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge revisions 4035:4261 from branches/5.1: ------------------------------------------------------------------------ r4065 | sunny | 2009-01-29 16:01:36 +0200 (Thu, 29 Jan 2009) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: In the last round of AUTOINC cleanup we assumed that AUTOINC is only defined for integer columns. This caused an assertion failure when we checked for the maximum value of a column type. We now calculate the max value for floating-point autoinc columns too. Fix Bug#42400 - InnoDB autoinc code can't handle floating-point columns rb://84 and Mantis issue://162 ------------------------------------------------------------------------ r4111 | sunny | 2009-02-03 22:06:52 +0200 (Tue, 03 Feb 2009) | 2 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Add the ULL suffix otherwise there is an overflow. ------------------------------------------------------------------------ r4128 | vasil | 2009-02-08 21:36:45 +0200 (Sun, 08 Feb 2009) | 18 lines Changed paths: M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2709.20.31 committer: Timothy Smith <timothy.smith@sun.com> branch nick: 51 timestamp: Fri 2008-12-19 01:28:51 +0100 message: Disable part of innodb-autoinc.test, because the MySQL server asserts when compiled --with-debug, due to bug 39828, "autoinc wraps around when offset and increment > 1". This change should be reverted when that bug is fixed (and a a few other minor changes to the test as described in comments). modified: mysql-test/r/innodb-autoinc.result mysql-test/t/innodb-autoinc.test ------------------------------------------------------------------------ r4129 | vasil | 2009-02-08 21:54:25 +0200 (Sun, 08 Feb 2009) | 310 lines Changed paths: M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Merge a change from MySQL: [looks like the changes to innodb-autoinc.test were made as part of the following huge merge, but we are merging only changes to that file] ------------------------------------------------------------ revno: 2546.47.1 committer: Luis Soares <luis.soares@sun.com> branch nick: 5.1-rpl timestamp: Fri 2009-01-23 13:22:05 +0100 message: merge: 5.1 -> 5.1-rpl conflicts: Text conflict in client/mysqltest.cc Text conflict in mysql-test/include/wait_until_connected_again.inc Text conflict in mysql-test/lib/mtr_report.pm Text conflict in mysql-test/mysql-test-run.pl Text conflict in mysql-test/r/events_bugs.result Text conflict in mysql-test/r/log_state.result Text conflict in mysql-test/r/myisam_data_pointer_size_func.result Text conflict in mysql-test/r/mysqlcheck.result Text conflict in mysql-test/r/query_cache.result Text conflict in mysql-test/r/status.result Text conflict in mysql-test/suite/binlog/r/binlog_index.result Text conflict in mysql-test/suite/binlog/r/binlog_innodb.result Text conflict in mysql-test/suite/rpl/r/rpl_packet.result Text conflict in mysql-test/suite/rpl/t/rpl_packet.test Text conflict in mysql-test/t/disabled.def Text conflict in mysql-test/t/events_bugs.test Text conflict in mysql-test/t/log_state.test Text conflict in mysql-test/t/myisam_data_pointer_size_func.test Text conflict in mysql-test/t/mysqlcheck.test Text conflict in mysql-test/t/query_cache.test Text conflict in mysql-test/t/rpl_init_slave_func.test Text conflict in mysql-test/t/status.test removed: mysql-test/suite/parts/r/partition_bit_ndb.result mysql-test/suite/parts/t/partition_bit_ndb.test mysql-test/suite/parts/t/partition_sessions.test mysql-test/suite/sys_vars/inc/tmp_table_size_basic.inc mysql-test/suite/sys_vars/r/tmp_table_size_basic_32.result mysql-test/suite/sys_vars/r/tmp_table_size_basic_64.result mysql-test/suite/sys_vars/t/tmp_table_size_basic_32.test mysql-test/suite/sys_vars/t/tmp_table_size_basic_64.test mysql-test/t/log_bin_trust_function_creators_func-master.opt mysql-test/t/rpl_init_slave_func-slave.opt added: mysql-test/include/check_events_off.inc mysql-test/include/cleanup_fake_relay_log.inc mysql-test/include/have_simple_parser.inc mysql-test/include/no_running_event_scheduler.inc mysql-test/include/no_running_events.inc mysql-test/include/running_event_scheduler.inc mysql-test/include/setup_fake_relay_log.inc mysql-test/include/wait_condition_sp.inc mysql-test/r/fulltext_plugin.result mysql-test/r/have_simple_parser.require mysql-test/r/innodb_bug38231.result mysql-test/r/innodb_bug39438.result mysql-test/r/innodb_mysql_rbk.result mysql-test/r/partition_innodb_semi_consistent.result mysql-test/r/query_cache_28249.result mysql-test/r/status2.result mysql-test/std_data/bug40482-bin.000001 mysql-test/suite/binlog/r/binlog_innodb_row.result mysql-test/suite/binlog/t/binlog_innodb_row.test mysql-test/suite/rpl/r/rpl_binlog_corruption.result mysql-test/suite/rpl/t/rpl_binlog_corruption-master.opt mysql-test/suite/rpl/t/rpl_binlog_corruption.test mysql-test/suite/sys_vars/r/tmp_table_size_basic.result mysql-test/suite/sys_vars/t/tmp_table_size_basic.test mysql-test/t/fulltext_plugin-master.opt mysql-test/t/fulltext_plugin.test mysql-test/t/innodb_bug38231.test mysql-test/t/innodb_bug39438-master.opt mysql-test/t/innodb_bug39438.test mysql-test/t/innodb_mysql_rbk-master.opt mysql-test/t/innodb_mysql_rbk.test mysql-test/t/partition_innodb_semi_consistent-master.opt mysql-test/t/partition_innodb_semi_consistent.test mysql-test/t/query_cache_28249.test mysql-test/t/status2.test renamed: mysql-test/suite/funcs_1/r/is_collation_character_set_applicability.result => mysql-test/suite/funcs_1/r/is_coll_char_set_appl.result mysql-test/suite/funcs_1/t/is_collation_character_set_applicability.test => mysql-test/suite/funcs_1/t/is_coll_char_set_appl.test modified: .bzr-mysql/default.conf CMakeLists.txt client/mysql.cc client/mysql_upgrade.c client/mysqlcheck.c client/mysqltest.cc configure.in extra/resolve_stack_dump.c extra/yassl/include/openssl/ssl.h include/config-win.h include/m_ctype.h include/my_global.h mysql-test/extra/binlog_tests/database.test mysql-test/extra/rpl_tests/rpl_auto_increment.test mysql-test/include/commit.inc mysql-test/include/have_32bit.inc mysql-test/include/have_64bit.inc mysql-test/include/index_merge1.inc mysql-test/include/linux_sys_vars.inc mysql-test/include/windows_sys_vars.inc mysql-test/lib/mtr_report.pm mysql-test/mysql-test-run.pl mysql-test/r/alter_table.result mysql-test/r/commit_1innodb.result mysql-test/r/create.result mysql-test/r/csv.result mysql-test/r/ctype_ucs.result mysql-test/r/date_formats.result mysql-test/r/events_bugs.result mysql-test/r/events_scheduling.result mysql-test/r/fulltext.result mysql-test/r/func_if.result mysql-test/r/func_in.result mysql-test/r/func_str.result mysql-test/r/func_time.result mysql-test/r/grant.result mysql-test/r/index_merge_myisam.result mysql-test/r/information_schema.result mysql-test/r/innodb-autoinc.result mysql-test/r/innodb.result mysql-test/r/innodb_mysql.result mysql-test/r/log_bin_trust_function_creators_func.result mysql-test/r/log_state.result mysql-test/r/myisampack.result mysql-test/r/mysql.result mysql-test/r/mysqlcheck.result mysql-test/r/partition_datatype.result mysql-test/r/partition_mgm.result mysql-test/r/partition_pruning.result mysql-test/r/query_cache.result mysql-test/r/read_buffer_size_basic.result mysql-test/r/read_rnd_buffer_size_basic.result mysql-test/r/rpl_init_slave_func.result mysql-test/r/select.result mysql-test/r/status.result mysql-test/r/strict.result mysql-test/r/temp_table.result mysql-test/r/type_bit.result mysql-test/r/type_date.result mysql-test/r/type_float.result mysql-test/r/warnings_engine_disabled.result mysql-test/r/xml.result mysql-test/suite/binlog/r/binlog_database.result mysql-test/suite/binlog/r/binlog_index.result mysql-test/suite/binlog/r/binlog_innodb.result mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result mysql-test/suite/binlog/t/binlog_innodb.test mysql-test/suite/funcs_1/r/is_columns_is.result mysql-test/suite/funcs_1/r/is_engines.result mysql-test/suite/funcs_1/r/storedproc.result mysql-test/suite/funcs_1/storedproc/param_check.inc mysql-test/suite/funcs_2/t/disabled.def mysql-test/suite/ndb/t/disabled.def mysql-test/suite/parts/r/partition_bit_innodb.result mysql-test/suite/parts/r/partition_bit_myisam.result mysql-test/suite/parts/r/partition_special_innodb.result mysql-test/suite/parts/t/disabled.def mysql-test/suite/parts/t/partition_special_innodb.test mysql-test/suite/parts/t/partition_value_innodb.test mysql-test/suite/parts/t/partition_value_myisam.test mysql-test/suite/parts/t/partition_value_ndb.test mysql-test/suite/rpl/r/rpl_auto_increment.result mysql-test/suite/rpl/r/rpl_packet.result mysql-test/suite/rpl/r/rpl_row_create_table.result mysql-test/suite/rpl/r/rpl_slave_skip.result mysql-test/suite/rpl/r/rpl_trigger.result mysql-test/suite/rpl/t/disabled.def mysql-test/suite/rpl/t/rpl_packet.test mysql-test/suite/rpl/t/rpl_row_create_table.test mysql-test/suite/rpl/t/rpl_slave_skip.test mysql-test/suite/rpl/t/rpl_trigger.test mysql-test/suite/rpl_ndb/t/disabled.def mysql-test/suite/sys_vars/inc/key_buffer_size_basic.inc mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result mysql-test/suite/sys_vars/r/key_buffer_size_basic_64.result mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result mysql-test/suite/sys_vars/r/sort_buffer_size_basic_64.result mysql-test/t/alter_table.test mysql-test/t/create.test mysql-test/t/csv.test mysql-test/t/ctype_ucs.test mysql-test/t/date_formats.test mysql-test/t/disabled.def mysql-test/t/events_bugs.test mysql-test/t/events_scheduling.test mysql-test/t/fulltext.test mysql-test/t/func_if.test mysql-test/t/func_in.test mysql-test/t/func_str.test mysql-test/t/func_time.test mysql-test/t/grant.test mysql-test/t/information_schema.test mysql-test/t/innodb-autoinc.test mysql-test/t/innodb.test mysql-test/t/innodb_mysql.test mysql-test/t/log_bin_trust_function_creators_func.test mysql-test/t/log_state.test mysql-test/t/myisam_data_pointer_size_func.test mysql-test/t/myisampack.test mysql-test/t/mysql.test mysql-test/t/mysqlcheck.test mysql-test/t/partition_innodb_stmt.test mysql-test/t/partition_mgm.test mysql-test/t/partition_pruning.test mysql-test/t/query_cache.test mysql-test/t/rpl_init_slave_func.test mysql-test/t/select.test mysql-test/t/status.test mysql-test/t/strict.test mysql-test/t/temp_table.test mysql-test/t/type_bit.test mysql-test/t/type_date.test mysql-test/t/type_float.test mysql-test/t/warnings_engine_disabled.test mysql-test/t/xml.test mysys/my_getopt.c mysys/my_init.c scripts/mysql_install_db.sh sql-common/my_time.c sql/field.cc sql/field.h sql/filesort.cc sql/ha_partition.cc sql/ha_partition.h sql/item.cc sql/item_cmpfunc.cc sql/item_func.h sql/item_strfunc.cc sql/item_sum.cc sql/item_timefunc.cc sql/item_timefunc.h sql/log.cc sql/log.h sql/log_event.cc sql/log_event.h sql/mysql_priv.h sql/mysqld.cc sql/opt_range.cc sql/partition_info.cc sql/repl_failsafe.cc sql/rpl_constants.h sql/set_var.cc sql/slave.cc sql/spatial.h sql/sql_acl.cc sql/sql_base.cc sql/sql_binlog.cc sql/sql_class.h sql/sql_cursor.cc sql/sql_delete.cc sql/sql_lex.cc sql/sql_lex.h sql/sql_locale.cc sql/sql_parse.cc sql/sql_partition.cc sql/sql_plugin.cc sql/sql_plugin.h sql/sql_profile.cc sql/sql_repl.cc sql/sql_select.cc sql/sql_select.h sql/sql_show.cc sql/sql_table.cc sql/sql_trigger.cc sql/sql_trigger.h sql/table.cc sql/table.h sql/unireg.cc storage/csv/ha_tina.cc storage/federated/ha_federated.cc storage/heap/ha_heap.cc storage/innobase/Makefile.am storage/innobase/btr/btr0sea.c storage/innobase/buf/buf0lru.c storage/innobase/dict/dict0dict.c storage/innobase/dict/dict0mem.c storage/innobase/handler/ha_innodb.cc storage/innobase/handler/ha_innodb.h storage/innobase/include/btr0sea.h storage/innobase/include/dict0dict.h storage/innobase/include/dict0mem.h storage/innobase/include/ha_prototypes.h storage/innobase/include/lock0lock.h storage/innobase/include/row0mysql.h storage/innobase/include/sync0sync.ic storage/innobase/include/ut0ut.h storage/innobase/lock/lock0lock.c storage/innobase/os/os0file.c storage/innobase/plug.in storage/innobase/row/row0mysql.c storage/innobase/row/row0sel.c storage/innobase/srv/srv0srv.c storage/innobase/srv/srv0start.c storage/innobase/ut/ut0ut.c storage/myisam/ft_boolean_search.c strings/ctype.c strings/xml.c tests/mysql_client_test.c win/configure.js mysql-test/suite/funcs_1/t/is_coll_char_set_appl.test ------------------------------------------------------------------------ r4165 | calvin | 2009-02-12 01:34:27 +0200 (Thu, 12 Feb 2009) | 1 line Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: minor non-functional changes. ------------------------------------------------------------------------
17 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge revisions 4035:4261 from branches/5.1: ------------------------------------------------------------------------ r4065 | sunny | 2009-01-29 16:01:36 +0200 (Thu, 29 Jan 2009) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: In the last round of AUTOINC cleanup we assumed that AUTOINC is only defined for integer columns. This caused an assertion failure when we checked for the maximum value of a column type. We now calculate the max value for floating-point autoinc columns too. Fix Bug#42400 - InnoDB autoinc code can't handle floating-point columns rb://84 and Mantis issue://162 ------------------------------------------------------------------------ r4111 | sunny | 2009-02-03 22:06:52 +0200 (Tue, 03 Feb 2009) | 2 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Add the ULL suffix otherwise there is an overflow. ------------------------------------------------------------------------ r4128 | vasil | 2009-02-08 21:36:45 +0200 (Sun, 08 Feb 2009) | 18 lines Changed paths: M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2709.20.31 committer: Timothy Smith <timothy.smith@sun.com> branch nick: 51 timestamp: Fri 2008-12-19 01:28:51 +0100 message: Disable part of innodb-autoinc.test, because the MySQL server asserts when compiled --with-debug, due to bug 39828, "autoinc wraps around when offset and increment > 1". This change should be reverted when that bug is fixed (and a a few other minor changes to the test as described in comments). modified: mysql-test/r/innodb-autoinc.result mysql-test/t/innodb-autoinc.test ------------------------------------------------------------------------ r4129 | vasil | 2009-02-08 21:54:25 +0200 (Sun, 08 Feb 2009) | 310 lines Changed paths: M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Merge a change from MySQL: [looks like the changes to innodb-autoinc.test were made as part of the following huge merge, but we are merging only changes to that file] ------------------------------------------------------------ revno: 2546.47.1 committer: Luis Soares <luis.soares@sun.com> branch nick: 5.1-rpl timestamp: Fri 2009-01-23 13:22:05 +0100 message: merge: 5.1 -> 5.1-rpl conflicts: Text conflict in client/mysqltest.cc Text conflict in mysql-test/include/wait_until_connected_again.inc Text conflict in mysql-test/lib/mtr_report.pm Text conflict in mysql-test/mysql-test-run.pl Text conflict in mysql-test/r/events_bugs.result Text conflict in mysql-test/r/log_state.result Text conflict in mysql-test/r/myisam_data_pointer_size_func.result Text conflict in mysql-test/r/mysqlcheck.result Text conflict in mysql-test/r/query_cache.result Text conflict in mysql-test/r/status.result Text conflict in mysql-test/suite/binlog/r/binlog_index.result Text conflict in mysql-test/suite/binlog/r/binlog_innodb.result Text conflict in mysql-test/suite/rpl/r/rpl_packet.result Text conflict in mysql-test/suite/rpl/t/rpl_packet.test Text conflict in mysql-test/t/disabled.def Text conflict in mysql-test/t/events_bugs.test Text conflict in mysql-test/t/log_state.test Text conflict in mysql-test/t/myisam_data_pointer_size_func.test Text conflict in mysql-test/t/mysqlcheck.test Text conflict in mysql-test/t/query_cache.test Text conflict in mysql-test/t/rpl_init_slave_func.test Text conflict in mysql-test/t/status.test removed: mysql-test/suite/parts/r/partition_bit_ndb.result mysql-test/suite/parts/t/partition_bit_ndb.test mysql-test/suite/parts/t/partition_sessions.test mysql-test/suite/sys_vars/inc/tmp_table_size_basic.inc mysql-test/suite/sys_vars/r/tmp_table_size_basic_32.result mysql-test/suite/sys_vars/r/tmp_table_size_basic_64.result mysql-test/suite/sys_vars/t/tmp_table_size_basic_32.test mysql-test/suite/sys_vars/t/tmp_table_size_basic_64.test mysql-test/t/log_bin_trust_function_creators_func-master.opt mysql-test/t/rpl_init_slave_func-slave.opt added: mysql-test/include/check_events_off.inc mysql-test/include/cleanup_fake_relay_log.inc mysql-test/include/have_simple_parser.inc mysql-test/include/no_running_event_scheduler.inc mysql-test/include/no_running_events.inc mysql-test/include/running_event_scheduler.inc mysql-test/include/setup_fake_relay_log.inc mysql-test/include/wait_condition_sp.inc mysql-test/r/fulltext_plugin.result mysql-test/r/have_simple_parser.require mysql-test/r/innodb_bug38231.result mysql-test/r/innodb_bug39438.result mysql-test/r/innodb_mysql_rbk.result mysql-test/r/partition_innodb_semi_consistent.result mysql-test/r/query_cache_28249.result mysql-test/r/status2.result mysql-test/std_data/bug40482-bin.000001 mysql-test/suite/binlog/r/binlog_innodb_row.result mysql-test/suite/binlog/t/binlog_innodb_row.test mysql-test/suite/rpl/r/rpl_binlog_corruption.result mysql-test/suite/rpl/t/rpl_binlog_corruption-master.opt mysql-test/suite/rpl/t/rpl_binlog_corruption.test mysql-test/suite/sys_vars/r/tmp_table_size_basic.result mysql-test/suite/sys_vars/t/tmp_table_size_basic.test mysql-test/t/fulltext_plugin-master.opt mysql-test/t/fulltext_plugin.test mysql-test/t/innodb_bug38231.test mysql-test/t/innodb_bug39438-master.opt mysql-test/t/innodb_bug39438.test mysql-test/t/innodb_mysql_rbk-master.opt mysql-test/t/innodb_mysql_rbk.test mysql-test/t/partition_innodb_semi_consistent-master.opt mysql-test/t/partition_innodb_semi_consistent.test mysql-test/t/query_cache_28249.test mysql-test/t/status2.test renamed: mysql-test/suite/funcs_1/r/is_collation_character_set_applicability.result => mysql-test/suite/funcs_1/r/is_coll_char_set_appl.result mysql-test/suite/funcs_1/t/is_collation_character_set_applicability.test => mysql-test/suite/funcs_1/t/is_coll_char_set_appl.test modified: .bzr-mysql/default.conf CMakeLists.txt client/mysql.cc client/mysql_upgrade.c client/mysqlcheck.c client/mysqltest.cc configure.in extra/resolve_stack_dump.c extra/yassl/include/openssl/ssl.h include/config-win.h include/m_ctype.h include/my_global.h mysql-test/extra/binlog_tests/database.test mysql-test/extra/rpl_tests/rpl_auto_increment.test mysql-test/include/commit.inc mysql-test/include/have_32bit.inc mysql-test/include/have_64bit.inc mysql-test/include/index_merge1.inc mysql-test/include/linux_sys_vars.inc mysql-test/include/windows_sys_vars.inc mysql-test/lib/mtr_report.pm mysql-test/mysql-test-run.pl mysql-test/r/alter_table.result mysql-test/r/commit_1innodb.result mysql-test/r/create.result mysql-test/r/csv.result mysql-test/r/ctype_ucs.result mysql-test/r/date_formats.result mysql-test/r/events_bugs.result mysql-test/r/events_scheduling.result mysql-test/r/fulltext.result mysql-test/r/func_if.result mysql-test/r/func_in.result mysql-test/r/func_str.result mysql-test/r/func_time.result mysql-test/r/grant.result mysql-test/r/index_merge_myisam.result mysql-test/r/information_schema.result mysql-test/r/innodb-autoinc.result mysql-test/r/innodb.result mysql-test/r/innodb_mysql.result mysql-test/r/log_bin_trust_function_creators_func.result mysql-test/r/log_state.result mysql-test/r/myisampack.result mysql-test/r/mysql.result mysql-test/r/mysqlcheck.result mysql-test/r/partition_datatype.result mysql-test/r/partition_mgm.result mysql-test/r/partition_pruning.result mysql-test/r/query_cache.result mysql-test/r/read_buffer_size_basic.result mysql-test/r/read_rnd_buffer_size_basic.result mysql-test/r/rpl_init_slave_func.result mysql-test/r/select.result mysql-test/r/status.result mysql-test/r/strict.result mysql-test/r/temp_table.result mysql-test/r/type_bit.result mysql-test/r/type_date.result mysql-test/r/type_float.result mysql-test/r/warnings_engine_disabled.result mysql-test/r/xml.result mysql-test/suite/binlog/r/binlog_database.result mysql-test/suite/binlog/r/binlog_index.result mysql-test/suite/binlog/r/binlog_innodb.result mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result mysql-test/suite/binlog/t/binlog_innodb.test mysql-test/suite/funcs_1/r/is_columns_is.result mysql-test/suite/funcs_1/r/is_engines.result mysql-test/suite/funcs_1/r/storedproc.result mysql-test/suite/funcs_1/storedproc/param_check.inc mysql-test/suite/funcs_2/t/disabled.def mysql-test/suite/ndb/t/disabled.def mysql-test/suite/parts/r/partition_bit_innodb.result mysql-test/suite/parts/r/partition_bit_myisam.result mysql-test/suite/parts/r/partition_special_innodb.result mysql-test/suite/parts/t/disabled.def mysql-test/suite/parts/t/partition_special_innodb.test mysql-test/suite/parts/t/partition_value_innodb.test mysql-test/suite/parts/t/partition_value_myisam.test mysql-test/suite/parts/t/partition_value_ndb.test mysql-test/suite/rpl/r/rpl_auto_increment.result mysql-test/suite/rpl/r/rpl_packet.result mysql-test/suite/rpl/r/rpl_row_create_table.result mysql-test/suite/rpl/r/rpl_slave_skip.result mysql-test/suite/rpl/r/rpl_trigger.result mysql-test/suite/rpl/t/disabled.def mysql-test/suite/rpl/t/rpl_packet.test mysql-test/suite/rpl/t/rpl_row_create_table.test mysql-test/suite/rpl/t/rpl_slave_skip.test mysql-test/suite/rpl/t/rpl_trigger.test mysql-test/suite/rpl_ndb/t/disabled.def mysql-test/suite/sys_vars/inc/key_buffer_size_basic.inc mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result mysql-test/suite/sys_vars/r/key_buffer_size_basic_64.result mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result mysql-test/suite/sys_vars/r/sort_buffer_size_basic_64.result mysql-test/t/alter_table.test mysql-test/t/create.test mysql-test/t/csv.test mysql-test/t/ctype_ucs.test mysql-test/t/date_formats.test mysql-test/t/disabled.def mysql-test/t/events_bugs.test mysql-test/t/events_scheduling.test mysql-test/t/fulltext.test mysql-test/t/func_if.test mysql-test/t/func_in.test mysql-test/t/func_str.test mysql-test/t/func_time.test mysql-test/t/grant.test mysql-test/t/information_schema.test mysql-test/t/innodb-autoinc.test mysql-test/t/innodb.test mysql-test/t/innodb_mysql.test mysql-test/t/log_bin_trust_function_creators_func.test mysql-test/t/log_state.test mysql-test/t/myisam_data_pointer_size_func.test mysql-test/t/myisampack.test mysql-test/t/mysql.test mysql-test/t/mysqlcheck.test mysql-test/t/partition_innodb_stmt.test mysql-test/t/partition_mgm.test mysql-test/t/partition_pruning.test mysql-test/t/query_cache.test mysql-test/t/rpl_init_slave_func.test mysql-test/t/select.test mysql-test/t/status.test mysql-test/t/strict.test mysql-test/t/temp_table.test mysql-test/t/type_bit.test mysql-test/t/type_date.test mysql-test/t/type_float.test mysql-test/t/warnings_engine_disabled.test mysql-test/t/xml.test mysys/my_getopt.c mysys/my_init.c scripts/mysql_install_db.sh sql-common/my_time.c sql/field.cc sql/field.h sql/filesort.cc sql/ha_partition.cc sql/ha_partition.h sql/item.cc sql/item_cmpfunc.cc sql/item_func.h sql/item_strfunc.cc sql/item_sum.cc sql/item_timefunc.cc sql/item_timefunc.h sql/log.cc sql/log.h sql/log_event.cc sql/log_event.h sql/mysql_priv.h sql/mysqld.cc sql/opt_range.cc sql/partition_info.cc sql/repl_failsafe.cc sql/rpl_constants.h sql/set_var.cc sql/slave.cc sql/spatial.h sql/sql_acl.cc sql/sql_base.cc sql/sql_binlog.cc sql/sql_class.h sql/sql_cursor.cc sql/sql_delete.cc sql/sql_lex.cc sql/sql_lex.h sql/sql_locale.cc sql/sql_parse.cc sql/sql_partition.cc sql/sql_plugin.cc sql/sql_plugin.h sql/sql_profile.cc sql/sql_repl.cc sql/sql_select.cc sql/sql_select.h sql/sql_show.cc sql/sql_table.cc sql/sql_trigger.cc sql/sql_trigger.h sql/table.cc sql/table.h sql/unireg.cc storage/csv/ha_tina.cc storage/federated/ha_federated.cc storage/heap/ha_heap.cc storage/innobase/Makefile.am storage/innobase/btr/btr0sea.c storage/innobase/buf/buf0lru.c storage/innobase/dict/dict0dict.c storage/innobase/dict/dict0mem.c storage/innobase/handler/ha_innodb.cc storage/innobase/handler/ha_innodb.h storage/innobase/include/btr0sea.h storage/innobase/include/dict0dict.h storage/innobase/include/dict0mem.h storage/innobase/include/ha_prototypes.h storage/innobase/include/lock0lock.h storage/innobase/include/row0mysql.h storage/innobase/include/sync0sync.ic storage/innobase/include/ut0ut.h storage/innobase/lock/lock0lock.c storage/innobase/os/os0file.c storage/innobase/plug.in storage/innobase/row/row0mysql.c storage/innobase/row/row0sel.c storage/innobase/srv/srv0srv.c storage/innobase/srv/srv0start.c storage/innobase/ut/ut0ut.c storage/myisam/ft_boolean_search.c strings/ctype.c strings/xml.c tests/mysql_client_test.c win/configure.js mysql-test/suite/funcs_1/t/is_coll_char_set_appl.test ------------------------------------------------------------------------ r4165 | calvin | 2009-02-12 01:34:27 +0200 (Thu, 12 Feb 2009) | 1 line Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: minor non-functional changes. ------------------------------------------------------------------------
17 years ago
branches/zip: Merge revisions 4035:4261 from branches/5.1: ------------------------------------------------------------------------ r4065 | sunny | 2009-01-29 16:01:36 +0200 (Thu, 29 Jan 2009) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: In the last round of AUTOINC cleanup we assumed that AUTOINC is only defined for integer columns. This caused an assertion failure when we checked for the maximum value of a column type. We now calculate the max value for floating-point autoinc columns too. Fix Bug#42400 - InnoDB autoinc code can't handle floating-point columns rb://84 and Mantis issue://162 ------------------------------------------------------------------------ r4111 | sunny | 2009-02-03 22:06:52 +0200 (Tue, 03 Feb 2009) | 2 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Add the ULL suffix otherwise there is an overflow. ------------------------------------------------------------------------ r4128 | vasil | 2009-02-08 21:36:45 +0200 (Sun, 08 Feb 2009) | 18 lines Changed paths: M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2709.20.31 committer: Timothy Smith <timothy.smith@sun.com> branch nick: 51 timestamp: Fri 2008-12-19 01:28:51 +0100 message: Disable part of innodb-autoinc.test, because the MySQL server asserts when compiled --with-debug, due to bug 39828, "autoinc wraps around when offset and increment > 1". This change should be reverted when that bug is fixed (and a a few other minor changes to the test as described in comments). modified: mysql-test/r/innodb-autoinc.result mysql-test/t/innodb-autoinc.test ------------------------------------------------------------------------ r4129 | vasil | 2009-02-08 21:54:25 +0200 (Sun, 08 Feb 2009) | 310 lines Changed paths: M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Merge a change from MySQL: [looks like the changes to innodb-autoinc.test were made as part of the following huge merge, but we are merging only changes to that file] ------------------------------------------------------------ revno: 2546.47.1 committer: Luis Soares <luis.soares@sun.com> branch nick: 5.1-rpl timestamp: Fri 2009-01-23 13:22:05 +0100 message: merge: 5.1 -> 5.1-rpl conflicts: Text conflict in client/mysqltest.cc Text conflict in mysql-test/include/wait_until_connected_again.inc Text conflict in mysql-test/lib/mtr_report.pm Text conflict in mysql-test/mysql-test-run.pl Text conflict in mysql-test/r/events_bugs.result Text conflict in mysql-test/r/log_state.result Text conflict in mysql-test/r/myisam_data_pointer_size_func.result Text conflict in mysql-test/r/mysqlcheck.result Text conflict in mysql-test/r/query_cache.result Text conflict in mysql-test/r/status.result Text conflict in mysql-test/suite/binlog/r/binlog_index.result Text conflict in mysql-test/suite/binlog/r/binlog_innodb.result Text conflict in mysql-test/suite/rpl/r/rpl_packet.result Text conflict in mysql-test/suite/rpl/t/rpl_packet.test Text conflict in mysql-test/t/disabled.def Text conflict in mysql-test/t/events_bugs.test Text conflict in mysql-test/t/log_state.test Text conflict in mysql-test/t/myisam_data_pointer_size_func.test Text conflict in mysql-test/t/mysqlcheck.test Text conflict in mysql-test/t/query_cache.test Text conflict in mysql-test/t/rpl_init_slave_func.test Text conflict in mysql-test/t/status.test removed: mysql-test/suite/parts/r/partition_bit_ndb.result mysql-test/suite/parts/t/partition_bit_ndb.test mysql-test/suite/parts/t/partition_sessions.test mysql-test/suite/sys_vars/inc/tmp_table_size_basic.inc mysql-test/suite/sys_vars/r/tmp_table_size_basic_32.result mysql-test/suite/sys_vars/r/tmp_table_size_basic_64.result mysql-test/suite/sys_vars/t/tmp_table_size_basic_32.test mysql-test/suite/sys_vars/t/tmp_table_size_basic_64.test mysql-test/t/log_bin_trust_function_creators_func-master.opt mysql-test/t/rpl_init_slave_func-slave.opt added: mysql-test/include/check_events_off.inc mysql-test/include/cleanup_fake_relay_log.inc mysql-test/include/have_simple_parser.inc mysql-test/include/no_running_event_scheduler.inc mysql-test/include/no_running_events.inc mysql-test/include/running_event_scheduler.inc mysql-test/include/setup_fake_relay_log.inc mysql-test/include/wait_condition_sp.inc mysql-test/r/fulltext_plugin.result mysql-test/r/have_simple_parser.require mysql-test/r/innodb_bug38231.result mysql-test/r/innodb_bug39438.result mysql-test/r/innodb_mysql_rbk.result mysql-test/r/partition_innodb_semi_consistent.result mysql-test/r/query_cache_28249.result mysql-test/r/status2.result mysql-test/std_data/bug40482-bin.000001 mysql-test/suite/binlog/r/binlog_innodb_row.result mysql-test/suite/binlog/t/binlog_innodb_row.test mysql-test/suite/rpl/r/rpl_binlog_corruption.result mysql-test/suite/rpl/t/rpl_binlog_corruption-master.opt mysql-test/suite/rpl/t/rpl_binlog_corruption.test mysql-test/suite/sys_vars/r/tmp_table_size_basic.result mysql-test/suite/sys_vars/t/tmp_table_size_basic.test mysql-test/t/fulltext_plugin-master.opt mysql-test/t/fulltext_plugin.test mysql-test/t/innodb_bug38231.test mysql-test/t/innodb_bug39438-master.opt mysql-test/t/innodb_bug39438.test mysql-test/t/innodb_mysql_rbk-master.opt mysql-test/t/innodb_mysql_rbk.test mysql-test/t/partition_innodb_semi_consistent-master.opt mysql-test/t/partition_innodb_semi_consistent.test mysql-test/t/query_cache_28249.test mysql-test/t/status2.test renamed: mysql-test/suite/funcs_1/r/is_collation_character_set_applicability.result => mysql-test/suite/funcs_1/r/is_coll_char_set_appl.result mysql-test/suite/funcs_1/t/is_collation_character_set_applicability.test => mysql-test/suite/funcs_1/t/is_coll_char_set_appl.test modified: .bzr-mysql/default.conf CMakeLists.txt client/mysql.cc client/mysql_upgrade.c client/mysqlcheck.c client/mysqltest.cc configure.in extra/resolve_stack_dump.c extra/yassl/include/openssl/ssl.h include/config-win.h include/m_ctype.h include/my_global.h mysql-test/extra/binlog_tests/database.test mysql-test/extra/rpl_tests/rpl_auto_increment.test mysql-test/include/commit.inc mysql-test/include/have_32bit.inc mysql-test/include/have_64bit.inc mysql-test/include/index_merge1.inc mysql-test/include/linux_sys_vars.inc mysql-test/include/windows_sys_vars.inc mysql-test/lib/mtr_report.pm mysql-test/mysql-test-run.pl mysql-test/r/alter_table.result mysql-test/r/commit_1innodb.result mysql-test/r/create.result mysql-test/r/csv.result mysql-test/r/ctype_ucs.result mysql-test/r/date_formats.result mysql-test/r/events_bugs.result mysql-test/r/events_scheduling.result mysql-test/r/fulltext.result mysql-test/r/func_if.result mysql-test/r/func_in.result mysql-test/r/func_str.result mysql-test/r/func_time.result mysql-test/r/grant.result mysql-test/r/index_merge_myisam.result mysql-test/r/information_schema.result mysql-test/r/innodb-autoinc.result mysql-test/r/innodb.result mysql-test/r/innodb_mysql.result mysql-test/r/log_bin_trust_function_creators_func.result mysql-test/r/log_state.result mysql-test/r/myisampack.result mysql-test/r/mysql.result mysql-test/r/mysqlcheck.result mysql-test/r/partition_datatype.result mysql-test/r/partition_mgm.result mysql-test/r/partition_pruning.result mysql-test/r/query_cache.result mysql-test/r/read_buffer_size_basic.result mysql-test/r/read_rnd_buffer_size_basic.result mysql-test/r/rpl_init_slave_func.result mysql-test/r/select.result mysql-test/r/status.result mysql-test/r/strict.result mysql-test/r/temp_table.result mysql-test/r/type_bit.result mysql-test/r/type_date.result mysql-test/r/type_float.result mysql-test/r/warnings_engine_disabled.result mysql-test/r/xml.result mysql-test/suite/binlog/r/binlog_database.result mysql-test/suite/binlog/r/binlog_index.result mysql-test/suite/binlog/r/binlog_innodb.result mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result mysql-test/suite/binlog/t/binlog_innodb.test mysql-test/suite/funcs_1/r/is_columns_is.result mysql-test/suite/funcs_1/r/is_engines.result mysql-test/suite/funcs_1/r/storedproc.result mysql-test/suite/funcs_1/storedproc/param_check.inc mysql-test/suite/funcs_2/t/disabled.def mysql-test/suite/ndb/t/disabled.def mysql-test/suite/parts/r/partition_bit_innodb.result mysql-test/suite/parts/r/partition_bit_myisam.result mysql-test/suite/parts/r/partition_special_innodb.result mysql-test/suite/parts/t/disabled.def mysql-test/suite/parts/t/partition_special_innodb.test mysql-test/suite/parts/t/partition_value_innodb.test mysql-test/suite/parts/t/partition_value_myisam.test mysql-test/suite/parts/t/partition_value_ndb.test mysql-test/suite/rpl/r/rpl_auto_increment.result mysql-test/suite/rpl/r/rpl_packet.result mysql-test/suite/rpl/r/rpl_row_create_table.result mysql-test/suite/rpl/r/rpl_slave_skip.result mysql-test/suite/rpl/r/rpl_trigger.result mysql-test/suite/rpl/t/disabled.def mysql-test/suite/rpl/t/rpl_packet.test mysql-test/suite/rpl/t/rpl_row_create_table.test mysql-test/suite/rpl/t/rpl_slave_skip.test mysql-test/suite/rpl/t/rpl_trigger.test mysql-test/suite/rpl_ndb/t/disabled.def mysql-test/suite/sys_vars/inc/key_buffer_size_basic.inc mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result mysql-test/suite/sys_vars/r/key_buffer_size_basic_64.result mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result mysql-test/suite/sys_vars/r/sort_buffer_size_basic_64.result mysql-test/t/alter_table.test mysql-test/t/create.test mysql-test/t/csv.test mysql-test/t/ctype_ucs.test mysql-test/t/date_formats.test mysql-test/t/disabled.def mysql-test/t/events_bugs.test mysql-test/t/events_scheduling.test mysql-test/t/fulltext.test mysql-test/t/func_if.test mysql-test/t/func_in.test mysql-test/t/func_str.test mysql-test/t/func_time.test mysql-test/t/grant.test mysql-test/t/information_schema.test mysql-test/t/innodb-autoinc.test mysql-test/t/innodb.test mysql-test/t/innodb_mysql.test mysql-test/t/log_bin_trust_function_creators_func.test mysql-test/t/log_state.test mysql-test/t/myisam_data_pointer_size_func.test mysql-test/t/myisampack.test mysql-test/t/mysql.test mysql-test/t/mysqlcheck.test mysql-test/t/partition_innodb_stmt.test mysql-test/t/partition_mgm.test mysql-test/t/partition_pruning.test mysql-test/t/query_cache.test mysql-test/t/rpl_init_slave_func.test mysql-test/t/select.test mysql-test/t/status.test mysql-test/t/strict.test mysql-test/t/temp_table.test mysql-test/t/type_bit.test mysql-test/t/type_date.test mysql-test/t/type_float.test mysql-test/t/warnings_engine_disabled.test mysql-test/t/xml.test mysys/my_getopt.c mysys/my_init.c scripts/mysql_install_db.sh sql-common/my_time.c sql/field.cc sql/field.h sql/filesort.cc sql/ha_partition.cc sql/ha_partition.h sql/item.cc sql/item_cmpfunc.cc sql/item_func.h sql/item_strfunc.cc sql/item_sum.cc sql/item_timefunc.cc sql/item_timefunc.h sql/log.cc sql/log.h sql/log_event.cc sql/log_event.h sql/mysql_priv.h sql/mysqld.cc sql/opt_range.cc sql/partition_info.cc sql/repl_failsafe.cc sql/rpl_constants.h sql/set_var.cc sql/slave.cc sql/spatial.h sql/sql_acl.cc sql/sql_base.cc sql/sql_binlog.cc sql/sql_class.h sql/sql_cursor.cc sql/sql_delete.cc sql/sql_lex.cc sql/sql_lex.h sql/sql_locale.cc sql/sql_parse.cc sql/sql_partition.cc sql/sql_plugin.cc sql/sql_plugin.h sql/sql_profile.cc sql/sql_repl.cc sql/sql_select.cc sql/sql_select.h sql/sql_show.cc sql/sql_table.cc sql/sql_trigger.cc sql/sql_trigger.h sql/table.cc sql/table.h sql/unireg.cc storage/csv/ha_tina.cc storage/federated/ha_federated.cc storage/heap/ha_heap.cc storage/innobase/Makefile.am storage/innobase/btr/btr0sea.c storage/innobase/buf/buf0lru.c storage/innobase/dict/dict0dict.c storage/innobase/dict/dict0mem.c storage/innobase/handler/ha_innodb.cc storage/innobase/handler/ha_innodb.h storage/innobase/include/btr0sea.h storage/innobase/include/dict0dict.h storage/innobase/include/dict0mem.h storage/innobase/include/ha_prototypes.h storage/innobase/include/lock0lock.h storage/innobase/include/row0mysql.h storage/innobase/include/sync0sync.ic storage/innobase/include/ut0ut.h storage/innobase/lock/lock0lock.c storage/innobase/os/os0file.c storage/innobase/plug.in storage/innobase/row/row0mysql.c storage/innobase/row/row0sel.c storage/innobase/srv/srv0srv.c storage/innobase/srv/srv0start.c storage/innobase/ut/ut0ut.c storage/myisam/ft_boolean_search.c strings/ctype.c strings/xml.c tests/mysql_client_test.c win/configure.js mysql-test/suite/funcs_1/t/is_coll_char_set_appl.test ------------------------------------------------------------------------ r4165 | calvin | 2009-02-12 01:34:27 +0200 (Thu, 12 Feb 2009) | 1 line Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: minor non-functional changes. ------------------------------------------------------------------------
17 years ago
branches/zip: Merge revisions 4035:4261 from branches/5.1: ------------------------------------------------------------------------ r4065 | sunny | 2009-01-29 16:01:36 +0200 (Thu, 29 Jan 2009) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: In the last round of AUTOINC cleanup we assumed that AUTOINC is only defined for integer columns. This caused an assertion failure when we checked for the maximum value of a column type. We now calculate the max value for floating-point autoinc columns too. Fix Bug#42400 - InnoDB autoinc code can't handle floating-point columns rb://84 and Mantis issue://162 ------------------------------------------------------------------------ r4111 | sunny | 2009-02-03 22:06:52 +0200 (Tue, 03 Feb 2009) | 2 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Add the ULL suffix otherwise there is an overflow. ------------------------------------------------------------------------ r4128 | vasil | 2009-02-08 21:36:45 +0200 (Sun, 08 Feb 2009) | 18 lines Changed paths: M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2709.20.31 committer: Timothy Smith <timothy.smith@sun.com> branch nick: 51 timestamp: Fri 2008-12-19 01:28:51 +0100 message: Disable part of innodb-autoinc.test, because the MySQL server asserts when compiled --with-debug, due to bug 39828, "autoinc wraps around when offset and increment > 1". This change should be reverted when that bug is fixed (and a a few other minor changes to the test as described in comments). modified: mysql-test/r/innodb-autoinc.result mysql-test/t/innodb-autoinc.test ------------------------------------------------------------------------ r4129 | vasil | 2009-02-08 21:54:25 +0200 (Sun, 08 Feb 2009) | 310 lines Changed paths: M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Merge a change from MySQL: [looks like the changes to innodb-autoinc.test were made as part of the following huge merge, but we are merging only changes to that file] ------------------------------------------------------------ revno: 2546.47.1 committer: Luis Soares <luis.soares@sun.com> branch nick: 5.1-rpl timestamp: Fri 2009-01-23 13:22:05 +0100 message: merge: 5.1 -> 5.1-rpl conflicts: Text conflict in client/mysqltest.cc Text conflict in mysql-test/include/wait_until_connected_again.inc Text conflict in mysql-test/lib/mtr_report.pm Text conflict in mysql-test/mysql-test-run.pl Text conflict in mysql-test/r/events_bugs.result Text conflict in mysql-test/r/log_state.result Text conflict in mysql-test/r/myisam_data_pointer_size_func.result Text conflict in mysql-test/r/mysqlcheck.result Text conflict in mysql-test/r/query_cache.result Text conflict in mysql-test/r/status.result Text conflict in mysql-test/suite/binlog/r/binlog_index.result Text conflict in mysql-test/suite/binlog/r/binlog_innodb.result Text conflict in mysql-test/suite/rpl/r/rpl_packet.result Text conflict in mysql-test/suite/rpl/t/rpl_packet.test Text conflict in mysql-test/t/disabled.def Text conflict in mysql-test/t/events_bugs.test Text conflict in mysql-test/t/log_state.test Text conflict in mysql-test/t/myisam_data_pointer_size_func.test Text conflict in mysql-test/t/mysqlcheck.test Text conflict in mysql-test/t/query_cache.test Text conflict in mysql-test/t/rpl_init_slave_func.test Text conflict in mysql-test/t/status.test removed: mysql-test/suite/parts/r/partition_bit_ndb.result mysql-test/suite/parts/t/partition_bit_ndb.test mysql-test/suite/parts/t/partition_sessions.test mysql-test/suite/sys_vars/inc/tmp_table_size_basic.inc mysql-test/suite/sys_vars/r/tmp_table_size_basic_32.result mysql-test/suite/sys_vars/r/tmp_table_size_basic_64.result mysql-test/suite/sys_vars/t/tmp_table_size_basic_32.test mysql-test/suite/sys_vars/t/tmp_table_size_basic_64.test mysql-test/t/log_bin_trust_function_creators_func-master.opt mysql-test/t/rpl_init_slave_func-slave.opt added: mysql-test/include/check_events_off.inc mysql-test/include/cleanup_fake_relay_log.inc mysql-test/include/have_simple_parser.inc mysql-test/include/no_running_event_scheduler.inc mysql-test/include/no_running_events.inc mysql-test/include/running_event_scheduler.inc mysql-test/include/setup_fake_relay_log.inc mysql-test/include/wait_condition_sp.inc mysql-test/r/fulltext_plugin.result mysql-test/r/have_simple_parser.require mysql-test/r/innodb_bug38231.result mysql-test/r/innodb_bug39438.result mysql-test/r/innodb_mysql_rbk.result mysql-test/r/partition_innodb_semi_consistent.result mysql-test/r/query_cache_28249.result mysql-test/r/status2.result mysql-test/std_data/bug40482-bin.000001 mysql-test/suite/binlog/r/binlog_innodb_row.result mysql-test/suite/binlog/t/binlog_innodb_row.test mysql-test/suite/rpl/r/rpl_binlog_corruption.result mysql-test/suite/rpl/t/rpl_binlog_corruption-master.opt mysql-test/suite/rpl/t/rpl_binlog_corruption.test mysql-test/suite/sys_vars/r/tmp_table_size_basic.result mysql-test/suite/sys_vars/t/tmp_table_size_basic.test mysql-test/t/fulltext_plugin-master.opt mysql-test/t/fulltext_plugin.test mysql-test/t/innodb_bug38231.test mysql-test/t/innodb_bug39438-master.opt mysql-test/t/innodb_bug39438.test mysql-test/t/innodb_mysql_rbk-master.opt mysql-test/t/innodb_mysql_rbk.test mysql-test/t/partition_innodb_semi_consistent-master.opt mysql-test/t/partition_innodb_semi_consistent.test mysql-test/t/query_cache_28249.test mysql-test/t/status2.test renamed: mysql-test/suite/funcs_1/r/is_collation_character_set_applicability.result => mysql-test/suite/funcs_1/r/is_coll_char_set_appl.result mysql-test/suite/funcs_1/t/is_collation_character_set_applicability.test => mysql-test/suite/funcs_1/t/is_coll_char_set_appl.test modified: .bzr-mysql/default.conf CMakeLists.txt client/mysql.cc client/mysql_upgrade.c client/mysqlcheck.c client/mysqltest.cc configure.in extra/resolve_stack_dump.c extra/yassl/include/openssl/ssl.h include/config-win.h include/m_ctype.h include/my_global.h mysql-test/extra/binlog_tests/database.test mysql-test/extra/rpl_tests/rpl_auto_increment.test mysql-test/include/commit.inc mysql-test/include/have_32bit.inc mysql-test/include/have_64bit.inc mysql-test/include/index_merge1.inc mysql-test/include/linux_sys_vars.inc mysql-test/include/windows_sys_vars.inc mysql-test/lib/mtr_report.pm mysql-test/mysql-test-run.pl mysql-test/r/alter_table.result mysql-test/r/commit_1innodb.result mysql-test/r/create.result mysql-test/r/csv.result mysql-test/r/ctype_ucs.result mysql-test/r/date_formats.result mysql-test/r/events_bugs.result mysql-test/r/events_scheduling.result mysql-test/r/fulltext.result mysql-test/r/func_if.result mysql-test/r/func_in.result mysql-test/r/func_str.result mysql-test/r/func_time.result mysql-test/r/grant.result mysql-test/r/index_merge_myisam.result mysql-test/r/information_schema.result mysql-test/r/innodb-autoinc.result mysql-test/r/innodb.result mysql-test/r/innodb_mysql.result mysql-test/r/log_bin_trust_function_creators_func.result mysql-test/r/log_state.result mysql-test/r/myisampack.result mysql-test/r/mysql.result mysql-test/r/mysqlcheck.result mysql-test/r/partition_datatype.result mysql-test/r/partition_mgm.result mysql-test/r/partition_pruning.result mysql-test/r/query_cache.result mysql-test/r/read_buffer_size_basic.result mysql-test/r/read_rnd_buffer_size_basic.result mysql-test/r/rpl_init_slave_func.result mysql-test/r/select.result mysql-test/r/status.result mysql-test/r/strict.result mysql-test/r/temp_table.result mysql-test/r/type_bit.result mysql-test/r/type_date.result mysql-test/r/type_float.result mysql-test/r/warnings_engine_disabled.result mysql-test/r/xml.result mysql-test/suite/binlog/r/binlog_database.result mysql-test/suite/binlog/r/binlog_index.result mysql-test/suite/binlog/r/binlog_innodb.result mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result mysql-test/suite/binlog/t/binlog_innodb.test mysql-test/suite/funcs_1/r/is_columns_is.result mysql-test/suite/funcs_1/r/is_engines.result mysql-test/suite/funcs_1/r/storedproc.result mysql-test/suite/funcs_1/storedproc/param_check.inc mysql-test/suite/funcs_2/t/disabled.def mysql-test/suite/ndb/t/disabled.def mysql-test/suite/parts/r/partition_bit_innodb.result mysql-test/suite/parts/r/partition_bit_myisam.result mysql-test/suite/parts/r/partition_special_innodb.result mysql-test/suite/parts/t/disabled.def mysql-test/suite/parts/t/partition_special_innodb.test mysql-test/suite/parts/t/partition_value_innodb.test mysql-test/suite/parts/t/partition_value_myisam.test mysql-test/suite/parts/t/partition_value_ndb.test mysql-test/suite/rpl/r/rpl_auto_increment.result mysql-test/suite/rpl/r/rpl_packet.result mysql-test/suite/rpl/r/rpl_row_create_table.result mysql-test/suite/rpl/r/rpl_slave_skip.result mysql-test/suite/rpl/r/rpl_trigger.result mysql-test/suite/rpl/t/disabled.def mysql-test/suite/rpl/t/rpl_packet.test mysql-test/suite/rpl/t/rpl_row_create_table.test mysql-test/suite/rpl/t/rpl_slave_skip.test mysql-test/suite/rpl/t/rpl_trigger.test mysql-test/suite/rpl_ndb/t/disabled.def mysql-test/suite/sys_vars/inc/key_buffer_size_basic.inc mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result mysql-test/suite/sys_vars/r/key_buffer_size_basic_64.result mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result mysql-test/suite/sys_vars/r/sort_buffer_size_basic_64.result mysql-test/t/alter_table.test mysql-test/t/create.test mysql-test/t/csv.test mysql-test/t/ctype_ucs.test mysql-test/t/date_formats.test mysql-test/t/disabled.def mysql-test/t/events_bugs.test mysql-test/t/events_scheduling.test mysql-test/t/fulltext.test mysql-test/t/func_if.test mysql-test/t/func_in.test mysql-test/t/func_str.test mysql-test/t/func_time.test mysql-test/t/grant.test mysql-test/t/information_schema.test mysql-test/t/innodb-autoinc.test mysql-test/t/innodb.test mysql-test/t/innodb_mysql.test mysql-test/t/log_bin_trust_function_creators_func.test mysql-test/t/log_state.test mysql-test/t/myisam_data_pointer_size_func.test mysql-test/t/myisampack.test mysql-test/t/mysql.test mysql-test/t/mysqlcheck.test mysql-test/t/partition_innodb_stmt.test mysql-test/t/partition_mgm.test mysql-test/t/partition_pruning.test mysql-test/t/query_cache.test mysql-test/t/rpl_init_slave_func.test mysql-test/t/select.test mysql-test/t/status.test mysql-test/t/strict.test mysql-test/t/temp_table.test mysql-test/t/type_bit.test mysql-test/t/type_date.test mysql-test/t/type_float.test mysql-test/t/warnings_engine_disabled.test mysql-test/t/xml.test mysys/my_getopt.c mysys/my_init.c scripts/mysql_install_db.sh sql-common/my_time.c sql/field.cc sql/field.h sql/filesort.cc sql/ha_partition.cc sql/ha_partition.h sql/item.cc sql/item_cmpfunc.cc sql/item_func.h sql/item_strfunc.cc sql/item_sum.cc sql/item_timefunc.cc sql/item_timefunc.h sql/log.cc sql/log.h sql/log_event.cc sql/log_event.h sql/mysql_priv.h sql/mysqld.cc sql/opt_range.cc sql/partition_info.cc sql/repl_failsafe.cc sql/rpl_constants.h sql/set_var.cc sql/slave.cc sql/spatial.h sql/sql_acl.cc sql/sql_base.cc sql/sql_binlog.cc sql/sql_class.h sql/sql_cursor.cc sql/sql_delete.cc sql/sql_lex.cc sql/sql_lex.h sql/sql_locale.cc sql/sql_parse.cc sql/sql_partition.cc sql/sql_plugin.cc sql/sql_plugin.h sql/sql_profile.cc sql/sql_repl.cc sql/sql_select.cc sql/sql_select.h sql/sql_show.cc sql/sql_table.cc sql/sql_trigger.cc sql/sql_trigger.h sql/table.cc sql/table.h sql/unireg.cc storage/csv/ha_tina.cc storage/federated/ha_federated.cc storage/heap/ha_heap.cc storage/innobase/Makefile.am storage/innobase/btr/btr0sea.c storage/innobase/buf/buf0lru.c storage/innobase/dict/dict0dict.c storage/innobase/dict/dict0mem.c storage/innobase/handler/ha_innodb.cc storage/innobase/handler/ha_innodb.h storage/innobase/include/btr0sea.h storage/innobase/include/dict0dict.h storage/innobase/include/dict0mem.h storage/innobase/include/ha_prototypes.h storage/innobase/include/lock0lock.h storage/innobase/include/row0mysql.h storage/innobase/include/sync0sync.ic storage/innobase/include/ut0ut.h storage/innobase/lock/lock0lock.c storage/innobase/os/os0file.c storage/innobase/plug.in storage/innobase/row/row0mysql.c storage/innobase/row/row0sel.c storage/innobase/srv/srv0srv.c storage/innobase/srv/srv0start.c storage/innobase/ut/ut0ut.c storage/myisam/ft_boolean_search.c strings/ctype.c strings/xml.c tests/mysql_client_test.c win/configure.js mysql-test/suite/funcs_1/t/is_coll_char_set_appl.test ------------------------------------------------------------------------ r4165 | calvin | 2009-02-12 01:34:27 +0200 (Thu, 12 Feb 2009) | 1 line Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: minor non-functional changes. ------------------------------------------------------------------------
17 years ago
branches/zip: Merge revisions 4035:4261 from branches/5.1: ------------------------------------------------------------------------ r4065 | sunny | 2009-01-29 16:01:36 +0200 (Thu, 29 Jan 2009) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: In the last round of AUTOINC cleanup we assumed that AUTOINC is only defined for integer columns. This caused an assertion failure when we checked for the maximum value of a column type. We now calculate the max value for floating-point autoinc columns too. Fix Bug#42400 - InnoDB autoinc code can't handle floating-point columns rb://84 and Mantis issue://162 ------------------------------------------------------------------------ r4111 | sunny | 2009-02-03 22:06:52 +0200 (Tue, 03 Feb 2009) | 2 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Add the ULL suffix otherwise there is an overflow. ------------------------------------------------------------------------ r4128 | vasil | 2009-02-08 21:36:45 +0200 (Sun, 08 Feb 2009) | 18 lines Changed paths: M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2709.20.31 committer: Timothy Smith <timothy.smith@sun.com> branch nick: 51 timestamp: Fri 2008-12-19 01:28:51 +0100 message: Disable part of innodb-autoinc.test, because the MySQL server asserts when compiled --with-debug, due to bug 39828, "autoinc wraps around when offset and increment > 1". This change should be reverted when that bug is fixed (and a a few other minor changes to the test as described in comments). modified: mysql-test/r/innodb-autoinc.result mysql-test/t/innodb-autoinc.test ------------------------------------------------------------------------ r4129 | vasil | 2009-02-08 21:54:25 +0200 (Sun, 08 Feb 2009) | 310 lines Changed paths: M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Merge a change from MySQL: [looks like the changes to innodb-autoinc.test were made as part of the following huge merge, but we are merging only changes to that file] ------------------------------------------------------------ revno: 2546.47.1 committer: Luis Soares <luis.soares@sun.com> branch nick: 5.1-rpl timestamp: Fri 2009-01-23 13:22:05 +0100 message: merge: 5.1 -> 5.1-rpl conflicts: Text conflict in client/mysqltest.cc Text conflict in mysql-test/include/wait_until_connected_again.inc Text conflict in mysql-test/lib/mtr_report.pm Text conflict in mysql-test/mysql-test-run.pl Text conflict in mysql-test/r/events_bugs.result Text conflict in mysql-test/r/log_state.result Text conflict in mysql-test/r/myisam_data_pointer_size_func.result Text conflict in mysql-test/r/mysqlcheck.result Text conflict in mysql-test/r/query_cache.result Text conflict in mysql-test/r/status.result Text conflict in mysql-test/suite/binlog/r/binlog_index.result Text conflict in mysql-test/suite/binlog/r/binlog_innodb.result Text conflict in mysql-test/suite/rpl/r/rpl_packet.result Text conflict in mysql-test/suite/rpl/t/rpl_packet.test Text conflict in mysql-test/t/disabled.def Text conflict in mysql-test/t/events_bugs.test Text conflict in mysql-test/t/log_state.test Text conflict in mysql-test/t/myisam_data_pointer_size_func.test Text conflict in mysql-test/t/mysqlcheck.test Text conflict in mysql-test/t/query_cache.test Text conflict in mysql-test/t/rpl_init_slave_func.test Text conflict in mysql-test/t/status.test removed: mysql-test/suite/parts/r/partition_bit_ndb.result mysql-test/suite/parts/t/partition_bit_ndb.test mysql-test/suite/parts/t/partition_sessions.test mysql-test/suite/sys_vars/inc/tmp_table_size_basic.inc mysql-test/suite/sys_vars/r/tmp_table_size_basic_32.result mysql-test/suite/sys_vars/r/tmp_table_size_basic_64.result mysql-test/suite/sys_vars/t/tmp_table_size_basic_32.test mysql-test/suite/sys_vars/t/tmp_table_size_basic_64.test mysql-test/t/log_bin_trust_function_creators_func-master.opt mysql-test/t/rpl_init_slave_func-slave.opt added: mysql-test/include/check_events_off.inc mysql-test/include/cleanup_fake_relay_log.inc mysql-test/include/have_simple_parser.inc mysql-test/include/no_running_event_scheduler.inc mysql-test/include/no_running_events.inc mysql-test/include/running_event_scheduler.inc mysql-test/include/setup_fake_relay_log.inc mysql-test/include/wait_condition_sp.inc mysql-test/r/fulltext_plugin.result mysql-test/r/have_simple_parser.require mysql-test/r/innodb_bug38231.result mysql-test/r/innodb_bug39438.result mysql-test/r/innodb_mysql_rbk.result mysql-test/r/partition_innodb_semi_consistent.result mysql-test/r/query_cache_28249.result mysql-test/r/status2.result mysql-test/std_data/bug40482-bin.000001 mysql-test/suite/binlog/r/binlog_innodb_row.result mysql-test/suite/binlog/t/binlog_innodb_row.test mysql-test/suite/rpl/r/rpl_binlog_corruption.result mysql-test/suite/rpl/t/rpl_binlog_corruption-master.opt mysql-test/suite/rpl/t/rpl_binlog_corruption.test mysql-test/suite/sys_vars/r/tmp_table_size_basic.result mysql-test/suite/sys_vars/t/tmp_table_size_basic.test mysql-test/t/fulltext_plugin-master.opt mysql-test/t/fulltext_plugin.test mysql-test/t/innodb_bug38231.test mysql-test/t/innodb_bug39438-master.opt mysql-test/t/innodb_bug39438.test mysql-test/t/innodb_mysql_rbk-master.opt mysql-test/t/innodb_mysql_rbk.test mysql-test/t/partition_innodb_semi_consistent-master.opt mysql-test/t/partition_innodb_semi_consistent.test mysql-test/t/query_cache_28249.test mysql-test/t/status2.test renamed: mysql-test/suite/funcs_1/r/is_collation_character_set_applicability.result => mysql-test/suite/funcs_1/r/is_coll_char_set_appl.result mysql-test/suite/funcs_1/t/is_collation_character_set_applicability.test => mysql-test/suite/funcs_1/t/is_coll_char_set_appl.test modified: .bzr-mysql/default.conf CMakeLists.txt client/mysql.cc client/mysql_upgrade.c client/mysqlcheck.c client/mysqltest.cc configure.in extra/resolve_stack_dump.c extra/yassl/include/openssl/ssl.h include/config-win.h include/m_ctype.h include/my_global.h mysql-test/extra/binlog_tests/database.test mysql-test/extra/rpl_tests/rpl_auto_increment.test mysql-test/include/commit.inc mysql-test/include/have_32bit.inc mysql-test/include/have_64bit.inc mysql-test/include/index_merge1.inc mysql-test/include/linux_sys_vars.inc mysql-test/include/windows_sys_vars.inc mysql-test/lib/mtr_report.pm mysql-test/mysql-test-run.pl mysql-test/r/alter_table.result mysql-test/r/commit_1innodb.result mysql-test/r/create.result mysql-test/r/csv.result mysql-test/r/ctype_ucs.result mysql-test/r/date_formats.result mysql-test/r/events_bugs.result mysql-test/r/events_scheduling.result mysql-test/r/fulltext.result mysql-test/r/func_if.result mysql-test/r/func_in.result mysql-test/r/func_str.result mysql-test/r/func_time.result mysql-test/r/grant.result mysql-test/r/index_merge_myisam.result mysql-test/r/information_schema.result mysql-test/r/innodb-autoinc.result mysql-test/r/innodb.result mysql-test/r/innodb_mysql.result mysql-test/r/log_bin_trust_function_creators_func.result mysql-test/r/log_state.result mysql-test/r/myisampack.result mysql-test/r/mysql.result mysql-test/r/mysqlcheck.result mysql-test/r/partition_datatype.result mysql-test/r/partition_mgm.result mysql-test/r/partition_pruning.result mysql-test/r/query_cache.result mysql-test/r/read_buffer_size_basic.result mysql-test/r/read_rnd_buffer_size_basic.result mysql-test/r/rpl_init_slave_func.result mysql-test/r/select.result mysql-test/r/status.result mysql-test/r/strict.result mysql-test/r/temp_table.result mysql-test/r/type_bit.result mysql-test/r/type_date.result mysql-test/r/type_float.result mysql-test/r/warnings_engine_disabled.result mysql-test/r/xml.result mysql-test/suite/binlog/r/binlog_database.result mysql-test/suite/binlog/r/binlog_index.result mysql-test/suite/binlog/r/binlog_innodb.result mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result mysql-test/suite/binlog/t/binlog_innodb.test mysql-test/suite/funcs_1/r/is_columns_is.result mysql-test/suite/funcs_1/r/is_engines.result mysql-test/suite/funcs_1/r/storedproc.result mysql-test/suite/funcs_1/storedproc/param_check.inc mysql-test/suite/funcs_2/t/disabled.def mysql-test/suite/ndb/t/disabled.def mysql-test/suite/parts/r/partition_bit_innodb.result mysql-test/suite/parts/r/partition_bit_myisam.result mysql-test/suite/parts/r/partition_special_innodb.result mysql-test/suite/parts/t/disabled.def mysql-test/suite/parts/t/partition_special_innodb.test mysql-test/suite/parts/t/partition_value_innodb.test mysql-test/suite/parts/t/partition_value_myisam.test mysql-test/suite/parts/t/partition_value_ndb.test mysql-test/suite/rpl/r/rpl_auto_increment.result mysql-test/suite/rpl/r/rpl_packet.result mysql-test/suite/rpl/r/rpl_row_create_table.result mysql-test/suite/rpl/r/rpl_slave_skip.result mysql-test/suite/rpl/r/rpl_trigger.result mysql-test/suite/rpl/t/disabled.def mysql-test/suite/rpl/t/rpl_packet.test mysql-test/suite/rpl/t/rpl_row_create_table.test mysql-test/suite/rpl/t/rpl_slave_skip.test mysql-test/suite/rpl/t/rpl_trigger.test mysql-test/suite/rpl_ndb/t/disabled.def mysql-test/suite/sys_vars/inc/key_buffer_size_basic.inc mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result mysql-test/suite/sys_vars/r/key_buffer_size_basic_64.result mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result mysql-test/suite/sys_vars/r/sort_buffer_size_basic_64.result mysql-test/t/alter_table.test mysql-test/t/create.test mysql-test/t/csv.test mysql-test/t/ctype_ucs.test mysql-test/t/date_formats.test mysql-test/t/disabled.def mysql-test/t/events_bugs.test mysql-test/t/events_scheduling.test mysql-test/t/fulltext.test mysql-test/t/func_if.test mysql-test/t/func_in.test mysql-test/t/func_str.test mysql-test/t/func_time.test mysql-test/t/grant.test mysql-test/t/information_schema.test mysql-test/t/innodb-autoinc.test mysql-test/t/innodb.test mysql-test/t/innodb_mysql.test mysql-test/t/log_bin_trust_function_creators_func.test mysql-test/t/log_state.test mysql-test/t/myisam_data_pointer_size_func.test mysql-test/t/myisampack.test mysql-test/t/mysql.test mysql-test/t/mysqlcheck.test mysql-test/t/partition_innodb_stmt.test mysql-test/t/partition_mgm.test mysql-test/t/partition_pruning.test mysql-test/t/query_cache.test mysql-test/t/rpl_init_slave_func.test mysql-test/t/select.test mysql-test/t/status.test mysql-test/t/strict.test mysql-test/t/temp_table.test mysql-test/t/type_bit.test mysql-test/t/type_date.test mysql-test/t/type_float.test mysql-test/t/warnings_engine_disabled.test mysql-test/t/xml.test mysys/my_getopt.c mysys/my_init.c scripts/mysql_install_db.sh sql-common/my_time.c sql/field.cc sql/field.h sql/filesort.cc sql/ha_partition.cc sql/ha_partition.h sql/item.cc sql/item_cmpfunc.cc sql/item_func.h sql/item_strfunc.cc sql/item_sum.cc sql/item_timefunc.cc sql/item_timefunc.h sql/log.cc sql/log.h sql/log_event.cc sql/log_event.h sql/mysql_priv.h sql/mysqld.cc sql/opt_range.cc sql/partition_info.cc sql/repl_failsafe.cc sql/rpl_constants.h sql/set_var.cc sql/slave.cc sql/spatial.h sql/sql_acl.cc sql/sql_base.cc sql/sql_binlog.cc sql/sql_class.h sql/sql_cursor.cc sql/sql_delete.cc sql/sql_lex.cc sql/sql_lex.h sql/sql_locale.cc sql/sql_parse.cc sql/sql_partition.cc sql/sql_plugin.cc sql/sql_plugin.h sql/sql_profile.cc sql/sql_repl.cc sql/sql_select.cc sql/sql_select.h sql/sql_show.cc sql/sql_table.cc sql/sql_trigger.cc sql/sql_trigger.h sql/table.cc sql/table.h sql/unireg.cc storage/csv/ha_tina.cc storage/federated/ha_federated.cc storage/heap/ha_heap.cc storage/innobase/Makefile.am storage/innobase/btr/btr0sea.c storage/innobase/buf/buf0lru.c storage/innobase/dict/dict0dict.c storage/innobase/dict/dict0mem.c storage/innobase/handler/ha_innodb.cc storage/innobase/handler/ha_innodb.h storage/innobase/include/btr0sea.h storage/innobase/include/dict0dict.h storage/innobase/include/dict0mem.h storage/innobase/include/ha_prototypes.h storage/innobase/include/lock0lock.h storage/innobase/include/row0mysql.h storage/innobase/include/sync0sync.ic storage/innobase/include/ut0ut.h storage/innobase/lock/lock0lock.c storage/innobase/os/os0file.c storage/innobase/plug.in storage/innobase/row/row0mysql.c storage/innobase/row/row0sel.c storage/innobase/srv/srv0srv.c storage/innobase/srv/srv0start.c storage/innobase/ut/ut0ut.c storage/myisam/ft_boolean_search.c strings/ctype.c strings/xml.c tests/mysql_client_test.c win/configure.js mysql-test/suite/funcs_1/t/is_coll_char_set_appl.test ------------------------------------------------------------------------ r4165 | calvin | 2009-02-12 01:34:27 +0200 (Thu, 12 Feb 2009) | 1 line Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: minor non-functional changes. ------------------------------------------------------------------------
17 years ago
branches/zip: Merge revisions 4035:4261 from branches/5.1: ------------------------------------------------------------------------ r4065 | sunny | 2009-01-29 16:01:36 +0200 (Thu, 29 Jan 2009) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: In the last round of AUTOINC cleanup we assumed that AUTOINC is only defined for integer columns. This caused an assertion failure when we checked for the maximum value of a column type. We now calculate the max value for floating-point autoinc columns too. Fix Bug#42400 - InnoDB autoinc code can't handle floating-point columns rb://84 and Mantis issue://162 ------------------------------------------------------------------------ r4111 | sunny | 2009-02-03 22:06:52 +0200 (Tue, 03 Feb 2009) | 2 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Add the ULL suffix otherwise there is an overflow. ------------------------------------------------------------------------ r4128 | vasil | 2009-02-08 21:36:45 +0200 (Sun, 08 Feb 2009) | 18 lines Changed paths: M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2709.20.31 committer: Timothy Smith <timothy.smith@sun.com> branch nick: 51 timestamp: Fri 2008-12-19 01:28:51 +0100 message: Disable part of innodb-autoinc.test, because the MySQL server asserts when compiled --with-debug, due to bug 39828, "autoinc wraps around when offset and increment > 1". This change should be reverted when that bug is fixed (and a a few other minor changes to the test as described in comments). modified: mysql-test/r/innodb-autoinc.result mysql-test/t/innodb-autoinc.test ------------------------------------------------------------------------ r4129 | vasil | 2009-02-08 21:54:25 +0200 (Sun, 08 Feb 2009) | 310 lines Changed paths: M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Merge a change from MySQL: [looks like the changes to innodb-autoinc.test were made as part of the following huge merge, but we are merging only changes to that file] ------------------------------------------------------------ revno: 2546.47.1 committer: Luis Soares <luis.soares@sun.com> branch nick: 5.1-rpl timestamp: Fri 2009-01-23 13:22:05 +0100 message: merge: 5.1 -> 5.1-rpl conflicts: Text conflict in client/mysqltest.cc Text conflict in mysql-test/include/wait_until_connected_again.inc Text conflict in mysql-test/lib/mtr_report.pm Text conflict in mysql-test/mysql-test-run.pl Text conflict in mysql-test/r/events_bugs.result Text conflict in mysql-test/r/log_state.result Text conflict in mysql-test/r/myisam_data_pointer_size_func.result Text conflict in mysql-test/r/mysqlcheck.result Text conflict in mysql-test/r/query_cache.result Text conflict in mysql-test/r/status.result Text conflict in mysql-test/suite/binlog/r/binlog_index.result Text conflict in mysql-test/suite/binlog/r/binlog_innodb.result Text conflict in mysql-test/suite/rpl/r/rpl_packet.result Text conflict in mysql-test/suite/rpl/t/rpl_packet.test Text conflict in mysql-test/t/disabled.def Text conflict in mysql-test/t/events_bugs.test Text conflict in mysql-test/t/log_state.test Text conflict in mysql-test/t/myisam_data_pointer_size_func.test Text conflict in mysql-test/t/mysqlcheck.test Text conflict in mysql-test/t/query_cache.test Text conflict in mysql-test/t/rpl_init_slave_func.test Text conflict in mysql-test/t/status.test removed: mysql-test/suite/parts/r/partition_bit_ndb.result mysql-test/suite/parts/t/partition_bit_ndb.test mysql-test/suite/parts/t/partition_sessions.test mysql-test/suite/sys_vars/inc/tmp_table_size_basic.inc mysql-test/suite/sys_vars/r/tmp_table_size_basic_32.result mysql-test/suite/sys_vars/r/tmp_table_size_basic_64.result mysql-test/suite/sys_vars/t/tmp_table_size_basic_32.test mysql-test/suite/sys_vars/t/tmp_table_size_basic_64.test mysql-test/t/log_bin_trust_function_creators_func-master.opt mysql-test/t/rpl_init_slave_func-slave.opt added: mysql-test/include/check_events_off.inc mysql-test/include/cleanup_fake_relay_log.inc mysql-test/include/have_simple_parser.inc mysql-test/include/no_running_event_scheduler.inc mysql-test/include/no_running_events.inc mysql-test/include/running_event_scheduler.inc mysql-test/include/setup_fake_relay_log.inc mysql-test/include/wait_condition_sp.inc mysql-test/r/fulltext_plugin.result mysql-test/r/have_simple_parser.require mysql-test/r/innodb_bug38231.result mysql-test/r/innodb_bug39438.result mysql-test/r/innodb_mysql_rbk.result mysql-test/r/partition_innodb_semi_consistent.result mysql-test/r/query_cache_28249.result mysql-test/r/status2.result mysql-test/std_data/bug40482-bin.000001 mysql-test/suite/binlog/r/binlog_innodb_row.result mysql-test/suite/binlog/t/binlog_innodb_row.test mysql-test/suite/rpl/r/rpl_binlog_corruption.result mysql-test/suite/rpl/t/rpl_binlog_corruption-master.opt mysql-test/suite/rpl/t/rpl_binlog_corruption.test mysql-test/suite/sys_vars/r/tmp_table_size_basic.result mysql-test/suite/sys_vars/t/tmp_table_size_basic.test mysql-test/t/fulltext_plugin-master.opt mysql-test/t/fulltext_plugin.test mysql-test/t/innodb_bug38231.test mysql-test/t/innodb_bug39438-master.opt mysql-test/t/innodb_bug39438.test mysql-test/t/innodb_mysql_rbk-master.opt mysql-test/t/innodb_mysql_rbk.test mysql-test/t/partition_innodb_semi_consistent-master.opt mysql-test/t/partition_innodb_semi_consistent.test mysql-test/t/query_cache_28249.test mysql-test/t/status2.test renamed: mysql-test/suite/funcs_1/r/is_collation_character_set_applicability.result => mysql-test/suite/funcs_1/r/is_coll_char_set_appl.result mysql-test/suite/funcs_1/t/is_collation_character_set_applicability.test => mysql-test/suite/funcs_1/t/is_coll_char_set_appl.test modified: .bzr-mysql/default.conf CMakeLists.txt client/mysql.cc client/mysql_upgrade.c client/mysqlcheck.c client/mysqltest.cc configure.in extra/resolve_stack_dump.c extra/yassl/include/openssl/ssl.h include/config-win.h include/m_ctype.h include/my_global.h mysql-test/extra/binlog_tests/database.test mysql-test/extra/rpl_tests/rpl_auto_increment.test mysql-test/include/commit.inc mysql-test/include/have_32bit.inc mysql-test/include/have_64bit.inc mysql-test/include/index_merge1.inc mysql-test/include/linux_sys_vars.inc mysql-test/include/windows_sys_vars.inc mysql-test/lib/mtr_report.pm mysql-test/mysql-test-run.pl mysql-test/r/alter_table.result mysql-test/r/commit_1innodb.result mysql-test/r/create.result mysql-test/r/csv.result mysql-test/r/ctype_ucs.result mysql-test/r/date_formats.result mysql-test/r/events_bugs.result mysql-test/r/events_scheduling.result mysql-test/r/fulltext.result mysql-test/r/func_if.result mysql-test/r/func_in.result mysql-test/r/func_str.result mysql-test/r/func_time.result mysql-test/r/grant.result mysql-test/r/index_merge_myisam.result mysql-test/r/information_schema.result mysql-test/r/innodb-autoinc.result mysql-test/r/innodb.result mysql-test/r/innodb_mysql.result mysql-test/r/log_bin_trust_function_creators_func.result mysql-test/r/log_state.result mysql-test/r/myisampack.result mysql-test/r/mysql.result mysql-test/r/mysqlcheck.result mysql-test/r/partition_datatype.result mysql-test/r/partition_mgm.result mysql-test/r/partition_pruning.result mysql-test/r/query_cache.result mysql-test/r/read_buffer_size_basic.result mysql-test/r/read_rnd_buffer_size_basic.result mysql-test/r/rpl_init_slave_func.result mysql-test/r/select.result mysql-test/r/status.result mysql-test/r/strict.result mysql-test/r/temp_table.result mysql-test/r/type_bit.result mysql-test/r/type_date.result mysql-test/r/type_float.result mysql-test/r/warnings_engine_disabled.result mysql-test/r/xml.result mysql-test/suite/binlog/r/binlog_database.result mysql-test/suite/binlog/r/binlog_index.result mysql-test/suite/binlog/r/binlog_innodb.result mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result mysql-test/suite/binlog/t/binlog_innodb.test mysql-test/suite/funcs_1/r/is_columns_is.result mysql-test/suite/funcs_1/r/is_engines.result mysql-test/suite/funcs_1/r/storedproc.result mysql-test/suite/funcs_1/storedproc/param_check.inc mysql-test/suite/funcs_2/t/disabled.def mysql-test/suite/ndb/t/disabled.def mysql-test/suite/parts/r/partition_bit_innodb.result mysql-test/suite/parts/r/partition_bit_myisam.result mysql-test/suite/parts/r/partition_special_innodb.result mysql-test/suite/parts/t/disabled.def mysql-test/suite/parts/t/partition_special_innodb.test mysql-test/suite/parts/t/partition_value_innodb.test mysql-test/suite/parts/t/partition_value_myisam.test mysql-test/suite/parts/t/partition_value_ndb.test mysql-test/suite/rpl/r/rpl_auto_increment.result mysql-test/suite/rpl/r/rpl_packet.result mysql-test/suite/rpl/r/rpl_row_create_table.result mysql-test/suite/rpl/r/rpl_slave_skip.result mysql-test/suite/rpl/r/rpl_trigger.result mysql-test/suite/rpl/t/disabled.def mysql-test/suite/rpl/t/rpl_packet.test mysql-test/suite/rpl/t/rpl_row_create_table.test mysql-test/suite/rpl/t/rpl_slave_skip.test mysql-test/suite/rpl/t/rpl_trigger.test mysql-test/suite/rpl_ndb/t/disabled.def mysql-test/suite/sys_vars/inc/key_buffer_size_basic.inc mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result mysql-test/suite/sys_vars/r/key_buffer_size_basic_64.result mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result mysql-test/suite/sys_vars/r/sort_buffer_size_basic_64.result mysql-test/t/alter_table.test mysql-test/t/create.test mysql-test/t/csv.test mysql-test/t/ctype_ucs.test mysql-test/t/date_formats.test mysql-test/t/disabled.def mysql-test/t/events_bugs.test mysql-test/t/events_scheduling.test mysql-test/t/fulltext.test mysql-test/t/func_if.test mysql-test/t/func_in.test mysql-test/t/func_str.test mysql-test/t/func_time.test mysql-test/t/grant.test mysql-test/t/information_schema.test mysql-test/t/innodb-autoinc.test mysql-test/t/innodb.test mysql-test/t/innodb_mysql.test mysql-test/t/log_bin_trust_function_creators_func.test mysql-test/t/log_state.test mysql-test/t/myisam_data_pointer_size_func.test mysql-test/t/myisampack.test mysql-test/t/mysql.test mysql-test/t/mysqlcheck.test mysql-test/t/partition_innodb_stmt.test mysql-test/t/partition_mgm.test mysql-test/t/partition_pruning.test mysql-test/t/query_cache.test mysql-test/t/rpl_init_slave_func.test mysql-test/t/select.test mysql-test/t/status.test mysql-test/t/strict.test mysql-test/t/temp_table.test mysql-test/t/type_bit.test mysql-test/t/type_date.test mysql-test/t/type_float.test mysql-test/t/warnings_engine_disabled.test mysql-test/t/xml.test mysys/my_getopt.c mysys/my_init.c scripts/mysql_install_db.sh sql-common/my_time.c sql/field.cc sql/field.h sql/filesort.cc sql/ha_partition.cc sql/ha_partition.h sql/item.cc sql/item_cmpfunc.cc sql/item_func.h sql/item_strfunc.cc sql/item_sum.cc sql/item_timefunc.cc sql/item_timefunc.h sql/log.cc sql/log.h sql/log_event.cc sql/log_event.h sql/mysql_priv.h sql/mysqld.cc sql/opt_range.cc sql/partition_info.cc sql/repl_failsafe.cc sql/rpl_constants.h sql/set_var.cc sql/slave.cc sql/spatial.h sql/sql_acl.cc sql/sql_base.cc sql/sql_binlog.cc sql/sql_class.h sql/sql_cursor.cc sql/sql_delete.cc sql/sql_lex.cc sql/sql_lex.h sql/sql_locale.cc sql/sql_parse.cc sql/sql_partition.cc sql/sql_plugin.cc sql/sql_plugin.h sql/sql_profile.cc sql/sql_repl.cc sql/sql_select.cc sql/sql_select.h sql/sql_show.cc sql/sql_table.cc sql/sql_trigger.cc sql/sql_trigger.h sql/table.cc sql/table.h sql/unireg.cc storage/csv/ha_tina.cc storage/federated/ha_federated.cc storage/heap/ha_heap.cc storage/innobase/Makefile.am storage/innobase/btr/btr0sea.c storage/innobase/buf/buf0lru.c storage/innobase/dict/dict0dict.c storage/innobase/dict/dict0mem.c storage/innobase/handler/ha_innodb.cc storage/innobase/handler/ha_innodb.h storage/innobase/include/btr0sea.h storage/innobase/include/dict0dict.h storage/innobase/include/dict0mem.h storage/innobase/include/ha_prototypes.h storage/innobase/include/lock0lock.h storage/innobase/include/row0mysql.h storage/innobase/include/sync0sync.ic storage/innobase/include/ut0ut.h storage/innobase/lock/lock0lock.c storage/innobase/os/os0file.c storage/innobase/plug.in storage/innobase/row/row0mysql.c storage/innobase/row/row0sel.c storage/innobase/srv/srv0srv.c storage/innobase/srv/srv0start.c storage/innobase/ut/ut0ut.c storage/myisam/ft_boolean_search.c strings/ctype.c strings/xml.c tests/mysql_client_test.c win/configure.js mysql-test/suite/funcs_1/t/is_coll_char_set_appl.test ------------------------------------------------------------------------ r4165 | calvin | 2009-02-12 01:34:27 +0200 (Thu, 12 Feb 2009) | 1 line Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: minor non-functional changes. ------------------------------------------------------------------------
17 years ago
branches/zip: Merge 2437:2485 from branches/5.1: (r2478 was skipped for the obvious reason) ------------------------------------------------------------------------ r2464 | vasil | 2008-05-19 17:59:42 +0300 (Mon, 19 May 2008) | 9 lines branches/5.1: Fix Bug#36600 SHOW STATUS takes a lot of CPU in buf_get_latched_pages_number by removing the Innodb_buffer_pool_pages_latched variable from SHOW STATUS output in non-UNIV_DEBUG compilation. Approved by: Heikki ------------------------------------------------------------------------ r2466 | calvin | 2008-05-20 01:37:14 +0300 (Tue, 20 May 2008) | 12 lines branches/5.1: Fix Bug#11894 innodb_file_per_table crashes w/ Windows .sym symbolic link hack The crash was due to un-handled error 3 (path not found). In the case of file per table, change the call to os_file_handle_error_no_exit() from os_file_handle_error(). Also, checks for full path pattern during table create (Windows only), which is used in symbolic link and temp table creation. Approved by: Heikki ------------------------------------------------------------------------ r2478 | sunny | 2008-05-23 08:29:08 +0300 (Fri, 23 May 2008) | 3 lines branches/5.1: Fix for bug# 36793. This is a back port from branches/zip. This code has been tested on a big-endian machine too. ------------------------------------------------------------------------ r2480 | vasil | 2008-05-27 11:40:07 +0300 (Tue, 27 May 2008) | 11 lines branches/5.1: Fix Bug#36819 ut_usectime does not handle errors from gettimeofday by retrying gettimeofday() several times if it fails in ut_usectime(). If it fails on all calls then return error to the caller to be handled at higher level. Update the variable innodb_row_lock_time_max in SHOW STATUS output only if ut_usectime() was successful. ------------------------------------------------------------------------ r2482 | sunny | 2008-05-28 12:18:35 +0300 (Wed, 28 May 2008) | 5 lines branches/5.1: Fix for Bug#35602, "Failed to read auto-increment value from storage engine". The test for REPLACE was an error of ommission since it's classified as a simple INSERT. For REPLACE statements we don't acquire the special AUTOINC lock for AUTOINC_NEW_STYLE_LOCKING with this fix. ------------------------------------------------------------------------ r2485 | vasil | 2008-05-28 16:01:14 +0300 (Wed, 28 May 2008) | 9 lines branches/5.1: Fix Bug#36149 Read buffer overflow in srv0start.c found during "make test" Use strncmp(3) instead of memcmp(3) to avoid reading past end of the string if it is empty (*str == '\0'). This bug is _not_ a buffer overflow. Discussed with: Sunny (via IM) ------------------------------------------------------------------------
18 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge revisions 2702:2722 from branches/5.1: ------------------------------------------------------------------------ r2702 | sunny | 2008-09-30 11:41:56 +0300 (Tue, 30 Sep 2008) | 13 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Since handler::get_auto_increment() doesn't allow us to return the cause of failure we have to inform MySQL using the sql_print_warning() function to return the cause for autoinc failure. Previously we simply printed the error code, this patch prints the text string representing the following two error codes: DB_LOCK_WAIT_TIMEOUT DB_DEADLOCK. Bug#35498 Cannot get table test/table1 auto-inccounter value in ::info Approved by Marko. ------------------------------------------------------------------------ r2709 | vasil | 2008-10-01 10:13:13 +0300 (Wed, 01 Oct 2008) | 10 lines Changed paths: M /branches/5.1/include/lock0lock.h M /branches/5.1/lock/lock0lock.c A /branches/5.1/mysql-test/innodb_bug38231.result A /branches/5.1/mysql-test/innodb_bug38231.test M /branches/5.1/row/row0mysql.c branches/5.1: Fix Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK In TRUNCATE TABLE and discard tablespace: do not remove table-level S and X locks and do not assert on such locks not being wait locks. Leave such locks alone. Approved by: Heikki (rb://14) ------------------------------------------------------------------------ r2710 | vasil | 2008-10-01 14:13:58 +0300 (Wed, 01 Oct 2008) | 6 lines Changed paths: M /branches/5.1/include/sync0sync.ic branches/5.1: Silence a compilation warning in UNIV_DEBUG. Approved by: Marko (via IM) ------------------------------------------------------------------------ r2719 | vasil | 2008-10-03 18:17:28 +0300 (Fri, 03 Oct 2008) | 49 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug39438-master.opt A /branches/5.1/mysql-test/innodb_bug39438.result A /branches/5.1/mysql-test/innodb_bug39438.test branches/5.1: Fix Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch In ha_innobase::info() - do not try to get the free space for a tablespace which has been discarded with ALTER TABLE ... DISCARD TABLESPACE or if the .ibd file is missing for some other reason. ibd_file_missing and tablespace_discarded are manipulated only in row_discard_tablespace_for_mysql() and in row_import_tablespace_for_mysql() and the manipulation is protected/surrounded by row_mysql_lock_data_dictionary()/row_mysql_unlock_data_dictionary() thus we do the same in ha_innobase::info() when checking the values of those members to avoid race conditions. I have tested the code-path with UNIV_DEBUG and UNIV_SYNC_DEBUG. Looks like it is not possible to avoid mysqld printing warnings in the mysql-test case and thus this test innodb_bug39438 must be added to the list of exceptional test cases that are allowed to print warnings. For this, the following patch must be applied to the mysql source tree: --- cut --- === modified file 'mysql-test/lib/mtr_report.pl' --- mysql-test/lib/mtr_report.pl 2008-08-12 10:26:23 +0000 +++ mysql-test/lib/mtr_report.pl 2008-10-01 11:57:41 +0000 @@ -412,7 +412,10 @@ # When trying to set lower_case_table_names = 2 # on a case sensitive file system. Bug#37402. - /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ + /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ or + + # this test is expected to print warnings + ($testname eq 'main.innodb_bug39438') ) { next; # Skip these lines --- cut --- The mysql-test is currently somewhat disabled (see inside innodb_bug39438.test), after the above patch has been applied to the mysql source tree, the test can be enabled. rb://20 Reviewed by: Inaam, Calvin Approved by: Heikki ------------------------------------------------------------------------ r2720 | vasil | 2008-10-03 19:52:39 +0300 (Fri, 03 Oct 2008) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Print a warning if an attempt is made to get the free space for a table whose .ibd file is missing or the tablespace has been discarded. This is a followup to r2719. Suggested by: Inaam ------------------------------------------------------------------------ r2721 | sunny | 2008-10-04 02:08:23 +0300 (Sat, 04 Oct 2008) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: We need to send the messages to the client because handler::get_auto_increment() doesn't allow a way to return the specific error for why it failed. rb://18 ------------------------------------------------------------------------ r2722 | sunny | 2008-10-04 02:48:04 +0300 (Sat, 04 Oct 2008) | 18 lines Changed paths: M /branches/5.1/dict/dict0mem.c M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/dict0mem.h M /branches/5.1/include/row0mysql.h M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test M /branches/5.1/row/row0mysql.c branches/5.1: This bug has always existed but was masked by other errors. The fix for bug# 38839 triggered this bug. When the offset and increment are > 1 we need to calculate the next value taking into consideration the two variables. Previously we simply assumed they were 1 particularly offset was never used. MySQL does its own calculation and that's probably why it seemed to work in the past. We would return what we thought was the correct next value and then MySQL would recalculate the actual value from that and return it to the caller (e.g., handler::write_row()). Several new tests have been added that try and catch some edge cases. The tests exposed a wrap around error in MySQL next value calculation which was filed as bug#39828. The tests will need to be updated once MySQL fix that bug. One good side effect of this fix is that dict_table_t size has been reduced by 8 bytes because we have moved the autoinc_increment field to the row_prebuilt_t structure. See review-board for a detailed discussion. rb://3 ------------------------------------------------------------------------
17 years ago
branches/zip: Merge revisions 2702:2722 from branches/5.1: ------------------------------------------------------------------------ r2702 | sunny | 2008-09-30 11:41:56 +0300 (Tue, 30 Sep 2008) | 13 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Since handler::get_auto_increment() doesn't allow us to return the cause of failure we have to inform MySQL using the sql_print_warning() function to return the cause for autoinc failure. Previously we simply printed the error code, this patch prints the text string representing the following two error codes: DB_LOCK_WAIT_TIMEOUT DB_DEADLOCK. Bug#35498 Cannot get table test/table1 auto-inccounter value in ::info Approved by Marko. ------------------------------------------------------------------------ r2709 | vasil | 2008-10-01 10:13:13 +0300 (Wed, 01 Oct 2008) | 10 lines Changed paths: M /branches/5.1/include/lock0lock.h M /branches/5.1/lock/lock0lock.c A /branches/5.1/mysql-test/innodb_bug38231.result A /branches/5.1/mysql-test/innodb_bug38231.test M /branches/5.1/row/row0mysql.c branches/5.1: Fix Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK In TRUNCATE TABLE and discard tablespace: do not remove table-level S and X locks and do not assert on such locks not being wait locks. Leave such locks alone. Approved by: Heikki (rb://14) ------------------------------------------------------------------------ r2710 | vasil | 2008-10-01 14:13:58 +0300 (Wed, 01 Oct 2008) | 6 lines Changed paths: M /branches/5.1/include/sync0sync.ic branches/5.1: Silence a compilation warning in UNIV_DEBUG. Approved by: Marko (via IM) ------------------------------------------------------------------------ r2719 | vasil | 2008-10-03 18:17:28 +0300 (Fri, 03 Oct 2008) | 49 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug39438-master.opt A /branches/5.1/mysql-test/innodb_bug39438.result A /branches/5.1/mysql-test/innodb_bug39438.test branches/5.1: Fix Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch In ha_innobase::info() - do not try to get the free space for a tablespace which has been discarded with ALTER TABLE ... DISCARD TABLESPACE or if the .ibd file is missing for some other reason. ibd_file_missing and tablespace_discarded are manipulated only in row_discard_tablespace_for_mysql() and in row_import_tablespace_for_mysql() and the manipulation is protected/surrounded by row_mysql_lock_data_dictionary()/row_mysql_unlock_data_dictionary() thus we do the same in ha_innobase::info() when checking the values of those members to avoid race conditions. I have tested the code-path with UNIV_DEBUG and UNIV_SYNC_DEBUG. Looks like it is not possible to avoid mysqld printing warnings in the mysql-test case and thus this test innodb_bug39438 must be added to the list of exceptional test cases that are allowed to print warnings. For this, the following patch must be applied to the mysql source tree: --- cut --- === modified file 'mysql-test/lib/mtr_report.pl' --- mysql-test/lib/mtr_report.pl 2008-08-12 10:26:23 +0000 +++ mysql-test/lib/mtr_report.pl 2008-10-01 11:57:41 +0000 @@ -412,7 +412,10 @@ # When trying to set lower_case_table_names = 2 # on a case sensitive file system. Bug#37402. - /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ + /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ or + + # this test is expected to print warnings + ($testname eq 'main.innodb_bug39438') ) { next; # Skip these lines --- cut --- The mysql-test is currently somewhat disabled (see inside innodb_bug39438.test), after the above patch has been applied to the mysql source tree, the test can be enabled. rb://20 Reviewed by: Inaam, Calvin Approved by: Heikki ------------------------------------------------------------------------ r2720 | vasil | 2008-10-03 19:52:39 +0300 (Fri, 03 Oct 2008) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Print a warning if an attempt is made to get the free space for a table whose .ibd file is missing or the tablespace has been discarded. This is a followup to r2719. Suggested by: Inaam ------------------------------------------------------------------------ r2721 | sunny | 2008-10-04 02:08:23 +0300 (Sat, 04 Oct 2008) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: We need to send the messages to the client because handler::get_auto_increment() doesn't allow a way to return the specific error for why it failed. rb://18 ------------------------------------------------------------------------ r2722 | sunny | 2008-10-04 02:48:04 +0300 (Sat, 04 Oct 2008) | 18 lines Changed paths: M /branches/5.1/dict/dict0mem.c M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/dict0mem.h M /branches/5.1/include/row0mysql.h M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test M /branches/5.1/row/row0mysql.c branches/5.1: This bug has always existed but was masked by other errors. The fix for bug# 38839 triggered this bug. When the offset and increment are > 1 we need to calculate the next value taking into consideration the two variables. Previously we simply assumed they were 1 particularly offset was never used. MySQL does its own calculation and that's probably why it seemed to work in the past. We would return what we thought was the correct next value and then MySQL would recalculate the actual value from that and return it to the caller (e.g., handler::write_row()). Several new tests have been added that try and catch some edge cases. The tests exposed a wrap around error in MySQL next value calculation which was filed as bug#39828. The tests will need to be updated once MySQL fix that bug. One good side effect of this fix is that dict_table_t size has been reduced by 8 bytes because we have moved the autoinc_increment field to the row_prebuilt_t structure. See review-board for a detailed discussion. rb://3 ------------------------------------------------------------------------
17 years ago
branches/zip: Merge revisions 2702:2722 from branches/5.1: ------------------------------------------------------------------------ r2702 | sunny | 2008-09-30 11:41:56 +0300 (Tue, 30 Sep 2008) | 13 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Since handler::get_auto_increment() doesn't allow us to return the cause of failure we have to inform MySQL using the sql_print_warning() function to return the cause for autoinc failure. Previously we simply printed the error code, this patch prints the text string representing the following two error codes: DB_LOCK_WAIT_TIMEOUT DB_DEADLOCK. Bug#35498 Cannot get table test/table1 auto-inccounter value in ::info Approved by Marko. ------------------------------------------------------------------------ r2709 | vasil | 2008-10-01 10:13:13 +0300 (Wed, 01 Oct 2008) | 10 lines Changed paths: M /branches/5.1/include/lock0lock.h M /branches/5.1/lock/lock0lock.c A /branches/5.1/mysql-test/innodb_bug38231.result A /branches/5.1/mysql-test/innodb_bug38231.test M /branches/5.1/row/row0mysql.c branches/5.1: Fix Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK In TRUNCATE TABLE and discard tablespace: do not remove table-level S and X locks and do not assert on such locks not being wait locks. Leave such locks alone. Approved by: Heikki (rb://14) ------------------------------------------------------------------------ r2710 | vasil | 2008-10-01 14:13:58 +0300 (Wed, 01 Oct 2008) | 6 lines Changed paths: M /branches/5.1/include/sync0sync.ic branches/5.1: Silence a compilation warning in UNIV_DEBUG. Approved by: Marko (via IM) ------------------------------------------------------------------------ r2719 | vasil | 2008-10-03 18:17:28 +0300 (Fri, 03 Oct 2008) | 49 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug39438-master.opt A /branches/5.1/mysql-test/innodb_bug39438.result A /branches/5.1/mysql-test/innodb_bug39438.test branches/5.1: Fix Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch In ha_innobase::info() - do not try to get the free space for a tablespace which has been discarded with ALTER TABLE ... DISCARD TABLESPACE or if the .ibd file is missing for some other reason. ibd_file_missing and tablespace_discarded are manipulated only in row_discard_tablespace_for_mysql() and in row_import_tablespace_for_mysql() and the manipulation is protected/surrounded by row_mysql_lock_data_dictionary()/row_mysql_unlock_data_dictionary() thus we do the same in ha_innobase::info() when checking the values of those members to avoid race conditions. I have tested the code-path with UNIV_DEBUG and UNIV_SYNC_DEBUG. Looks like it is not possible to avoid mysqld printing warnings in the mysql-test case and thus this test innodb_bug39438 must be added to the list of exceptional test cases that are allowed to print warnings. For this, the following patch must be applied to the mysql source tree: --- cut --- === modified file 'mysql-test/lib/mtr_report.pl' --- mysql-test/lib/mtr_report.pl 2008-08-12 10:26:23 +0000 +++ mysql-test/lib/mtr_report.pl 2008-10-01 11:57:41 +0000 @@ -412,7 +412,10 @@ # When trying to set lower_case_table_names = 2 # on a case sensitive file system. Bug#37402. - /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ + /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ or + + # this test is expected to print warnings + ($testname eq 'main.innodb_bug39438') ) { next; # Skip these lines --- cut --- The mysql-test is currently somewhat disabled (see inside innodb_bug39438.test), after the above patch has been applied to the mysql source tree, the test can be enabled. rb://20 Reviewed by: Inaam, Calvin Approved by: Heikki ------------------------------------------------------------------------ r2720 | vasil | 2008-10-03 19:52:39 +0300 (Fri, 03 Oct 2008) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Print a warning if an attempt is made to get the free space for a table whose .ibd file is missing or the tablespace has been discarded. This is a followup to r2719. Suggested by: Inaam ------------------------------------------------------------------------ r2721 | sunny | 2008-10-04 02:08:23 +0300 (Sat, 04 Oct 2008) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: We need to send the messages to the client because handler::get_auto_increment() doesn't allow a way to return the specific error for why it failed. rb://18 ------------------------------------------------------------------------ r2722 | sunny | 2008-10-04 02:48:04 +0300 (Sat, 04 Oct 2008) | 18 lines Changed paths: M /branches/5.1/dict/dict0mem.c M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/dict0mem.h M /branches/5.1/include/row0mysql.h M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test M /branches/5.1/row/row0mysql.c branches/5.1: This bug has always existed but was masked by other errors. The fix for bug# 38839 triggered this bug. When the offset and increment are > 1 we need to calculate the next value taking into consideration the two variables. Previously we simply assumed they were 1 particularly offset was never used. MySQL does its own calculation and that's probably why it seemed to work in the past. We would return what we thought was the correct next value and then MySQL would recalculate the actual value from that and return it to the caller (e.g., handler::write_row()). Several new tests have been added that try and catch some edge cases. The tests exposed a wrap around error in MySQL next value calculation which was filed as bug#39828. The tests will need to be updated once MySQL fix that bug. One good side effect of this fix is that dict_table_t size has been reduced by 8 bytes because we have moved the autoinc_increment field to the row_prebuilt_t structure. See review-board for a detailed discussion. rb://3 ------------------------------------------------------------------------
17 years ago
branches/zip: Merge revisions 2702:2722 from branches/5.1: ------------------------------------------------------------------------ r2702 | sunny | 2008-09-30 11:41:56 +0300 (Tue, 30 Sep 2008) | 13 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Since handler::get_auto_increment() doesn't allow us to return the cause of failure we have to inform MySQL using the sql_print_warning() function to return the cause for autoinc failure. Previously we simply printed the error code, this patch prints the text string representing the following two error codes: DB_LOCK_WAIT_TIMEOUT DB_DEADLOCK. Bug#35498 Cannot get table test/table1 auto-inccounter value in ::info Approved by Marko. ------------------------------------------------------------------------ r2709 | vasil | 2008-10-01 10:13:13 +0300 (Wed, 01 Oct 2008) | 10 lines Changed paths: M /branches/5.1/include/lock0lock.h M /branches/5.1/lock/lock0lock.c A /branches/5.1/mysql-test/innodb_bug38231.result A /branches/5.1/mysql-test/innodb_bug38231.test M /branches/5.1/row/row0mysql.c branches/5.1: Fix Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK In TRUNCATE TABLE and discard tablespace: do not remove table-level S and X locks and do not assert on such locks not being wait locks. Leave such locks alone. Approved by: Heikki (rb://14) ------------------------------------------------------------------------ r2710 | vasil | 2008-10-01 14:13:58 +0300 (Wed, 01 Oct 2008) | 6 lines Changed paths: M /branches/5.1/include/sync0sync.ic branches/5.1: Silence a compilation warning in UNIV_DEBUG. Approved by: Marko (via IM) ------------------------------------------------------------------------ r2719 | vasil | 2008-10-03 18:17:28 +0300 (Fri, 03 Oct 2008) | 49 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug39438-master.opt A /branches/5.1/mysql-test/innodb_bug39438.result A /branches/5.1/mysql-test/innodb_bug39438.test branches/5.1: Fix Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch In ha_innobase::info() - do not try to get the free space for a tablespace which has been discarded with ALTER TABLE ... DISCARD TABLESPACE or if the .ibd file is missing for some other reason. ibd_file_missing and tablespace_discarded are manipulated only in row_discard_tablespace_for_mysql() and in row_import_tablespace_for_mysql() and the manipulation is protected/surrounded by row_mysql_lock_data_dictionary()/row_mysql_unlock_data_dictionary() thus we do the same in ha_innobase::info() when checking the values of those members to avoid race conditions. I have tested the code-path with UNIV_DEBUG and UNIV_SYNC_DEBUG. Looks like it is not possible to avoid mysqld printing warnings in the mysql-test case and thus this test innodb_bug39438 must be added to the list of exceptional test cases that are allowed to print warnings. For this, the following patch must be applied to the mysql source tree: --- cut --- === modified file 'mysql-test/lib/mtr_report.pl' --- mysql-test/lib/mtr_report.pl 2008-08-12 10:26:23 +0000 +++ mysql-test/lib/mtr_report.pl 2008-10-01 11:57:41 +0000 @@ -412,7 +412,10 @@ # When trying to set lower_case_table_names = 2 # on a case sensitive file system. Bug#37402. - /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ + /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ or + + # this test is expected to print warnings + ($testname eq 'main.innodb_bug39438') ) { next; # Skip these lines --- cut --- The mysql-test is currently somewhat disabled (see inside innodb_bug39438.test), after the above patch has been applied to the mysql source tree, the test can be enabled. rb://20 Reviewed by: Inaam, Calvin Approved by: Heikki ------------------------------------------------------------------------ r2720 | vasil | 2008-10-03 19:52:39 +0300 (Fri, 03 Oct 2008) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Print a warning if an attempt is made to get the free space for a table whose .ibd file is missing or the tablespace has been discarded. This is a followup to r2719. Suggested by: Inaam ------------------------------------------------------------------------ r2721 | sunny | 2008-10-04 02:08:23 +0300 (Sat, 04 Oct 2008) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: We need to send the messages to the client because handler::get_auto_increment() doesn't allow a way to return the specific error for why it failed. rb://18 ------------------------------------------------------------------------ r2722 | sunny | 2008-10-04 02:48:04 +0300 (Sat, 04 Oct 2008) | 18 lines Changed paths: M /branches/5.1/dict/dict0mem.c M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/dict0mem.h M /branches/5.1/include/row0mysql.h M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test M /branches/5.1/row/row0mysql.c branches/5.1: This bug has always existed but was masked by other errors. The fix for bug# 38839 triggered this bug. When the offset and increment are > 1 we need to calculate the next value taking into consideration the two variables. Previously we simply assumed they were 1 particularly offset was never used. MySQL does its own calculation and that's probably why it seemed to work in the past. We would return what we thought was the correct next value and then MySQL would recalculate the actual value from that and return it to the caller (e.g., handler::write_row()). Several new tests have been added that try and catch some edge cases. The tests exposed a wrap around error in MySQL next value calculation which was filed as bug#39828. The tests will need to be updated once MySQL fix that bug. One good side effect of this fix is that dict_table_t size has been reduced by 8 bytes because we have moved the autoinc_increment field to the row_prebuilt_t structure. See review-board for a detailed discussion. rb://3 ------------------------------------------------------------------------
17 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge 2384:2423 from branches/5.1: ------------------------------------------------------------------------ r2386 | vasil | 2008-03-27 07:45:02 +0200 (Thu, 27 Mar 2008) | 22 lines branches/5.1: Merge change from MySQL (this fixes the failing innodb test): ChangeSet@1.1810.3601.4, 2008-02-07 02:33:21+04:00, gshchepa@host.loc +9 -0 Fixed bug#30059. Server handles truncation for assignment of too-long values into CHAR/VARCHAR/TEXT columns in a different ways when the truncated characters are spaces: 1. CHAR(N) columns silently ignore end-space truncation; 2. TEXT columns post a truncation warning/error in the non-strict/strict mode. 3. VARCHAR columns always post a truncation note in any mode. Space truncation processing has been synchronised over CHAR/VARCHAR/TEXT columns: current behavior of VARCHAR columns has been propagated as standard. Binary-encoded string/BLOB columns are not affected. ------------------------------------------------------------------------ r2387 | vasil | 2008-03-27 08:49:05 +0200 (Thu, 27 Mar 2008) | 8 lines branches/5.1: Check whether *trx->mysql_query_str is != NULL in addition to trx->mysql_query_str. This adds more safety. This may or may not fix Bug#35226 RBR event crashes slave. ------------------------------------------------------------------------ r2388 | vasil | 2008-03-27 14:02:34 +0200 (Thu, 27 Mar 2008) | 7 lines branches/5.1: Swap the order in which mysql_thd, mysql_query_str and *mysql_query_str are checked for non-NULL. Suggested by: Marko ------------------------------------------------------------------------ r2419 | vasil | 2008-04-23 19:08:06 +0300 (Wed, 23 Apr 2008) | 9 lines branches/5.1: Change the fix for Bug#32440 to show bytes instead of kilobytes in INFORMATION_SCHEMA.TABLES.DATA_FREE. Suggested by: Domas Mituzas <domas@mysql.com> Approved by: Heikki ------------------------------------------------------------------------ r2420 | calvin | 2008-04-24 15:25:30 +0300 (Thu, 24 Apr 2008) | 4 lines branches/5.1: Fix bug#29507 TRUNCATE shows to many rows effected In InnoDB, the row count is only a rough estimate used by SQL optimization. InnoDB is now return row count 0 for TRUNCATE operation. ------------------------------------------------------------------------ r2421 | calvin | 2008-04-24 15:32:30 +0300 (Thu, 24 Apr 2008) | 6 lines branches/5.1: Fix bug#35537 - Innodb doesn't increment handler_update and handler_delete Add the calls to ha_statistic_increment() in ha_innobase::delete_row() and ha_innobase::update_row(). ------------------------------------------------------------------------ r2422 | vasil | 2008-04-24 16:00:30 +0300 (Thu, 24 Apr 2008) | 11 lines branches/5.1: Fix Bug#36169 create innodb compressed table with too large row size crashed Sometimes it is possible that row_drop_table_for_mysql(index->table_name, trx, FALSE); is invoked in row_create_index_for_mysql() when the index object is freed so copy the table name to a safe place beforehand and use the copy. Approved by: Sunny ------------------------------------------------------------------------
18 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge revisions 2702:2722 from branches/5.1: ------------------------------------------------------------------------ r2702 | sunny | 2008-09-30 11:41:56 +0300 (Tue, 30 Sep 2008) | 13 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Since handler::get_auto_increment() doesn't allow us to return the cause of failure we have to inform MySQL using the sql_print_warning() function to return the cause for autoinc failure. Previously we simply printed the error code, this patch prints the text string representing the following two error codes: DB_LOCK_WAIT_TIMEOUT DB_DEADLOCK. Bug#35498 Cannot get table test/table1 auto-inccounter value in ::info Approved by Marko. ------------------------------------------------------------------------ r2709 | vasil | 2008-10-01 10:13:13 +0300 (Wed, 01 Oct 2008) | 10 lines Changed paths: M /branches/5.1/include/lock0lock.h M /branches/5.1/lock/lock0lock.c A /branches/5.1/mysql-test/innodb_bug38231.result A /branches/5.1/mysql-test/innodb_bug38231.test M /branches/5.1/row/row0mysql.c branches/5.1: Fix Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK In TRUNCATE TABLE and discard tablespace: do not remove table-level S and X locks and do not assert on such locks not being wait locks. Leave such locks alone. Approved by: Heikki (rb://14) ------------------------------------------------------------------------ r2710 | vasil | 2008-10-01 14:13:58 +0300 (Wed, 01 Oct 2008) | 6 lines Changed paths: M /branches/5.1/include/sync0sync.ic branches/5.1: Silence a compilation warning in UNIV_DEBUG. Approved by: Marko (via IM) ------------------------------------------------------------------------ r2719 | vasil | 2008-10-03 18:17:28 +0300 (Fri, 03 Oct 2008) | 49 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug39438-master.opt A /branches/5.1/mysql-test/innodb_bug39438.result A /branches/5.1/mysql-test/innodb_bug39438.test branches/5.1: Fix Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch In ha_innobase::info() - do not try to get the free space for a tablespace which has been discarded with ALTER TABLE ... DISCARD TABLESPACE or if the .ibd file is missing for some other reason. ibd_file_missing and tablespace_discarded are manipulated only in row_discard_tablespace_for_mysql() and in row_import_tablespace_for_mysql() and the manipulation is protected/surrounded by row_mysql_lock_data_dictionary()/row_mysql_unlock_data_dictionary() thus we do the same in ha_innobase::info() when checking the values of those members to avoid race conditions. I have tested the code-path with UNIV_DEBUG and UNIV_SYNC_DEBUG. Looks like it is not possible to avoid mysqld printing warnings in the mysql-test case and thus this test innodb_bug39438 must be added to the list of exceptional test cases that are allowed to print warnings. For this, the following patch must be applied to the mysql source tree: --- cut --- === modified file 'mysql-test/lib/mtr_report.pl' --- mysql-test/lib/mtr_report.pl 2008-08-12 10:26:23 +0000 +++ mysql-test/lib/mtr_report.pl 2008-10-01 11:57:41 +0000 @@ -412,7 +412,10 @@ # When trying to set lower_case_table_names = 2 # on a case sensitive file system. Bug#37402. - /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ + /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ or + + # this test is expected to print warnings + ($testname eq 'main.innodb_bug39438') ) { next; # Skip these lines --- cut --- The mysql-test is currently somewhat disabled (see inside innodb_bug39438.test), after the above patch has been applied to the mysql source tree, the test can be enabled. rb://20 Reviewed by: Inaam, Calvin Approved by: Heikki ------------------------------------------------------------------------ r2720 | vasil | 2008-10-03 19:52:39 +0300 (Fri, 03 Oct 2008) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Print a warning if an attempt is made to get the free space for a table whose .ibd file is missing or the tablespace has been discarded. This is a followup to r2719. Suggested by: Inaam ------------------------------------------------------------------------ r2721 | sunny | 2008-10-04 02:08:23 +0300 (Sat, 04 Oct 2008) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: We need to send the messages to the client because handler::get_auto_increment() doesn't allow a way to return the specific error for why it failed. rb://18 ------------------------------------------------------------------------ r2722 | sunny | 2008-10-04 02:48:04 +0300 (Sat, 04 Oct 2008) | 18 lines Changed paths: M /branches/5.1/dict/dict0mem.c M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/dict0mem.h M /branches/5.1/include/row0mysql.h M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test M /branches/5.1/row/row0mysql.c branches/5.1: This bug has always existed but was masked by other errors. The fix for bug# 38839 triggered this bug. When the offset and increment are > 1 we need to calculate the next value taking into consideration the two variables. Previously we simply assumed they were 1 particularly offset was never used. MySQL does its own calculation and that's probably why it seemed to work in the past. We would return what we thought was the correct next value and then MySQL would recalculate the actual value from that and return it to the caller (e.g., handler::write_row()). Several new tests have been added that try and catch some edge cases. The tests exposed a wrap around error in MySQL next value calculation which was filed as bug#39828. The tests will need to be updated once MySQL fix that bug. One good side effect of this fix is that dict_table_t size has been reduced by 8 bytes because we have moved the autoinc_increment field to the row_prebuilt_t structure. See review-board for a detailed discussion. rb://3 ------------------------------------------------------------------------
17 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge 2384:2423 from branches/5.1: ------------------------------------------------------------------------ r2386 | vasil | 2008-03-27 07:45:02 +0200 (Thu, 27 Mar 2008) | 22 lines branches/5.1: Merge change from MySQL (this fixes the failing innodb test): ChangeSet@1.1810.3601.4, 2008-02-07 02:33:21+04:00, gshchepa@host.loc +9 -0 Fixed bug#30059. Server handles truncation for assignment of too-long values into CHAR/VARCHAR/TEXT columns in a different ways when the truncated characters are spaces: 1. CHAR(N) columns silently ignore end-space truncation; 2. TEXT columns post a truncation warning/error in the non-strict/strict mode. 3. VARCHAR columns always post a truncation note in any mode. Space truncation processing has been synchronised over CHAR/VARCHAR/TEXT columns: current behavior of VARCHAR columns has been propagated as standard. Binary-encoded string/BLOB columns are not affected. ------------------------------------------------------------------------ r2387 | vasil | 2008-03-27 08:49:05 +0200 (Thu, 27 Mar 2008) | 8 lines branches/5.1: Check whether *trx->mysql_query_str is != NULL in addition to trx->mysql_query_str. This adds more safety. This may or may not fix Bug#35226 RBR event crashes slave. ------------------------------------------------------------------------ r2388 | vasil | 2008-03-27 14:02:34 +0200 (Thu, 27 Mar 2008) | 7 lines branches/5.1: Swap the order in which mysql_thd, mysql_query_str and *mysql_query_str are checked for non-NULL. Suggested by: Marko ------------------------------------------------------------------------ r2419 | vasil | 2008-04-23 19:08:06 +0300 (Wed, 23 Apr 2008) | 9 lines branches/5.1: Change the fix for Bug#32440 to show bytes instead of kilobytes in INFORMATION_SCHEMA.TABLES.DATA_FREE. Suggested by: Domas Mituzas <domas@mysql.com> Approved by: Heikki ------------------------------------------------------------------------ r2420 | calvin | 2008-04-24 15:25:30 +0300 (Thu, 24 Apr 2008) | 4 lines branches/5.1: Fix bug#29507 TRUNCATE shows to many rows effected In InnoDB, the row count is only a rough estimate used by SQL optimization. InnoDB is now return row count 0 for TRUNCATE operation. ------------------------------------------------------------------------ r2421 | calvin | 2008-04-24 15:32:30 +0300 (Thu, 24 Apr 2008) | 6 lines branches/5.1: Fix bug#35537 - Innodb doesn't increment handler_update and handler_delete Add the calls to ha_statistic_increment() in ha_innobase::delete_row() and ha_innobase::update_row(). ------------------------------------------------------------------------ r2422 | vasil | 2008-04-24 16:00:30 +0300 (Thu, 24 Apr 2008) | 11 lines branches/5.1: Fix Bug#36169 create innodb compressed table with too large row size crashed Sometimes it is possible that row_drop_table_for_mysql(index->table_name, trx, FALSE); is invoked in row_create_index_for_mysql() when the index object is freed so copy the table name to a safe place beforehand and use the copy. Approved by: Sunny ------------------------------------------------------------------------
18 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge revisions 5622:5912 from branches/5.1, except r5700 (changes to CMakeLists.txt) ------------------------------------------------------------------------ r5622 | vasil | 2009-08-03 15:27:00 +0300 (Mon, 03 Aug 2009) | 20 lines Changed paths: M /branches/5.1/Makefile.am branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2988 committer: Satya B <satya.bn@sun.com> branch nick: mysql-5.1-bugteam timestamp: Wed 2009-07-01 11:06:05 +0530 message: Fix build failure after applying Innodb snapshot 5.1-ss5282 After applying Innodb snapshot 5.1-ss5282, build was broken because of missing header file. Adding the header file to Makefile.am after informing the innodb developers. modified: storage/innobase/Makefile.am ------------------------------------------------------------------------ r5740 | jyang | 2009-09-03 06:33:47 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Sunny Bains. ------------------------------------------------------------------------ r5741 | jyang | 2009-09-03 07:16:01 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5757 | jyang | 2009-09-04 04:26:13 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h D /branches/5.1/mysql-test/innodb_bug46000.result D /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Revert change in 5740. Making the fix in a subsequent check in. ------------------------------------------------------------------------ r5760 | jyang | 2009-09-04 07:07:34 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc D /branches/5.1/mysql-test/innodb_bug44369.result D /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: This is to revert change 5741. A return status for create_table_def() needs to be fixed. ------------------------------------------------------------------------ r5797 | calvin | 2009-09-09 18:26:29 +0300 (Wed, 09 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: merge change from 5.1.38 HA_ERR_TOO_MANY_CONCURRENT_TRXS is added in 5.1.38. ------------------------------------------------------------------------ r5799 | calvin | 2009-09-09 20:47:31 +0300 (Wed, 09 Sep 2009) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: fix bug#46256 Allow tables to be dropped even if the collation is not found, but issue a warning. Could not find an easy way to add mysql-test since it requires changes to charsets and restarting the server. Tests were executed manually. Approved by: Heikki (on IM) ------------------------------------------------------------------------ r5805 | vasil | 2009-09-10 08:41:48 +0300 (Thu, 10 Sep 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix a compilation warning caused by c5799: handler/ha_innodb.cc: In function 'void innobase_get_cset_width(ulint, ulint*, ulint*)': handler/ha_innodb.cc:830: warning: format '%d' expects type 'int', but argument 2 has type 'ulint' ------------------------------------------------------------------------ r5834 | jyang | 2009-09-11 00:43:05 +0300 (Fri, 11 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5895 | jyang | 2009-09-15 03:39:21 +0300 (Tue, 15 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Marko Makela. ------------------------------------------------------------------------
16 years ago
branches/zip: Merge revisions 5622:5912 from branches/5.1, except r5700 (changes to CMakeLists.txt) ------------------------------------------------------------------------ r5622 | vasil | 2009-08-03 15:27:00 +0300 (Mon, 03 Aug 2009) | 20 lines Changed paths: M /branches/5.1/Makefile.am branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2988 committer: Satya B <satya.bn@sun.com> branch nick: mysql-5.1-bugteam timestamp: Wed 2009-07-01 11:06:05 +0530 message: Fix build failure after applying Innodb snapshot 5.1-ss5282 After applying Innodb snapshot 5.1-ss5282, build was broken because of missing header file. Adding the header file to Makefile.am after informing the innodb developers. modified: storage/innobase/Makefile.am ------------------------------------------------------------------------ r5740 | jyang | 2009-09-03 06:33:47 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Sunny Bains. ------------------------------------------------------------------------ r5741 | jyang | 2009-09-03 07:16:01 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5757 | jyang | 2009-09-04 04:26:13 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h D /branches/5.1/mysql-test/innodb_bug46000.result D /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Revert change in 5740. Making the fix in a subsequent check in. ------------------------------------------------------------------------ r5760 | jyang | 2009-09-04 07:07:34 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc D /branches/5.1/mysql-test/innodb_bug44369.result D /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: This is to revert change 5741. A return status for create_table_def() needs to be fixed. ------------------------------------------------------------------------ r5797 | calvin | 2009-09-09 18:26:29 +0300 (Wed, 09 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: merge change from 5.1.38 HA_ERR_TOO_MANY_CONCURRENT_TRXS is added in 5.1.38. ------------------------------------------------------------------------ r5799 | calvin | 2009-09-09 20:47:31 +0300 (Wed, 09 Sep 2009) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: fix bug#46256 Allow tables to be dropped even if the collation is not found, but issue a warning. Could not find an easy way to add mysql-test since it requires changes to charsets and restarting the server. Tests were executed manually. Approved by: Heikki (on IM) ------------------------------------------------------------------------ r5805 | vasil | 2009-09-10 08:41:48 +0300 (Thu, 10 Sep 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix a compilation warning caused by c5799: handler/ha_innodb.cc: In function 'void innobase_get_cset_width(ulint, ulint*, ulint*)': handler/ha_innodb.cc:830: warning: format '%d' expects type 'int', but argument 2 has type 'ulint' ------------------------------------------------------------------------ r5834 | jyang | 2009-09-11 00:43:05 +0300 (Fri, 11 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5895 | jyang | 2009-09-15 03:39:21 +0300 (Tue, 15 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Marko Makela. ------------------------------------------------------------------------
16 years ago
20 years ago
branches/zip: Merge revisions 5622:5912 from branches/5.1, except r5700 (changes to CMakeLists.txt) ------------------------------------------------------------------------ r5622 | vasil | 2009-08-03 15:27:00 +0300 (Mon, 03 Aug 2009) | 20 lines Changed paths: M /branches/5.1/Makefile.am branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2988 committer: Satya B <satya.bn@sun.com> branch nick: mysql-5.1-bugteam timestamp: Wed 2009-07-01 11:06:05 +0530 message: Fix build failure after applying Innodb snapshot 5.1-ss5282 After applying Innodb snapshot 5.1-ss5282, build was broken because of missing header file. Adding the header file to Makefile.am after informing the innodb developers. modified: storage/innobase/Makefile.am ------------------------------------------------------------------------ r5740 | jyang | 2009-09-03 06:33:47 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Sunny Bains. ------------------------------------------------------------------------ r5741 | jyang | 2009-09-03 07:16:01 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5757 | jyang | 2009-09-04 04:26:13 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h D /branches/5.1/mysql-test/innodb_bug46000.result D /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Revert change in 5740. Making the fix in a subsequent check in. ------------------------------------------------------------------------ r5760 | jyang | 2009-09-04 07:07:34 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc D /branches/5.1/mysql-test/innodb_bug44369.result D /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: This is to revert change 5741. A return status for create_table_def() needs to be fixed. ------------------------------------------------------------------------ r5797 | calvin | 2009-09-09 18:26:29 +0300 (Wed, 09 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: merge change from 5.1.38 HA_ERR_TOO_MANY_CONCURRENT_TRXS is added in 5.1.38. ------------------------------------------------------------------------ r5799 | calvin | 2009-09-09 20:47:31 +0300 (Wed, 09 Sep 2009) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: fix bug#46256 Allow tables to be dropped even if the collation is not found, but issue a warning. Could not find an easy way to add mysql-test since it requires changes to charsets and restarting the server. Tests were executed manually. Approved by: Heikki (on IM) ------------------------------------------------------------------------ r5805 | vasil | 2009-09-10 08:41:48 +0300 (Thu, 10 Sep 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix a compilation warning caused by c5799: handler/ha_innodb.cc: In function 'void innobase_get_cset_width(ulint, ulint*, ulint*)': handler/ha_innodb.cc:830: warning: format '%d' expects type 'int', but argument 2 has type 'ulint' ------------------------------------------------------------------------ r5834 | jyang | 2009-09-11 00:43:05 +0300 (Fri, 11 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5895 | jyang | 2009-09-15 03:39:21 +0300 (Tue, 15 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Marko Makela. ------------------------------------------------------------------------
16 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge revisions 5622:5912 from branches/5.1, except r5700 (changes to CMakeLists.txt) ------------------------------------------------------------------------ r5622 | vasil | 2009-08-03 15:27:00 +0300 (Mon, 03 Aug 2009) | 20 lines Changed paths: M /branches/5.1/Makefile.am branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2988 committer: Satya B <satya.bn@sun.com> branch nick: mysql-5.1-bugteam timestamp: Wed 2009-07-01 11:06:05 +0530 message: Fix build failure after applying Innodb snapshot 5.1-ss5282 After applying Innodb snapshot 5.1-ss5282, build was broken because of missing header file. Adding the header file to Makefile.am after informing the innodb developers. modified: storage/innobase/Makefile.am ------------------------------------------------------------------------ r5740 | jyang | 2009-09-03 06:33:47 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Sunny Bains. ------------------------------------------------------------------------ r5741 | jyang | 2009-09-03 07:16:01 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5757 | jyang | 2009-09-04 04:26:13 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h D /branches/5.1/mysql-test/innodb_bug46000.result D /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Revert change in 5740. Making the fix in a subsequent check in. ------------------------------------------------------------------------ r5760 | jyang | 2009-09-04 07:07:34 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc D /branches/5.1/mysql-test/innodb_bug44369.result D /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: This is to revert change 5741. A return status for create_table_def() needs to be fixed. ------------------------------------------------------------------------ r5797 | calvin | 2009-09-09 18:26:29 +0300 (Wed, 09 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: merge change from 5.1.38 HA_ERR_TOO_MANY_CONCURRENT_TRXS is added in 5.1.38. ------------------------------------------------------------------------ r5799 | calvin | 2009-09-09 20:47:31 +0300 (Wed, 09 Sep 2009) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: fix bug#46256 Allow tables to be dropped even if the collation is not found, but issue a warning. Could not find an easy way to add mysql-test since it requires changes to charsets and restarting the server. Tests were executed manually. Approved by: Heikki (on IM) ------------------------------------------------------------------------ r5805 | vasil | 2009-09-10 08:41:48 +0300 (Thu, 10 Sep 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix a compilation warning caused by c5799: handler/ha_innodb.cc: In function 'void innobase_get_cset_width(ulint, ulint*, ulint*)': handler/ha_innodb.cc:830: warning: format '%d' expects type 'int', but argument 2 has type 'ulint' ------------------------------------------------------------------------ r5834 | jyang | 2009-09-11 00:43:05 +0300 (Fri, 11 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5895 | jyang | 2009-09-15 03:39:21 +0300 (Tue, 15 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Marko Makela. ------------------------------------------------------------------------
16 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge revisions 5622:5912 from branches/5.1, except r5700 (changes to CMakeLists.txt) ------------------------------------------------------------------------ r5622 | vasil | 2009-08-03 15:27:00 +0300 (Mon, 03 Aug 2009) | 20 lines Changed paths: M /branches/5.1/Makefile.am branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2988 committer: Satya B <satya.bn@sun.com> branch nick: mysql-5.1-bugteam timestamp: Wed 2009-07-01 11:06:05 +0530 message: Fix build failure after applying Innodb snapshot 5.1-ss5282 After applying Innodb snapshot 5.1-ss5282, build was broken because of missing header file. Adding the header file to Makefile.am after informing the innodb developers. modified: storage/innobase/Makefile.am ------------------------------------------------------------------------ r5740 | jyang | 2009-09-03 06:33:47 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Sunny Bains. ------------------------------------------------------------------------ r5741 | jyang | 2009-09-03 07:16:01 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5757 | jyang | 2009-09-04 04:26:13 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h D /branches/5.1/mysql-test/innodb_bug46000.result D /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Revert change in 5740. Making the fix in a subsequent check in. ------------------------------------------------------------------------ r5760 | jyang | 2009-09-04 07:07:34 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc D /branches/5.1/mysql-test/innodb_bug44369.result D /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: This is to revert change 5741. A return status for create_table_def() needs to be fixed. ------------------------------------------------------------------------ r5797 | calvin | 2009-09-09 18:26:29 +0300 (Wed, 09 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: merge change from 5.1.38 HA_ERR_TOO_MANY_CONCURRENT_TRXS is added in 5.1.38. ------------------------------------------------------------------------ r5799 | calvin | 2009-09-09 20:47:31 +0300 (Wed, 09 Sep 2009) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: fix bug#46256 Allow tables to be dropped even if the collation is not found, but issue a warning. Could not find an easy way to add mysql-test since it requires changes to charsets and restarting the server. Tests were executed manually. Approved by: Heikki (on IM) ------------------------------------------------------------------------ r5805 | vasil | 2009-09-10 08:41:48 +0300 (Thu, 10 Sep 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix a compilation warning caused by c5799: handler/ha_innodb.cc: In function 'void innobase_get_cset_width(ulint, ulint*, ulint*)': handler/ha_innodb.cc:830: warning: format '%d' expects type 'int', but argument 2 has type 'ulint' ------------------------------------------------------------------------ r5834 | jyang | 2009-09-11 00:43:05 +0300 (Fri, 11 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5895 | jyang | 2009-09-15 03:39:21 +0300 (Tue, 15 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Marko Makela. ------------------------------------------------------------------------
16 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC. Throw warnings, not errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE, so that any table dump can be loaded. As of this change, InnoDB supports the following table formats: ROW_FORMAT=REDUNDANT the only format before MySQL/InnoDB 5.0.3 ROW_FORMAT=COMPACT the new default format of MySQL/InnoDB 5.0.3 ROW_FORMAT=DYNAMIC uncompressed, no prefix in the clustered index record for BLOBs ROW_FORMAT=COMPRESSED like ROW_FORMAT=DYNAMIC, but zlib compressed B-trees and BLOBs; the compressed page size is specified by KEY_BLOCK_SIZE in kilobytes (1, 2, 4, 8, or 16; default 8) KEY_BLOCK_SIZE=1, 2, 4, 8, or 16: implies ROW_FORMAT=COMPRESSED; ignored if ROW_FORMAT is not COMPRESSED KEY_BLOCK_SIZE=anything else: ignored The InnoDB row format is displayed in the 4th column (Row_format) of the output of SHOW TABLE STATUS. The Create_options column may show ROW_FORMAT= and KEY_BLOCK_SIZE=, but they do not necessarily have anything to do with InnoDB. The table format can also be queried like this: SELECT table_schema, table_name, row_format FROM information_schema.tables WHERE engine='innodb' and row_format in ('Compressed','Dynamic'); When Row_format='Compressed', KEY_BLOCK_SIZE should usually correspond to the compressed page size. But the .frm file could be manipulated to show any KEY_BLOCK_SIZE. For some reason, INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS does not include KEY_BLOCK_SIZE. It does include row_format (spelled in lowercase). This looks like a MySQL bug, because the table INFORMATION_SCHEMA.TABLES probably tries to replace SHOW TABLE STATUS. I reported this as Bug #35275 <http://bugs.mysql.com/35275>. ha_innobase::get_row_type(): Add ROW_TYPE_COMPRESSED, ROW_TYPE_DYNAMIC. ha_innobase::create(): Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC. Do not throw errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE, but issue warnings instead. ha_innobase::check_if_incompatible_data(): Return COMPATIBLE_DATA_NO if KEY_BLOCK_SIZE has been specified. innodb.result: Adjust the result for the warning issued for ROW_FORMAT=FIXED. innodb-zip.test: Add tests. Query INFORMATION_SCHEMA.TABLES for ROW_FORMAT.
18 years ago
branches/zip: Implement the configuration parameter and settable global variable innodb_file_format. Implement file format version stamping of *.ibd files and SYS_TABLES.TYPE. This change breaks introduces an incompatible change for for compressed tables. We can do this, as we have not released yet. innodb-zip.test: Add tests for stricter KEY_BLOCK_SIZE and ROW_FORMAT checks. DICT_TF_COMPRESSED_MASK, DICT_TF_COMPRESSED_SHIFT: Replace with DICT_TF_ZSSIZE_MASK, DICT_TF_ZSSIZE_SHIFT. DICT_TF_FORMAT_MASK, DICT_TF_FORMAT_SHIFT, DICT_TF_FORMAT_51, DICT_TF_FORMAT_ZIP: File format version, stored in table->flags, in the .ibd file header, and in SYS_TABLES.TYPE. dict_create_sys_tables_tuple(): Write the table flags to SYS_TABLES.TYPE if the format is at least DICT_TF_FORMAT_ZIP. For old formats (DICT_TF_FORMAT_51), write DICT_TABLE_ORDINARY as the table type. DB_TABLE_ZIP_NO_IBD: Remove the error code. The error handling is done in ha_innodb.cc; as a failsafe measure, dict_build_table_def_step() will silently clear the compression and format flags instead of returning this error. dict_mem_table_create(): Assert that no extra bits are set in the flags. dict_sys_tables_get_zip_size(): Rename to dict_sys_tables_get_flags(). Check all flag bits, and return ULINT_UNDEFINED if the combination is unsupported. dict_boot(): Document the SYS_TABLES columns N_COLS and TYPE. dict_table_get_format(), dict_table_set_format(), dict_table_flags_to_zip_size(): New accessors to table->flags. dtuple_convert_big_rec(): Introduce the auxiliary variables local_len, local_prefix_len. Store a 768-byte prefix locally if the file format is less than DICT_TF_FORMAT_ZIP. dtuple_convert_back_big_rec(): Restore the columns. srv_file_format: New variable: innodb_file_format. fil_create_new_single_table_tablespace(): Replace the parameter zip_size with table->flags. fil_open_single_table_tablespace(): Replace the parameter zip_size_in_k with table->flags. Check the flags. fil_space_struct, fil_space_create(), fil_op_write_log(): Replace zip_size with flags. fil_node_open_file(): Note a TODO item for InnoDB Hot Backup. Check that the tablespace flags match. fil_space_get_zip_size(): Rename to fil_space_get_flags(). Add a wrapper for fil_space_get_zip_size(). fsp_header_get_flags(): New function. fsp_header_init_fields(): Replace zip_size with flags. FSP_SPACE_FLAGS: New name for the tablespace flags. This field used to be called FSP_PAGE_ZIP_SIZE, or FSP_LOWEST_NO_WRITE. It has always been written as 0 in MySQL/InnoDB versions 4.1 to 5.1. MLOG_ZIP_FILE_CREATE: Rename to MLOG_FILE_CREATE2. Add a 32-bit parameter for the tablespace flags. ha_innobase::create(): Check the table attributes ROW_FORMAT and KEY_BLOCK_SIZE. Issue errors if they are inappropriate, or warnings if the inherited attributes (in ALTER TABLE) will be ignored. PAGE_ZIP_MIN_SIZE_SHIFT: New constant: the 2-logarithm of PAGE_ZIP_MIN_SIZE.
18 years ago
20 years ago
20 years ago
branches/zip: Merge 2437:2485 from branches/5.1: (r2478 was skipped for the obvious reason) ------------------------------------------------------------------------ r2464 | vasil | 2008-05-19 17:59:42 +0300 (Mon, 19 May 2008) | 9 lines branches/5.1: Fix Bug#36600 SHOW STATUS takes a lot of CPU in buf_get_latched_pages_number by removing the Innodb_buffer_pool_pages_latched variable from SHOW STATUS output in non-UNIV_DEBUG compilation. Approved by: Heikki ------------------------------------------------------------------------ r2466 | calvin | 2008-05-20 01:37:14 +0300 (Tue, 20 May 2008) | 12 lines branches/5.1: Fix Bug#11894 innodb_file_per_table crashes w/ Windows .sym symbolic link hack The crash was due to un-handled error 3 (path not found). In the case of file per table, change the call to os_file_handle_error_no_exit() from os_file_handle_error(). Also, checks for full path pattern during table create (Windows only), which is used in symbolic link and temp table creation. Approved by: Heikki ------------------------------------------------------------------------ r2478 | sunny | 2008-05-23 08:29:08 +0300 (Fri, 23 May 2008) | 3 lines branches/5.1: Fix for bug# 36793. This is a back port from branches/zip. This code has been tested on a big-endian machine too. ------------------------------------------------------------------------ r2480 | vasil | 2008-05-27 11:40:07 +0300 (Tue, 27 May 2008) | 11 lines branches/5.1: Fix Bug#36819 ut_usectime does not handle errors from gettimeofday by retrying gettimeofday() several times if it fails in ut_usectime(). If it fails on all calls then return error to the caller to be handled at higher level. Update the variable innodb_row_lock_time_max in SHOW STATUS output only if ut_usectime() was successful. ------------------------------------------------------------------------ r2482 | sunny | 2008-05-28 12:18:35 +0300 (Wed, 28 May 2008) | 5 lines branches/5.1: Fix for Bug#35602, "Failed to read auto-increment value from storage engine". The test for REPLACE was an error of ommission since it's classified as a simple INSERT. For REPLACE statements we don't acquire the special AUTOINC lock for AUTOINC_NEW_STYLE_LOCKING with this fix. ------------------------------------------------------------------------ r2485 | vasil | 2008-05-28 16:01:14 +0300 (Wed, 28 May 2008) | 9 lines branches/5.1: Fix Bug#36149 Read buffer overflow in srv0start.c found during "make test" Use strncmp(3) instead of memcmp(3) to avoid reading past end of the string if it is empty (*str == '\0'). This bug is _not_ a buffer overflow. Discussed with: Sunny (via IM) ------------------------------------------------------------------------
18 years ago
branches/zip: Merge r5912:6112 from branches/5.1: (after this merge the innodb-autoinc test starts to fail, but I commit anyway because it would be easier to investigate the failure this way) ------------------------------------------------------------------------ r5952 | calvin | 2009-09-22 19:45:07 +0300 (Tue, 22 Sep 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: fix bug#42383: Can't create table 'test.bug39438' For embedded server, MySQL may pass in full path, which is currently disallowed. It is needed to relax the condition by accepting full paths in the embedded case. Approved by: Heikki (on IM) ------------------------------------------------------------------------ r6032 | vasil | 2009-10-01 15:55:49 +0300 (Thu, 01 Oct 2009) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix Bug#38996 Race condition in ANALYZE TABLE by serializing ANALYZE TABLE inside InnoDB. Approved by: Heikki (rb://175) ------------------------------------------------------------------------ r6045 | jyang | 2009-10-08 02:27:08 +0300 (Thu, 08 Oct 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug47777.result A /branches/5.1/mysql-test/innodb_bug47777.test branches/5.1: Fix bug #47777. Treat the Geometry data same as Binary BLOB in ha_innobase::store_key_val_for_row(), since the Geometry data is stored as Binary BLOB in Innodb. Review: rb://180 approved by Marko Makela. ------------------------------------------------------------------------ r6051 | sunny | 2009-10-12 07:05:00 +0300 (Mon, 12 Oct 2009) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Ignore negative values supplied by the user when calculating the next value to store in dict_table_t. Setting autoincrement columns top negative values is undefined behavior and this change should bring the behavior of InnoDB closer to what users expect. Added several tests to check. rb://162 ------------------------------------------------------------------------ r6052 | sunny | 2009-10-12 07:09:56 +0300 (Mon, 12 Oct 2009) | 4 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Reset the statement level autoinc counter on ROLLBACK. Fix the test results too. rb://164 ------------------------------------------------------------------------ r6053 | sunny | 2009-10-12 07:37:49 +0300 (Mon, 12 Oct 2009) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Copy the maximum AUTOINC value from the old table to the new table when MySQL does a CREATE INDEX ON T. This is required because MySQL does a table copy, rename and drops the old table. Fix Bug#47125: auto_increment start value is ignored if an index is created and engine=innodb rb://168 ------------------------------------------------------------------------ r6076 | vasil | 2009-10-14 19:30:12 +0300 (Wed, 14 Oct 2009) | 4 lines Changed paths: M /branches/5.1/row/row0mysql.c branches/5.1: Fix typo. ------------------------------------------------------------------------
16 years ago
branches/zip: Merge 2437:2485 from branches/5.1: (r2478 was skipped for the obvious reason) ------------------------------------------------------------------------ r2464 | vasil | 2008-05-19 17:59:42 +0300 (Mon, 19 May 2008) | 9 lines branches/5.1: Fix Bug#36600 SHOW STATUS takes a lot of CPU in buf_get_latched_pages_number by removing the Innodb_buffer_pool_pages_latched variable from SHOW STATUS output in non-UNIV_DEBUG compilation. Approved by: Heikki ------------------------------------------------------------------------ r2466 | calvin | 2008-05-20 01:37:14 +0300 (Tue, 20 May 2008) | 12 lines branches/5.1: Fix Bug#11894 innodb_file_per_table crashes w/ Windows .sym symbolic link hack The crash was due to un-handled error 3 (path not found). In the case of file per table, change the call to os_file_handle_error_no_exit() from os_file_handle_error(). Also, checks for full path pattern during table create (Windows only), which is used in symbolic link and temp table creation. Approved by: Heikki ------------------------------------------------------------------------ r2478 | sunny | 2008-05-23 08:29:08 +0300 (Fri, 23 May 2008) | 3 lines branches/5.1: Fix for bug# 36793. This is a back port from branches/zip. This code has been tested on a big-endian machine too. ------------------------------------------------------------------------ r2480 | vasil | 2008-05-27 11:40:07 +0300 (Tue, 27 May 2008) | 11 lines branches/5.1: Fix Bug#36819 ut_usectime does not handle errors from gettimeofday by retrying gettimeofday() several times if it fails in ut_usectime(). If it fails on all calls then return error to the caller to be handled at higher level. Update the variable innodb_row_lock_time_max in SHOW STATUS output only if ut_usectime() was successful. ------------------------------------------------------------------------ r2482 | sunny | 2008-05-28 12:18:35 +0300 (Wed, 28 May 2008) | 5 lines branches/5.1: Fix for Bug#35602, "Failed to read auto-increment value from storage engine". The test for REPLACE was an error of ommission since it's classified as a simple INSERT. For REPLACE statements we don't acquire the special AUTOINC lock for AUTOINC_NEW_STYLE_LOCKING with this fix. ------------------------------------------------------------------------ r2485 | vasil | 2008-05-28 16:01:14 +0300 (Wed, 28 May 2008) | 9 lines branches/5.1: Fix Bug#36149 Read buffer overflow in srv0start.c found during "make test" Use strncmp(3) instead of memcmp(3) to avoid reading past end of the string if it is empty (*str == '\0'). This bug is _not_ a buffer overflow. Discussed with: Sunny (via IM) ------------------------------------------------------------------------
18 years ago
branches/zip: Merge r5912:6112 from branches/5.1: (after this merge the innodb-autoinc test starts to fail, but I commit anyway because it would be easier to investigate the failure this way) ------------------------------------------------------------------------ r5952 | calvin | 2009-09-22 19:45:07 +0300 (Tue, 22 Sep 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: fix bug#42383: Can't create table 'test.bug39438' For embedded server, MySQL may pass in full path, which is currently disallowed. It is needed to relax the condition by accepting full paths in the embedded case. Approved by: Heikki (on IM) ------------------------------------------------------------------------ r6032 | vasil | 2009-10-01 15:55:49 +0300 (Thu, 01 Oct 2009) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix Bug#38996 Race condition in ANALYZE TABLE by serializing ANALYZE TABLE inside InnoDB. Approved by: Heikki (rb://175) ------------------------------------------------------------------------ r6045 | jyang | 2009-10-08 02:27:08 +0300 (Thu, 08 Oct 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug47777.result A /branches/5.1/mysql-test/innodb_bug47777.test branches/5.1: Fix bug #47777. Treat the Geometry data same as Binary BLOB in ha_innobase::store_key_val_for_row(), since the Geometry data is stored as Binary BLOB in Innodb. Review: rb://180 approved by Marko Makela. ------------------------------------------------------------------------ r6051 | sunny | 2009-10-12 07:05:00 +0300 (Mon, 12 Oct 2009) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Ignore negative values supplied by the user when calculating the next value to store in dict_table_t. Setting autoincrement columns top negative values is undefined behavior and this change should bring the behavior of InnoDB closer to what users expect. Added several tests to check. rb://162 ------------------------------------------------------------------------ r6052 | sunny | 2009-10-12 07:09:56 +0300 (Mon, 12 Oct 2009) | 4 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Reset the statement level autoinc counter on ROLLBACK. Fix the test results too. rb://164 ------------------------------------------------------------------------ r6053 | sunny | 2009-10-12 07:37:49 +0300 (Mon, 12 Oct 2009) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Copy the maximum AUTOINC value from the old table to the new table when MySQL does a CREATE INDEX ON T. This is required because MySQL does a table copy, rename and drops the old table. Fix Bug#47125: auto_increment start value is ignored if an index is created and engine=innodb rb://168 ------------------------------------------------------------------------ r6076 | vasil | 2009-10-14 19:30:12 +0300 (Wed, 14 Oct 2009) | 4 lines Changed paths: M /branches/5.1/row/row0mysql.c branches/5.1: Fix typo. ------------------------------------------------------------------------
16 years ago
branches/zip: Merge 2437:2485 from branches/5.1: (r2478 was skipped for the obvious reason) ------------------------------------------------------------------------ r2464 | vasil | 2008-05-19 17:59:42 +0300 (Mon, 19 May 2008) | 9 lines branches/5.1: Fix Bug#36600 SHOW STATUS takes a lot of CPU in buf_get_latched_pages_number by removing the Innodb_buffer_pool_pages_latched variable from SHOW STATUS output in non-UNIV_DEBUG compilation. Approved by: Heikki ------------------------------------------------------------------------ r2466 | calvin | 2008-05-20 01:37:14 +0300 (Tue, 20 May 2008) | 12 lines branches/5.1: Fix Bug#11894 innodb_file_per_table crashes w/ Windows .sym symbolic link hack The crash was due to un-handled error 3 (path not found). In the case of file per table, change the call to os_file_handle_error_no_exit() from os_file_handle_error(). Also, checks for full path pattern during table create (Windows only), which is used in symbolic link and temp table creation. Approved by: Heikki ------------------------------------------------------------------------ r2478 | sunny | 2008-05-23 08:29:08 +0300 (Fri, 23 May 2008) | 3 lines branches/5.1: Fix for bug# 36793. This is a back port from branches/zip. This code has been tested on a big-endian machine too. ------------------------------------------------------------------------ r2480 | vasil | 2008-05-27 11:40:07 +0300 (Tue, 27 May 2008) | 11 lines branches/5.1: Fix Bug#36819 ut_usectime does not handle errors from gettimeofday by retrying gettimeofday() several times if it fails in ut_usectime(). If it fails on all calls then return error to the caller to be handled at higher level. Update the variable innodb_row_lock_time_max in SHOW STATUS output only if ut_usectime() was successful. ------------------------------------------------------------------------ r2482 | sunny | 2008-05-28 12:18:35 +0300 (Wed, 28 May 2008) | 5 lines branches/5.1: Fix for Bug#35602, "Failed to read auto-increment value from storage engine". The test for REPLACE was an error of ommission since it's classified as a simple INSERT. For REPLACE statements we don't acquire the special AUTOINC lock for AUTOINC_NEW_STYLE_LOCKING with this fix. ------------------------------------------------------------------------ r2485 | vasil | 2008-05-28 16:01:14 +0300 (Wed, 28 May 2008) | 9 lines branches/5.1: Fix Bug#36149 Read buffer overflow in srv0start.c found during "make test" Use strncmp(3) instead of memcmp(3) to avoid reading past end of the string if it is empty (*str == '\0'). This bug is _not_ a buffer overflow. Discussed with: Sunny (via IM) ------------------------------------------------------------------------
18 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC. Throw warnings, not errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE, so that any table dump can be loaded. As of this change, InnoDB supports the following table formats: ROW_FORMAT=REDUNDANT the only format before MySQL/InnoDB 5.0.3 ROW_FORMAT=COMPACT the new default format of MySQL/InnoDB 5.0.3 ROW_FORMAT=DYNAMIC uncompressed, no prefix in the clustered index record for BLOBs ROW_FORMAT=COMPRESSED like ROW_FORMAT=DYNAMIC, but zlib compressed B-trees and BLOBs; the compressed page size is specified by KEY_BLOCK_SIZE in kilobytes (1, 2, 4, 8, or 16; default 8) KEY_BLOCK_SIZE=1, 2, 4, 8, or 16: implies ROW_FORMAT=COMPRESSED; ignored if ROW_FORMAT is not COMPRESSED KEY_BLOCK_SIZE=anything else: ignored The InnoDB row format is displayed in the 4th column (Row_format) of the output of SHOW TABLE STATUS. The Create_options column may show ROW_FORMAT= and KEY_BLOCK_SIZE=, but they do not necessarily have anything to do with InnoDB. The table format can also be queried like this: SELECT table_schema, table_name, row_format FROM information_schema.tables WHERE engine='innodb' and row_format in ('Compressed','Dynamic'); When Row_format='Compressed', KEY_BLOCK_SIZE should usually correspond to the compressed page size. But the .frm file could be manipulated to show any KEY_BLOCK_SIZE. For some reason, INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS does not include KEY_BLOCK_SIZE. It does include row_format (spelled in lowercase). This looks like a MySQL bug, because the table INFORMATION_SCHEMA.TABLES probably tries to replace SHOW TABLE STATUS. I reported this as Bug #35275 <http://bugs.mysql.com/35275>. ha_innobase::get_row_type(): Add ROW_TYPE_COMPRESSED, ROW_TYPE_DYNAMIC. ha_innobase::create(): Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC. Do not throw errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE, but issue warnings instead. ha_innobase::check_if_incompatible_data(): Return COMPATIBLE_DATA_NO if KEY_BLOCK_SIZE has been specified. innodb.result: Adjust the result for the warning issued for ROW_FORMAT=FIXED. innodb-zip.test: Add tests. Query INFORMATION_SCHEMA.TABLES for ROW_FORMAT.
18 years ago
branches/zip: Implement the configuration parameter and settable global variable innodb_file_format. Implement file format version stamping of *.ibd files and SYS_TABLES.TYPE. This change breaks introduces an incompatible change for for compressed tables. We can do this, as we have not released yet. innodb-zip.test: Add tests for stricter KEY_BLOCK_SIZE and ROW_FORMAT checks. DICT_TF_COMPRESSED_MASK, DICT_TF_COMPRESSED_SHIFT: Replace with DICT_TF_ZSSIZE_MASK, DICT_TF_ZSSIZE_SHIFT. DICT_TF_FORMAT_MASK, DICT_TF_FORMAT_SHIFT, DICT_TF_FORMAT_51, DICT_TF_FORMAT_ZIP: File format version, stored in table->flags, in the .ibd file header, and in SYS_TABLES.TYPE. dict_create_sys_tables_tuple(): Write the table flags to SYS_TABLES.TYPE if the format is at least DICT_TF_FORMAT_ZIP. For old formats (DICT_TF_FORMAT_51), write DICT_TABLE_ORDINARY as the table type. DB_TABLE_ZIP_NO_IBD: Remove the error code. The error handling is done in ha_innodb.cc; as a failsafe measure, dict_build_table_def_step() will silently clear the compression and format flags instead of returning this error. dict_mem_table_create(): Assert that no extra bits are set in the flags. dict_sys_tables_get_zip_size(): Rename to dict_sys_tables_get_flags(). Check all flag bits, and return ULINT_UNDEFINED if the combination is unsupported. dict_boot(): Document the SYS_TABLES columns N_COLS and TYPE. dict_table_get_format(), dict_table_set_format(), dict_table_flags_to_zip_size(): New accessors to table->flags. dtuple_convert_big_rec(): Introduce the auxiliary variables local_len, local_prefix_len. Store a 768-byte prefix locally if the file format is less than DICT_TF_FORMAT_ZIP. dtuple_convert_back_big_rec(): Restore the columns. srv_file_format: New variable: innodb_file_format. fil_create_new_single_table_tablespace(): Replace the parameter zip_size with table->flags. fil_open_single_table_tablespace(): Replace the parameter zip_size_in_k with table->flags. Check the flags. fil_space_struct, fil_space_create(), fil_op_write_log(): Replace zip_size with flags. fil_node_open_file(): Note a TODO item for InnoDB Hot Backup. Check that the tablespace flags match. fil_space_get_zip_size(): Rename to fil_space_get_flags(). Add a wrapper for fil_space_get_zip_size(). fsp_header_get_flags(): New function. fsp_header_init_fields(): Replace zip_size with flags. FSP_SPACE_FLAGS: New name for the tablespace flags. This field used to be called FSP_PAGE_ZIP_SIZE, or FSP_LOWEST_NO_WRITE. It has always been written as 0 in MySQL/InnoDB versions 4.1 to 5.1. MLOG_ZIP_FILE_CREATE: Rename to MLOG_FILE_CREATE2. Add a 32-bit parameter for the tablespace flags. ha_innobase::create(): Check the table attributes ROW_FORMAT and KEY_BLOCK_SIZE. Issue errors if they are inappropriate, or warnings if the inherited attributes (in ALTER TABLE) will be ignored. PAGE_ZIP_MIN_SIZE_SHIFT: New constant: the 2-logarithm of PAGE_ZIP_MIN_SIZE.
18 years ago
branches/zip: Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC. Throw warnings, not errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE, so that any table dump can be loaded. As of this change, InnoDB supports the following table formats: ROW_FORMAT=REDUNDANT the only format before MySQL/InnoDB 5.0.3 ROW_FORMAT=COMPACT the new default format of MySQL/InnoDB 5.0.3 ROW_FORMAT=DYNAMIC uncompressed, no prefix in the clustered index record for BLOBs ROW_FORMAT=COMPRESSED like ROW_FORMAT=DYNAMIC, but zlib compressed B-trees and BLOBs; the compressed page size is specified by KEY_BLOCK_SIZE in kilobytes (1, 2, 4, 8, or 16; default 8) KEY_BLOCK_SIZE=1, 2, 4, 8, or 16: implies ROW_FORMAT=COMPRESSED; ignored if ROW_FORMAT is not COMPRESSED KEY_BLOCK_SIZE=anything else: ignored The InnoDB row format is displayed in the 4th column (Row_format) of the output of SHOW TABLE STATUS. The Create_options column may show ROW_FORMAT= and KEY_BLOCK_SIZE=, but they do not necessarily have anything to do with InnoDB. The table format can also be queried like this: SELECT table_schema, table_name, row_format FROM information_schema.tables WHERE engine='innodb' and row_format in ('Compressed','Dynamic'); When Row_format='Compressed', KEY_BLOCK_SIZE should usually correspond to the compressed page size. But the .frm file could be manipulated to show any KEY_BLOCK_SIZE. For some reason, INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS does not include KEY_BLOCK_SIZE. It does include row_format (spelled in lowercase). This looks like a MySQL bug, because the table INFORMATION_SCHEMA.TABLES probably tries to replace SHOW TABLE STATUS. I reported this as Bug #35275 <http://bugs.mysql.com/35275>. ha_innobase::get_row_type(): Add ROW_TYPE_COMPRESSED, ROW_TYPE_DYNAMIC. ha_innobase::create(): Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC. Do not throw errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE, but issue warnings instead. ha_innobase::check_if_incompatible_data(): Return COMPATIBLE_DATA_NO if KEY_BLOCK_SIZE has been specified. innodb.result: Adjust the result for the warning issued for ROW_FORMAT=FIXED. innodb-zip.test: Add tests. Query INFORMATION_SCHEMA.TABLES for ROW_FORMAT.
18 years ago
branches/zip: Implement the configuration parameter and settable global variable innodb_file_format. Implement file format version stamping of *.ibd files and SYS_TABLES.TYPE. This change breaks introduces an incompatible change for for compressed tables. We can do this, as we have not released yet. innodb-zip.test: Add tests for stricter KEY_BLOCK_SIZE and ROW_FORMAT checks. DICT_TF_COMPRESSED_MASK, DICT_TF_COMPRESSED_SHIFT: Replace with DICT_TF_ZSSIZE_MASK, DICT_TF_ZSSIZE_SHIFT. DICT_TF_FORMAT_MASK, DICT_TF_FORMAT_SHIFT, DICT_TF_FORMAT_51, DICT_TF_FORMAT_ZIP: File format version, stored in table->flags, in the .ibd file header, and in SYS_TABLES.TYPE. dict_create_sys_tables_tuple(): Write the table flags to SYS_TABLES.TYPE if the format is at least DICT_TF_FORMAT_ZIP. For old formats (DICT_TF_FORMAT_51), write DICT_TABLE_ORDINARY as the table type. DB_TABLE_ZIP_NO_IBD: Remove the error code. The error handling is done in ha_innodb.cc; as a failsafe measure, dict_build_table_def_step() will silently clear the compression and format flags instead of returning this error. dict_mem_table_create(): Assert that no extra bits are set in the flags. dict_sys_tables_get_zip_size(): Rename to dict_sys_tables_get_flags(). Check all flag bits, and return ULINT_UNDEFINED if the combination is unsupported. dict_boot(): Document the SYS_TABLES columns N_COLS and TYPE. dict_table_get_format(), dict_table_set_format(), dict_table_flags_to_zip_size(): New accessors to table->flags. dtuple_convert_big_rec(): Introduce the auxiliary variables local_len, local_prefix_len. Store a 768-byte prefix locally if the file format is less than DICT_TF_FORMAT_ZIP. dtuple_convert_back_big_rec(): Restore the columns. srv_file_format: New variable: innodb_file_format. fil_create_new_single_table_tablespace(): Replace the parameter zip_size with table->flags. fil_open_single_table_tablespace(): Replace the parameter zip_size_in_k with table->flags. Check the flags. fil_space_struct, fil_space_create(), fil_op_write_log(): Replace zip_size with flags. fil_node_open_file(): Note a TODO item for InnoDB Hot Backup. Check that the tablespace flags match. fil_space_get_zip_size(): Rename to fil_space_get_flags(). Add a wrapper for fil_space_get_zip_size(). fsp_header_get_flags(): New function. fsp_header_init_fields(): Replace zip_size with flags. FSP_SPACE_FLAGS: New name for the tablespace flags. This field used to be called FSP_PAGE_ZIP_SIZE, or FSP_LOWEST_NO_WRITE. It has always been written as 0 in MySQL/InnoDB versions 4.1 to 5.1. MLOG_ZIP_FILE_CREATE: Rename to MLOG_FILE_CREATE2. Add a 32-bit parameter for the tablespace flags. ha_innobase::create(): Check the table attributes ROW_FORMAT and KEY_BLOCK_SIZE. Issue errors if they are inappropriate, or warnings if the inherited attributes (in ALTER TABLE) will be ignored. PAGE_ZIP_MIN_SIZE_SHIFT: New constant: the 2-logarithm of PAGE_ZIP_MIN_SIZE.
18 years ago
branches/zip: Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC. Throw warnings, not errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE, so that any table dump can be loaded. As of this change, InnoDB supports the following table formats: ROW_FORMAT=REDUNDANT the only format before MySQL/InnoDB 5.0.3 ROW_FORMAT=COMPACT the new default format of MySQL/InnoDB 5.0.3 ROW_FORMAT=DYNAMIC uncompressed, no prefix in the clustered index record for BLOBs ROW_FORMAT=COMPRESSED like ROW_FORMAT=DYNAMIC, but zlib compressed B-trees and BLOBs; the compressed page size is specified by KEY_BLOCK_SIZE in kilobytes (1, 2, 4, 8, or 16; default 8) KEY_BLOCK_SIZE=1, 2, 4, 8, or 16: implies ROW_FORMAT=COMPRESSED; ignored if ROW_FORMAT is not COMPRESSED KEY_BLOCK_SIZE=anything else: ignored The InnoDB row format is displayed in the 4th column (Row_format) of the output of SHOW TABLE STATUS. The Create_options column may show ROW_FORMAT= and KEY_BLOCK_SIZE=, but they do not necessarily have anything to do with InnoDB. The table format can also be queried like this: SELECT table_schema, table_name, row_format FROM information_schema.tables WHERE engine='innodb' and row_format in ('Compressed','Dynamic'); When Row_format='Compressed', KEY_BLOCK_SIZE should usually correspond to the compressed page size. But the .frm file could be manipulated to show any KEY_BLOCK_SIZE. For some reason, INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS does not include KEY_BLOCK_SIZE. It does include row_format (spelled in lowercase). This looks like a MySQL bug, because the table INFORMATION_SCHEMA.TABLES probably tries to replace SHOW TABLE STATUS. I reported this as Bug #35275 <http://bugs.mysql.com/35275>. ha_innobase::get_row_type(): Add ROW_TYPE_COMPRESSED, ROW_TYPE_DYNAMIC. ha_innobase::create(): Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC. Do not throw errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE, but issue warnings instead. ha_innobase::check_if_incompatible_data(): Return COMPATIBLE_DATA_NO if KEY_BLOCK_SIZE has been specified. innodb.result: Adjust the result for the warning issued for ROW_FORMAT=FIXED. innodb-zip.test: Add tests. Query INFORMATION_SCHEMA.TABLES for ROW_FORMAT.
18 years ago
branches/zip: Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC. Throw warnings, not errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE, so that any table dump can be loaded. As of this change, InnoDB supports the following table formats: ROW_FORMAT=REDUNDANT the only format before MySQL/InnoDB 5.0.3 ROW_FORMAT=COMPACT the new default format of MySQL/InnoDB 5.0.3 ROW_FORMAT=DYNAMIC uncompressed, no prefix in the clustered index record for BLOBs ROW_FORMAT=COMPRESSED like ROW_FORMAT=DYNAMIC, but zlib compressed B-trees and BLOBs; the compressed page size is specified by KEY_BLOCK_SIZE in kilobytes (1, 2, 4, 8, or 16; default 8) KEY_BLOCK_SIZE=1, 2, 4, 8, or 16: implies ROW_FORMAT=COMPRESSED; ignored if ROW_FORMAT is not COMPRESSED KEY_BLOCK_SIZE=anything else: ignored The InnoDB row format is displayed in the 4th column (Row_format) of the output of SHOW TABLE STATUS. The Create_options column may show ROW_FORMAT= and KEY_BLOCK_SIZE=, but they do not necessarily have anything to do with InnoDB. The table format can also be queried like this: SELECT table_schema, table_name, row_format FROM information_schema.tables WHERE engine='innodb' and row_format in ('Compressed','Dynamic'); When Row_format='Compressed', KEY_BLOCK_SIZE should usually correspond to the compressed page size. But the .frm file could be manipulated to show any KEY_BLOCK_SIZE. For some reason, INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS does not include KEY_BLOCK_SIZE. It does include row_format (spelled in lowercase). This looks like a MySQL bug, because the table INFORMATION_SCHEMA.TABLES probably tries to replace SHOW TABLE STATUS. I reported this as Bug #35275 <http://bugs.mysql.com/35275>. ha_innobase::get_row_type(): Add ROW_TYPE_COMPRESSED, ROW_TYPE_DYNAMIC. ha_innobase::create(): Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC. Do not throw errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE, but issue warnings instead. ha_innobase::check_if_incompatible_data(): Return COMPATIBLE_DATA_NO if KEY_BLOCK_SIZE has been specified. innodb.result: Adjust the result for the warning issued for ROW_FORMAT=FIXED. innodb-zip.test: Add tests. Query INFORMATION_SCHEMA.TABLES for ROW_FORMAT.
18 years ago
branches/zip: Implement the configuration parameter and settable global variable innodb_file_format. Implement file format version stamping of *.ibd files and SYS_TABLES.TYPE. This change breaks introduces an incompatible change for for compressed tables. We can do this, as we have not released yet. innodb-zip.test: Add tests for stricter KEY_BLOCK_SIZE and ROW_FORMAT checks. DICT_TF_COMPRESSED_MASK, DICT_TF_COMPRESSED_SHIFT: Replace with DICT_TF_ZSSIZE_MASK, DICT_TF_ZSSIZE_SHIFT. DICT_TF_FORMAT_MASK, DICT_TF_FORMAT_SHIFT, DICT_TF_FORMAT_51, DICT_TF_FORMAT_ZIP: File format version, stored in table->flags, in the .ibd file header, and in SYS_TABLES.TYPE. dict_create_sys_tables_tuple(): Write the table flags to SYS_TABLES.TYPE if the format is at least DICT_TF_FORMAT_ZIP. For old formats (DICT_TF_FORMAT_51), write DICT_TABLE_ORDINARY as the table type. DB_TABLE_ZIP_NO_IBD: Remove the error code. The error handling is done in ha_innodb.cc; as a failsafe measure, dict_build_table_def_step() will silently clear the compression and format flags instead of returning this error. dict_mem_table_create(): Assert that no extra bits are set in the flags. dict_sys_tables_get_zip_size(): Rename to dict_sys_tables_get_flags(). Check all flag bits, and return ULINT_UNDEFINED if the combination is unsupported. dict_boot(): Document the SYS_TABLES columns N_COLS and TYPE. dict_table_get_format(), dict_table_set_format(), dict_table_flags_to_zip_size(): New accessors to table->flags. dtuple_convert_big_rec(): Introduce the auxiliary variables local_len, local_prefix_len. Store a 768-byte prefix locally if the file format is less than DICT_TF_FORMAT_ZIP. dtuple_convert_back_big_rec(): Restore the columns. srv_file_format: New variable: innodb_file_format. fil_create_new_single_table_tablespace(): Replace the parameter zip_size with table->flags. fil_open_single_table_tablespace(): Replace the parameter zip_size_in_k with table->flags. Check the flags. fil_space_struct, fil_space_create(), fil_op_write_log(): Replace zip_size with flags. fil_node_open_file(): Note a TODO item for InnoDB Hot Backup. Check that the tablespace flags match. fil_space_get_zip_size(): Rename to fil_space_get_flags(). Add a wrapper for fil_space_get_zip_size(). fsp_header_get_flags(): New function. fsp_header_init_fields(): Replace zip_size with flags. FSP_SPACE_FLAGS: New name for the tablespace flags. This field used to be called FSP_PAGE_ZIP_SIZE, or FSP_LOWEST_NO_WRITE. It has always been written as 0 in MySQL/InnoDB versions 4.1 to 5.1. MLOG_ZIP_FILE_CREATE: Rename to MLOG_FILE_CREATE2. Add a 32-bit parameter for the tablespace flags. ha_innobase::create(): Check the table attributes ROW_FORMAT and KEY_BLOCK_SIZE. Issue errors if they are inappropriate, or warnings if the inherited attributes (in ALTER TABLE) will be ignored. PAGE_ZIP_MIN_SIZE_SHIFT: New constant: the 2-logarithm of PAGE_ZIP_MIN_SIZE.
18 years ago
branches/zip: Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC. Throw warnings, not errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE, so that any table dump can be loaded. As of this change, InnoDB supports the following table formats: ROW_FORMAT=REDUNDANT the only format before MySQL/InnoDB 5.0.3 ROW_FORMAT=COMPACT the new default format of MySQL/InnoDB 5.0.3 ROW_FORMAT=DYNAMIC uncompressed, no prefix in the clustered index record for BLOBs ROW_FORMAT=COMPRESSED like ROW_FORMAT=DYNAMIC, but zlib compressed B-trees and BLOBs; the compressed page size is specified by KEY_BLOCK_SIZE in kilobytes (1, 2, 4, 8, or 16; default 8) KEY_BLOCK_SIZE=1, 2, 4, 8, or 16: implies ROW_FORMAT=COMPRESSED; ignored if ROW_FORMAT is not COMPRESSED KEY_BLOCK_SIZE=anything else: ignored The InnoDB row format is displayed in the 4th column (Row_format) of the output of SHOW TABLE STATUS. The Create_options column may show ROW_FORMAT= and KEY_BLOCK_SIZE=, but they do not necessarily have anything to do with InnoDB. The table format can also be queried like this: SELECT table_schema, table_name, row_format FROM information_schema.tables WHERE engine='innodb' and row_format in ('Compressed','Dynamic'); When Row_format='Compressed', KEY_BLOCK_SIZE should usually correspond to the compressed page size. But the .frm file could be manipulated to show any KEY_BLOCK_SIZE. For some reason, INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS does not include KEY_BLOCK_SIZE. It does include row_format (spelled in lowercase). This looks like a MySQL bug, because the table INFORMATION_SCHEMA.TABLES probably tries to replace SHOW TABLE STATUS. I reported this as Bug #35275 <http://bugs.mysql.com/35275>. ha_innobase::get_row_type(): Add ROW_TYPE_COMPRESSED, ROW_TYPE_DYNAMIC. ha_innobase::create(): Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC. Do not throw errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE, but issue warnings instead. ha_innobase::check_if_incompatible_data(): Return COMPATIBLE_DATA_NO if KEY_BLOCK_SIZE has been specified. innodb.result: Adjust the result for the warning issued for ROW_FORMAT=FIXED. innodb-zip.test: Add tests. Query INFORMATION_SCHEMA.TABLES for ROW_FORMAT.
18 years ago
branches/zip: Implement the configuration parameter and settable global variable innodb_file_format. Implement file format version stamping of *.ibd files and SYS_TABLES.TYPE. This change breaks introduces an incompatible change for for compressed tables. We can do this, as we have not released yet. innodb-zip.test: Add tests for stricter KEY_BLOCK_SIZE and ROW_FORMAT checks. DICT_TF_COMPRESSED_MASK, DICT_TF_COMPRESSED_SHIFT: Replace with DICT_TF_ZSSIZE_MASK, DICT_TF_ZSSIZE_SHIFT. DICT_TF_FORMAT_MASK, DICT_TF_FORMAT_SHIFT, DICT_TF_FORMAT_51, DICT_TF_FORMAT_ZIP: File format version, stored in table->flags, in the .ibd file header, and in SYS_TABLES.TYPE. dict_create_sys_tables_tuple(): Write the table flags to SYS_TABLES.TYPE if the format is at least DICT_TF_FORMAT_ZIP. For old formats (DICT_TF_FORMAT_51), write DICT_TABLE_ORDINARY as the table type. DB_TABLE_ZIP_NO_IBD: Remove the error code. The error handling is done in ha_innodb.cc; as a failsafe measure, dict_build_table_def_step() will silently clear the compression and format flags instead of returning this error. dict_mem_table_create(): Assert that no extra bits are set in the flags. dict_sys_tables_get_zip_size(): Rename to dict_sys_tables_get_flags(). Check all flag bits, and return ULINT_UNDEFINED if the combination is unsupported. dict_boot(): Document the SYS_TABLES columns N_COLS and TYPE. dict_table_get_format(), dict_table_set_format(), dict_table_flags_to_zip_size(): New accessors to table->flags. dtuple_convert_big_rec(): Introduce the auxiliary variables local_len, local_prefix_len. Store a 768-byte prefix locally if the file format is less than DICT_TF_FORMAT_ZIP. dtuple_convert_back_big_rec(): Restore the columns. srv_file_format: New variable: innodb_file_format. fil_create_new_single_table_tablespace(): Replace the parameter zip_size with table->flags. fil_open_single_table_tablespace(): Replace the parameter zip_size_in_k with table->flags. Check the flags. fil_space_struct, fil_space_create(), fil_op_write_log(): Replace zip_size with flags. fil_node_open_file(): Note a TODO item for InnoDB Hot Backup. Check that the tablespace flags match. fil_space_get_zip_size(): Rename to fil_space_get_flags(). Add a wrapper for fil_space_get_zip_size(). fsp_header_get_flags(): New function. fsp_header_init_fields(): Replace zip_size with flags. FSP_SPACE_FLAGS: New name for the tablespace flags. This field used to be called FSP_PAGE_ZIP_SIZE, or FSP_LOWEST_NO_WRITE. It has always been written as 0 in MySQL/InnoDB versions 4.1 to 5.1. MLOG_ZIP_FILE_CREATE: Rename to MLOG_FILE_CREATE2. Add a 32-bit parameter for the tablespace flags. ha_innobase::create(): Check the table attributes ROW_FORMAT and KEY_BLOCK_SIZE. Issue errors if they are inappropriate, or warnings if the inherited attributes (in ALTER TABLE) will be ignored. PAGE_ZIP_MIN_SIZE_SHIFT: New constant: the 2-logarithm of PAGE_ZIP_MIN_SIZE.
18 years ago
branches/zip: Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC. Throw warnings, not errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE, so that any table dump can be loaded. As of this change, InnoDB supports the following table formats: ROW_FORMAT=REDUNDANT the only format before MySQL/InnoDB 5.0.3 ROW_FORMAT=COMPACT the new default format of MySQL/InnoDB 5.0.3 ROW_FORMAT=DYNAMIC uncompressed, no prefix in the clustered index record for BLOBs ROW_FORMAT=COMPRESSED like ROW_FORMAT=DYNAMIC, but zlib compressed B-trees and BLOBs; the compressed page size is specified by KEY_BLOCK_SIZE in kilobytes (1, 2, 4, 8, or 16; default 8) KEY_BLOCK_SIZE=1, 2, 4, 8, or 16: implies ROW_FORMAT=COMPRESSED; ignored if ROW_FORMAT is not COMPRESSED KEY_BLOCK_SIZE=anything else: ignored The InnoDB row format is displayed in the 4th column (Row_format) of the output of SHOW TABLE STATUS. The Create_options column may show ROW_FORMAT= and KEY_BLOCK_SIZE=, but they do not necessarily have anything to do with InnoDB. The table format can also be queried like this: SELECT table_schema, table_name, row_format FROM information_schema.tables WHERE engine='innodb' and row_format in ('Compressed','Dynamic'); When Row_format='Compressed', KEY_BLOCK_SIZE should usually correspond to the compressed page size. But the .frm file could be manipulated to show any KEY_BLOCK_SIZE. For some reason, INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS does not include KEY_BLOCK_SIZE. It does include row_format (spelled in lowercase). This looks like a MySQL bug, because the table INFORMATION_SCHEMA.TABLES probably tries to replace SHOW TABLE STATUS. I reported this as Bug #35275 <http://bugs.mysql.com/35275>. ha_innobase::get_row_type(): Add ROW_TYPE_COMPRESSED, ROW_TYPE_DYNAMIC. ha_innobase::create(): Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC. Do not throw errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE, but issue warnings instead. ha_innobase::check_if_incompatible_data(): Return COMPATIBLE_DATA_NO if KEY_BLOCK_SIZE has been specified. innodb.result: Adjust the result for the warning issued for ROW_FORMAT=FIXED. innodb-zip.test: Add tests. Query INFORMATION_SCHEMA.TABLES for ROW_FORMAT.
18 years ago
branches/zip: Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC. Throw warnings, not errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE, so that any table dump can be loaded. As of this change, InnoDB supports the following table formats: ROW_FORMAT=REDUNDANT the only format before MySQL/InnoDB 5.0.3 ROW_FORMAT=COMPACT the new default format of MySQL/InnoDB 5.0.3 ROW_FORMAT=DYNAMIC uncompressed, no prefix in the clustered index record for BLOBs ROW_FORMAT=COMPRESSED like ROW_FORMAT=DYNAMIC, but zlib compressed B-trees and BLOBs; the compressed page size is specified by KEY_BLOCK_SIZE in kilobytes (1, 2, 4, 8, or 16; default 8) KEY_BLOCK_SIZE=1, 2, 4, 8, or 16: implies ROW_FORMAT=COMPRESSED; ignored if ROW_FORMAT is not COMPRESSED KEY_BLOCK_SIZE=anything else: ignored The InnoDB row format is displayed in the 4th column (Row_format) of the output of SHOW TABLE STATUS. The Create_options column may show ROW_FORMAT= and KEY_BLOCK_SIZE=, but they do not necessarily have anything to do with InnoDB. The table format can also be queried like this: SELECT table_schema, table_name, row_format FROM information_schema.tables WHERE engine='innodb' and row_format in ('Compressed','Dynamic'); When Row_format='Compressed', KEY_BLOCK_SIZE should usually correspond to the compressed page size. But the .frm file could be manipulated to show any KEY_BLOCK_SIZE. For some reason, INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS does not include KEY_BLOCK_SIZE. It does include row_format (spelled in lowercase). This looks like a MySQL bug, because the table INFORMATION_SCHEMA.TABLES probably tries to replace SHOW TABLE STATUS. I reported this as Bug #35275 <http://bugs.mysql.com/35275>. ha_innobase::get_row_type(): Add ROW_TYPE_COMPRESSED, ROW_TYPE_DYNAMIC. ha_innobase::create(): Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC. Do not throw errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE, but issue warnings instead. ha_innobase::check_if_incompatible_data(): Return COMPATIBLE_DATA_NO if KEY_BLOCK_SIZE has been specified. innodb.result: Adjust the result for the warning issued for ROW_FORMAT=FIXED. innodb-zip.test: Add tests. Query INFORMATION_SCHEMA.TABLES for ROW_FORMAT.
18 years ago
branches/zip: Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC. Throw warnings, not errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE, so that any table dump can be loaded. As of this change, InnoDB supports the following table formats: ROW_FORMAT=REDUNDANT the only format before MySQL/InnoDB 5.0.3 ROW_FORMAT=COMPACT the new default format of MySQL/InnoDB 5.0.3 ROW_FORMAT=DYNAMIC uncompressed, no prefix in the clustered index record for BLOBs ROW_FORMAT=COMPRESSED like ROW_FORMAT=DYNAMIC, but zlib compressed B-trees and BLOBs; the compressed page size is specified by KEY_BLOCK_SIZE in kilobytes (1, 2, 4, 8, or 16; default 8) KEY_BLOCK_SIZE=1, 2, 4, 8, or 16: implies ROW_FORMAT=COMPRESSED; ignored if ROW_FORMAT is not COMPRESSED KEY_BLOCK_SIZE=anything else: ignored The InnoDB row format is displayed in the 4th column (Row_format) of the output of SHOW TABLE STATUS. The Create_options column may show ROW_FORMAT= and KEY_BLOCK_SIZE=, but they do not necessarily have anything to do with InnoDB. The table format can also be queried like this: SELECT table_schema, table_name, row_format FROM information_schema.tables WHERE engine='innodb' and row_format in ('Compressed','Dynamic'); When Row_format='Compressed', KEY_BLOCK_SIZE should usually correspond to the compressed page size. But the .frm file could be manipulated to show any KEY_BLOCK_SIZE. For some reason, INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS does not include KEY_BLOCK_SIZE. It does include row_format (spelled in lowercase). This looks like a MySQL bug, because the table INFORMATION_SCHEMA.TABLES probably tries to replace SHOW TABLE STATUS. I reported this as Bug #35275 <http://bugs.mysql.com/35275>. ha_innobase::get_row_type(): Add ROW_TYPE_COMPRESSED, ROW_TYPE_DYNAMIC. ha_innobase::create(): Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC. Do not throw errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE, but issue warnings instead. ha_innobase::check_if_incompatible_data(): Return COMPATIBLE_DATA_NO if KEY_BLOCK_SIZE has been specified. innodb.result: Adjust the result for the warning issued for ROW_FORMAT=FIXED. innodb-zip.test: Add tests. Query INFORMATION_SCHEMA.TABLES for ROW_FORMAT.
18 years ago
branches/zip: Implement the configuration parameter and settable global variable innodb_file_format. Implement file format version stamping of *.ibd files and SYS_TABLES.TYPE. This change breaks introduces an incompatible change for for compressed tables. We can do this, as we have not released yet. innodb-zip.test: Add tests for stricter KEY_BLOCK_SIZE and ROW_FORMAT checks. DICT_TF_COMPRESSED_MASK, DICT_TF_COMPRESSED_SHIFT: Replace with DICT_TF_ZSSIZE_MASK, DICT_TF_ZSSIZE_SHIFT. DICT_TF_FORMAT_MASK, DICT_TF_FORMAT_SHIFT, DICT_TF_FORMAT_51, DICT_TF_FORMAT_ZIP: File format version, stored in table->flags, in the .ibd file header, and in SYS_TABLES.TYPE. dict_create_sys_tables_tuple(): Write the table flags to SYS_TABLES.TYPE if the format is at least DICT_TF_FORMAT_ZIP. For old formats (DICT_TF_FORMAT_51), write DICT_TABLE_ORDINARY as the table type. DB_TABLE_ZIP_NO_IBD: Remove the error code. The error handling is done in ha_innodb.cc; as a failsafe measure, dict_build_table_def_step() will silently clear the compression and format flags instead of returning this error. dict_mem_table_create(): Assert that no extra bits are set in the flags. dict_sys_tables_get_zip_size(): Rename to dict_sys_tables_get_flags(). Check all flag bits, and return ULINT_UNDEFINED if the combination is unsupported. dict_boot(): Document the SYS_TABLES columns N_COLS and TYPE. dict_table_get_format(), dict_table_set_format(), dict_table_flags_to_zip_size(): New accessors to table->flags. dtuple_convert_big_rec(): Introduce the auxiliary variables local_len, local_prefix_len. Store a 768-byte prefix locally if the file format is less than DICT_TF_FORMAT_ZIP. dtuple_convert_back_big_rec(): Restore the columns. srv_file_format: New variable: innodb_file_format. fil_create_new_single_table_tablespace(): Replace the parameter zip_size with table->flags. fil_open_single_table_tablespace(): Replace the parameter zip_size_in_k with table->flags. Check the flags. fil_space_struct, fil_space_create(), fil_op_write_log(): Replace zip_size with flags. fil_node_open_file(): Note a TODO item for InnoDB Hot Backup. Check that the tablespace flags match. fil_space_get_zip_size(): Rename to fil_space_get_flags(). Add a wrapper for fil_space_get_zip_size(). fsp_header_get_flags(): New function. fsp_header_init_fields(): Replace zip_size with flags. FSP_SPACE_FLAGS: New name for the tablespace flags. This field used to be called FSP_PAGE_ZIP_SIZE, or FSP_LOWEST_NO_WRITE. It has always been written as 0 in MySQL/InnoDB versions 4.1 to 5.1. MLOG_ZIP_FILE_CREATE: Rename to MLOG_FILE_CREATE2. Add a 32-bit parameter for the tablespace flags. ha_innobase::create(): Check the table attributes ROW_FORMAT and KEY_BLOCK_SIZE. Issue errors if they are inappropriate, or warnings if the inherited attributes (in ALTER TABLE) will be ignored. PAGE_ZIP_MIN_SIZE_SHIFT: New constant: the 2-logarithm of PAGE_ZIP_MIN_SIZE.
18 years ago
branches/zip: Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC. Throw warnings, not errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE, so that any table dump can be loaded. As of this change, InnoDB supports the following table formats: ROW_FORMAT=REDUNDANT the only format before MySQL/InnoDB 5.0.3 ROW_FORMAT=COMPACT the new default format of MySQL/InnoDB 5.0.3 ROW_FORMAT=DYNAMIC uncompressed, no prefix in the clustered index record for BLOBs ROW_FORMAT=COMPRESSED like ROW_FORMAT=DYNAMIC, but zlib compressed B-trees and BLOBs; the compressed page size is specified by KEY_BLOCK_SIZE in kilobytes (1, 2, 4, 8, or 16; default 8) KEY_BLOCK_SIZE=1, 2, 4, 8, or 16: implies ROW_FORMAT=COMPRESSED; ignored if ROW_FORMAT is not COMPRESSED KEY_BLOCK_SIZE=anything else: ignored The InnoDB row format is displayed in the 4th column (Row_format) of the output of SHOW TABLE STATUS. The Create_options column may show ROW_FORMAT= and KEY_BLOCK_SIZE=, but they do not necessarily have anything to do with InnoDB. The table format can also be queried like this: SELECT table_schema, table_name, row_format FROM information_schema.tables WHERE engine='innodb' and row_format in ('Compressed','Dynamic'); When Row_format='Compressed', KEY_BLOCK_SIZE should usually correspond to the compressed page size. But the .frm file could be manipulated to show any KEY_BLOCK_SIZE. For some reason, INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS does not include KEY_BLOCK_SIZE. It does include row_format (spelled in lowercase). This looks like a MySQL bug, because the table INFORMATION_SCHEMA.TABLES probably tries to replace SHOW TABLE STATUS. I reported this as Bug #35275 <http://bugs.mysql.com/35275>. ha_innobase::get_row_type(): Add ROW_TYPE_COMPRESSED, ROW_TYPE_DYNAMIC. ha_innobase::create(): Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC. Do not throw errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE, but issue warnings instead. ha_innobase::check_if_incompatible_data(): Return COMPATIBLE_DATA_NO if KEY_BLOCK_SIZE has been specified. innodb.result: Adjust the result for the warning issued for ROW_FORMAT=FIXED. innodb-zip.test: Add tests. Query INFORMATION_SCHEMA.TABLES for ROW_FORMAT.
18 years ago
branches/zip: Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC. Throw warnings, not errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE, so that any table dump can be loaded. As of this change, InnoDB supports the following table formats: ROW_FORMAT=REDUNDANT the only format before MySQL/InnoDB 5.0.3 ROW_FORMAT=COMPACT the new default format of MySQL/InnoDB 5.0.3 ROW_FORMAT=DYNAMIC uncompressed, no prefix in the clustered index record for BLOBs ROW_FORMAT=COMPRESSED like ROW_FORMAT=DYNAMIC, but zlib compressed B-trees and BLOBs; the compressed page size is specified by KEY_BLOCK_SIZE in kilobytes (1, 2, 4, 8, or 16; default 8) KEY_BLOCK_SIZE=1, 2, 4, 8, or 16: implies ROW_FORMAT=COMPRESSED; ignored if ROW_FORMAT is not COMPRESSED KEY_BLOCK_SIZE=anything else: ignored The InnoDB row format is displayed in the 4th column (Row_format) of the output of SHOW TABLE STATUS. The Create_options column may show ROW_FORMAT= and KEY_BLOCK_SIZE=, but they do not necessarily have anything to do with InnoDB. The table format can also be queried like this: SELECT table_schema, table_name, row_format FROM information_schema.tables WHERE engine='innodb' and row_format in ('Compressed','Dynamic'); When Row_format='Compressed', KEY_BLOCK_SIZE should usually correspond to the compressed page size. But the .frm file could be manipulated to show any KEY_BLOCK_SIZE. For some reason, INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS does not include KEY_BLOCK_SIZE. It does include row_format (spelled in lowercase). This looks like a MySQL bug, because the table INFORMATION_SCHEMA.TABLES probably tries to replace SHOW TABLE STATUS. I reported this as Bug #35275 <http://bugs.mysql.com/35275>. ha_innobase::get_row_type(): Add ROW_TYPE_COMPRESSED, ROW_TYPE_DYNAMIC. ha_innobase::create(): Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC. Do not throw errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE, but issue warnings instead. ha_innobase::check_if_incompatible_data(): Return COMPATIBLE_DATA_NO if KEY_BLOCK_SIZE has been specified. innodb.result: Adjust the result for the warning issued for ROW_FORMAT=FIXED. innodb-zip.test: Add tests. Query INFORMATION_SCHEMA.TABLES for ROW_FORMAT.
18 years ago
branches/zip: Implement the configuration parameter and settable global variable innodb_file_format. Implement file format version stamping of *.ibd files and SYS_TABLES.TYPE. This change breaks introduces an incompatible change for for compressed tables. We can do this, as we have not released yet. innodb-zip.test: Add tests for stricter KEY_BLOCK_SIZE and ROW_FORMAT checks. DICT_TF_COMPRESSED_MASK, DICT_TF_COMPRESSED_SHIFT: Replace with DICT_TF_ZSSIZE_MASK, DICT_TF_ZSSIZE_SHIFT. DICT_TF_FORMAT_MASK, DICT_TF_FORMAT_SHIFT, DICT_TF_FORMAT_51, DICT_TF_FORMAT_ZIP: File format version, stored in table->flags, in the .ibd file header, and in SYS_TABLES.TYPE. dict_create_sys_tables_tuple(): Write the table flags to SYS_TABLES.TYPE if the format is at least DICT_TF_FORMAT_ZIP. For old formats (DICT_TF_FORMAT_51), write DICT_TABLE_ORDINARY as the table type. DB_TABLE_ZIP_NO_IBD: Remove the error code. The error handling is done in ha_innodb.cc; as a failsafe measure, dict_build_table_def_step() will silently clear the compression and format flags instead of returning this error. dict_mem_table_create(): Assert that no extra bits are set in the flags. dict_sys_tables_get_zip_size(): Rename to dict_sys_tables_get_flags(). Check all flag bits, and return ULINT_UNDEFINED if the combination is unsupported. dict_boot(): Document the SYS_TABLES columns N_COLS and TYPE. dict_table_get_format(), dict_table_set_format(), dict_table_flags_to_zip_size(): New accessors to table->flags. dtuple_convert_big_rec(): Introduce the auxiliary variables local_len, local_prefix_len. Store a 768-byte prefix locally if the file format is less than DICT_TF_FORMAT_ZIP. dtuple_convert_back_big_rec(): Restore the columns. srv_file_format: New variable: innodb_file_format. fil_create_new_single_table_tablespace(): Replace the parameter zip_size with table->flags. fil_open_single_table_tablespace(): Replace the parameter zip_size_in_k with table->flags. Check the flags. fil_space_struct, fil_space_create(), fil_op_write_log(): Replace zip_size with flags. fil_node_open_file(): Note a TODO item for InnoDB Hot Backup. Check that the tablespace flags match. fil_space_get_zip_size(): Rename to fil_space_get_flags(). Add a wrapper for fil_space_get_zip_size(). fsp_header_get_flags(): New function. fsp_header_init_fields(): Replace zip_size with flags. FSP_SPACE_FLAGS: New name for the tablespace flags. This field used to be called FSP_PAGE_ZIP_SIZE, or FSP_LOWEST_NO_WRITE. It has always been written as 0 in MySQL/InnoDB versions 4.1 to 5.1. MLOG_ZIP_FILE_CREATE: Rename to MLOG_FILE_CREATE2. Add a 32-bit parameter for the tablespace flags. ha_innobase::create(): Check the table attributes ROW_FORMAT and KEY_BLOCK_SIZE. Issue errors if they are inappropriate, or warnings if the inherited attributes (in ALTER TABLE) will be ignored. PAGE_ZIP_MIN_SIZE_SHIFT: New constant: the 2-logarithm of PAGE_ZIP_MIN_SIZE.
18 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge revisions 5622:5912 from branches/5.1, except r5700 (changes to CMakeLists.txt) ------------------------------------------------------------------------ r5622 | vasil | 2009-08-03 15:27:00 +0300 (Mon, 03 Aug 2009) | 20 lines Changed paths: M /branches/5.1/Makefile.am branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2988 committer: Satya B <satya.bn@sun.com> branch nick: mysql-5.1-bugteam timestamp: Wed 2009-07-01 11:06:05 +0530 message: Fix build failure after applying Innodb snapshot 5.1-ss5282 After applying Innodb snapshot 5.1-ss5282, build was broken because of missing header file. Adding the header file to Makefile.am after informing the innodb developers. modified: storage/innobase/Makefile.am ------------------------------------------------------------------------ r5740 | jyang | 2009-09-03 06:33:47 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Sunny Bains. ------------------------------------------------------------------------ r5741 | jyang | 2009-09-03 07:16:01 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5757 | jyang | 2009-09-04 04:26:13 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h D /branches/5.1/mysql-test/innodb_bug46000.result D /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Revert change in 5740. Making the fix in a subsequent check in. ------------------------------------------------------------------------ r5760 | jyang | 2009-09-04 07:07:34 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc D /branches/5.1/mysql-test/innodb_bug44369.result D /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: This is to revert change 5741. A return status for create_table_def() needs to be fixed. ------------------------------------------------------------------------ r5797 | calvin | 2009-09-09 18:26:29 +0300 (Wed, 09 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: merge change from 5.1.38 HA_ERR_TOO_MANY_CONCURRENT_TRXS is added in 5.1.38. ------------------------------------------------------------------------ r5799 | calvin | 2009-09-09 20:47:31 +0300 (Wed, 09 Sep 2009) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: fix bug#46256 Allow tables to be dropped even if the collation is not found, but issue a warning. Could not find an easy way to add mysql-test since it requires changes to charsets and restarting the server. Tests were executed manually. Approved by: Heikki (on IM) ------------------------------------------------------------------------ r5805 | vasil | 2009-09-10 08:41:48 +0300 (Thu, 10 Sep 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix a compilation warning caused by c5799: handler/ha_innodb.cc: In function 'void innobase_get_cset_width(ulint, ulint*, ulint*)': handler/ha_innodb.cc:830: warning: format '%d' expects type 'int', but argument 2 has type 'ulint' ------------------------------------------------------------------------ r5834 | jyang | 2009-09-11 00:43:05 +0300 (Fri, 11 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5895 | jyang | 2009-09-15 03:39:21 +0300 (Tue, 15 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Marko Makela. ------------------------------------------------------------------------
16 years ago
branches/zip: Merge revisions 5622:5912 from branches/5.1, except r5700 (changes to CMakeLists.txt) ------------------------------------------------------------------------ r5622 | vasil | 2009-08-03 15:27:00 +0300 (Mon, 03 Aug 2009) | 20 lines Changed paths: M /branches/5.1/Makefile.am branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2988 committer: Satya B <satya.bn@sun.com> branch nick: mysql-5.1-bugteam timestamp: Wed 2009-07-01 11:06:05 +0530 message: Fix build failure after applying Innodb snapshot 5.1-ss5282 After applying Innodb snapshot 5.1-ss5282, build was broken because of missing header file. Adding the header file to Makefile.am after informing the innodb developers. modified: storage/innobase/Makefile.am ------------------------------------------------------------------------ r5740 | jyang | 2009-09-03 06:33:47 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Sunny Bains. ------------------------------------------------------------------------ r5741 | jyang | 2009-09-03 07:16:01 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5757 | jyang | 2009-09-04 04:26:13 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h D /branches/5.1/mysql-test/innodb_bug46000.result D /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Revert change in 5740. Making the fix in a subsequent check in. ------------------------------------------------------------------------ r5760 | jyang | 2009-09-04 07:07:34 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc D /branches/5.1/mysql-test/innodb_bug44369.result D /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: This is to revert change 5741. A return status for create_table_def() needs to be fixed. ------------------------------------------------------------------------ r5797 | calvin | 2009-09-09 18:26:29 +0300 (Wed, 09 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: merge change from 5.1.38 HA_ERR_TOO_MANY_CONCURRENT_TRXS is added in 5.1.38. ------------------------------------------------------------------------ r5799 | calvin | 2009-09-09 20:47:31 +0300 (Wed, 09 Sep 2009) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: fix bug#46256 Allow tables to be dropped even if the collation is not found, but issue a warning. Could not find an easy way to add mysql-test since it requires changes to charsets and restarting the server. Tests were executed manually. Approved by: Heikki (on IM) ------------------------------------------------------------------------ r5805 | vasil | 2009-09-10 08:41:48 +0300 (Thu, 10 Sep 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix a compilation warning caused by c5799: handler/ha_innodb.cc: In function 'void innobase_get_cset_width(ulint, ulint*, ulint*)': handler/ha_innodb.cc:830: warning: format '%d' expects type 'int', but argument 2 has type 'ulint' ------------------------------------------------------------------------ r5834 | jyang | 2009-09-11 00:43:05 +0300 (Fri, 11 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5895 | jyang | 2009-09-15 03:39:21 +0300 (Tue, 15 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Marko Makela. ------------------------------------------------------------------------
16 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge r5912:6112 from branches/5.1: (after this merge the innodb-autoinc test starts to fail, but I commit anyway because it would be easier to investigate the failure this way) ------------------------------------------------------------------------ r5952 | calvin | 2009-09-22 19:45:07 +0300 (Tue, 22 Sep 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: fix bug#42383: Can't create table 'test.bug39438' For embedded server, MySQL may pass in full path, which is currently disallowed. It is needed to relax the condition by accepting full paths in the embedded case. Approved by: Heikki (on IM) ------------------------------------------------------------------------ r6032 | vasil | 2009-10-01 15:55:49 +0300 (Thu, 01 Oct 2009) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix Bug#38996 Race condition in ANALYZE TABLE by serializing ANALYZE TABLE inside InnoDB. Approved by: Heikki (rb://175) ------------------------------------------------------------------------ r6045 | jyang | 2009-10-08 02:27:08 +0300 (Thu, 08 Oct 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug47777.result A /branches/5.1/mysql-test/innodb_bug47777.test branches/5.1: Fix bug #47777. Treat the Geometry data same as Binary BLOB in ha_innobase::store_key_val_for_row(), since the Geometry data is stored as Binary BLOB in Innodb. Review: rb://180 approved by Marko Makela. ------------------------------------------------------------------------ r6051 | sunny | 2009-10-12 07:05:00 +0300 (Mon, 12 Oct 2009) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Ignore negative values supplied by the user when calculating the next value to store in dict_table_t. Setting autoincrement columns top negative values is undefined behavior and this change should bring the behavior of InnoDB closer to what users expect. Added several tests to check. rb://162 ------------------------------------------------------------------------ r6052 | sunny | 2009-10-12 07:09:56 +0300 (Mon, 12 Oct 2009) | 4 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Reset the statement level autoinc counter on ROLLBACK. Fix the test results too. rb://164 ------------------------------------------------------------------------ r6053 | sunny | 2009-10-12 07:37:49 +0300 (Mon, 12 Oct 2009) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Copy the maximum AUTOINC value from the old table to the new table when MySQL does a CREATE INDEX ON T. This is required because MySQL does a table copy, rename and drops the old table. Fix Bug#47125: auto_increment start value is ignored if an index is created and engine=innodb rb://168 ------------------------------------------------------------------------ r6076 | vasil | 2009-10-14 19:30:12 +0300 (Wed, 14 Oct 2009) | 4 lines Changed paths: M /branches/5.1/row/row0mysql.c branches/5.1: Fix typo. ------------------------------------------------------------------------
16 years ago
branches/zip: Merge r5912:6112 from branches/5.1: (after this merge the innodb-autoinc test starts to fail, but I commit anyway because it would be easier to investigate the failure this way) ------------------------------------------------------------------------ r5952 | calvin | 2009-09-22 19:45:07 +0300 (Tue, 22 Sep 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: fix bug#42383: Can't create table 'test.bug39438' For embedded server, MySQL may pass in full path, which is currently disallowed. It is needed to relax the condition by accepting full paths in the embedded case. Approved by: Heikki (on IM) ------------------------------------------------------------------------ r6032 | vasil | 2009-10-01 15:55:49 +0300 (Thu, 01 Oct 2009) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix Bug#38996 Race condition in ANALYZE TABLE by serializing ANALYZE TABLE inside InnoDB. Approved by: Heikki (rb://175) ------------------------------------------------------------------------ r6045 | jyang | 2009-10-08 02:27:08 +0300 (Thu, 08 Oct 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug47777.result A /branches/5.1/mysql-test/innodb_bug47777.test branches/5.1: Fix bug #47777. Treat the Geometry data same as Binary BLOB in ha_innobase::store_key_val_for_row(), since the Geometry data is stored as Binary BLOB in Innodb. Review: rb://180 approved by Marko Makela. ------------------------------------------------------------------------ r6051 | sunny | 2009-10-12 07:05:00 +0300 (Mon, 12 Oct 2009) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Ignore negative values supplied by the user when calculating the next value to store in dict_table_t. Setting autoincrement columns top negative values is undefined behavior and this change should bring the behavior of InnoDB closer to what users expect. Added several tests to check. rb://162 ------------------------------------------------------------------------ r6052 | sunny | 2009-10-12 07:09:56 +0300 (Mon, 12 Oct 2009) | 4 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Reset the statement level autoinc counter on ROLLBACK. Fix the test results too. rb://164 ------------------------------------------------------------------------ r6053 | sunny | 2009-10-12 07:37:49 +0300 (Mon, 12 Oct 2009) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Copy the maximum AUTOINC value from the old table to the new table when MySQL does a CREATE INDEX ON T. This is required because MySQL does a table copy, rename and drops the old table. Fix Bug#47125: auto_increment start value is ignored if an index is created and engine=innodb rb://168 ------------------------------------------------------------------------ r6076 | vasil | 2009-10-14 19:30:12 +0300 (Wed, 14 Oct 2009) | 4 lines Changed paths: M /branches/5.1/row/row0mysql.c branches/5.1: Fix typo. ------------------------------------------------------------------------
16 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge revisions 4481:4710 from branches/5.1: (resolving conflict in r4574, r4575 and skipping r4699 and r4705 because analogous changes to r4699 and r4705 were already made to branches/zip) ------------------------------------------------------------------------ r4573 | vasil | 2009-03-30 14:17:13 +0300 (Mon, 30 Mar 2009) | 4 lines Changed paths: M /branches/5.1/mysql-test/innodb.test branches/5.1: Fix email address from dev@innodb.com to innodb_dev_ww@oracle.com ------------------------------------------------------------------------ r4574 | vasil | 2009-03-30 14:27:08 +0300 (Mon, 30 Mar 2009) | 38 lines Changed paths: M /branches/5.1/Makefile.am M /branches/5.1/mysql-test/innodb.test branches/5.1: Restore the state of INNODB_THREAD_CONCURRENCY to silence this warning: TEST RESULT TIME (ms) ------------------------------------------------------------ worker[1] Using MTR_BUILD_THREAD 250, with reserved ports 12500..12509 main.innodb [ pass ] 8803 MTR's internal check of the test case 'main.innodb' failed. This means that the test case does not preserve the state that existed before the test case was executed. Most likely the test case did not do a proper clean-up. This is the diff of the states of the servers before and after the test case was executed: mysqltest: Logging to '/tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.log'. mysqltest: Results saved in '/tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.result'. mysqltest: Connecting to server localhost:12500 (socket /tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/mysqld.1.sock) as 'root', connection 'default', attempt 0 ... mysqltest: ... Connected. mysqltest: Start processing test commands from './include/check-testcase.test' ... mysqltest: ... Done processing test commands. --- /tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.result 2009-03-30 14:12:31.000000000 +0300 +++ /tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.reject 2009-03-30 14:12:41.000000000 +0300 @@ -99,7 +99,7 @@ INNODB_SUPPORT_XA ON INNODB_SYNC_SPIN_LOOPS 20 INNODB_TABLE_LOCKS ON -INNODB_THREAD_CONCURRENCY 8 +INNODB_THREAD_CONCURRENCY 16 INNODB_THREAD_SLEEP_DELAY 10000 INSERT_ID 0 INTERACTIVE_TIMEOUT 28800 mysqltest: Result content mismatch not ok ------------------------------------------------------------------------ r4575 | vasil | 2009-03-30 15:55:31 +0300 (Mon, 30 Mar 2009) | 8 lines Changed paths: M /branches/5.1/mysql-test/innodb.result M /branches/5.1/mysql-test/innodb.test branches/5.1: Fix Bug#43309 Test main.innodb can't be run twice Make the innodb mysql-test more flexible by inspecting how much a variable of interest has changed since the start of the test. Do not assume the variables have zero values at the start of the test. ------------------------------------------------------------------------ r4576 | vasil | 2009-03-30 16:25:10 +0300 (Mon, 30 Mar 2009) | 4 lines Changed paths: M /branches/5.1/Makefile.am branches/5.1: Revert a change to Makefile.am that I committed accidentally in c4574. ------------------------------------------------------------------------ r4659 | vasil | 2009-04-06 15:34:51 +0300 (Mon, 06 Apr 2009) | 6 lines Changed paths: M /branches/5.1/mysql-test/innodb.test branches/5.1: Followup to r4575 and the fix of Bug#43309 Test main.innodb can't be run twice: Add an explanatory comment, as suggested by Patrick Crews in the bug report. ------------------------------------------------------------------------ r4699 | vasil | 2009-04-09 14:01:52 +0300 (Thu, 09 Apr 2009) | 15 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/srv0srv.h M /branches/5.1/page/page0cur.c M /branches/5.1/srv/srv0srv.c branches/5.1: Fix Bug#43660 SHOW INDEXES/ANALYZE does NOT update cardinality for indexes of InnoDB table by replacing the PRNG that is used to pick random pages with a better one. This is based on r4670 but also adds a new configuration option and enables the fix only if this option is changed. Please skip the present revision when merging. Approved by: Heikki (via email) ------------------------------------------------------------------------ r4705 | vasil | 2009-04-14 14:30:13 +0300 (Tue, 14 Apr 2009) | 5 lines Changed paths: M /branches/5.1/page/page0cur.c branches/5.1: When using the random function, first take the modulus by the number of pages and then typecast to ulint. ------------------------------------------------------------------------ r4710 | vasil | 2009-04-15 11:55:18 +0300 (Wed, 15 Apr 2009) | 25 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Merge a change from MySQL (looks like this is against 5.0 but they later merged it to 5.1): ------------------------------------------------------------ revno: 1810.3846.1 committer: Alexey Botchkov <holyfoot@mysql.com> branch nick: 31435 timestamp: Tue 2008-11-11 14:42:32 +0400 message: Bug#31435 ha_innodb.cc:3983: ulint convert_search_mode_to_innobase(ha_rkey_function): Asse I think we don't need to issue an error statement in the convert_search_mode_to_innobase(). Returning the PAGE_CUR_UNSUPP value is enough as allows to handle this case depending on the requirements. per-file comments: sql/ha_innodb.cc Bug#31435 ha_innodb.cc:3983: ulint convert_search_mode_to_innobase(ha_rkey_function): Asse no error issued in convert_search_mode_to_innobase. ha_innobase::records_in_range() returns HA_POS_ERROR if search mode isn't supported. modified: sql/ha_innodb.cc ------------------------------------------------------------------------
17 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge 2929:3458 from branches/5.1 (resolving conflict in c3257, note also that r3363 reverted r2933 so there are not changes in mysql-test/innodb-autoinc.result with the current merge): ------------------------------------------------------------------------ r2933 | calvin | 2008-10-30 02:57:31 +0200 (Thu, 30 Oct 2008) | 10 lines Changed paths: M /branches/5.1/mysql-test/innodb-autoinc.result branches/5.1: correct the result file innodb-autoinc.result Change the followings: auto_increment_increment auto_increment_offset to auto-increment-increment auto-increment-offset ------------------------------------------------------------------------ r2981 | marko | 2008-11-07 14:54:10 +0200 (Fri, 07 Nov 2008) | 5 lines Changed paths: M /branches/5.1/row/row0mysql.c branches/5.0: row_mysql_store_col_in_innobase_format(): Correct a misleading comment. In the UTF-8 encoding, ASCII takes 1 byte per character, while the "latin1" character set (normally ISO-8859-1, but in MySQL it actually refers to the Windows Code Page 1252 a.k.a. CP1252, WinLatin1) takes 1 to 3 bytes (1 to 2 bytes for the ISO-8859-1 subset). ------------------------------------------------------------------------ r3114 | calvin | 2008-11-14 20:31:48 +0200 (Fri, 14 Nov 2008) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: fix bug#40386: Not flushing query cache after truncate ha_statistics.records can not be 0 unless the table is empty, set to 1 instead. The original problem of bug#29507 is fixed in the server. Additional test was done with the fix of bug#29507 in the server. Approved by: Heikki (on IM) ------------------------------------------------------------------------ r3257 | inaam | 2008-11-24 22:06:50 +0200 (Mon, 24 Nov 2008) | 13 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/srv/srv0srv.c M /branches/5.1/trx/trx0trx.c branches/5.1 bug#40760 The config param innodb_thread_concurrency is dynamically set and is read when a thread enters/exits innodb. If the value is changed between the enter and exit time the behaviour becomes erratic. The fix is not to use srv_thread_concurrency when exiting, instead use the flag trx->declared_to_be_inside_innodb. rb://57 Approved by: Marko ------------------------------------------------------------------------ r3363 | calvin | 2008-12-04 19:00:20 +0200 (Thu, 04 Dec 2008) | 13 lines Changed paths: M /branches/5.1/mysql-test/innodb-autoinc.result branches/5.1: revert the changes in r2933 The changes in r2933 causes test failure on Linux. More investigation is needed for Windows. Change the followings in innodb-autoinc.result: auto-increment-increment auto-increment-offset back to: auto_increment_increment auto_increment_offset ------------------------------------------------------------------------ r3412 | vasil | 2008-12-05 10:46:18 +0200 (Fri, 05 Dec 2008) | 7 lines Changed paths: M /branches/5.1/trx/trx0undo.c branches/5.1: Add the traditional 2 spaces after the timestamp so the message does not look like: 070223 13:26:01InnoDB: Warning: canno.... ------------------------------------------------------------------------ r3458 | vasil | 2008-12-09 11:21:08 +0200 (Tue, 09 Dec 2008) | 51 lines Changed paths: M /branches/5.1/mysql-test/innodb_bug34300.test branches/5.1: Merge a change from MySQL to fix the failing innodb_bug34300 mysql-test: main.innodb_bug34300 [ fail ] mysqltest: At line 11: query 'SET @@max_allowed_packet=16777216' failed: 1621: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value Aborting: main.innodb_bug34300 failed in default mode. The changeset is this: ------------------------------------------------------------ revno: 2709.1.10 committer: Staale Smedseng <staale.smedseng@sun.com> branch nick: b22891-51-bugteam timestamp: Thu 2008-11-20 08:51:48 +0100 message: A fix for Bug#22891 "session level max_allowed_packet can be set but is ignored". This patch makes @@session.max_allowed_packed and @@session.net_buffer_length read-only as suggested in the bug report. The user will have to use SET GLOBAL (and reconnect) to alter the session values of these variables. The error string ER_VARIABLE_IS_READONLY is introduced. Tests are modified accordingly. modified: mysql-test/r/func_compress.result mysql-test/r/max_allowed_packet_basic.result mysql-test/r/max_allowed_packet_func.result mysql-test/r/net_buffer_length_basic.result mysql-test/r/packet.result mysql-test/r/union.result mysql-test/r/variables.result mysql-test/t/func_compress.test mysql-test/t/innodb_bug34300.test mysql-test/t/max_allowed_packet_basic.test mysql-test/t/max_allowed_packet_func.test mysql-test/t/net_buffer_length_basic.test mysql-test/t/packet.test mysql-test/t/union.test mysql-test/t/variables.test sql/set_var.cc sql/set_var.h sql/share/errmsg.txt ------------------------------------------------------------ ------------------------------------------------------------------------
17 years ago
branches/zip: Merge 2384:2423 from branches/5.1: ------------------------------------------------------------------------ r2386 | vasil | 2008-03-27 07:45:02 +0200 (Thu, 27 Mar 2008) | 22 lines branches/5.1: Merge change from MySQL (this fixes the failing innodb test): ChangeSet@1.1810.3601.4, 2008-02-07 02:33:21+04:00, gshchepa@host.loc +9 -0 Fixed bug#30059. Server handles truncation for assignment of too-long values into CHAR/VARCHAR/TEXT columns in a different ways when the truncated characters are spaces: 1. CHAR(N) columns silently ignore end-space truncation; 2. TEXT columns post a truncation warning/error in the non-strict/strict mode. 3. VARCHAR columns always post a truncation note in any mode. Space truncation processing has been synchronised over CHAR/VARCHAR/TEXT columns: current behavior of VARCHAR columns has been propagated as standard. Binary-encoded string/BLOB columns are not affected. ------------------------------------------------------------------------ r2387 | vasil | 2008-03-27 08:49:05 +0200 (Thu, 27 Mar 2008) | 8 lines branches/5.1: Check whether *trx->mysql_query_str is != NULL in addition to trx->mysql_query_str. This adds more safety. This may or may not fix Bug#35226 RBR event crashes slave. ------------------------------------------------------------------------ r2388 | vasil | 2008-03-27 14:02:34 +0200 (Thu, 27 Mar 2008) | 7 lines branches/5.1: Swap the order in which mysql_thd, mysql_query_str and *mysql_query_str are checked for non-NULL. Suggested by: Marko ------------------------------------------------------------------------ r2419 | vasil | 2008-04-23 19:08:06 +0300 (Wed, 23 Apr 2008) | 9 lines branches/5.1: Change the fix for Bug#32440 to show bytes instead of kilobytes in INFORMATION_SCHEMA.TABLES.DATA_FREE. Suggested by: Domas Mituzas <domas@mysql.com> Approved by: Heikki ------------------------------------------------------------------------ r2420 | calvin | 2008-04-24 15:25:30 +0300 (Thu, 24 Apr 2008) | 4 lines branches/5.1: Fix bug#29507 TRUNCATE shows to many rows effected In InnoDB, the row count is only a rough estimate used by SQL optimization. InnoDB is now return row count 0 for TRUNCATE operation. ------------------------------------------------------------------------ r2421 | calvin | 2008-04-24 15:32:30 +0300 (Thu, 24 Apr 2008) | 6 lines branches/5.1: Fix bug#35537 - Innodb doesn't increment handler_update and handler_delete Add the calls to ha_statistic_increment() in ha_innobase::delete_row() and ha_innobase::update_row(). ------------------------------------------------------------------------ r2422 | vasil | 2008-04-24 16:00:30 +0300 (Thu, 24 Apr 2008) | 11 lines branches/5.1: Fix Bug#36169 create innodb compressed table with too large row size crashed Sometimes it is possible that row_drop_table_for_mysql(index->table_name, trx, FALSE); is invoked in row_create_index_for_mysql() when the index object is freed so copy the table name to a safe place beforehand and use the copy. Approved by: Sunny ------------------------------------------------------------------------
18 years ago
branches/zip: Merge 2929:3458 from branches/5.1 (resolving conflict in c3257, note also that r3363 reverted r2933 so there are not changes in mysql-test/innodb-autoinc.result with the current merge): ------------------------------------------------------------------------ r2933 | calvin | 2008-10-30 02:57:31 +0200 (Thu, 30 Oct 2008) | 10 lines Changed paths: M /branches/5.1/mysql-test/innodb-autoinc.result branches/5.1: correct the result file innodb-autoinc.result Change the followings: auto_increment_increment auto_increment_offset to auto-increment-increment auto-increment-offset ------------------------------------------------------------------------ r2981 | marko | 2008-11-07 14:54:10 +0200 (Fri, 07 Nov 2008) | 5 lines Changed paths: M /branches/5.1/row/row0mysql.c branches/5.0: row_mysql_store_col_in_innobase_format(): Correct a misleading comment. In the UTF-8 encoding, ASCII takes 1 byte per character, while the "latin1" character set (normally ISO-8859-1, but in MySQL it actually refers to the Windows Code Page 1252 a.k.a. CP1252, WinLatin1) takes 1 to 3 bytes (1 to 2 bytes for the ISO-8859-1 subset). ------------------------------------------------------------------------ r3114 | calvin | 2008-11-14 20:31:48 +0200 (Fri, 14 Nov 2008) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: fix bug#40386: Not flushing query cache after truncate ha_statistics.records can not be 0 unless the table is empty, set to 1 instead. The original problem of bug#29507 is fixed in the server. Additional test was done with the fix of bug#29507 in the server. Approved by: Heikki (on IM) ------------------------------------------------------------------------ r3257 | inaam | 2008-11-24 22:06:50 +0200 (Mon, 24 Nov 2008) | 13 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/srv/srv0srv.c M /branches/5.1/trx/trx0trx.c branches/5.1 bug#40760 The config param innodb_thread_concurrency is dynamically set and is read when a thread enters/exits innodb. If the value is changed between the enter and exit time the behaviour becomes erratic. The fix is not to use srv_thread_concurrency when exiting, instead use the flag trx->declared_to_be_inside_innodb. rb://57 Approved by: Marko ------------------------------------------------------------------------ r3363 | calvin | 2008-12-04 19:00:20 +0200 (Thu, 04 Dec 2008) | 13 lines Changed paths: M /branches/5.1/mysql-test/innodb-autoinc.result branches/5.1: revert the changes in r2933 The changes in r2933 causes test failure on Linux. More investigation is needed for Windows. Change the followings in innodb-autoinc.result: auto-increment-increment auto-increment-offset back to: auto_increment_increment auto_increment_offset ------------------------------------------------------------------------ r3412 | vasil | 2008-12-05 10:46:18 +0200 (Fri, 05 Dec 2008) | 7 lines Changed paths: M /branches/5.1/trx/trx0undo.c branches/5.1: Add the traditional 2 spaces after the timestamp so the message does not look like: 070223 13:26:01InnoDB: Warning: canno.... ------------------------------------------------------------------------ r3458 | vasil | 2008-12-09 11:21:08 +0200 (Tue, 09 Dec 2008) | 51 lines Changed paths: M /branches/5.1/mysql-test/innodb_bug34300.test branches/5.1: Merge a change from MySQL to fix the failing innodb_bug34300 mysql-test: main.innodb_bug34300 [ fail ] mysqltest: At line 11: query 'SET @@max_allowed_packet=16777216' failed: 1621: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value Aborting: main.innodb_bug34300 failed in default mode. The changeset is this: ------------------------------------------------------------ revno: 2709.1.10 committer: Staale Smedseng <staale.smedseng@sun.com> branch nick: b22891-51-bugteam timestamp: Thu 2008-11-20 08:51:48 +0100 message: A fix for Bug#22891 "session level max_allowed_packet can be set but is ignored". This patch makes @@session.max_allowed_packed and @@session.net_buffer_length read-only as suggested in the bug report. The user will have to use SET GLOBAL (and reconnect) to alter the session values of these variables. The error string ER_VARIABLE_IS_READONLY is introduced. Tests are modified accordingly. modified: mysql-test/r/func_compress.result mysql-test/r/max_allowed_packet_basic.result mysql-test/r/max_allowed_packet_func.result mysql-test/r/net_buffer_length_basic.result mysql-test/r/packet.result mysql-test/r/union.result mysql-test/r/variables.result mysql-test/t/func_compress.test mysql-test/t/innodb_bug34300.test mysql-test/t/max_allowed_packet_basic.test mysql-test/t/max_allowed_packet_func.test mysql-test/t/net_buffer_length_basic.test mysql-test/t/packet.test mysql-test/t/union.test mysql-test/t/variables.test sql/set_var.cc sql/set_var.h sql/share/errmsg.txt ------------------------------------------------------------ ------------------------------------------------------------------------
17 years ago
branches/zip: Merge 2489:2524 from branches/5.1: ------------------------------------------------------------------------ r2519 | sunny | 2008-06-26 16:55:43 +0300 (Thu, 26 Jun 2008) | 5 lines branches/5.1: Add test cases and fix a bug where the last AUTOINC cached value was not reset to 0 when the table was truncated. Bug #37531 : After truncate, auto_increment behaves incorrectly for InnoDB ------------------------------------------------------------------------ r2520 | vasil | 2008-06-26 17:38:02 +0300 (Thu, 26 Jun 2008) | 7 lines branches/5.1: Fix Bug#36941 Performance problem in ha_print_info (SHOW INNODB STATUS) by disabling some of the code in ha_print_info() in production builds. Approved by: Heikki (via IM) ------------------------------------------------------------------------ r2521 | vasil | 2008-06-26 17:39:01 +0300 (Thu, 26 Jun 2008) | 8 lines branches/5.1: Fix Bug#36942 Performance problem in lock_get_n_rec_locks (SHOW INNODB STATUS) by not calling lock_get_n_rec_locks() from lock_print_info_summary() on production builds. Approved by: Heikki (via IM) ------------------------------------------------------------------------ r2524 | vasil | 2008-07-01 10:37:34 +0300 (Tue, 01 Jul 2008) | 29 lines branches/5.1: Merge a change from MySQL (this fixes the failing innodb-replace test): revno: 2659 committer: Mattias Jonsson <mattiasj@mysql.com> branch nick: b31210-51-bugteam timestamp: Tue 2008-06-03 13:25:41 +0200 message: Bug#31210: INSERT DELAYED crashes server when used on partitioned tables Problem was an unclear error message since it could suggest that MyISAM did not support INSERT DELAYED. Changed the error message to say that DELAYED is not supported by the table, instead of the table's storage engine. The confusion is that a partitioned table is in somewhat sense using the partitioning storage engine, which in turn uses the ordinary storage engine. By saying that the table does not support DELAYED we do not give any extra informantion about the storage engine or if it is partitioned. modified: mysql-test/r/innodb-replace.result mysql-test/t/innodb-replace.test mysql-test/t/merge.test mysql-test/t/partition_hash.test sql/share/errmsg.txt sql/sql_insert.cc ------------------------------------------------------------------------
18 years ago
branches/zip: Merge revisions 2702:2722 from branches/5.1: ------------------------------------------------------------------------ r2702 | sunny | 2008-09-30 11:41:56 +0300 (Tue, 30 Sep 2008) | 13 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Since handler::get_auto_increment() doesn't allow us to return the cause of failure we have to inform MySQL using the sql_print_warning() function to return the cause for autoinc failure. Previously we simply printed the error code, this patch prints the text string representing the following two error codes: DB_LOCK_WAIT_TIMEOUT DB_DEADLOCK. Bug#35498 Cannot get table test/table1 auto-inccounter value in ::info Approved by Marko. ------------------------------------------------------------------------ r2709 | vasil | 2008-10-01 10:13:13 +0300 (Wed, 01 Oct 2008) | 10 lines Changed paths: M /branches/5.1/include/lock0lock.h M /branches/5.1/lock/lock0lock.c A /branches/5.1/mysql-test/innodb_bug38231.result A /branches/5.1/mysql-test/innodb_bug38231.test M /branches/5.1/row/row0mysql.c branches/5.1: Fix Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK In TRUNCATE TABLE and discard tablespace: do not remove table-level S and X locks and do not assert on such locks not being wait locks. Leave such locks alone. Approved by: Heikki (rb://14) ------------------------------------------------------------------------ r2710 | vasil | 2008-10-01 14:13:58 +0300 (Wed, 01 Oct 2008) | 6 lines Changed paths: M /branches/5.1/include/sync0sync.ic branches/5.1: Silence a compilation warning in UNIV_DEBUG. Approved by: Marko (via IM) ------------------------------------------------------------------------ r2719 | vasil | 2008-10-03 18:17:28 +0300 (Fri, 03 Oct 2008) | 49 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug39438-master.opt A /branches/5.1/mysql-test/innodb_bug39438.result A /branches/5.1/mysql-test/innodb_bug39438.test branches/5.1: Fix Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch In ha_innobase::info() - do not try to get the free space for a tablespace which has been discarded with ALTER TABLE ... DISCARD TABLESPACE or if the .ibd file is missing for some other reason. ibd_file_missing and tablespace_discarded are manipulated only in row_discard_tablespace_for_mysql() and in row_import_tablespace_for_mysql() and the manipulation is protected/surrounded by row_mysql_lock_data_dictionary()/row_mysql_unlock_data_dictionary() thus we do the same in ha_innobase::info() when checking the values of those members to avoid race conditions. I have tested the code-path with UNIV_DEBUG and UNIV_SYNC_DEBUG. Looks like it is not possible to avoid mysqld printing warnings in the mysql-test case and thus this test innodb_bug39438 must be added to the list of exceptional test cases that are allowed to print warnings. For this, the following patch must be applied to the mysql source tree: --- cut --- === modified file 'mysql-test/lib/mtr_report.pl' --- mysql-test/lib/mtr_report.pl 2008-08-12 10:26:23 +0000 +++ mysql-test/lib/mtr_report.pl 2008-10-01 11:57:41 +0000 @@ -412,7 +412,10 @@ # When trying to set lower_case_table_names = 2 # on a case sensitive file system. Bug#37402. - /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ + /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ or + + # this test is expected to print warnings + ($testname eq 'main.innodb_bug39438') ) { next; # Skip these lines --- cut --- The mysql-test is currently somewhat disabled (see inside innodb_bug39438.test), after the above patch has been applied to the mysql source tree, the test can be enabled. rb://20 Reviewed by: Inaam, Calvin Approved by: Heikki ------------------------------------------------------------------------ r2720 | vasil | 2008-10-03 19:52:39 +0300 (Fri, 03 Oct 2008) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Print a warning if an attempt is made to get the free space for a table whose .ibd file is missing or the tablespace has been discarded. This is a followup to r2719. Suggested by: Inaam ------------------------------------------------------------------------ r2721 | sunny | 2008-10-04 02:08:23 +0300 (Sat, 04 Oct 2008) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: We need to send the messages to the client because handler::get_auto_increment() doesn't allow a way to return the specific error for why it failed. rb://18 ------------------------------------------------------------------------ r2722 | sunny | 2008-10-04 02:48:04 +0300 (Sat, 04 Oct 2008) | 18 lines Changed paths: M /branches/5.1/dict/dict0mem.c M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/dict0mem.h M /branches/5.1/include/row0mysql.h M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test M /branches/5.1/row/row0mysql.c branches/5.1: This bug has always existed but was masked by other errors. The fix for bug# 38839 triggered this bug. When the offset and increment are > 1 we need to calculate the next value taking into consideration the two variables. Previously we simply assumed they were 1 particularly offset was never used. MySQL does its own calculation and that's probably why it seemed to work in the past. We would return what we thought was the correct next value and then MySQL would recalculate the actual value from that and return it to the caller (e.g., handler::write_row()). Several new tests have been added that try and catch some edge cases. The tests exposed a wrap around error in MySQL next value calculation which was filed as bug#39828. The tests will need to be updated once MySQL fix that bug. One good side effect of this fix is that dict_table_t size has been reduced by 8 bytes because we have moved the autoinc_increment field to the row_prebuilt_t structure. See review-board for a detailed discussion. rb://3 ------------------------------------------------------------------------
17 years ago
branches/zip: Merge 2384:2423 from branches/5.1: ------------------------------------------------------------------------ r2386 | vasil | 2008-03-27 07:45:02 +0200 (Thu, 27 Mar 2008) | 22 lines branches/5.1: Merge change from MySQL (this fixes the failing innodb test): ChangeSet@1.1810.3601.4, 2008-02-07 02:33:21+04:00, gshchepa@host.loc +9 -0 Fixed bug#30059. Server handles truncation for assignment of too-long values into CHAR/VARCHAR/TEXT columns in a different ways when the truncated characters are spaces: 1. CHAR(N) columns silently ignore end-space truncation; 2. TEXT columns post a truncation warning/error in the non-strict/strict mode. 3. VARCHAR columns always post a truncation note in any mode. Space truncation processing has been synchronised over CHAR/VARCHAR/TEXT columns: current behavior of VARCHAR columns has been propagated as standard. Binary-encoded string/BLOB columns are not affected. ------------------------------------------------------------------------ r2387 | vasil | 2008-03-27 08:49:05 +0200 (Thu, 27 Mar 2008) | 8 lines branches/5.1: Check whether *trx->mysql_query_str is != NULL in addition to trx->mysql_query_str. This adds more safety. This may or may not fix Bug#35226 RBR event crashes slave. ------------------------------------------------------------------------ r2388 | vasil | 2008-03-27 14:02:34 +0200 (Thu, 27 Mar 2008) | 7 lines branches/5.1: Swap the order in which mysql_thd, mysql_query_str and *mysql_query_str are checked for non-NULL. Suggested by: Marko ------------------------------------------------------------------------ r2419 | vasil | 2008-04-23 19:08:06 +0300 (Wed, 23 Apr 2008) | 9 lines branches/5.1: Change the fix for Bug#32440 to show bytes instead of kilobytes in INFORMATION_SCHEMA.TABLES.DATA_FREE. Suggested by: Domas Mituzas <domas@mysql.com> Approved by: Heikki ------------------------------------------------------------------------ r2420 | calvin | 2008-04-24 15:25:30 +0300 (Thu, 24 Apr 2008) | 4 lines branches/5.1: Fix bug#29507 TRUNCATE shows to many rows effected In InnoDB, the row count is only a rough estimate used by SQL optimization. InnoDB is now return row count 0 for TRUNCATE operation. ------------------------------------------------------------------------ r2421 | calvin | 2008-04-24 15:32:30 +0300 (Thu, 24 Apr 2008) | 6 lines branches/5.1: Fix bug#35537 - Innodb doesn't increment handler_update and handler_delete Add the calls to ha_statistic_increment() in ha_innobase::delete_row() and ha_innobase::update_row(). ------------------------------------------------------------------------ r2422 | vasil | 2008-04-24 16:00:30 +0300 (Thu, 24 Apr 2008) | 11 lines branches/5.1: Fix Bug#36169 create innodb compressed table with too large row size crashed Sometimes it is possible that row_drop_table_for_mysql(index->table_name, trx, FALSE); is invoked in row_create_index_for_mysql() when the index object is freed so copy the table name to a safe place beforehand and use the copy. Approved by: Sunny ------------------------------------------------------------------------
18 years ago
20 years ago
20 years ago
branches/zip: Merge 2537:2605 from branches/5.1: ------------------------------------------------------------------------ r2545 | vasil | 2008-07-25 17:24:23 +0300 (Fri, 25 Jul 2008) | 37 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix Bug#38185 ha_innobase::info can hold locks even when called with HA_STATUS_NO_LOCK The fix is to call fsp_get_available_space_in_free_extents() from ha_innobase::info() only if HA_STATUS_NO_LOCK is not present in the flag *AND* change get_schema_tables_record() in MySQL's sql/sql_show.cc to call ::info() *without* HA_STATUS_NO_LOCK whenever a user issues SELECT FROM information_schema.tables; Without the change to sql/sql_show.cc this patch would lead to Bug#32440 resurfacing. I.e. delete_length would never be updated in ::info() and will remain 0 forever, resulting in the free space not being shown anywhere. This is the change to sql/sql_show.cc for reference, it needs to be committed to the MySQL repo before or at the same time with this change to ha_innodb.cc: --- patch begins here --- --- sql/sql_show.cc.orig 2008-07-23 09:32:14.000000000 +0300 +++ sql/sql_show.cc 2008-07-23 09:32:19.000000000 +0300 @@ -3549,8 +3549,7 @@ static int get_schema_tables_record(THD if(file) { - file->info(HA_STATUS_VARIABLE | HA_STATUS_TIME | HA_STATUS_AUTO | - HA_STATUS_NO_LOCK); + file->info(HA_STATUS_VARIABLE | HA_STATUS_TIME | HA_STATUS_AUTO); enum row_type row_type = file->get_row_type(); switch (row_type) { case ROW_TYPE_NOT_USED: --- patch ends here --- Approved by: Heikki ------------------------------------------------------------------------ r2603 | marko | 2008-08-21 16:25:05 +0300 (Thu, 21 Aug 2008) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/ha_prototypes.h M /branches/5.1/row/row0sel.c branches/5.1: Identify SELECT statements by thd_sql_command() == SQLCOM_SELECT instead of parsing the query string. This fixes MySQL Bug #37885 without us having to implement lexical analysis of SQL comments in yet another place. thd_is_select(): A new predicate. row_search_for_mysql(): Use thd_is_select(). Approved by Heikki. ------------------------------------------------------------------------
17 years ago
branches/zip: Merge revisions 2702:2722 from branches/5.1: ------------------------------------------------------------------------ r2702 | sunny | 2008-09-30 11:41:56 +0300 (Tue, 30 Sep 2008) | 13 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Since handler::get_auto_increment() doesn't allow us to return the cause of failure we have to inform MySQL using the sql_print_warning() function to return the cause for autoinc failure. Previously we simply printed the error code, this patch prints the text string representing the following two error codes: DB_LOCK_WAIT_TIMEOUT DB_DEADLOCK. Bug#35498 Cannot get table test/table1 auto-inccounter value in ::info Approved by Marko. ------------------------------------------------------------------------ r2709 | vasil | 2008-10-01 10:13:13 +0300 (Wed, 01 Oct 2008) | 10 lines Changed paths: M /branches/5.1/include/lock0lock.h M /branches/5.1/lock/lock0lock.c A /branches/5.1/mysql-test/innodb_bug38231.result A /branches/5.1/mysql-test/innodb_bug38231.test M /branches/5.1/row/row0mysql.c branches/5.1: Fix Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK In TRUNCATE TABLE and discard tablespace: do not remove table-level S and X locks and do not assert on such locks not being wait locks. Leave such locks alone. Approved by: Heikki (rb://14) ------------------------------------------------------------------------ r2710 | vasil | 2008-10-01 14:13:58 +0300 (Wed, 01 Oct 2008) | 6 lines Changed paths: M /branches/5.1/include/sync0sync.ic branches/5.1: Silence a compilation warning in UNIV_DEBUG. Approved by: Marko (via IM) ------------------------------------------------------------------------ r2719 | vasil | 2008-10-03 18:17:28 +0300 (Fri, 03 Oct 2008) | 49 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug39438-master.opt A /branches/5.1/mysql-test/innodb_bug39438.result A /branches/5.1/mysql-test/innodb_bug39438.test branches/5.1: Fix Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch In ha_innobase::info() - do not try to get the free space for a tablespace which has been discarded with ALTER TABLE ... DISCARD TABLESPACE or if the .ibd file is missing for some other reason. ibd_file_missing and tablespace_discarded are manipulated only in row_discard_tablespace_for_mysql() and in row_import_tablespace_for_mysql() and the manipulation is protected/surrounded by row_mysql_lock_data_dictionary()/row_mysql_unlock_data_dictionary() thus we do the same in ha_innobase::info() when checking the values of those members to avoid race conditions. I have tested the code-path with UNIV_DEBUG and UNIV_SYNC_DEBUG. Looks like it is not possible to avoid mysqld printing warnings in the mysql-test case and thus this test innodb_bug39438 must be added to the list of exceptional test cases that are allowed to print warnings. For this, the following patch must be applied to the mysql source tree: --- cut --- === modified file 'mysql-test/lib/mtr_report.pl' --- mysql-test/lib/mtr_report.pl 2008-08-12 10:26:23 +0000 +++ mysql-test/lib/mtr_report.pl 2008-10-01 11:57:41 +0000 @@ -412,7 +412,10 @@ # When trying to set lower_case_table_names = 2 # on a case sensitive file system. Bug#37402. - /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ + /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ or + + # this test is expected to print warnings + ($testname eq 'main.innodb_bug39438') ) { next; # Skip these lines --- cut --- The mysql-test is currently somewhat disabled (see inside innodb_bug39438.test), after the above patch has been applied to the mysql source tree, the test can be enabled. rb://20 Reviewed by: Inaam, Calvin Approved by: Heikki ------------------------------------------------------------------------ r2720 | vasil | 2008-10-03 19:52:39 +0300 (Fri, 03 Oct 2008) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Print a warning if an attempt is made to get the free space for a table whose .ibd file is missing or the tablespace has been discarded. This is a followup to r2719. Suggested by: Inaam ------------------------------------------------------------------------ r2721 | sunny | 2008-10-04 02:08:23 +0300 (Sat, 04 Oct 2008) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: We need to send the messages to the client because handler::get_auto_increment() doesn't allow a way to return the specific error for why it failed. rb://18 ------------------------------------------------------------------------ r2722 | sunny | 2008-10-04 02:48:04 +0300 (Sat, 04 Oct 2008) | 18 lines Changed paths: M /branches/5.1/dict/dict0mem.c M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/dict0mem.h M /branches/5.1/include/row0mysql.h M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test M /branches/5.1/row/row0mysql.c branches/5.1: This bug has always existed but was masked by other errors. The fix for bug# 38839 triggered this bug. When the offset and increment are > 1 we need to calculate the next value taking into consideration the two variables. Previously we simply assumed they were 1 particularly offset was never used. MySQL does its own calculation and that's probably why it seemed to work in the past. We would return what we thought was the correct next value and then MySQL would recalculate the actual value from that and return it to the caller (e.g., handler::write_row()). Several new tests have been added that try and catch some edge cases. The tests exposed a wrap around error in MySQL next value calculation which was filed as bug#39828. The tests will need to be updated once MySQL fix that bug. One good side effect of this fix is that dict_table_t size has been reduced by 8 bytes because we have moved the autoinc_increment field to the row_prebuilt_t structure. See review-board for a detailed discussion. rb://3 ------------------------------------------------------------------------
17 years ago
branches/zip: Merge 2744:2837 from branches/5.1 (skipping r2782 and r2826): ------------------------------------------------------------------------ r2832 | vasil | 2008-10-21 10:08:30 +0300 (Tue, 21 Oct 2008) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: In ha_innobase::info(): Replace sql_print_warning() which prints to mysqld error log with push_warning_printf() which sends the error message to the client. Suggested by: Marko, Sunny, Michael Objected by: Inaam ------------------------------------------------------------------------ r2837 | vasil | 2008-10-21 12:07:44 +0300 (Tue, 21 Oct 2008) | 32 lines Changed paths: M /branches/5.1/mysql-test/innodb-semi-consistent.result M /branches/5.1/mysql-test/innodb-semi-consistent.test M /branches/5.1/mysql-test/innodb.result M /branches/5.1/mysql-test/innodb.test branches/5.1: Merge a change from MySQL (this fixes the failing innodb and innodb-semi-consistent tests): revno: 2757 committer: Georgi Kodinov <kgeorge@mysql.com> branch nick: B39812-5.1-5.1.29-rc timestamp: Fri 2008-10-03 15:24:19 +0300 message: Bug #39812: Make statement replication default for 5.1 (to match 5.0) Make STMT replication default for 5.1. Add a default of MIXED into the config files Fix the tests that needed MIXED replication mode. modified: mysql-test/include/mix1.inc mysql-test/r/innodb-semi-consistent.result mysql-test/r/innodb.result mysql-test/r/innodb_mysql.result mysql-test/r/tx_isolation_func.result mysql-test/t/innodb-semi-consistent.test mysql-test/t/innodb.test mysql-test/t/tx_isolation_func.test sql/mysqld.cc support-files/my-huge.cnf.sh support-files/my-innodb-heavy-4G.cnf.sh support-files/my-large.cnf.sh support-files/my-medium.cnf.sh support-files/my-small.cnf.sh ------------------------------------------------------------------------
17 years ago
branches/zip: Merge revisions 2702:2722 from branches/5.1: ------------------------------------------------------------------------ r2702 | sunny | 2008-09-30 11:41:56 +0300 (Tue, 30 Sep 2008) | 13 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Since handler::get_auto_increment() doesn't allow us to return the cause of failure we have to inform MySQL using the sql_print_warning() function to return the cause for autoinc failure. Previously we simply printed the error code, this patch prints the text string representing the following two error codes: DB_LOCK_WAIT_TIMEOUT DB_DEADLOCK. Bug#35498 Cannot get table test/table1 auto-inccounter value in ::info Approved by Marko. ------------------------------------------------------------------------ r2709 | vasil | 2008-10-01 10:13:13 +0300 (Wed, 01 Oct 2008) | 10 lines Changed paths: M /branches/5.1/include/lock0lock.h M /branches/5.1/lock/lock0lock.c A /branches/5.1/mysql-test/innodb_bug38231.result A /branches/5.1/mysql-test/innodb_bug38231.test M /branches/5.1/row/row0mysql.c branches/5.1: Fix Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK In TRUNCATE TABLE and discard tablespace: do not remove table-level S and X locks and do not assert on such locks not being wait locks. Leave such locks alone. Approved by: Heikki (rb://14) ------------------------------------------------------------------------ r2710 | vasil | 2008-10-01 14:13:58 +0300 (Wed, 01 Oct 2008) | 6 lines Changed paths: M /branches/5.1/include/sync0sync.ic branches/5.1: Silence a compilation warning in UNIV_DEBUG. Approved by: Marko (via IM) ------------------------------------------------------------------------ r2719 | vasil | 2008-10-03 18:17:28 +0300 (Fri, 03 Oct 2008) | 49 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug39438-master.opt A /branches/5.1/mysql-test/innodb_bug39438.result A /branches/5.1/mysql-test/innodb_bug39438.test branches/5.1: Fix Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch In ha_innobase::info() - do not try to get the free space for a tablespace which has been discarded with ALTER TABLE ... DISCARD TABLESPACE or if the .ibd file is missing for some other reason. ibd_file_missing and tablespace_discarded are manipulated only in row_discard_tablespace_for_mysql() and in row_import_tablespace_for_mysql() and the manipulation is protected/surrounded by row_mysql_lock_data_dictionary()/row_mysql_unlock_data_dictionary() thus we do the same in ha_innobase::info() when checking the values of those members to avoid race conditions. I have tested the code-path with UNIV_DEBUG and UNIV_SYNC_DEBUG. Looks like it is not possible to avoid mysqld printing warnings in the mysql-test case and thus this test innodb_bug39438 must be added to the list of exceptional test cases that are allowed to print warnings. For this, the following patch must be applied to the mysql source tree: --- cut --- === modified file 'mysql-test/lib/mtr_report.pl' --- mysql-test/lib/mtr_report.pl 2008-08-12 10:26:23 +0000 +++ mysql-test/lib/mtr_report.pl 2008-10-01 11:57:41 +0000 @@ -412,7 +412,10 @@ # When trying to set lower_case_table_names = 2 # on a case sensitive file system. Bug#37402. - /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ + /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ or + + # this test is expected to print warnings + ($testname eq 'main.innodb_bug39438') ) { next; # Skip these lines --- cut --- The mysql-test is currently somewhat disabled (see inside innodb_bug39438.test), after the above patch has been applied to the mysql source tree, the test can be enabled. rb://20 Reviewed by: Inaam, Calvin Approved by: Heikki ------------------------------------------------------------------------ r2720 | vasil | 2008-10-03 19:52:39 +0300 (Fri, 03 Oct 2008) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Print a warning if an attempt is made to get the free space for a table whose .ibd file is missing or the tablespace has been discarded. This is a followup to r2719. Suggested by: Inaam ------------------------------------------------------------------------ r2721 | sunny | 2008-10-04 02:08:23 +0300 (Sat, 04 Oct 2008) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: We need to send the messages to the client because handler::get_auto_increment() doesn't allow a way to return the specific error for why it failed. rb://18 ------------------------------------------------------------------------ r2722 | sunny | 2008-10-04 02:48:04 +0300 (Sat, 04 Oct 2008) | 18 lines Changed paths: M /branches/5.1/dict/dict0mem.c M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/dict0mem.h M /branches/5.1/include/row0mysql.h M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test M /branches/5.1/row/row0mysql.c branches/5.1: This bug has always existed but was masked by other errors. The fix for bug# 38839 triggered this bug. When the offset and increment are > 1 we need to calculate the next value taking into consideration the two variables. Previously we simply assumed they were 1 particularly offset was never used. MySQL does its own calculation and that's probably why it seemed to work in the past. We would return what we thought was the correct next value and then MySQL would recalculate the actual value from that and return it to the caller (e.g., handler::write_row()). Several new tests have been added that try and catch some edge cases. The tests exposed a wrap around error in MySQL next value calculation which was filed as bug#39828. The tests will need to be updated once MySQL fix that bug. One good side effect of this fix is that dict_table_t size has been reduced by 8 bytes because we have moved the autoinc_increment field to the row_prebuilt_t structure. See review-board for a detailed discussion. rb://3 ------------------------------------------------------------------------
17 years ago
branches/zip: Merge 2537:2605 from branches/5.1: ------------------------------------------------------------------------ r2545 | vasil | 2008-07-25 17:24:23 +0300 (Fri, 25 Jul 2008) | 37 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix Bug#38185 ha_innobase::info can hold locks even when called with HA_STATUS_NO_LOCK The fix is to call fsp_get_available_space_in_free_extents() from ha_innobase::info() only if HA_STATUS_NO_LOCK is not present in the flag *AND* change get_schema_tables_record() in MySQL's sql/sql_show.cc to call ::info() *without* HA_STATUS_NO_LOCK whenever a user issues SELECT FROM information_schema.tables; Without the change to sql/sql_show.cc this patch would lead to Bug#32440 resurfacing. I.e. delete_length would never be updated in ::info() and will remain 0 forever, resulting in the free space not being shown anywhere. This is the change to sql/sql_show.cc for reference, it needs to be committed to the MySQL repo before or at the same time with this change to ha_innodb.cc: --- patch begins here --- --- sql/sql_show.cc.orig 2008-07-23 09:32:14.000000000 +0300 +++ sql/sql_show.cc 2008-07-23 09:32:19.000000000 +0300 @@ -3549,8 +3549,7 @@ static int get_schema_tables_record(THD if(file) { - file->info(HA_STATUS_VARIABLE | HA_STATUS_TIME | HA_STATUS_AUTO | - HA_STATUS_NO_LOCK); + file->info(HA_STATUS_VARIABLE | HA_STATUS_TIME | HA_STATUS_AUTO); enum row_type row_type = file->get_row_type(); switch (row_type) { case ROW_TYPE_NOT_USED: --- patch ends here --- Approved by: Heikki ------------------------------------------------------------------------ r2603 | marko | 2008-08-21 16:25:05 +0300 (Thu, 21 Aug 2008) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/ha_prototypes.h M /branches/5.1/row/row0sel.c branches/5.1: Identify SELECT statements by thd_sql_command() == SQLCOM_SELECT instead of parsing the query string. This fixes MySQL Bug #37885 without us having to implement lexical analysis of SQL comments in yet another place. thd_is_select(): A new predicate. row_search_for_mysql(): Use thd_is_select(). Approved by Heikki. ------------------------------------------------------------------------
17 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge r5912:6112 from branches/5.1: (after this merge the innodb-autoinc test starts to fail, but I commit anyway because it would be easier to investigate the failure this way) ------------------------------------------------------------------------ r5952 | calvin | 2009-09-22 19:45:07 +0300 (Tue, 22 Sep 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: fix bug#42383: Can't create table 'test.bug39438' For embedded server, MySQL may pass in full path, which is currently disallowed. It is needed to relax the condition by accepting full paths in the embedded case. Approved by: Heikki (on IM) ------------------------------------------------------------------------ r6032 | vasil | 2009-10-01 15:55:49 +0300 (Thu, 01 Oct 2009) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix Bug#38996 Race condition in ANALYZE TABLE by serializing ANALYZE TABLE inside InnoDB. Approved by: Heikki (rb://175) ------------------------------------------------------------------------ r6045 | jyang | 2009-10-08 02:27:08 +0300 (Thu, 08 Oct 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug47777.result A /branches/5.1/mysql-test/innodb_bug47777.test branches/5.1: Fix bug #47777. Treat the Geometry data same as Binary BLOB in ha_innobase::store_key_val_for_row(), since the Geometry data is stored as Binary BLOB in Innodb. Review: rb://180 approved by Marko Makela. ------------------------------------------------------------------------ r6051 | sunny | 2009-10-12 07:05:00 +0300 (Mon, 12 Oct 2009) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Ignore negative values supplied by the user when calculating the next value to store in dict_table_t. Setting autoincrement columns top negative values is undefined behavior and this change should bring the behavior of InnoDB closer to what users expect. Added several tests to check. rb://162 ------------------------------------------------------------------------ r6052 | sunny | 2009-10-12 07:09:56 +0300 (Mon, 12 Oct 2009) | 4 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Reset the statement level autoinc counter on ROLLBACK. Fix the test results too. rb://164 ------------------------------------------------------------------------ r6053 | sunny | 2009-10-12 07:37:49 +0300 (Mon, 12 Oct 2009) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Copy the maximum AUTOINC value from the old table to the new table when MySQL does a CREATE INDEX ON T. This is required because MySQL does a table copy, rename and drops the old table. Fix Bug#47125: auto_increment start value is ignored if an index is created and engine=innodb rb://168 ------------------------------------------------------------------------ r6076 | vasil | 2009-10-14 19:30:12 +0300 (Wed, 14 Oct 2009) | 4 lines Changed paths: M /branches/5.1/row/row0mysql.c branches/5.1: Fix typo. ------------------------------------------------------------------------
16 years ago
20 years ago
branches/zip: Merge r5912:6112 from branches/5.1: (after this merge the innodb-autoinc test starts to fail, but I commit anyway because it would be easier to investigate the failure this way) ------------------------------------------------------------------------ r5952 | calvin | 2009-09-22 19:45:07 +0300 (Tue, 22 Sep 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: fix bug#42383: Can't create table 'test.bug39438' For embedded server, MySQL may pass in full path, which is currently disallowed. It is needed to relax the condition by accepting full paths in the embedded case. Approved by: Heikki (on IM) ------------------------------------------------------------------------ r6032 | vasil | 2009-10-01 15:55:49 +0300 (Thu, 01 Oct 2009) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix Bug#38996 Race condition in ANALYZE TABLE by serializing ANALYZE TABLE inside InnoDB. Approved by: Heikki (rb://175) ------------------------------------------------------------------------ r6045 | jyang | 2009-10-08 02:27:08 +0300 (Thu, 08 Oct 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug47777.result A /branches/5.1/mysql-test/innodb_bug47777.test branches/5.1: Fix bug #47777. Treat the Geometry data same as Binary BLOB in ha_innobase::store_key_val_for_row(), since the Geometry data is stored as Binary BLOB in Innodb. Review: rb://180 approved by Marko Makela. ------------------------------------------------------------------------ r6051 | sunny | 2009-10-12 07:05:00 +0300 (Mon, 12 Oct 2009) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Ignore negative values supplied by the user when calculating the next value to store in dict_table_t. Setting autoincrement columns top negative values is undefined behavior and this change should bring the behavior of InnoDB closer to what users expect. Added several tests to check. rb://162 ------------------------------------------------------------------------ r6052 | sunny | 2009-10-12 07:09:56 +0300 (Mon, 12 Oct 2009) | 4 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Reset the statement level autoinc counter on ROLLBACK. Fix the test results too. rb://164 ------------------------------------------------------------------------ r6053 | sunny | 2009-10-12 07:37:49 +0300 (Mon, 12 Oct 2009) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Copy the maximum AUTOINC value from the old table to the new table when MySQL does a CREATE INDEX ON T. This is required because MySQL does a table copy, rename and drops the old table. Fix Bug#47125: auto_increment start value is ignored if an index is created and engine=innodb rb://168 ------------------------------------------------------------------------ r6076 | vasil | 2009-10-14 19:30:12 +0300 (Wed, 14 Oct 2009) | 4 lines Changed paths: M /branches/5.1/row/row0mysql.c branches/5.1: Fix typo. ------------------------------------------------------------------------
16 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge revisions 4710:4746 from branches/5.1: ------------------------------------------------------------------------ r4746 | vasil | 2009-04-18 00:32:08 +0300 (Sat, 18 Apr 2009) | 110 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/pars0pars.h branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2728.10.2 committer: Ignacio Galarza <iggy@mysql.com> branch nick: mysql-5.1-bugteam-bug29125 timestamp: Fri 2009-02-13 11:41:47 -0500 message: Bug#29125 Windows Server X64: so many compiler warnings - Remove bothersome warning messages. This change focuses on the warnings that are covered by the ignore file: support-files/compiler_warnings.supp. - Strings are guaranteed to be max uint in length modified: client/mysql_upgrade.c client/mysqladmin.cc client/mysqlbinlog.cc client/mysqlcheck.c client/mysqldump.c client/mysqlslap.c client/mysqltest.cc client/sql_string.cc extra/comp_err.c extra/yassl/src/buffer.cpp extra/yassl/taocrypt/include/block.hpp extra/yassl/taocrypt/src/algebra.cpp extra/yassl/taocrypt/src/asn.cpp include/config-win.h libmysql/libmysql.c mysys/array.c mysys/base64.c mysys/charset.c mysys/checksum.c mysys/default.c mysys/default_modify.c mysys/hash.c mysys/mf_keycache.c mysys/mf_tempdir.c mysys/my_append.c mysys/my_compress.c mysys/my_conio.c mysys/my_copy.c mysys/my_getwd.c mysys/my_pread.c mysys/my_quick.c mysys/my_read.c mysys/safemalloc.c mysys/string.c server-tools/instance-manager/buffer.cc server-tools/instance-manager/instance.cc server-tools/instance-manager/options.cc server-tools/instance-manager/parse.h sql-common/client.c sql-common/my_user.c sql/event_data_objects.cc sql/event_parse_data.cc sql/events.cc sql/gen_lex_hash.cc sql/item.h sql/item_func.cc sql/item_strfunc.cc sql/item_timefunc.cc sql/lock.cc sql/log_event.cc sql/log_event.h sql/log_event_old.cc sql/net_serv.cc sql/sp_head.h sql/spatial.h sql/sql_class.h sql/sql_connect.cc sql/sql_crypt.cc sql/sql_error.cc sql/sql_insert.cc sql/sql_lex.cc sql/sql_lex.h sql/sql_load.cc sql/sql_prepare.cc sql/sql_profile.cc sql/sql_repl.cc sql/sql_servers.cc sql/sql_string.cc sql/sql_table.cc sql/sql_trigger.cc sql/sql_udf.cc sql/sql_view.cc sql/udf_example.c sql/uniques.cc storage/archive/azio.c storage/archive/azlib.h storage/csv/ha_tina.cc storage/csv/ha_tina.h storage/csv/transparent_file.h storage/federated/ha_federated.cc storage/federated/ha_federated.h storage/heap/hp_write.c storage/innobase/handler/ha_innodb.cc storage/innobase/include/pars0pars.h storage/myisam/ha_myisam.cc storage/myisam/mi_check.c storage/myisam/mi_packrec.c storage/myisam/mi_search.c storage/myisam/rt_index.c storage/myisammrg/ha_myisammrg.cc strings/ctype.c strings/my_vsnprintf.c tests/bug25714.c tests/mysql_client_test.c
17 years ago
branches/zip: Merge 2423:2437 from branches/5.1: ------------------------------------------------------------------------ r2429 | vasil | 2008-04-30 11:19:06 +0300 (Wed, 30 Apr 2008) | 10 lines branches/5.1: * Use INNODB_CFLAGS insead of cluttering CFLAGS with InnoDB specific flags. CFLAGS are used to compile every file in the MySQL source tree. * Add INNODB_DYNAMIC_CFLAGS to the flags of the dynamic plugin and use -prefer-non-pic to make the dynamic plugin faster on i386. Approved by: Sunny ------------------------------------------------------------------------ r2430 | vasil | 2008-04-30 11:48:35 +0300 (Wed, 30 Apr 2008) | 8 lines branches/5.1: Use CFLAGS instead of INNODB_CFLAGS to avoid having incompatible flags inserted in CFLAGS and INNODB_CFLAGS and to avoid compiling mysql and innodb with different flags. Discussed with: Sunny ------------------------------------------------------------------------ r2431 | vasil | 2008-04-30 11:54:49 +0300 (Wed, 30 Apr 2008) | 4 lines branches/5.1: Fix r2430, it should be CFLAGS="$CFLAGS ..." not CFLAGS="..." ------------------------------------------------------------------------ r2432 | vasil | 2008-04-30 11:58:38 +0300 (Wed, 30 Apr 2008) | 4 lines branches/5.1: Non-functional change: use tabs for indentation in plug.in. ------------------------------------------------------------------------ r2433 | vasil | 2008-04-30 12:02:35 +0300 (Wed, 30 Apr 2008) | 5 lines branches/5.1: Add vim modeline to hint it that plug.in is a config file so it can be colorized. ------------------------------------------------------------------------ r2434 | vasil | 2008-04-30 18:45:44 +0300 (Wed, 30 Apr 2008) | 17 lines branches/5.1: Merge changes from MySQL: ChangeSet@1.2645, 2007-12-19 13:24:43+00:00, jperkin@chorlton.adsl.perkin.org.uk +14 -0 Add new pkgplugindir handling to seperate plugins from libraries, and allow override for binary distributions. Extend mysql_config to print compiled-in plugin location for third-party plugins to use. Resolves bug#31736. and ChangeSet@1.2646, 2008-01-02 13:00:46+00:00, jperkin@chorlton.adsl.perkin.org.uk +11 -0 Use pkglibdir to simplify pkgplugindir, and fix the path in a couple of Makefiles. Continuation of the fix for bug#31736. ------------------------------------------------------------------------ r2435 | vasil | 2008-04-30 19:04:36 +0300 (Wed, 30 Apr 2008) | 10 lines branches/5.1: Merge change from MySQL: ChangeSet@1.2563, 2008-03-18 19:42:04+04:00, gluh@mysql.com +1 -0 Bug#35406 5.1-opt crashes on select from I_S.REFERENTIAL_CONSTRAINTS added intialization of f_key_info.referenced_key_name for the case when referenced table is dropped ------------------------------------------------------------------------ r2436 | vasil | 2008-04-30 19:15:46 +0300 (Wed, 30 Apr 2008) | 7 lines branches/5.1: Non-functional white space change in Makefile.am: Use tabs for indentation and be consistent about spaces around the equal sign. ------------------------------------------------------------------------ r2437 | vasil | 2008-04-30 20:36:11 +0300 (Wed, 30 Apr 2008) | 8 lines branches/5.1: Fix Bug#36434 ha_innodb.so is installed in the wrong directory Change pkglib_LTLIBRARIES with pkgplugin_LTLIBRARIES which has been forgotten in this commit: http://lists.mysql.com/commits/40206 ------------------------------------------------------------------------
18 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge 2605:2617 from branches/5.1: ------------------------------------------------------------------------ r2609 | sunny | 2008-08-24 01:19:05 +0300 (Sun, 24 Aug 2008) | 12 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Fix for MySQL Bug#38839. Reset the statement level last value field in prebuilt. This field tracks the last value in an autoincrement interval. We use this value to check whether we need to update a table's AUTOINC counter, if the value written to a table is less than this value then we avoid updating the table's AUTOINC value in order to reduce mutex contention. If it's not reset (e.g., after a DELETE statement) then there is the possibility of missing updates to the table's AUTOINC counter resulting in a subsequent duplicate row error message under certain conditions (see the test case for details). Bug #38839 - auto increment does not work properly with InnoDB after update ------------------------------------------------------------------------ r2617 | vasil | 2008-09-09 15:46:17 +0300 (Tue, 09 Sep 2008) | 47 lines Changed paths: M /branches/5.1/mysql-test/innodb.result branches/5.1: Merge a change from MySQL (fix the failing innodb test): ------------------------------------------------------------ revno: 2646.12.1 committer: Mattias Jonsson <mattiasj@mysql.com> branch nick: wl4176_2-51-bugteam timestamp: Mon 2008-08-11 20:02:03 +0200 message: Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that partition is corrupt The main problem was that ALTER TABLE t ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION took another code path (over mysql_alter_table instead of mysql_admin_table) which differs in two ways: 1) alter table opens the tables in a different way than admin tables do resulting in returning with error before it tried the command 2) alter table does not start to send any diagnostic rows to the client which the lower admin functions continue to use -> resulting in assertion crash The fix: Remapped ALTER TABLE t ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION to use the same code path as ANALYZE/CHECK/OPTIMIZE/REPAIR TABLE t. Adding check in mysql_admin_table to setup the partition list for which partitions that should be used. Partitioned tables will still not work with REPAIR TABLE/PARTITION USE_FRM, since that requires moving partitions to tables, REPAIR TABLE t USE_FRM, and check that the data still fulfills the partitioning function and then move the table back to being a partition. NOTE: I have removed the following functions from the handler interface: analyze_partitions, check_partitions, optimize_partitions, repair_partitions Since they are not longer needed. THIS ALTERS THE STORAGE ENGINE API I have verified that OPTIMIZE TABLE actually rebuilds the table and calls ANALYZE. Approved by: Heikki
17 years ago
branches/zip: Merge 2605:2617 from branches/5.1: ------------------------------------------------------------------------ r2609 | sunny | 2008-08-24 01:19:05 +0300 (Sun, 24 Aug 2008) | 12 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Fix for MySQL Bug#38839. Reset the statement level last value field in prebuilt. This field tracks the last value in an autoincrement interval. We use this value to check whether we need to update a table's AUTOINC counter, if the value written to a table is less than this value then we avoid updating the table's AUTOINC value in order to reduce mutex contention. If it's not reset (e.g., after a DELETE statement) then there is the possibility of missing updates to the table's AUTOINC counter resulting in a subsequent duplicate row error message under certain conditions (see the test case for details). Bug #38839 - auto increment does not work properly with InnoDB after update ------------------------------------------------------------------------ r2617 | vasil | 2008-09-09 15:46:17 +0300 (Tue, 09 Sep 2008) | 47 lines Changed paths: M /branches/5.1/mysql-test/innodb.result branches/5.1: Merge a change from MySQL (fix the failing innodb test): ------------------------------------------------------------ revno: 2646.12.1 committer: Mattias Jonsson <mattiasj@mysql.com> branch nick: wl4176_2-51-bugteam timestamp: Mon 2008-08-11 20:02:03 +0200 message: Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that partition is corrupt The main problem was that ALTER TABLE t ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION took another code path (over mysql_alter_table instead of mysql_admin_table) which differs in two ways: 1) alter table opens the tables in a different way than admin tables do resulting in returning with error before it tried the command 2) alter table does not start to send any diagnostic rows to the client which the lower admin functions continue to use -> resulting in assertion crash The fix: Remapped ALTER TABLE t ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION to use the same code path as ANALYZE/CHECK/OPTIMIZE/REPAIR TABLE t. Adding check in mysql_admin_table to setup the partition list for which partitions that should be used. Partitioned tables will still not work with REPAIR TABLE/PARTITION USE_FRM, since that requires moving partitions to tables, REPAIR TABLE t USE_FRM, and check that the data still fulfills the partitioning function and then move the table back to being a partition. NOTE: I have removed the following functions from the handler interface: analyze_partitions, check_partitions, optimize_partitions, repair_partitions Since they are not longer needed. THIS ALTERS THE STORAGE ENGINE API I have verified that OPTIMIZE TABLE actually rebuilds the table and calls ANALYZE. Approved by: Heikki
17 years ago
branches/zip: Merge revisions 2702:2722 from branches/5.1: ------------------------------------------------------------------------ r2702 | sunny | 2008-09-30 11:41:56 +0300 (Tue, 30 Sep 2008) | 13 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Since handler::get_auto_increment() doesn't allow us to return the cause of failure we have to inform MySQL using the sql_print_warning() function to return the cause for autoinc failure. Previously we simply printed the error code, this patch prints the text string representing the following two error codes: DB_LOCK_WAIT_TIMEOUT DB_DEADLOCK. Bug#35498 Cannot get table test/table1 auto-inccounter value in ::info Approved by Marko. ------------------------------------------------------------------------ r2709 | vasil | 2008-10-01 10:13:13 +0300 (Wed, 01 Oct 2008) | 10 lines Changed paths: M /branches/5.1/include/lock0lock.h M /branches/5.1/lock/lock0lock.c A /branches/5.1/mysql-test/innodb_bug38231.result A /branches/5.1/mysql-test/innodb_bug38231.test M /branches/5.1/row/row0mysql.c branches/5.1: Fix Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK In TRUNCATE TABLE and discard tablespace: do not remove table-level S and X locks and do not assert on such locks not being wait locks. Leave such locks alone. Approved by: Heikki (rb://14) ------------------------------------------------------------------------ r2710 | vasil | 2008-10-01 14:13:58 +0300 (Wed, 01 Oct 2008) | 6 lines Changed paths: M /branches/5.1/include/sync0sync.ic branches/5.1: Silence a compilation warning in UNIV_DEBUG. Approved by: Marko (via IM) ------------------------------------------------------------------------ r2719 | vasil | 2008-10-03 18:17:28 +0300 (Fri, 03 Oct 2008) | 49 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug39438-master.opt A /branches/5.1/mysql-test/innodb_bug39438.result A /branches/5.1/mysql-test/innodb_bug39438.test branches/5.1: Fix Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch In ha_innobase::info() - do not try to get the free space for a tablespace which has been discarded with ALTER TABLE ... DISCARD TABLESPACE or if the .ibd file is missing for some other reason. ibd_file_missing and tablespace_discarded are manipulated only in row_discard_tablespace_for_mysql() and in row_import_tablespace_for_mysql() and the manipulation is protected/surrounded by row_mysql_lock_data_dictionary()/row_mysql_unlock_data_dictionary() thus we do the same in ha_innobase::info() when checking the values of those members to avoid race conditions. I have tested the code-path with UNIV_DEBUG and UNIV_SYNC_DEBUG. Looks like it is not possible to avoid mysqld printing warnings in the mysql-test case and thus this test innodb_bug39438 must be added to the list of exceptional test cases that are allowed to print warnings. For this, the following patch must be applied to the mysql source tree: --- cut --- === modified file 'mysql-test/lib/mtr_report.pl' --- mysql-test/lib/mtr_report.pl 2008-08-12 10:26:23 +0000 +++ mysql-test/lib/mtr_report.pl 2008-10-01 11:57:41 +0000 @@ -412,7 +412,10 @@ # When trying to set lower_case_table_names = 2 # on a case sensitive file system. Bug#37402. - /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ + /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ or + + # this test is expected to print warnings + ($testname eq 'main.innodb_bug39438') ) { next; # Skip these lines --- cut --- The mysql-test is currently somewhat disabled (see inside innodb_bug39438.test), after the above patch has been applied to the mysql source tree, the test can be enabled. rb://20 Reviewed by: Inaam, Calvin Approved by: Heikki ------------------------------------------------------------------------ r2720 | vasil | 2008-10-03 19:52:39 +0300 (Fri, 03 Oct 2008) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Print a warning if an attempt is made to get the free space for a table whose .ibd file is missing or the tablespace has been discarded. This is a followup to r2719. Suggested by: Inaam ------------------------------------------------------------------------ r2721 | sunny | 2008-10-04 02:08:23 +0300 (Sat, 04 Oct 2008) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: We need to send the messages to the client because handler::get_auto_increment() doesn't allow a way to return the specific error for why it failed. rb://18 ------------------------------------------------------------------------ r2722 | sunny | 2008-10-04 02:48:04 +0300 (Sat, 04 Oct 2008) | 18 lines Changed paths: M /branches/5.1/dict/dict0mem.c M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/dict0mem.h M /branches/5.1/include/row0mysql.h M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test M /branches/5.1/row/row0mysql.c branches/5.1: This bug has always existed but was masked by other errors. The fix for bug# 38839 triggered this bug. When the offset and increment are > 1 we need to calculate the next value taking into consideration the two variables. Previously we simply assumed they were 1 particularly offset was never used. MySQL does its own calculation and that's probably why it seemed to work in the past. We would return what we thought was the correct next value and then MySQL would recalculate the actual value from that and return it to the caller (e.g., handler::write_row()). Several new tests have been added that try and catch some edge cases. The tests exposed a wrap around error in MySQL next value calculation which was filed as bug#39828. The tests will need to be updated once MySQL fix that bug. One good side effect of this fix is that dict_table_t size has been reduced by 8 bytes because we have moved the autoinc_increment field to the row_prebuilt_t structure. See review-board for a detailed discussion. rb://3 ------------------------------------------------------------------------
17 years ago
branches/zip: Merge 2605:2617 from branches/5.1: ------------------------------------------------------------------------ r2609 | sunny | 2008-08-24 01:19:05 +0300 (Sun, 24 Aug 2008) | 12 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Fix for MySQL Bug#38839. Reset the statement level last value field in prebuilt. This field tracks the last value in an autoincrement interval. We use this value to check whether we need to update a table's AUTOINC counter, if the value written to a table is less than this value then we avoid updating the table's AUTOINC value in order to reduce mutex contention. If it's not reset (e.g., after a DELETE statement) then there is the possibility of missing updates to the table's AUTOINC counter resulting in a subsequent duplicate row error message under certain conditions (see the test case for details). Bug #38839 - auto increment does not work properly with InnoDB after update ------------------------------------------------------------------------ r2617 | vasil | 2008-09-09 15:46:17 +0300 (Tue, 09 Sep 2008) | 47 lines Changed paths: M /branches/5.1/mysql-test/innodb.result branches/5.1: Merge a change from MySQL (fix the failing innodb test): ------------------------------------------------------------ revno: 2646.12.1 committer: Mattias Jonsson <mattiasj@mysql.com> branch nick: wl4176_2-51-bugteam timestamp: Mon 2008-08-11 20:02:03 +0200 message: Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that partition is corrupt The main problem was that ALTER TABLE t ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION took another code path (over mysql_alter_table instead of mysql_admin_table) which differs in two ways: 1) alter table opens the tables in a different way than admin tables do resulting in returning with error before it tried the command 2) alter table does not start to send any diagnostic rows to the client which the lower admin functions continue to use -> resulting in assertion crash The fix: Remapped ALTER TABLE t ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION to use the same code path as ANALYZE/CHECK/OPTIMIZE/REPAIR TABLE t. Adding check in mysql_admin_table to setup the partition list for which partitions that should be used. Partitioned tables will still not work with REPAIR TABLE/PARTITION USE_FRM, since that requires moving partitions to tables, REPAIR TABLE t USE_FRM, and check that the data still fulfills the partitioning function and then move the table back to being a partition. NOTE: I have removed the following functions from the handler interface: analyze_partitions, check_partitions, optimize_partitions, repair_partitions Since they are not longer needed. THIS ALTERS THE STORAGE ENGINE API I have verified that OPTIMIZE TABLE actually rebuilds the table and calls ANALYZE. Approved by: Heikki
17 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge revisions 4710:4746 from branches/5.1: ------------------------------------------------------------------------ r4746 | vasil | 2009-04-18 00:32:08 +0300 (Sat, 18 Apr 2009) | 110 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/pars0pars.h branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2728.10.2 committer: Ignacio Galarza <iggy@mysql.com> branch nick: mysql-5.1-bugteam-bug29125 timestamp: Fri 2009-02-13 11:41:47 -0500 message: Bug#29125 Windows Server X64: so many compiler warnings - Remove bothersome warning messages. This change focuses on the warnings that are covered by the ignore file: support-files/compiler_warnings.supp. - Strings are guaranteed to be max uint in length modified: client/mysql_upgrade.c client/mysqladmin.cc client/mysqlbinlog.cc client/mysqlcheck.c client/mysqldump.c client/mysqlslap.c client/mysqltest.cc client/sql_string.cc extra/comp_err.c extra/yassl/src/buffer.cpp extra/yassl/taocrypt/include/block.hpp extra/yassl/taocrypt/src/algebra.cpp extra/yassl/taocrypt/src/asn.cpp include/config-win.h libmysql/libmysql.c mysys/array.c mysys/base64.c mysys/charset.c mysys/checksum.c mysys/default.c mysys/default_modify.c mysys/hash.c mysys/mf_keycache.c mysys/mf_tempdir.c mysys/my_append.c mysys/my_compress.c mysys/my_conio.c mysys/my_copy.c mysys/my_getwd.c mysys/my_pread.c mysys/my_quick.c mysys/my_read.c mysys/safemalloc.c mysys/string.c server-tools/instance-manager/buffer.cc server-tools/instance-manager/instance.cc server-tools/instance-manager/options.cc server-tools/instance-manager/parse.h sql-common/client.c sql-common/my_user.c sql/event_data_objects.cc sql/event_parse_data.cc sql/events.cc sql/gen_lex_hash.cc sql/item.h sql/item_func.cc sql/item_strfunc.cc sql/item_timefunc.cc sql/lock.cc sql/log_event.cc sql/log_event.h sql/log_event_old.cc sql/net_serv.cc sql/sp_head.h sql/spatial.h sql/sql_class.h sql/sql_connect.cc sql/sql_crypt.cc sql/sql_error.cc sql/sql_insert.cc sql/sql_lex.cc sql/sql_lex.h sql/sql_load.cc sql/sql_prepare.cc sql/sql_profile.cc sql/sql_repl.cc sql/sql_servers.cc sql/sql_string.cc sql/sql_table.cc sql/sql_trigger.cc sql/sql_udf.cc sql/sql_view.cc sql/udf_example.c sql/uniques.cc storage/archive/azio.c storage/archive/azlib.h storage/csv/ha_tina.cc storage/csv/ha_tina.h storage/csv/transparent_file.h storage/federated/ha_federated.cc storage/federated/ha_federated.h storage/heap/hp_write.c storage/innobase/handler/ha_innodb.cc storage/innobase/include/pars0pars.h storage/myisam/ha_myisam.cc storage/myisam/mi_check.c storage/myisam/mi_packrec.c storage/myisam/mi_search.c storage/myisam/rt_index.c storage/myisammrg/ha_myisammrg.cc strings/ctype.c strings/my_vsnprintf.c tests/bug25714.c tests/mysql_client_test.c
17 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge revisions 4710:4746 from branches/5.1: ------------------------------------------------------------------------ r4746 | vasil | 2009-04-18 00:32:08 +0300 (Sat, 18 Apr 2009) | 110 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/pars0pars.h branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2728.10.2 committer: Ignacio Galarza <iggy@mysql.com> branch nick: mysql-5.1-bugteam-bug29125 timestamp: Fri 2009-02-13 11:41:47 -0500 message: Bug#29125 Windows Server X64: so many compiler warnings - Remove bothersome warning messages. This change focuses on the warnings that are covered by the ignore file: support-files/compiler_warnings.supp. - Strings are guaranteed to be max uint in length modified: client/mysql_upgrade.c client/mysqladmin.cc client/mysqlbinlog.cc client/mysqlcheck.c client/mysqldump.c client/mysqlslap.c client/mysqltest.cc client/sql_string.cc extra/comp_err.c extra/yassl/src/buffer.cpp extra/yassl/taocrypt/include/block.hpp extra/yassl/taocrypt/src/algebra.cpp extra/yassl/taocrypt/src/asn.cpp include/config-win.h libmysql/libmysql.c mysys/array.c mysys/base64.c mysys/charset.c mysys/checksum.c mysys/default.c mysys/default_modify.c mysys/hash.c mysys/mf_keycache.c mysys/mf_tempdir.c mysys/my_append.c mysys/my_compress.c mysys/my_conio.c mysys/my_copy.c mysys/my_getwd.c mysys/my_pread.c mysys/my_quick.c mysys/my_read.c mysys/safemalloc.c mysys/string.c server-tools/instance-manager/buffer.cc server-tools/instance-manager/instance.cc server-tools/instance-manager/options.cc server-tools/instance-manager/parse.h sql-common/client.c sql-common/my_user.c sql/event_data_objects.cc sql/event_parse_data.cc sql/events.cc sql/gen_lex_hash.cc sql/item.h sql/item_func.cc sql/item_strfunc.cc sql/item_timefunc.cc sql/lock.cc sql/log_event.cc sql/log_event.h sql/log_event_old.cc sql/net_serv.cc sql/sp_head.h sql/spatial.h sql/sql_class.h sql/sql_connect.cc sql/sql_crypt.cc sql/sql_error.cc sql/sql_insert.cc sql/sql_lex.cc sql/sql_lex.h sql/sql_load.cc sql/sql_prepare.cc sql/sql_profile.cc sql/sql_repl.cc sql/sql_servers.cc sql/sql_string.cc sql/sql_table.cc sql/sql_trigger.cc sql/sql_udf.cc sql/sql_view.cc sql/udf_example.c sql/uniques.cc storage/archive/azio.c storage/archive/azlib.h storage/csv/ha_tina.cc storage/csv/ha_tina.h storage/csv/transparent_file.h storage/federated/ha_federated.cc storage/federated/ha_federated.h storage/heap/hp_write.c storage/innobase/handler/ha_innodb.cc storage/innobase/include/pars0pars.h storage/myisam/ha_myisam.cc storage/myisam/mi_check.c storage/myisam/mi_packrec.c storage/myisam/mi_search.c storage/myisam/rt_index.c storage/myisammrg/ha_myisammrg.cc strings/ctype.c strings/my_vsnprintf.c tests/bug25714.c tests/mysql_client_test.c
17 years ago
20 years ago
20 years ago
branches/zip: Merge revisions 4710:4746 from branches/5.1: ------------------------------------------------------------------------ r4746 | vasil | 2009-04-18 00:32:08 +0300 (Sat, 18 Apr 2009) | 110 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/pars0pars.h branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2728.10.2 committer: Ignacio Galarza <iggy@mysql.com> branch nick: mysql-5.1-bugteam-bug29125 timestamp: Fri 2009-02-13 11:41:47 -0500 message: Bug#29125 Windows Server X64: so many compiler warnings - Remove bothersome warning messages. This change focuses on the warnings that are covered by the ignore file: support-files/compiler_warnings.supp. - Strings are guaranteed to be max uint in length modified: client/mysql_upgrade.c client/mysqladmin.cc client/mysqlbinlog.cc client/mysqlcheck.c client/mysqldump.c client/mysqlslap.c client/mysqltest.cc client/sql_string.cc extra/comp_err.c extra/yassl/src/buffer.cpp extra/yassl/taocrypt/include/block.hpp extra/yassl/taocrypt/src/algebra.cpp extra/yassl/taocrypt/src/asn.cpp include/config-win.h libmysql/libmysql.c mysys/array.c mysys/base64.c mysys/charset.c mysys/checksum.c mysys/default.c mysys/default_modify.c mysys/hash.c mysys/mf_keycache.c mysys/mf_tempdir.c mysys/my_append.c mysys/my_compress.c mysys/my_conio.c mysys/my_copy.c mysys/my_getwd.c mysys/my_pread.c mysys/my_quick.c mysys/my_read.c mysys/safemalloc.c mysys/string.c server-tools/instance-manager/buffer.cc server-tools/instance-manager/instance.cc server-tools/instance-manager/options.cc server-tools/instance-manager/parse.h sql-common/client.c sql-common/my_user.c sql/event_data_objects.cc sql/event_parse_data.cc sql/events.cc sql/gen_lex_hash.cc sql/item.h sql/item_func.cc sql/item_strfunc.cc sql/item_timefunc.cc sql/lock.cc sql/log_event.cc sql/log_event.h sql/log_event_old.cc sql/net_serv.cc sql/sp_head.h sql/spatial.h sql/sql_class.h sql/sql_connect.cc sql/sql_crypt.cc sql/sql_error.cc sql/sql_insert.cc sql/sql_lex.cc sql/sql_lex.h sql/sql_load.cc sql/sql_prepare.cc sql/sql_profile.cc sql/sql_repl.cc sql/sql_servers.cc sql/sql_string.cc sql/sql_table.cc sql/sql_trigger.cc sql/sql_udf.cc sql/sql_view.cc sql/udf_example.c sql/uniques.cc storage/archive/azio.c storage/archive/azlib.h storage/csv/ha_tina.cc storage/csv/ha_tina.h storage/csv/transparent_file.h storage/federated/ha_federated.cc storage/federated/ha_federated.h storage/heap/hp_write.c storage/innobase/handler/ha_innodb.cc storage/innobase/include/pars0pars.h storage/myisam/ha_myisam.cc storage/myisam/mi_check.c storage/myisam/mi_packrec.c storage/myisam/mi_search.c storage/myisam/rt_index.c storage/myisammrg/ha_myisammrg.cc strings/ctype.c strings/my_vsnprintf.c tests/bug25714.c tests/mysql_client_test.c
17 years ago
branches/zip: Merge revisions 4710:4746 from branches/5.1: ------------------------------------------------------------------------ r4746 | vasil | 2009-04-18 00:32:08 +0300 (Sat, 18 Apr 2009) | 110 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/pars0pars.h branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2728.10.2 committer: Ignacio Galarza <iggy@mysql.com> branch nick: mysql-5.1-bugteam-bug29125 timestamp: Fri 2009-02-13 11:41:47 -0500 message: Bug#29125 Windows Server X64: so many compiler warnings - Remove bothersome warning messages. This change focuses on the warnings that are covered by the ignore file: support-files/compiler_warnings.supp. - Strings are guaranteed to be max uint in length modified: client/mysql_upgrade.c client/mysqladmin.cc client/mysqlbinlog.cc client/mysqlcheck.c client/mysqldump.c client/mysqlslap.c client/mysqltest.cc client/sql_string.cc extra/comp_err.c extra/yassl/src/buffer.cpp extra/yassl/taocrypt/include/block.hpp extra/yassl/taocrypt/src/algebra.cpp extra/yassl/taocrypt/src/asn.cpp include/config-win.h libmysql/libmysql.c mysys/array.c mysys/base64.c mysys/charset.c mysys/checksum.c mysys/default.c mysys/default_modify.c mysys/hash.c mysys/mf_keycache.c mysys/mf_tempdir.c mysys/my_append.c mysys/my_compress.c mysys/my_conio.c mysys/my_copy.c mysys/my_getwd.c mysys/my_pread.c mysys/my_quick.c mysys/my_read.c mysys/safemalloc.c mysys/string.c server-tools/instance-manager/buffer.cc server-tools/instance-manager/instance.cc server-tools/instance-manager/options.cc server-tools/instance-manager/parse.h sql-common/client.c sql-common/my_user.c sql/event_data_objects.cc sql/event_parse_data.cc sql/events.cc sql/gen_lex_hash.cc sql/item.h sql/item_func.cc sql/item_strfunc.cc sql/item_timefunc.cc sql/lock.cc sql/log_event.cc sql/log_event.h sql/log_event_old.cc sql/net_serv.cc sql/sp_head.h sql/spatial.h sql/sql_class.h sql/sql_connect.cc sql/sql_crypt.cc sql/sql_error.cc sql/sql_insert.cc sql/sql_lex.cc sql/sql_lex.h sql/sql_load.cc sql/sql_prepare.cc sql/sql_profile.cc sql/sql_repl.cc sql/sql_servers.cc sql/sql_string.cc sql/sql_table.cc sql/sql_trigger.cc sql/sql_udf.cc sql/sql_view.cc sql/udf_example.c sql/uniques.cc storage/archive/azio.c storage/archive/azlib.h storage/csv/ha_tina.cc storage/csv/ha_tina.h storage/csv/transparent_file.h storage/federated/ha_federated.cc storage/federated/ha_federated.h storage/heap/hp_write.c storage/innobase/handler/ha_innodb.cc storage/innobase/include/pars0pars.h storage/myisam/ha_myisam.cc storage/myisam/mi_check.c storage/myisam/mi_packrec.c storage/myisam/mi_search.c storage/myisam/rt_index.c storage/myisammrg/ha_myisammrg.cc strings/ctype.c strings/my_vsnprintf.c tests/bug25714.c tests/mysql_client_test.c
17 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge revisions 2702:2722 from branches/5.1: ------------------------------------------------------------------------ r2702 | sunny | 2008-09-30 11:41:56 +0300 (Tue, 30 Sep 2008) | 13 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Since handler::get_auto_increment() doesn't allow us to return the cause of failure we have to inform MySQL using the sql_print_warning() function to return the cause for autoinc failure. Previously we simply printed the error code, this patch prints the text string representing the following two error codes: DB_LOCK_WAIT_TIMEOUT DB_DEADLOCK. Bug#35498 Cannot get table test/table1 auto-inccounter value in ::info Approved by Marko. ------------------------------------------------------------------------ r2709 | vasil | 2008-10-01 10:13:13 +0300 (Wed, 01 Oct 2008) | 10 lines Changed paths: M /branches/5.1/include/lock0lock.h M /branches/5.1/lock/lock0lock.c A /branches/5.1/mysql-test/innodb_bug38231.result A /branches/5.1/mysql-test/innodb_bug38231.test M /branches/5.1/row/row0mysql.c branches/5.1: Fix Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK In TRUNCATE TABLE and discard tablespace: do not remove table-level S and X locks and do not assert on such locks not being wait locks. Leave such locks alone. Approved by: Heikki (rb://14) ------------------------------------------------------------------------ r2710 | vasil | 2008-10-01 14:13:58 +0300 (Wed, 01 Oct 2008) | 6 lines Changed paths: M /branches/5.1/include/sync0sync.ic branches/5.1: Silence a compilation warning in UNIV_DEBUG. Approved by: Marko (via IM) ------------------------------------------------------------------------ r2719 | vasil | 2008-10-03 18:17:28 +0300 (Fri, 03 Oct 2008) | 49 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug39438-master.opt A /branches/5.1/mysql-test/innodb_bug39438.result A /branches/5.1/mysql-test/innodb_bug39438.test branches/5.1: Fix Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch In ha_innobase::info() - do not try to get the free space for a tablespace which has been discarded with ALTER TABLE ... DISCARD TABLESPACE or if the .ibd file is missing for some other reason. ibd_file_missing and tablespace_discarded are manipulated only in row_discard_tablespace_for_mysql() and in row_import_tablespace_for_mysql() and the manipulation is protected/surrounded by row_mysql_lock_data_dictionary()/row_mysql_unlock_data_dictionary() thus we do the same in ha_innobase::info() when checking the values of those members to avoid race conditions. I have tested the code-path with UNIV_DEBUG and UNIV_SYNC_DEBUG. Looks like it is not possible to avoid mysqld printing warnings in the mysql-test case and thus this test innodb_bug39438 must be added to the list of exceptional test cases that are allowed to print warnings. For this, the following patch must be applied to the mysql source tree: --- cut --- === modified file 'mysql-test/lib/mtr_report.pl' --- mysql-test/lib/mtr_report.pl 2008-08-12 10:26:23 +0000 +++ mysql-test/lib/mtr_report.pl 2008-10-01 11:57:41 +0000 @@ -412,7 +412,10 @@ # When trying to set lower_case_table_names = 2 # on a case sensitive file system. Bug#37402. - /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ + /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ or + + # this test is expected to print warnings + ($testname eq 'main.innodb_bug39438') ) { next; # Skip these lines --- cut --- The mysql-test is currently somewhat disabled (see inside innodb_bug39438.test), after the above patch has been applied to the mysql source tree, the test can be enabled. rb://20 Reviewed by: Inaam, Calvin Approved by: Heikki ------------------------------------------------------------------------ r2720 | vasil | 2008-10-03 19:52:39 +0300 (Fri, 03 Oct 2008) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Print a warning if an attempt is made to get the free space for a table whose .ibd file is missing or the tablespace has been discarded. This is a followup to r2719. Suggested by: Inaam ------------------------------------------------------------------------ r2721 | sunny | 2008-10-04 02:08:23 +0300 (Sat, 04 Oct 2008) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: We need to send the messages to the client because handler::get_auto_increment() doesn't allow a way to return the specific error for why it failed. rb://18 ------------------------------------------------------------------------ r2722 | sunny | 2008-10-04 02:48:04 +0300 (Sat, 04 Oct 2008) | 18 lines Changed paths: M /branches/5.1/dict/dict0mem.c M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/dict0mem.h M /branches/5.1/include/row0mysql.h M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test M /branches/5.1/row/row0mysql.c branches/5.1: This bug has always existed but was masked by other errors. The fix for bug# 38839 triggered this bug. When the offset and increment are > 1 we need to calculate the next value taking into consideration the two variables. Previously we simply assumed they were 1 particularly offset was never used. MySQL does its own calculation and that's probably why it seemed to work in the past. We would return what we thought was the correct next value and then MySQL would recalculate the actual value from that and return it to the caller (e.g., handler::write_row()). Several new tests have been added that try and catch some edge cases. The tests exposed a wrap around error in MySQL next value calculation which was filed as bug#39828. The tests will need to be updated once MySQL fix that bug. One good side effect of this fix is that dict_table_t size has been reduced by 8 bytes because we have moved the autoinc_increment field to the row_prebuilt_t structure. See review-board for a detailed discussion. rb://3 ------------------------------------------------------------------------
17 years ago
branches/zip: Merge r5912:6112 from branches/5.1: (after this merge the innodb-autoinc test starts to fail, but I commit anyway because it would be easier to investigate the failure this way) ------------------------------------------------------------------------ r5952 | calvin | 2009-09-22 19:45:07 +0300 (Tue, 22 Sep 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: fix bug#42383: Can't create table 'test.bug39438' For embedded server, MySQL may pass in full path, which is currently disallowed. It is needed to relax the condition by accepting full paths in the embedded case. Approved by: Heikki (on IM) ------------------------------------------------------------------------ r6032 | vasil | 2009-10-01 15:55:49 +0300 (Thu, 01 Oct 2009) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix Bug#38996 Race condition in ANALYZE TABLE by serializing ANALYZE TABLE inside InnoDB. Approved by: Heikki (rb://175) ------------------------------------------------------------------------ r6045 | jyang | 2009-10-08 02:27:08 +0300 (Thu, 08 Oct 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug47777.result A /branches/5.1/mysql-test/innodb_bug47777.test branches/5.1: Fix bug #47777. Treat the Geometry data same as Binary BLOB in ha_innobase::store_key_val_for_row(), since the Geometry data is stored as Binary BLOB in Innodb. Review: rb://180 approved by Marko Makela. ------------------------------------------------------------------------ r6051 | sunny | 2009-10-12 07:05:00 +0300 (Mon, 12 Oct 2009) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Ignore negative values supplied by the user when calculating the next value to store in dict_table_t. Setting autoincrement columns top negative values is undefined behavior and this change should bring the behavior of InnoDB closer to what users expect. Added several tests to check. rb://162 ------------------------------------------------------------------------ r6052 | sunny | 2009-10-12 07:09:56 +0300 (Mon, 12 Oct 2009) | 4 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Reset the statement level autoinc counter on ROLLBACK. Fix the test results too. rb://164 ------------------------------------------------------------------------ r6053 | sunny | 2009-10-12 07:37:49 +0300 (Mon, 12 Oct 2009) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Copy the maximum AUTOINC value from the old table to the new table when MySQL does a CREATE INDEX ON T. This is required because MySQL does a table copy, rename and drops the old table. Fix Bug#47125: auto_increment start value is ignored if an index is created and engine=innodb rb://168 ------------------------------------------------------------------------ r6076 | vasil | 2009-10-14 19:30:12 +0300 (Wed, 14 Oct 2009) | 4 lines Changed paths: M /branches/5.1/row/row0mysql.c branches/5.1: Fix typo. ------------------------------------------------------------------------
16 years ago
branches/zip: Merge revisions 2702:2722 from branches/5.1: ------------------------------------------------------------------------ r2702 | sunny | 2008-09-30 11:41:56 +0300 (Tue, 30 Sep 2008) | 13 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Since handler::get_auto_increment() doesn't allow us to return the cause of failure we have to inform MySQL using the sql_print_warning() function to return the cause for autoinc failure. Previously we simply printed the error code, this patch prints the text string representing the following two error codes: DB_LOCK_WAIT_TIMEOUT DB_DEADLOCK. Bug#35498 Cannot get table test/table1 auto-inccounter value in ::info Approved by Marko. ------------------------------------------------------------------------ r2709 | vasil | 2008-10-01 10:13:13 +0300 (Wed, 01 Oct 2008) | 10 lines Changed paths: M /branches/5.1/include/lock0lock.h M /branches/5.1/lock/lock0lock.c A /branches/5.1/mysql-test/innodb_bug38231.result A /branches/5.1/mysql-test/innodb_bug38231.test M /branches/5.1/row/row0mysql.c branches/5.1: Fix Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK In TRUNCATE TABLE and discard tablespace: do not remove table-level S and X locks and do not assert on such locks not being wait locks. Leave such locks alone. Approved by: Heikki (rb://14) ------------------------------------------------------------------------ r2710 | vasil | 2008-10-01 14:13:58 +0300 (Wed, 01 Oct 2008) | 6 lines Changed paths: M /branches/5.1/include/sync0sync.ic branches/5.1: Silence a compilation warning in UNIV_DEBUG. Approved by: Marko (via IM) ------------------------------------------------------------------------ r2719 | vasil | 2008-10-03 18:17:28 +0300 (Fri, 03 Oct 2008) | 49 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug39438-master.opt A /branches/5.1/mysql-test/innodb_bug39438.result A /branches/5.1/mysql-test/innodb_bug39438.test branches/5.1: Fix Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch In ha_innobase::info() - do not try to get the free space for a tablespace which has been discarded with ALTER TABLE ... DISCARD TABLESPACE or if the .ibd file is missing for some other reason. ibd_file_missing and tablespace_discarded are manipulated only in row_discard_tablespace_for_mysql() and in row_import_tablespace_for_mysql() and the manipulation is protected/surrounded by row_mysql_lock_data_dictionary()/row_mysql_unlock_data_dictionary() thus we do the same in ha_innobase::info() when checking the values of those members to avoid race conditions. I have tested the code-path with UNIV_DEBUG and UNIV_SYNC_DEBUG. Looks like it is not possible to avoid mysqld printing warnings in the mysql-test case and thus this test innodb_bug39438 must be added to the list of exceptional test cases that are allowed to print warnings. For this, the following patch must be applied to the mysql source tree: --- cut --- === modified file 'mysql-test/lib/mtr_report.pl' --- mysql-test/lib/mtr_report.pl 2008-08-12 10:26:23 +0000 +++ mysql-test/lib/mtr_report.pl 2008-10-01 11:57:41 +0000 @@ -412,7 +412,10 @@ # When trying to set lower_case_table_names = 2 # on a case sensitive file system. Bug#37402. - /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ + /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ or + + # this test is expected to print warnings + ($testname eq 'main.innodb_bug39438') ) { next; # Skip these lines --- cut --- The mysql-test is currently somewhat disabled (see inside innodb_bug39438.test), after the above patch has been applied to the mysql source tree, the test can be enabled. rb://20 Reviewed by: Inaam, Calvin Approved by: Heikki ------------------------------------------------------------------------ r2720 | vasil | 2008-10-03 19:52:39 +0300 (Fri, 03 Oct 2008) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Print a warning if an attempt is made to get the free space for a table whose .ibd file is missing or the tablespace has been discarded. This is a followup to r2719. Suggested by: Inaam ------------------------------------------------------------------------ r2721 | sunny | 2008-10-04 02:08:23 +0300 (Sat, 04 Oct 2008) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: We need to send the messages to the client because handler::get_auto_increment() doesn't allow a way to return the specific error for why it failed. rb://18 ------------------------------------------------------------------------ r2722 | sunny | 2008-10-04 02:48:04 +0300 (Sat, 04 Oct 2008) | 18 lines Changed paths: M /branches/5.1/dict/dict0mem.c M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/dict0mem.h M /branches/5.1/include/row0mysql.h M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test M /branches/5.1/row/row0mysql.c branches/5.1: This bug has always existed but was masked by other errors. The fix for bug# 38839 triggered this bug. When the offset and increment are > 1 we need to calculate the next value taking into consideration the two variables. Previously we simply assumed they were 1 particularly offset was never used. MySQL does its own calculation and that's probably why it seemed to work in the past. We would return what we thought was the correct next value and then MySQL would recalculate the actual value from that and return it to the caller (e.g., handler::write_row()). Several new tests have been added that try and catch some edge cases. The tests exposed a wrap around error in MySQL next value calculation which was filed as bug#39828. The tests will need to be updated once MySQL fix that bug. One good side effect of this fix is that dict_table_t size has been reduced by 8 bytes because we have moved the autoinc_increment field to the row_prebuilt_t structure. See review-board for a detailed discussion. rb://3 ------------------------------------------------------------------------
17 years ago
branches/zip: Merge r5912:6112 from branches/5.1: (after this merge the innodb-autoinc test starts to fail, but I commit anyway because it would be easier to investigate the failure this way) ------------------------------------------------------------------------ r5952 | calvin | 2009-09-22 19:45:07 +0300 (Tue, 22 Sep 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: fix bug#42383: Can't create table 'test.bug39438' For embedded server, MySQL may pass in full path, which is currently disallowed. It is needed to relax the condition by accepting full paths in the embedded case. Approved by: Heikki (on IM) ------------------------------------------------------------------------ r6032 | vasil | 2009-10-01 15:55:49 +0300 (Thu, 01 Oct 2009) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix Bug#38996 Race condition in ANALYZE TABLE by serializing ANALYZE TABLE inside InnoDB. Approved by: Heikki (rb://175) ------------------------------------------------------------------------ r6045 | jyang | 2009-10-08 02:27:08 +0300 (Thu, 08 Oct 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug47777.result A /branches/5.1/mysql-test/innodb_bug47777.test branches/5.1: Fix bug #47777. Treat the Geometry data same as Binary BLOB in ha_innobase::store_key_val_for_row(), since the Geometry data is stored as Binary BLOB in Innodb. Review: rb://180 approved by Marko Makela. ------------------------------------------------------------------------ r6051 | sunny | 2009-10-12 07:05:00 +0300 (Mon, 12 Oct 2009) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Ignore negative values supplied by the user when calculating the next value to store in dict_table_t. Setting autoincrement columns top negative values is undefined behavior and this change should bring the behavior of InnoDB closer to what users expect. Added several tests to check. rb://162 ------------------------------------------------------------------------ r6052 | sunny | 2009-10-12 07:09:56 +0300 (Mon, 12 Oct 2009) | 4 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Reset the statement level autoinc counter on ROLLBACK. Fix the test results too. rb://164 ------------------------------------------------------------------------ r6053 | sunny | 2009-10-12 07:37:49 +0300 (Mon, 12 Oct 2009) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Copy the maximum AUTOINC value from the old table to the new table when MySQL does a CREATE INDEX ON T. This is required because MySQL does a table copy, rename and drops the old table. Fix Bug#47125: auto_increment start value is ignored if an index is created and engine=innodb rb://168 ------------------------------------------------------------------------ r6076 | vasil | 2009-10-14 19:30:12 +0300 (Wed, 14 Oct 2009) | 4 lines Changed paths: M /branches/5.1/row/row0mysql.c branches/5.1: Fix typo. ------------------------------------------------------------------------
16 years ago
branches/zip: Merge r5912:6112 from branches/5.1: (after this merge the innodb-autoinc test starts to fail, but I commit anyway because it would be easier to investigate the failure this way) ------------------------------------------------------------------------ r5952 | calvin | 2009-09-22 19:45:07 +0300 (Tue, 22 Sep 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: fix bug#42383: Can't create table 'test.bug39438' For embedded server, MySQL may pass in full path, which is currently disallowed. It is needed to relax the condition by accepting full paths in the embedded case. Approved by: Heikki (on IM) ------------------------------------------------------------------------ r6032 | vasil | 2009-10-01 15:55:49 +0300 (Thu, 01 Oct 2009) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix Bug#38996 Race condition in ANALYZE TABLE by serializing ANALYZE TABLE inside InnoDB. Approved by: Heikki (rb://175) ------------------------------------------------------------------------ r6045 | jyang | 2009-10-08 02:27:08 +0300 (Thu, 08 Oct 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug47777.result A /branches/5.1/mysql-test/innodb_bug47777.test branches/5.1: Fix bug #47777. Treat the Geometry data same as Binary BLOB in ha_innobase::store_key_val_for_row(), since the Geometry data is stored as Binary BLOB in Innodb. Review: rb://180 approved by Marko Makela. ------------------------------------------------------------------------ r6051 | sunny | 2009-10-12 07:05:00 +0300 (Mon, 12 Oct 2009) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Ignore negative values supplied by the user when calculating the next value to store in dict_table_t. Setting autoincrement columns top negative values is undefined behavior and this change should bring the behavior of InnoDB closer to what users expect. Added several tests to check. rb://162 ------------------------------------------------------------------------ r6052 | sunny | 2009-10-12 07:09:56 +0300 (Mon, 12 Oct 2009) | 4 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Reset the statement level autoinc counter on ROLLBACK. Fix the test results too. rb://164 ------------------------------------------------------------------------ r6053 | sunny | 2009-10-12 07:37:49 +0300 (Mon, 12 Oct 2009) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Copy the maximum AUTOINC value from the old table to the new table when MySQL does a CREATE INDEX ON T. This is required because MySQL does a table copy, rename and drops the old table. Fix Bug#47125: auto_increment start value is ignored if an index is created and engine=innodb rb://168 ------------------------------------------------------------------------ r6076 | vasil | 2009-10-14 19:30:12 +0300 (Wed, 14 Oct 2009) | 4 lines Changed paths: M /branches/5.1/row/row0mysql.c branches/5.1: Fix typo. ------------------------------------------------------------------------
16 years ago
branches/zip: Merge revisions 2702:2722 from branches/5.1: ------------------------------------------------------------------------ r2702 | sunny | 2008-09-30 11:41:56 +0300 (Tue, 30 Sep 2008) | 13 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Since handler::get_auto_increment() doesn't allow us to return the cause of failure we have to inform MySQL using the sql_print_warning() function to return the cause for autoinc failure. Previously we simply printed the error code, this patch prints the text string representing the following two error codes: DB_LOCK_WAIT_TIMEOUT DB_DEADLOCK. Bug#35498 Cannot get table test/table1 auto-inccounter value in ::info Approved by Marko. ------------------------------------------------------------------------ r2709 | vasil | 2008-10-01 10:13:13 +0300 (Wed, 01 Oct 2008) | 10 lines Changed paths: M /branches/5.1/include/lock0lock.h M /branches/5.1/lock/lock0lock.c A /branches/5.1/mysql-test/innodb_bug38231.result A /branches/5.1/mysql-test/innodb_bug38231.test M /branches/5.1/row/row0mysql.c branches/5.1: Fix Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK In TRUNCATE TABLE and discard tablespace: do not remove table-level S and X locks and do not assert on such locks not being wait locks. Leave such locks alone. Approved by: Heikki (rb://14) ------------------------------------------------------------------------ r2710 | vasil | 2008-10-01 14:13:58 +0300 (Wed, 01 Oct 2008) | 6 lines Changed paths: M /branches/5.1/include/sync0sync.ic branches/5.1: Silence a compilation warning in UNIV_DEBUG. Approved by: Marko (via IM) ------------------------------------------------------------------------ r2719 | vasil | 2008-10-03 18:17:28 +0300 (Fri, 03 Oct 2008) | 49 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug39438-master.opt A /branches/5.1/mysql-test/innodb_bug39438.result A /branches/5.1/mysql-test/innodb_bug39438.test branches/5.1: Fix Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch In ha_innobase::info() - do not try to get the free space for a tablespace which has been discarded with ALTER TABLE ... DISCARD TABLESPACE or if the .ibd file is missing for some other reason. ibd_file_missing and tablespace_discarded are manipulated only in row_discard_tablespace_for_mysql() and in row_import_tablespace_for_mysql() and the manipulation is protected/surrounded by row_mysql_lock_data_dictionary()/row_mysql_unlock_data_dictionary() thus we do the same in ha_innobase::info() when checking the values of those members to avoid race conditions. I have tested the code-path with UNIV_DEBUG and UNIV_SYNC_DEBUG. Looks like it is not possible to avoid mysqld printing warnings in the mysql-test case and thus this test innodb_bug39438 must be added to the list of exceptional test cases that are allowed to print warnings. For this, the following patch must be applied to the mysql source tree: --- cut --- === modified file 'mysql-test/lib/mtr_report.pl' --- mysql-test/lib/mtr_report.pl 2008-08-12 10:26:23 +0000 +++ mysql-test/lib/mtr_report.pl 2008-10-01 11:57:41 +0000 @@ -412,7 +412,10 @@ # When trying to set lower_case_table_names = 2 # on a case sensitive file system. Bug#37402. - /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ + /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ or + + # this test is expected to print warnings + ($testname eq 'main.innodb_bug39438') ) { next; # Skip these lines --- cut --- The mysql-test is currently somewhat disabled (see inside innodb_bug39438.test), after the above patch has been applied to the mysql source tree, the test can be enabled. rb://20 Reviewed by: Inaam, Calvin Approved by: Heikki ------------------------------------------------------------------------ r2720 | vasil | 2008-10-03 19:52:39 +0300 (Fri, 03 Oct 2008) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Print a warning if an attempt is made to get the free space for a table whose .ibd file is missing or the tablespace has been discarded. This is a followup to r2719. Suggested by: Inaam ------------------------------------------------------------------------ r2721 | sunny | 2008-10-04 02:08:23 +0300 (Sat, 04 Oct 2008) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: We need to send the messages to the client because handler::get_auto_increment() doesn't allow a way to return the specific error for why it failed. rb://18 ------------------------------------------------------------------------ r2722 | sunny | 2008-10-04 02:48:04 +0300 (Sat, 04 Oct 2008) | 18 lines Changed paths: M /branches/5.1/dict/dict0mem.c M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/dict0mem.h M /branches/5.1/include/row0mysql.h M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test M /branches/5.1/row/row0mysql.c branches/5.1: This bug has always existed but was masked by other errors. The fix for bug# 38839 triggered this bug. When the offset and increment are > 1 we need to calculate the next value taking into consideration the two variables. Previously we simply assumed they were 1 particularly offset was never used. MySQL does its own calculation and that's probably why it seemed to work in the past. We would return what we thought was the correct next value and then MySQL would recalculate the actual value from that and return it to the caller (e.g., handler::write_row()). Several new tests have been added that try and catch some edge cases. The tests exposed a wrap around error in MySQL next value calculation which was filed as bug#39828. The tests will need to be updated once MySQL fix that bug. One good side effect of this fix is that dict_table_t size has been reduced by 8 bytes because we have moved the autoinc_increment field to the row_prebuilt_t structure. See review-board for a detailed discussion. rb://3 ------------------------------------------------------------------------
17 years ago
branches/zip: Merge revisions 2702:2722 from branches/5.1: ------------------------------------------------------------------------ r2702 | sunny | 2008-09-30 11:41:56 +0300 (Tue, 30 Sep 2008) | 13 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Since handler::get_auto_increment() doesn't allow us to return the cause of failure we have to inform MySQL using the sql_print_warning() function to return the cause for autoinc failure. Previously we simply printed the error code, this patch prints the text string representing the following two error codes: DB_LOCK_WAIT_TIMEOUT DB_DEADLOCK. Bug#35498 Cannot get table test/table1 auto-inccounter value in ::info Approved by Marko. ------------------------------------------------------------------------ r2709 | vasil | 2008-10-01 10:13:13 +0300 (Wed, 01 Oct 2008) | 10 lines Changed paths: M /branches/5.1/include/lock0lock.h M /branches/5.1/lock/lock0lock.c A /branches/5.1/mysql-test/innodb_bug38231.result A /branches/5.1/mysql-test/innodb_bug38231.test M /branches/5.1/row/row0mysql.c branches/5.1: Fix Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK In TRUNCATE TABLE and discard tablespace: do not remove table-level S and X locks and do not assert on such locks not being wait locks. Leave such locks alone. Approved by: Heikki (rb://14) ------------------------------------------------------------------------ r2710 | vasil | 2008-10-01 14:13:58 +0300 (Wed, 01 Oct 2008) | 6 lines Changed paths: M /branches/5.1/include/sync0sync.ic branches/5.1: Silence a compilation warning in UNIV_DEBUG. Approved by: Marko (via IM) ------------------------------------------------------------------------ r2719 | vasil | 2008-10-03 18:17:28 +0300 (Fri, 03 Oct 2008) | 49 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug39438-master.opt A /branches/5.1/mysql-test/innodb_bug39438.result A /branches/5.1/mysql-test/innodb_bug39438.test branches/5.1: Fix Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch In ha_innobase::info() - do not try to get the free space for a tablespace which has been discarded with ALTER TABLE ... DISCARD TABLESPACE or if the .ibd file is missing for some other reason. ibd_file_missing and tablespace_discarded are manipulated only in row_discard_tablespace_for_mysql() and in row_import_tablespace_for_mysql() and the manipulation is protected/surrounded by row_mysql_lock_data_dictionary()/row_mysql_unlock_data_dictionary() thus we do the same in ha_innobase::info() when checking the values of those members to avoid race conditions. I have tested the code-path with UNIV_DEBUG and UNIV_SYNC_DEBUG. Looks like it is not possible to avoid mysqld printing warnings in the mysql-test case and thus this test innodb_bug39438 must be added to the list of exceptional test cases that are allowed to print warnings. For this, the following patch must be applied to the mysql source tree: --- cut --- === modified file 'mysql-test/lib/mtr_report.pl' --- mysql-test/lib/mtr_report.pl 2008-08-12 10:26:23 +0000 +++ mysql-test/lib/mtr_report.pl 2008-10-01 11:57:41 +0000 @@ -412,7 +412,10 @@ # When trying to set lower_case_table_names = 2 # on a case sensitive file system. Bug#37402. - /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ + /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ or + + # this test is expected to print warnings + ($testname eq 'main.innodb_bug39438') ) { next; # Skip these lines --- cut --- The mysql-test is currently somewhat disabled (see inside innodb_bug39438.test), after the above patch has been applied to the mysql source tree, the test can be enabled. rb://20 Reviewed by: Inaam, Calvin Approved by: Heikki ------------------------------------------------------------------------ r2720 | vasil | 2008-10-03 19:52:39 +0300 (Fri, 03 Oct 2008) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Print a warning if an attempt is made to get the free space for a table whose .ibd file is missing or the tablespace has been discarded. This is a followup to r2719. Suggested by: Inaam ------------------------------------------------------------------------ r2721 | sunny | 2008-10-04 02:08:23 +0300 (Sat, 04 Oct 2008) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: We need to send the messages to the client because handler::get_auto_increment() doesn't allow a way to return the specific error for why it failed. rb://18 ------------------------------------------------------------------------ r2722 | sunny | 2008-10-04 02:48:04 +0300 (Sat, 04 Oct 2008) | 18 lines Changed paths: M /branches/5.1/dict/dict0mem.c M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/dict0mem.h M /branches/5.1/include/row0mysql.h M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test M /branches/5.1/row/row0mysql.c branches/5.1: This bug has always existed but was masked by other errors. The fix for bug# 38839 triggered this bug. When the offset and increment are > 1 we need to calculate the next value taking into consideration the two variables. Previously we simply assumed they were 1 particularly offset was never used. MySQL does its own calculation and that's probably why it seemed to work in the past. We would return what we thought was the correct next value and then MySQL would recalculate the actual value from that and return it to the caller (e.g., handler::write_row()). Several new tests have been added that try and catch some edge cases. The tests exposed a wrap around error in MySQL next value calculation which was filed as bug#39828. The tests will need to be updated once MySQL fix that bug. One good side effect of this fix is that dict_table_t size has been reduced by 8 bytes because we have moved the autoinc_increment field to the row_prebuilt_t structure. See review-board for a detailed discussion. rb://3 ------------------------------------------------------------------------
17 years ago
branches/zip: Merge revisions 2702:2722 from branches/5.1: ------------------------------------------------------------------------ r2702 | sunny | 2008-09-30 11:41:56 +0300 (Tue, 30 Sep 2008) | 13 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Since handler::get_auto_increment() doesn't allow us to return the cause of failure we have to inform MySQL using the sql_print_warning() function to return the cause for autoinc failure. Previously we simply printed the error code, this patch prints the text string representing the following two error codes: DB_LOCK_WAIT_TIMEOUT DB_DEADLOCK. Bug#35498 Cannot get table test/table1 auto-inccounter value in ::info Approved by Marko. ------------------------------------------------------------------------ r2709 | vasil | 2008-10-01 10:13:13 +0300 (Wed, 01 Oct 2008) | 10 lines Changed paths: M /branches/5.1/include/lock0lock.h M /branches/5.1/lock/lock0lock.c A /branches/5.1/mysql-test/innodb_bug38231.result A /branches/5.1/mysql-test/innodb_bug38231.test M /branches/5.1/row/row0mysql.c branches/5.1: Fix Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK In TRUNCATE TABLE and discard tablespace: do not remove table-level S and X locks and do not assert on such locks not being wait locks. Leave such locks alone. Approved by: Heikki (rb://14) ------------------------------------------------------------------------ r2710 | vasil | 2008-10-01 14:13:58 +0300 (Wed, 01 Oct 2008) | 6 lines Changed paths: M /branches/5.1/include/sync0sync.ic branches/5.1: Silence a compilation warning in UNIV_DEBUG. Approved by: Marko (via IM) ------------------------------------------------------------------------ r2719 | vasil | 2008-10-03 18:17:28 +0300 (Fri, 03 Oct 2008) | 49 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug39438-master.opt A /branches/5.1/mysql-test/innodb_bug39438.result A /branches/5.1/mysql-test/innodb_bug39438.test branches/5.1: Fix Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch In ha_innobase::info() - do not try to get the free space for a tablespace which has been discarded with ALTER TABLE ... DISCARD TABLESPACE or if the .ibd file is missing for some other reason. ibd_file_missing and tablespace_discarded are manipulated only in row_discard_tablespace_for_mysql() and in row_import_tablespace_for_mysql() and the manipulation is protected/surrounded by row_mysql_lock_data_dictionary()/row_mysql_unlock_data_dictionary() thus we do the same in ha_innobase::info() when checking the values of those members to avoid race conditions. I have tested the code-path with UNIV_DEBUG and UNIV_SYNC_DEBUG. Looks like it is not possible to avoid mysqld printing warnings in the mysql-test case and thus this test innodb_bug39438 must be added to the list of exceptional test cases that are allowed to print warnings. For this, the following patch must be applied to the mysql source tree: --- cut --- === modified file 'mysql-test/lib/mtr_report.pl' --- mysql-test/lib/mtr_report.pl 2008-08-12 10:26:23 +0000 +++ mysql-test/lib/mtr_report.pl 2008-10-01 11:57:41 +0000 @@ -412,7 +412,10 @@ # When trying to set lower_case_table_names = 2 # on a case sensitive file system. Bug#37402. - /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ + /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ or + + # this test is expected to print warnings + ($testname eq 'main.innodb_bug39438') ) { next; # Skip these lines --- cut --- The mysql-test is currently somewhat disabled (see inside innodb_bug39438.test), after the above patch has been applied to the mysql source tree, the test can be enabled. rb://20 Reviewed by: Inaam, Calvin Approved by: Heikki ------------------------------------------------------------------------ r2720 | vasil | 2008-10-03 19:52:39 +0300 (Fri, 03 Oct 2008) | 8 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Print a warning if an attempt is made to get the free space for a table whose .ibd file is missing or the tablespace has been discarded. This is a followup to r2719. Suggested by: Inaam ------------------------------------------------------------------------ r2721 | sunny | 2008-10-04 02:08:23 +0300 (Sat, 04 Oct 2008) | 6 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: We need to send the messages to the client because handler::get_auto_increment() doesn't allow a way to return the specific error for why it failed. rb://18 ------------------------------------------------------------------------ r2722 | sunny | 2008-10-04 02:48:04 +0300 (Sat, 04 Oct 2008) | 18 lines Changed paths: M /branches/5.1/dict/dict0mem.c M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/dict0mem.h M /branches/5.1/include/row0mysql.h M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test M /branches/5.1/row/row0mysql.c branches/5.1: This bug has always existed but was masked by other errors. The fix for bug# 38839 triggered this bug. When the offset and increment are > 1 we need to calculate the next value taking into consideration the two variables. Previously we simply assumed they were 1 particularly offset was never used. MySQL does its own calculation and that's probably why it seemed to work in the past. We would return what we thought was the correct next value and then MySQL would recalculate the actual value from that and return it to the caller (e.g., handler::write_row()). Several new tests have been added that try and catch some edge cases. The tests exposed a wrap around error in MySQL next value calculation which was filed as bug#39828. The tests will need to be updated once MySQL fix that bug. One good side effect of this fix is that dict_table_t size has been reduced by 8 bytes because we have moved the autoinc_increment field to the row_prebuilt_t structure. See review-board for a detailed discussion. rb://3 ------------------------------------------------------------------------
17 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge revisions 4710:4746 from branches/5.1: ------------------------------------------------------------------------ r4746 | vasil | 2009-04-18 00:32:08 +0300 (Sat, 18 Apr 2009) | 110 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/pars0pars.h branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2728.10.2 committer: Ignacio Galarza <iggy@mysql.com> branch nick: mysql-5.1-bugteam-bug29125 timestamp: Fri 2009-02-13 11:41:47 -0500 message: Bug#29125 Windows Server X64: so many compiler warnings - Remove bothersome warning messages. This change focuses on the warnings that are covered by the ignore file: support-files/compiler_warnings.supp. - Strings are guaranteed to be max uint in length modified: client/mysql_upgrade.c client/mysqladmin.cc client/mysqlbinlog.cc client/mysqlcheck.c client/mysqldump.c client/mysqlslap.c client/mysqltest.cc client/sql_string.cc extra/comp_err.c extra/yassl/src/buffer.cpp extra/yassl/taocrypt/include/block.hpp extra/yassl/taocrypt/src/algebra.cpp extra/yassl/taocrypt/src/asn.cpp include/config-win.h libmysql/libmysql.c mysys/array.c mysys/base64.c mysys/charset.c mysys/checksum.c mysys/default.c mysys/default_modify.c mysys/hash.c mysys/mf_keycache.c mysys/mf_tempdir.c mysys/my_append.c mysys/my_compress.c mysys/my_conio.c mysys/my_copy.c mysys/my_getwd.c mysys/my_pread.c mysys/my_quick.c mysys/my_read.c mysys/safemalloc.c mysys/string.c server-tools/instance-manager/buffer.cc server-tools/instance-manager/instance.cc server-tools/instance-manager/options.cc server-tools/instance-manager/parse.h sql-common/client.c sql-common/my_user.c sql/event_data_objects.cc sql/event_parse_data.cc sql/events.cc sql/gen_lex_hash.cc sql/item.h sql/item_func.cc sql/item_strfunc.cc sql/item_timefunc.cc sql/lock.cc sql/log_event.cc sql/log_event.h sql/log_event_old.cc sql/net_serv.cc sql/sp_head.h sql/spatial.h sql/sql_class.h sql/sql_connect.cc sql/sql_crypt.cc sql/sql_error.cc sql/sql_insert.cc sql/sql_lex.cc sql/sql_lex.h sql/sql_load.cc sql/sql_prepare.cc sql/sql_profile.cc sql/sql_repl.cc sql/sql_servers.cc sql/sql_string.cc sql/sql_table.cc sql/sql_trigger.cc sql/sql_udf.cc sql/sql_view.cc sql/udf_example.c sql/uniques.cc storage/archive/azio.c storage/archive/azlib.h storage/csv/ha_tina.cc storage/csv/ha_tina.h storage/csv/transparent_file.h storage/federated/ha_federated.cc storage/federated/ha_federated.h storage/heap/hp_write.c storage/innobase/handler/ha_innodb.cc storage/innobase/include/pars0pars.h storage/myisam/ha_myisam.cc storage/myisam/mi_check.c storage/myisam/mi_packrec.c storage/myisam/mi_search.c storage/myisam/rt_index.c storage/myisammrg/ha_myisammrg.cc strings/ctype.c strings/my_vsnprintf.c tests/bug25714.c tests/mysql_client_test.c
17 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge r6125:6152 from branches/5.1: (everything except the last white-space change was skipped as it is already in branches/zip) ------------------------------------------------------------------------ r6127 | vasil | 2009-10-30 11:18:25 +0200 (Fri, 30 Oct 2009) | 18 lines Changed paths: M /branches/5.1/Makefile.am M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Backport c6121 from branches/zip: ------------------------------------------------------------------------ r6121 | sunny | 2009-10-30 01:42:11 +0200 (Fri, 30 Oct 2009) | 7 lines Changed paths: M /branches/zip/mysql-test/innodb-autoinc.result branches/zip: This test has been problematic for sometime now. The underlying bug is that the data dictionaries get out of sync. In the AUTOINC code we try and apply salve to the symptoms. In the past MySQL made some unrelated change and the dictionaries stopped getting out of sync and this test started to fail. Now, it seems they have reverted that changed and the test is passing again. I suspect this is not he last time that this test will change. ------------------------------------------------------------------------ ------------------------------------------------------------------------ r6129 | vasil | 2009-10-30 17:14:22 +0200 (Fri, 30 Oct 2009) | 4 lines Changed paths: M /branches/5.1/Makefile.am branches/5.1: Revert a change to Makefile.am that sneaked unnoticed in c6127. ------------------------------------------------------------------------ r6136 | marko | 2009-11-04 12:28:10 +0200 (Wed, 04 Nov 2009) | 15 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/ha_prototypes.h M /branches/5.1/ut/ut0ut.c branches/5.1: Port r6134 from branches/zip: ------------------------------------------------------------------------ r6134 | marko | 2009-11-04 07:57:29 +0000 (Wed, 04 Nov 2009) | 5 lines branches/zip: innobase_convert_identifier(): Convert table names with explain_filename() to address Bug #32430: 'show innodb status' causes errors Invalid (old?) table or database name in logs. rb://134 approved by Sunny Bains ------------------------------------------------------------------------ innobase_print_identifier(): Replace with innobase_convert_name(). innobase_convert_identifier(): New function, called by innobase_convert_name(). ------------------------------------------------------------------------ r6149 | vasil | 2009-11-09 11:15:01 +0200 (Mon, 09 Nov 2009) | 5 lines Changed paths: M /branches/5.1/CMakeLists.txt branches/5.1: Followup to r5700: Adjust the changes so they are the same as in the BZR repository. ------------------------------------------------------------------------ r6150 | vasil | 2009-11-09 11:43:31 +0200 (Mon, 09 Nov 2009) | 58 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Merge a part of r2911.5.5 from MySQL: (the other part of this was merged in c5700) ------------------------------------------------------------ revno: 2911.5.5 committer: Vladislav Vaintroub <vvaintroub@mysql.com> branch nick: 5.1-innodb_plugin timestamp: Wed 2009-06-10 10:59:49 +0200 message: Backport WL#3653 to 5.1 to enable bundled innodb plugin. Remove custom DLL loader code from innodb plugin code, use symbols exported from mysqld. removed: storage/innodb_plugin/handler/handler0vars.h storage/innodb_plugin/handler/win_delay_loader.cc added: storage/mysql_storage_engine.cmake win/create_def_file.js modified: CMakeLists.txt include/m_ctype.h include/my_global.h include/my_sys.h include/mysql/plugin.h libmysqld/CMakeLists.txt mysql-test/mysql-test-run.pl mysql-test/t/plugin.test mysql-test/t/plugin_load-master.opt mysys/charset.c sql/CMakeLists.txt sql/handler.h sql/mysql_priv.h sql/mysqld.cc sql/sql_class.cc sql/sql_class.h sql/sql_list.h sql/sql_profile.h storage/Makefile.am storage/archive/CMakeLists.txt storage/blackhole/CMakeLists.txt storage/csv/CMakeLists.txt storage/example/CMakeLists.txt storage/federated/CMakeLists.txt storage/heap/CMakeLists.txt storage/innobase/CMakeLists.txt storage/innobase/handler/ha_innodb.cc storage/innodb_plugin/CMakeLists.txt storage/innodb_plugin/handler/ha_innodb.cc storage/innodb_plugin/handler/handler0alter.cc storage/innodb_plugin/handler/i_s.cc storage/innodb_plugin/plug.in storage/myisam/CMakeLists.txt storage/myisammrg/CMakeLists.txt win/Makefile.am win/configure.js ------------------------------------------------------------------------ r6152 | vasil | 2009-11-10 15:30:20 +0200 (Tue, 10 Nov 2009) | 4 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: White space fixup. ------------------------------------------------------------------------
16 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge r5341:5497 from branches/5.1, skipping: c5419 because it is merge from branches/zip into branches/5.1 c5466 because the source code has been adjusted to match the MySQL behavior and the innodb-autoinc test does not fail in branches/zip, if c5466 is merged, then innodb-autoinc starts failing, Sunny suggested not to merge c5466. and resolving conflicts in c5410, c5440, c5488: ------------------------------------------------------------------------ r5410 | marko | 2009-06-24 22:26:34 +0300 (Wed, 24 Jun 2009) | 2 lines Changed paths: M /branches/5.1/include/trx0sys.ic M /branches/5.1/trx/trx0purge.c M /branches/5.1/trx/trx0sys.c M /branches/5.1/trx/trx0undo.c branches/5.1: Add missing #include "mtr0log.h" to avoid warnings when compiling with -DUNIV_MUST_NOT_INLINE. ------------------------------------------------------------------------ r5419 | marko | 2009-06-25 16:11:57 +0300 (Thu, 25 Jun 2009) | 18 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb_bug42101-nonzero.result M /branches/5.1/mysql-test/innodb_bug42101-nonzero.test M /branches/5.1/mysql-test/innodb_bug42101.result M /branches/5.1/mysql-test/innodb_bug42101.test branches/5.1: Merge r5418 from branches/zip: ------------------------------------------------------------------------ r5418 | marko | 2009-06-25 15:55:52 +0300 (Thu, 25 Jun 2009) | 5 lines Changed paths: M /branches/zip/ChangeLog M /branches/zip/handler/ha_innodb.cc M /branches/zip/mysql-test/innodb_bug42101-nonzero.result M /branches/zip/mysql-test/innodb_bug42101-nonzero.test M /branches/zip/mysql-test/innodb_bug42101.result M /branches/zip/mysql-test/innodb_bug42101.test branches/zip: Fix a race condition caused by SET GLOBAL innodb_commit_concurrency=DEFAULT. (Bug #45749) When innodb_commit_concurrency is initially set nonzero, DEFAULT would change it back to 0, triggering Bug #42101. rb://139 approved by Heikki Tuuri. ------------------------------------------------------------------------ ------------------------------------------------------------------------ r5440 | vasil | 2009-06-30 13:04:29 +0300 (Tue, 30 Jun 2009) | 8 lines Changed paths: M /branches/5.1/fil/fil0fil.c branches/5.1: Fix Bug#45814 URL reference in InnoDB server errors needs adjusting to match documentation by changing the URL from http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html to http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting-datadict.html ------------------------------------------------------------------------ r5466 | vasil | 2009-07-02 10:46:45 +0300 (Thu, 02 Jul 2009) | 6 lines Changed paths: M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Adjust the failing innodb-autoinc test to conform to the latest behavior of the MySQL code. The idea and the comment in innodb-autoinc.test come from Sunny. ------------------------------------------------------------------------ r5488 | vasil | 2009-07-09 19:16:44 +0300 (Thu, 09 Jul 2009) | 13 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug21704.result A /branches/5.1/mysql-test/innodb_bug21704.test branches/5.1: Fix Bug#21704 Renaming column does not update FK definition by checking whether a column that participates in a FK definition is being renamed and denying the ALTER in this case. The patch was originally developed by Davi Arnaut <Davi.Arnaut@Sun.COM>: http://lists.mysql.com/commits/77714 and was later adjusted to conform to InnoDB coding style by me (Vasil), I also added some more comments and moved the bug specific mysql-test to a separate file to make it more manageable and flexible. ------------------------------------------------------------------------
17 years ago
branches/zip: Merge r5341:5497 from branches/5.1, skipping: c5419 because it is merge from branches/zip into branches/5.1 c5466 because the source code has been adjusted to match the MySQL behavior and the innodb-autoinc test does not fail in branches/zip, if c5466 is merged, then innodb-autoinc starts failing, Sunny suggested not to merge c5466. and resolving conflicts in c5410, c5440, c5488: ------------------------------------------------------------------------ r5410 | marko | 2009-06-24 22:26:34 +0300 (Wed, 24 Jun 2009) | 2 lines Changed paths: M /branches/5.1/include/trx0sys.ic M /branches/5.1/trx/trx0purge.c M /branches/5.1/trx/trx0sys.c M /branches/5.1/trx/trx0undo.c branches/5.1: Add missing #include "mtr0log.h" to avoid warnings when compiling with -DUNIV_MUST_NOT_INLINE. ------------------------------------------------------------------------ r5419 | marko | 2009-06-25 16:11:57 +0300 (Thu, 25 Jun 2009) | 18 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/mysql-test/innodb_bug42101-nonzero.result M /branches/5.1/mysql-test/innodb_bug42101-nonzero.test M /branches/5.1/mysql-test/innodb_bug42101.result M /branches/5.1/mysql-test/innodb_bug42101.test branches/5.1: Merge r5418 from branches/zip: ------------------------------------------------------------------------ r5418 | marko | 2009-06-25 15:55:52 +0300 (Thu, 25 Jun 2009) | 5 lines Changed paths: M /branches/zip/ChangeLog M /branches/zip/handler/ha_innodb.cc M /branches/zip/mysql-test/innodb_bug42101-nonzero.result M /branches/zip/mysql-test/innodb_bug42101-nonzero.test M /branches/zip/mysql-test/innodb_bug42101.result M /branches/zip/mysql-test/innodb_bug42101.test branches/zip: Fix a race condition caused by SET GLOBAL innodb_commit_concurrency=DEFAULT. (Bug #45749) When innodb_commit_concurrency is initially set nonzero, DEFAULT would change it back to 0, triggering Bug #42101. rb://139 approved by Heikki Tuuri. ------------------------------------------------------------------------ ------------------------------------------------------------------------ r5440 | vasil | 2009-06-30 13:04:29 +0300 (Tue, 30 Jun 2009) | 8 lines Changed paths: M /branches/5.1/fil/fil0fil.c branches/5.1: Fix Bug#45814 URL reference in InnoDB server errors needs adjusting to match documentation by changing the URL from http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html to http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting-datadict.html ------------------------------------------------------------------------ r5466 | vasil | 2009-07-02 10:46:45 +0300 (Thu, 02 Jul 2009) | 6 lines Changed paths: M /branches/5.1/mysql-test/innodb-autoinc.result M /branches/5.1/mysql-test/innodb-autoinc.test branches/5.1: Adjust the failing innodb-autoinc test to conform to the latest behavior of the MySQL code. The idea and the comment in innodb-autoinc.test come from Sunny. ------------------------------------------------------------------------ r5488 | vasil | 2009-07-09 19:16:44 +0300 (Thu, 09 Jul 2009) | 13 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug21704.result A /branches/5.1/mysql-test/innodb_bug21704.test branches/5.1: Fix Bug#21704 Renaming column does not update FK definition by checking whether a column that participates in a FK definition is being renamed and denying the ALTER in this case. The patch was originally developed by Davi Arnaut <Davi.Arnaut@Sun.COM>: http://lists.mysql.com/commits/77714 and was later adjusted to conform to InnoDB coding style by me (Vasil), I also added some more comments and moved the bug specific mysql-test to a separate file to make it more manageable and flexible. ------------------------------------------------------------------------
17 years ago
branches/zip: Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC. Throw warnings, not errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE, so that any table dump can be loaded. As of this change, InnoDB supports the following table formats: ROW_FORMAT=REDUNDANT the only format before MySQL/InnoDB 5.0.3 ROW_FORMAT=COMPACT the new default format of MySQL/InnoDB 5.0.3 ROW_FORMAT=DYNAMIC uncompressed, no prefix in the clustered index record for BLOBs ROW_FORMAT=COMPRESSED like ROW_FORMAT=DYNAMIC, but zlib compressed B-trees and BLOBs; the compressed page size is specified by KEY_BLOCK_SIZE in kilobytes (1, 2, 4, 8, or 16; default 8) KEY_BLOCK_SIZE=1, 2, 4, 8, or 16: implies ROW_FORMAT=COMPRESSED; ignored if ROW_FORMAT is not COMPRESSED KEY_BLOCK_SIZE=anything else: ignored The InnoDB row format is displayed in the 4th column (Row_format) of the output of SHOW TABLE STATUS. The Create_options column may show ROW_FORMAT= and KEY_BLOCK_SIZE=, but they do not necessarily have anything to do with InnoDB. The table format can also be queried like this: SELECT table_schema, table_name, row_format FROM information_schema.tables WHERE engine='innodb' and row_format in ('Compressed','Dynamic'); When Row_format='Compressed', KEY_BLOCK_SIZE should usually correspond to the compressed page size. But the .frm file could be manipulated to show any KEY_BLOCK_SIZE. For some reason, INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS does not include KEY_BLOCK_SIZE. It does include row_format (spelled in lowercase). This looks like a MySQL bug, because the table INFORMATION_SCHEMA.TABLES probably tries to replace SHOW TABLE STATUS. I reported this as Bug #35275 <http://bugs.mysql.com/35275>. ha_innobase::get_row_type(): Add ROW_TYPE_COMPRESSED, ROW_TYPE_DYNAMIC. ha_innobase::create(): Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC. Do not throw errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE, but issue warnings instead. ha_innobase::check_if_incompatible_data(): Return COMPATIBLE_DATA_NO if KEY_BLOCK_SIZE has been specified. innodb.result: Adjust the result for the warning issued for ROW_FORMAT=FIXED. innodb-zip.test: Add tests. Query INFORMATION_SCHEMA.TABLES for ROW_FORMAT.
18 years ago
branches/zip: Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC. Throw warnings, not errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE, so that any table dump can be loaded. As of this change, InnoDB supports the following table formats: ROW_FORMAT=REDUNDANT the only format before MySQL/InnoDB 5.0.3 ROW_FORMAT=COMPACT the new default format of MySQL/InnoDB 5.0.3 ROW_FORMAT=DYNAMIC uncompressed, no prefix in the clustered index record for BLOBs ROW_FORMAT=COMPRESSED like ROW_FORMAT=DYNAMIC, but zlib compressed B-trees and BLOBs; the compressed page size is specified by KEY_BLOCK_SIZE in kilobytes (1, 2, 4, 8, or 16; default 8) KEY_BLOCK_SIZE=1, 2, 4, 8, or 16: implies ROW_FORMAT=COMPRESSED; ignored if ROW_FORMAT is not COMPRESSED KEY_BLOCK_SIZE=anything else: ignored The InnoDB row format is displayed in the 4th column (Row_format) of the output of SHOW TABLE STATUS. The Create_options column may show ROW_FORMAT= and KEY_BLOCK_SIZE=, but they do not necessarily have anything to do with InnoDB. The table format can also be queried like this: SELECT table_schema, table_name, row_format FROM information_schema.tables WHERE engine='innodb' and row_format in ('Compressed','Dynamic'); When Row_format='Compressed', KEY_BLOCK_SIZE should usually correspond to the compressed page size. But the .frm file could be manipulated to show any KEY_BLOCK_SIZE. For some reason, INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS does not include KEY_BLOCK_SIZE. It does include row_format (spelled in lowercase). This looks like a MySQL bug, because the table INFORMATION_SCHEMA.TABLES probably tries to replace SHOW TABLE STATUS. I reported this as Bug #35275 <http://bugs.mysql.com/35275>. ha_innobase::get_row_type(): Add ROW_TYPE_COMPRESSED, ROW_TYPE_DYNAMIC. ha_innobase::create(): Implement ROW_FORMAT=COMPRESSED and ROW_FORMAT=DYNAMIC. Do not throw errors for wrong ROW_FORMAT or KEY_BLOCK_SIZE, but issue warnings instead. ha_innobase::check_if_incompatible_data(): Return COMPATIBLE_DATA_NO if KEY_BLOCK_SIZE has been specified. innodb.result: Adjust the result for the warning issued for ROW_FORMAT=FIXED. innodb-zip.test: Add tests. Query INFORMATION_SCHEMA.TABLES for ROW_FORMAT.
18 years ago
branches/zip: Replace the constant 3/8 ratio that controls the LRU_old size with the settable global variable innodb_old_blocks_pct. The minimum and maximum values are 5 and 95 per cent, respectively. The default is 100*3/8, in line with the old behavior. ut_time_ms(): New utility function, to return the current time in milliseconds. TODO: Is there a more efficient timestamp function, such as rdtsc divided by a power of two? buf_LRU_old_threshold_ms: New variable, corresponding to innodb_old_blocks_time. The value 0 is the default behaviour: no timeout before making blocks 'new'. bpage->accessed, bpage->LRU_position, buf_pool->ulint_clock: Remove. bpage->access_time: New field, replacing bpage->accessed. Protected by buf_pool_mutex instead of bpage->mutex. Updated when a page is created or accessed the first time in the buffer pool. buf_LRU_old_ratio, innobase_old_blocks_pct: New variables, corresponding to innodb_old_blocks_pct buf_LRU_old_ratio_update(), innobase_old_blocks_pct_update(): Update functions for buf_LRU_old_ratio, innobase_old_blocks_pct. buf_page_peek_if_too_old(): Compare ut_time_ms() to bpage->access_time if buf_LRU_old_threshold_ms && bpage->old. Else observe buf_LRU_old_ratio and bpage->freed_page_clock. buf_pool_t: Add n_pages_made_young, n_pages_not_made_young, n_pages_made_young_old, n_pages_not_made_young, for statistics. buf_print(): Display buf_pool->n_pages_made_young, buf_pool->n_pages_not_made_young. This function is only for crash diagnostics. buf_print_io(): Display buf_pool->LRU_old_len and quantities derived from buf_pool->n_pages_made_young, buf_pool->n_pages_not_made_young. This function is invoked by SHOW ENGINE INNODB STATUS. rb://129 approved by Heikki Tuuri. This addresses Bug #45015.
16 years ago
branches/zip: Merge revisions 5622:5912 from branches/5.1, except r5700 (changes to CMakeLists.txt) ------------------------------------------------------------------------ r5622 | vasil | 2009-08-03 15:27:00 +0300 (Mon, 03 Aug 2009) | 20 lines Changed paths: M /branches/5.1/Makefile.am branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2988 committer: Satya B <satya.bn@sun.com> branch nick: mysql-5.1-bugteam timestamp: Wed 2009-07-01 11:06:05 +0530 message: Fix build failure after applying Innodb snapshot 5.1-ss5282 After applying Innodb snapshot 5.1-ss5282, build was broken because of missing header file. Adding the header file to Makefile.am after informing the innodb developers. modified: storage/innobase/Makefile.am ------------------------------------------------------------------------ r5740 | jyang | 2009-09-03 06:33:47 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Sunny Bains. ------------------------------------------------------------------------ r5741 | jyang | 2009-09-03 07:16:01 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5757 | jyang | 2009-09-04 04:26:13 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h D /branches/5.1/mysql-test/innodb_bug46000.result D /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Revert change in 5740. Making the fix in a subsequent check in. ------------------------------------------------------------------------ r5760 | jyang | 2009-09-04 07:07:34 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc D /branches/5.1/mysql-test/innodb_bug44369.result D /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: This is to revert change 5741. A return status for create_table_def() needs to be fixed. ------------------------------------------------------------------------ r5797 | calvin | 2009-09-09 18:26:29 +0300 (Wed, 09 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: merge change from 5.1.38 HA_ERR_TOO_MANY_CONCURRENT_TRXS is added in 5.1.38. ------------------------------------------------------------------------ r5799 | calvin | 2009-09-09 20:47:31 +0300 (Wed, 09 Sep 2009) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: fix bug#46256 Allow tables to be dropped even if the collation is not found, but issue a warning. Could not find an easy way to add mysql-test since it requires changes to charsets and restarting the server. Tests were executed manually. Approved by: Heikki (on IM) ------------------------------------------------------------------------ r5805 | vasil | 2009-09-10 08:41:48 +0300 (Thu, 10 Sep 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix a compilation warning caused by c5799: handler/ha_innodb.cc: In function 'void innobase_get_cset_width(ulint, ulint*, ulint*)': handler/ha_innodb.cc:830: warning: format '%d' expects type 'int', but argument 2 has type 'ulint' ------------------------------------------------------------------------ r5834 | jyang | 2009-09-11 00:43:05 +0300 (Fri, 11 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5895 | jyang | 2009-09-15 03:39:21 +0300 (Tue, 15 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Marko Makela. ------------------------------------------------------------------------
16 years ago
branches/zip: Merge revisions 5622:5912 from branches/5.1, except r5700 (changes to CMakeLists.txt) ------------------------------------------------------------------------ r5622 | vasil | 2009-08-03 15:27:00 +0300 (Mon, 03 Aug 2009) | 20 lines Changed paths: M /branches/5.1/Makefile.am branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2988 committer: Satya B <satya.bn@sun.com> branch nick: mysql-5.1-bugteam timestamp: Wed 2009-07-01 11:06:05 +0530 message: Fix build failure after applying Innodb snapshot 5.1-ss5282 After applying Innodb snapshot 5.1-ss5282, build was broken because of missing header file. Adding the header file to Makefile.am after informing the innodb developers. modified: storage/innobase/Makefile.am ------------------------------------------------------------------------ r5740 | jyang | 2009-09-03 06:33:47 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Sunny Bains. ------------------------------------------------------------------------ r5741 | jyang | 2009-09-03 07:16:01 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5757 | jyang | 2009-09-04 04:26:13 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h D /branches/5.1/mysql-test/innodb_bug46000.result D /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Revert change in 5740. Making the fix in a subsequent check in. ------------------------------------------------------------------------ r5760 | jyang | 2009-09-04 07:07:34 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc D /branches/5.1/mysql-test/innodb_bug44369.result D /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: This is to revert change 5741. A return status for create_table_def() needs to be fixed. ------------------------------------------------------------------------ r5797 | calvin | 2009-09-09 18:26:29 +0300 (Wed, 09 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: merge change from 5.1.38 HA_ERR_TOO_MANY_CONCURRENT_TRXS is added in 5.1.38. ------------------------------------------------------------------------ r5799 | calvin | 2009-09-09 20:47:31 +0300 (Wed, 09 Sep 2009) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: fix bug#46256 Allow tables to be dropped even if the collation is not found, but issue a warning. Could not find an easy way to add mysql-test since it requires changes to charsets and restarting the server. Tests were executed manually. Approved by: Heikki (on IM) ------------------------------------------------------------------------ r5805 | vasil | 2009-09-10 08:41:48 +0300 (Thu, 10 Sep 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix a compilation warning caused by c5799: handler/ha_innodb.cc: In function 'void innobase_get_cset_width(ulint, ulint*, ulint*)': handler/ha_innodb.cc:830: warning: format '%d' expects type 'int', but argument 2 has type 'ulint' ------------------------------------------------------------------------ r5834 | jyang | 2009-09-11 00:43:05 +0300 (Fri, 11 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5895 | jyang | 2009-09-15 03:39:21 +0300 (Tue, 15 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Marko Makela. ------------------------------------------------------------------------
16 years ago
branches/zip: Merge revisions 5622:5912 from branches/5.1, except r5700 (changes to CMakeLists.txt) ------------------------------------------------------------------------ r5622 | vasil | 2009-08-03 15:27:00 +0300 (Mon, 03 Aug 2009) | 20 lines Changed paths: M /branches/5.1/Makefile.am branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2988 committer: Satya B <satya.bn@sun.com> branch nick: mysql-5.1-bugteam timestamp: Wed 2009-07-01 11:06:05 +0530 message: Fix build failure after applying Innodb snapshot 5.1-ss5282 After applying Innodb snapshot 5.1-ss5282, build was broken because of missing header file. Adding the header file to Makefile.am after informing the innodb developers. modified: storage/innobase/Makefile.am ------------------------------------------------------------------------ r5740 | jyang | 2009-09-03 06:33:47 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Sunny Bains. ------------------------------------------------------------------------ r5741 | jyang | 2009-09-03 07:16:01 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5757 | jyang | 2009-09-04 04:26:13 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h D /branches/5.1/mysql-test/innodb_bug46000.result D /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Revert change in 5740. Making the fix in a subsequent check in. ------------------------------------------------------------------------ r5760 | jyang | 2009-09-04 07:07:34 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc D /branches/5.1/mysql-test/innodb_bug44369.result D /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: This is to revert change 5741. A return status for create_table_def() needs to be fixed. ------------------------------------------------------------------------ r5797 | calvin | 2009-09-09 18:26:29 +0300 (Wed, 09 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: merge change from 5.1.38 HA_ERR_TOO_MANY_CONCURRENT_TRXS is added in 5.1.38. ------------------------------------------------------------------------ r5799 | calvin | 2009-09-09 20:47:31 +0300 (Wed, 09 Sep 2009) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: fix bug#46256 Allow tables to be dropped even if the collation is not found, but issue a warning. Could not find an easy way to add mysql-test since it requires changes to charsets and restarting the server. Tests were executed manually. Approved by: Heikki (on IM) ------------------------------------------------------------------------ r5805 | vasil | 2009-09-10 08:41:48 +0300 (Thu, 10 Sep 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix a compilation warning caused by c5799: handler/ha_innodb.cc: In function 'void innobase_get_cset_width(ulint, ulint*, ulint*)': handler/ha_innodb.cc:830: warning: format '%d' expects type 'int', but argument 2 has type 'ulint' ------------------------------------------------------------------------ r5834 | jyang | 2009-09-11 00:43:05 +0300 (Fri, 11 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5895 | jyang | 2009-09-15 03:39:21 +0300 (Tue, 15 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Marko Makela. ------------------------------------------------------------------------
16 years ago
branches/zip: Merge revisions 5622:5912 from branches/5.1, except r5700 (changes to CMakeLists.txt) ------------------------------------------------------------------------ r5622 | vasil | 2009-08-03 15:27:00 +0300 (Mon, 03 Aug 2009) | 20 lines Changed paths: M /branches/5.1/Makefile.am branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2988 committer: Satya B <satya.bn@sun.com> branch nick: mysql-5.1-bugteam timestamp: Wed 2009-07-01 11:06:05 +0530 message: Fix build failure after applying Innodb snapshot 5.1-ss5282 After applying Innodb snapshot 5.1-ss5282, build was broken because of missing header file. Adding the header file to Makefile.am after informing the innodb developers. modified: storage/innobase/Makefile.am ------------------------------------------------------------------------ r5740 | jyang | 2009-09-03 06:33:47 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Sunny Bains. ------------------------------------------------------------------------ r5741 | jyang | 2009-09-03 07:16:01 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5757 | jyang | 2009-09-04 04:26:13 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h D /branches/5.1/mysql-test/innodb_bug46000.result D /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Revert change in 5740. Making the fix in a subsequent check in. ------------------------------------------------------------------------ r5760 | jyang | 2009-09-04 07:07:34 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc D /branches/5.1/mysql-test/innodb_bug44369.result D /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: This is to revert change 5741. A return status for create_table_def() needs to be fixed. ------------------------------------------------------------------------ r5797 | calvin | 2009-09-09 18:26:29 +0300 (Wed, 09 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: merge change from 5.1.38 HA_ERR_TOO_MANY_CONCURRENT_TRXS is added in 5.1.38. ------------------------------------------------------------------------ r5799 | calvin | 2009-09-09 20:47:31 +0300 (Wed, 09 Sep 2009) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: fix bug#46256 Allow tables to be dropped even if the collation is not found, but issue a warning. Could not find an easy way to add mysql-test since it requires changes to charsets and restarting the server. Tests were executed manually. Approved by: Heikki (on IM) ------------------------------------------------------------------------ r5805 | vasil | 2009-09-10 08:41:48 +0300 (Thu, 10 Sep 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix a compilation warning caused by c5799: handler/ha_innodb.cc: In function 'void innobase_get_cset_width(ulint, ulint*, ulint*)': handler/ha_innodb.cc:830: warning: format '%d' expects type 'int', but argument 2 has type 'ulint' ------------------------------------------------------------------------ r5834 | jyang | 2009-09-11 00:43:05 +0300 (Fri, 11 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5895 | jyang | 2009-09-15 03:39:21 +0300 (Tue, 15 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Marko Makela. ------------------------------------------------------------------------
16 years ago
branches/zip: Merge revisions 5622:5912 from branches/5.1, except r5700 (changes to CMakeLists.txt) ------------------------------------------------------------------------ r5622 | vasil | 2009-08-03 15:27:00 +0300 (Mon, 03 Aug 2009) | 20 lines Changed paths: M /branches/5.1/Makefile.am branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2988 committer: Satya B <satya.bn@sun.com> branch nick: mysql-5.1-bugteam timestamp: Wed 2009-07-01 11:06:05 +0530 message: Fix build failure after applying Innodb snapshot 5.1-ss5282 After applying Innodb snapshot 5.1-ss5282, build was broken because of missing header file. Adding the header file to Makefile.am after informing the innodb developers. modified: storage/innobase/Makefile.am ------------------------------------------------------------------------ r5740 | jyang | 2009-09-03 06:33:47 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Sunny Bains. ------------------------------------------------------------------------ r5741 | jyang | 2009-09-03 07:16:01 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5757 | jyang | 2009-09-04 04:26:13 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h D /branches/5.1/mysql-test/innodb_bug46000.result D /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Revert change in 5740. Making the fix in a subsequent check in. ------------------------------------------------------------------------ r5760 | jyang | 2009-09-04 07:07:34 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc D /branches/5.1/mysql-test/innodb_bug44369.result D /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: This is to revert change 5741. A return status for create_table_def() needs to be fixed. ------------------------------------------------------------------------ r5797 | calvin | 2009-09-09 18:26:29 +0300 (Wed, 09 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: merge change from 5.1.38 HA_ERR_TOO_MANY_CONCURRENT_TRXS is added in 5.1.38. ------------------------------------------------------------------------ r5799 | calvin | 2009-09-09 20:47:31 +0300 (Wed, 09 Sep 2009) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: fix bug#46256 Allow tables to be dropped even if the collation is not found, but issue a warning. Could not find an easy way to add mysql-test since it requires changes to charsets and restarting the server. Tests were executed manually. Approved by: Heikki (on IM) ------------------------------------------------------------------------ r5805 | vasil | 2009-09-10 08:41:48 +0300 (Thu, 10 Sep 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix a compilation warning caused by c5799: handler/ha_innodb.cc: In function 'void innobase_get_cset_width(ulint, ulint*, ulint*)': handler/ha_innodb.cc:830: warning: format '%d' expects type 'int', but argument 2 has type 'ulint' ------------------------------------------------------------------------ r5834 | jyang | 2009-09-11 00:43:05 +0300 (Fri, 11 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5895 | jyang | 2009-09-15 03:39:21 +0300 (Tue, 15 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Marko Makela. ------------------------------------------------------------------------
16 years ago
branches/zip: Merge revisions 5622:5912 from branches/5.1, except r5700 (changes to CMakeLists.txt) ------------------------------------------------------------------------ r5622 | vasil | 2009-08-03 15:27:00 +0300 (Mon, 03 Aug 2009) | 20 lines Changed paths: M /branches/5.1/Makefile.am branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2988 committer: Satya B <satya.bn@sun.com> branch nick: mysql-5.1-bugteam timestamp: Wed 2009-07-01 11:06:05 +0530 message: Fix build failure after applying Innodb snapshot 5.1-ss5282 After applying Innodb snapshot 5.1-ss5282, build was broken because of missing header file. Adding the header file to Makefile.am after informing the innodb developers. modified: storage/innobase/Makefile.am ------------------------------------------------------------------------ r5740 | jyang | 2009-09-03 06:33:47 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Sunny Bains. ------------------------------------------------------------------------ r5741 | jyang | 2009-09-03 07:16:01 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5757 | jyang | 2009-09-04 04:26:13 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h D /branches/5.1/mysql-test/innodb_bug46000.result D /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Revert change in 5740. Making the fix in a subsequent check in. ------------------------------------------------------------------------ r5760 | jyang | 2009-09-04 07:07:34 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc D /branches/5.1/mysql-test/innodb_bug44369.result D /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: This is to revert change 5741. A return status for create_table_def() needs to be fixed. ------------------------------------------------------------------------ r5797 | calvin | 2009-09-09 18:26:29 +0300 (Wed, 09 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: merge change from 5.1.38 HA_ERR_TOO_MANY_CONCURRENT_TRXS is added in 5.1.38. ------------------------------------------------------------------------ r5799 | calvin | 2009-09-09 20:47:31 +0300 (Wed, 09 Sep 2009) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: fix bug#46256 Allow tables to be dropped even if the collation is not found, but issue a warning. Could not find an easy way to add mysql-test since it requires changes to charsets and restarting the server. Tests were executed manually. Approved by: Heikki (on IM) ------------------------------------------------------------------------ r5805 | vasil | 2009-09-10 08:41:48 +0300 (Thu, 10 Sep 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix a compilation warning caused by c5799: handler/ha_innodb.cc: In function 'void innobase_get_cset_width(ulint, ulint*, ulint*)': handler/ha_innodb.cc:830: warning: format '%d' expects type 'int', but argument 2 has type 'ulint' ------------------------------------------------------------------------ r5834 | jyang | 2009-09-11 00:43:05 +0300 (Fri, 11 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5895 | jyang | 2009-09-15 03:39:21 +0300 (Tue, 15 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Marko Makela. ------------------------------------------------------------------------
16 years ago
branches/zip: Merge revisions 5622:5912 from branches/5.1, except r5700 (changes to CMakeLists.txt) ------------------------------------------------------------------------ r5622 | vasil | 2009-08-03 15:27:00 +0300 (Mon, 03 Aug 2009) | 20 lines Changed paths: M /branches/5.1/Makefile.am branches/5.1: Merge a change from MySQL: ------------------------------------------------------------ revno: 2988 committer: Satya B <satya.bn@sun.com> branch nick: mysql-5.1-bugteam timestamp: Wed 2009-07-01 11:06:05 +0530 message: Fix build failure after applying Innodb snapshot 5.1-ss5282 After applying Innodb snapshot 5.1-ss5282, build was broken because of missing header file. Adding the header file to Makefile.am after informing the innodb developers. modified: storage/innobase/Makefile.am ------------------------------------------------------------------------ r5740 | jyang | 2009-09-03 06:33:47 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Sunny Bains. ------------------------------------------------------------------------ r5741 | jyang | 2009-09-03 07:16:01 +0300 (Thu, 03 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5757 | jyang | 2009-09-04 04:26:13 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/db0err.h D /branches/5.1/mysql-test/innodb_bug46000.result D /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Revert change in 5740. Making the fix in a subsequent check in. ------------------------------------------------------------------------ r5760 | jyang | 2009-09-04 07:07:34 +0300 (Fri, 04 Sep 2009) | 3 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc D /branches/5.1/mysql-test/innodb_bug44369.result D /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: This is to revert change 5741. A return status for create_table_def() needs to be fixed. ------------------------------------------------------------------------ r5797 | calvin | 2009-09-09 18:26:29 +0300 (Wed, 09 Sep 2009) | 3 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: merge change from 5.1.38 HA_ERR_TOO_MANY_CONCURRENT_TRXS is added in 5.1.38. ------------------------------------------------------------------------ r5799 | calvin | 2009-09-09 20:47:31 +0300 (Wed, 09 Sep 2009) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: fix bug#46256 Allow tables to be dropped even if the collation is not found, but issue a warning. Could not find an easy way to add mysql-test since it requires changes to charsets and restarting the server. Tests were executed manually. Approved by: Heikki (on IM) ------------------------------------------------------------------------ r5805 | vasil | 2009-09-10 08:41:48 +0300 (Thu, 10 Sep 2009) | 7 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Fix a compilation warning caused by c5799: handler/ha_innodb.cc: In function 'void innobase_get_cset_width(ulint, ulint*, ulint*)': handler/ha_innodb.cc:830: warning: format '%d' expects type 'int', but argument 2 has type 'ulint' ------------------------------------------------------------------------ r5834 | jyang | 2009-09-11 00:43:05 +0300 (Fri, 11 Sep 2009) | 5 lines Changed paths: M /branches/5.1/dict/dict0dict.c M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug44369.result A /branches/5.1/mysql-test/innodb_bug44369.test M /branches/5.1/row/row0mysql.c branches/5.1: Block creating table with column name conflicting with Innodb reserved key words. (Bug #44369) rb://151 approved by Sunny Bains. ------------------------------------------------------------------------ r5895 | jyang | 2009-09-15 03:39:21 +0300 (Tue, 15 Sep 2009) | 5 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc A /branches/5.1/mysql-test/innodb_bug46000.result A /branches/5.1/mysql-test/innodb_bug46000.test branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Marko Makela. ------------------------------------------------------------------------
16 years ago
branches/zip: Implement the configuration parameter and settable global variable innodb_file_format. Implement file format version stamping of *.ibd files and SYS_TABLES.TYPE. This change breaks introduces an incompatible change for for compressed tables. We can do this, as we have not released yet. innodb-zip.test: Add tests for stricter KEY_BLOCK_SIZE and ROW_FORMAT checks. DICT_TF_COMPRESSED_MASK, DICT_TF_COMPRESSED_SHIFT: Replace with DICT_TF_ZSSIZE_MASK, DICT_TF_ZSSIZE_SHIFT. DICT_TF_FORMAT_MASK, DICT_TF_FORMAT_SHIFT, DICT_TF_FORMAT_51, DICT_TF_FORMAT_ZIP: File format version, stored in table->flags, in the .ibd file header, and in SYS_TABLES.TYPE. dict_create_sys_tables_tuple(): Write the table flags to SYS_TABLES.TYPE if the format is at least DICT_TF_FORMAT_ZIP. For old formats (DICT_TF_FORMAT_51), write DICT_TABLE_ORDINARY as the table type. DB_TABLE_ZIP_NO_IBD: Remove the error code. The error handling is done in ha_innodb.cc; as a failsafe measure, dict_build_table_def_step() will silently clear the compression and format flags instead of returning this error. dict_mem_table_create(): Assert that no extra bits are set in the flags. dict_sys_tables_get_zip_size(): Rename to dict_sys_tables_get_flags(). Check all flag bits, and return ULINT_UNDEFINED if the combination is unsupported. dict_boot(): Document the SYS_TABLES columns N_COLS and TYPE. dict_table_get_format(), dict_table_set_format(), dict_table_flags_to_zip_size(): New accessors to table->flags. dtuple_convert_big_rec(): Introduce the auxiliary variables local_len, local_prefix_len. Store a 768-byte prefix locally if the file format is less than DICT_TF_FORMAT_ZIP. dtuple_convert_back_big_rec(): Restore the columns. srv_file_format: New variable: innodb_file_format. fil_create_new_single_table_tablespace(): Replace the parameter zip_size with table->flags. fil_open_single_table_tablespace(): Replace the parameter zip_size_in_k with table->flags. Check the flags. fil_space_struct, fil_space_create(), fil_op_write_log(): Replace zip_size with flags. fil_node_open_file(): Note a TODO item for InnoDB Hot Backup. Check that the tablespace flags match. fil_space_get_zip_size(): Rename to fil_space_get_flags(). Add a wrapper for fil_space_get_zip_size(). fsp_header_get_flags(): New function. fsp_header_init_fields(): Replace zip_size with flags. FSP_SPACE_FLAGS: New name for the tablespace flags. This field used to be called FSP_PAGE_ZIP_SIZE, or FSP_LOWEST_NO_WRITE. It has always been written as 0 in MySQL/InnoDB versions 4.1 to 5.1. MLOG_ZIP_FILE_CREATE: Rename to MLOG_FILE_CREATE2. Add a 32-bit parameter for the tablespace flags. ha_innobase::create(): Check the table attributes ROW_FORMAT and KEY_BLOCK_SIZE. Issue errors if they are inappropriate, or warnings if the inherited attributes (in ALTER TABLE) will be ignored. PAGE_ZIP_MIN_SIZE_SHIFT: New constant: the 2-logarithm of PAGE_ZIP_MIN_SIZE.
18 years ago
branches/zip: Implement the configuration parameter and settable global variable innodb_file_format. Implement file format version stamping of *.ibd files and SYS_TABLES.TYPE. This change breaks introduces an incompatible change for for compressed tables. We can do this, as we have not released yet. innodb-zip.test: Add tests for stricter KEY_BLOCK_SIZE and ROW_FORMAT checks. DICT_TF_COMPRESSED_MASK, DICT_TF_COMPRESSED_SHIFT: Replace with DICT_TF_ZSSIZE_MASK, DICT_TF_ZSSIZE_SHIFT. DICT_TF_FORMAT_MASK, DICT_TF_FORMAT_SHIFT, DICT_TF_FORMAT_51, DICT_TF_FORMAT_ZIP: File format version, stored in table->flags, in the .ibd file header, and in SYS_TABLES.TYPE. dict_create_sys_tables_tuple(): Write the table flags to SYS_TABLES.TYPE if the format is at least DICT_TF_FORMAT_ZIP. For old formats (DICT_TF_FORMAT_51), write DICT_TABLE_ORDINARY as the table type. DB_TABLE_ZIP_NO_IBD: Remove the error code. The error handling is done in ha_innodb.cc; as a failsafe measure, dict_build_table_def_step() will silently clear the compression and format flags instead of returning this error. dict_mem_table_create(): Assert that no extra bits are set in the flags. dict_sys_tables_get_zip_size(): Rename to dict_sys_tables_get_flags(). Check all flag bits, and return ULINT_UNDEFINED if the combination is unsupported. dict_boot(): Document the SYS_TABLES columns N_COLS and TYPE. dict_table_get_format(), dict_table_set_format(), dict_table_flags_to_zip_size(): New accessors to table->flags. dtuple_convert_big_rec(): Introduce the auxiliary variables local_len, local_prefix_len. Store a 768-byte prefix locally if the file format is less than DICT_TF_FORMAT_ZIP. dtuple_convert_back_big_rec(): Restore the columns. srv_file_format: New variable: innodb_file_format. fil_create_new_single_table_tablespace(): Replace the parameter zip_size with table->flags. fil_open_single_table_tablespace(): Replace the parameter zip_size_in_k with table->flags. Check the flags. fil_space_struct, fil_space_create(), fil_op_write_log(): Replace zip_size with flags. fil_node_open_file(): Note a TODO item for InnoDB Hot Backup. Check that the tablespace flags match. fil_space_get_zip_size(): Rename to fil_space_get_flags(). Add a wrapper for fil_space_get_zip_size(). fsp_header_get_flags(): New function. fsp_header_init_fields(): Replace zip_size with flags. FSP_SPACE_FLAGS: New name for the tablespace flags. This field used to be called FSP_PAGE_ZIP_SIZE, or FSP_LOWEST_NO_WRITE. It has always been written as 0 in MySQL/InnoDB versions 4.1 to 5.1. MLOG_ZIP_FILE_CREATE: Rename to MLOG_FILE_CREATE2. Add a 32-bit parameter for the tablespace flags. ha_innobase::create(): Check the table attributes ROW_FORMAT and KEY_BLOCK_SIZE. Issue errors if they are inappropriate, or warnings if the inherited attributes (in ALTER TABLE) will be ignored. PAGE_ZIP_MIN_SIZE_SHIFT: New constant: the 2-logarithm of PAGE_ZIP_MIN_SIZE.
18 years ago
branches/zip: Replace the constant 3/8 ratio that controls the LRU_old size with the settable global variable innodb_old_blocks_pct. The minimum and maximum values are 5 and 95 per cent, respectively. The default is 100*3/8, in line with the old behavior. ut_time_ms(): New utility function, to return the current time in milliseconds. TODO: Is there a more efficient timestamp function, such as rdtsc divided by a power of two? buf_LRU_old_threshold_ms: New variable, corresponding to innodb_old_blocks_time. The value 0 is the default behaviour: no timeout before making blocks 'new'. bpage->accessed, bpage->LRU_position, buf_pool->ulint_clock: Remove. bpage->access_time: New field, replacing bpage->accessed. Protected by buf_pool_mutex instead of bpage->mutex. Updated when a page is created or accessed the first time in the buffer pool. buf_LRU_old_ratio, innobase_old_blocks_pct: New variables, corresponding to innodb_old_blocks_pct buf_LRU_old_ratio_update(), innobase_old_blocks_pct_update(): Update functions for buf_LRU_old_ratio, innobase_old_blocks_pct. buf_page_peek_if_too_old(): Compare ut_time_ms() to bpage->access_time if buf_LRU_old_threshold_ms && bpage->old. Else observe buf_LRU_old_ratio and bpage->freed_page_clock. buf_pool_t: Add n_pages_made_young, n_pages_not_made_young, n_pages_made_young_old, n_pages_not_made_young, for statistics. buf_print(): Display buf_pool->n_pages_made_young, buf_pool->n_pages_not_made_young. This function is only for crash diagnostics. buf_print_io(): Display buf_pool->LRU_old_len and quantities derived from buf_pool->n_pages_made_young, buf_pool->n_pages_not_made_young. This function is invoked by SHOW ENGINE INNODB STATUS. rb://129 approved by Heikki Tuuri. This addresses Bug #45015.
16 years ago
branches/zip: Implement the configuration parameter and settable global variable innodb_file_format. Implement file format version stamping of *.ibd files and SYS_TABLES.TYPE. This change breaks introduces an incompatible change for for compressed tables. We can do this, as we have not released yet. innodb-zip.test: Add tests for stricter KEY_BLOCK_SIZE and ROW_FORMAT checks. DICT_TF_COMPRESSED_MASK, DICT_TF_COMPRESSED_SHIFT: Replace with DICT_TF_ZSSIZE_MASK, DICT_TF_ZSSIZE_SHIFT. DICT_TF_FORMAT_MASK, DICT_TF_FORMAT_SHIFT, DICT_TF_FORMAT_51, DICT_TF_FORMAT_ZIP: File format version, stored in table->flags, in the .ibd file header, and in SYS_TABLES.TYPE. dict_create_sys_tables_tuple(): Write the table flags to SYS_TABLES.TYPE if the format is at least DICT_TF_FORMAT_ZIP. For old formats (DICT_TF_FORMAT_51), write DICT_TABLE_ORDINARY as the table type. DB_TABLE_ZIP_NO_IBD: Remove the error code. The error handling is done in ha_innodb.cc; as a failsafe measure, dict_build_table_def_step() will silently clear the compression and format flags instead of returning this error. dict_mem_table_create(): Assert that no extra bits are set in the flags. dict_sys_tables_get_zip_size(): Rename to dict_sys_tables_get_flags(). Check all flag bits, and return ULINT_UNDEFINED if the combination is unsupported. dict_boot(): Document the SYS_TABLES columns N_COLS and TYPE. dict_table_get_format(), dict_table_set_format(), dict_table_flags_to_zip_size(): New accessors to table->flags. dtuple_convert_big_rec(): Introduce the auxiliary variables local_len, local_prefix_len. Store a 768-byte prefix locally if the file format is less than DICT_TF_FORMAT_ZIP. dtuple_convert_back_big_rec(): Restore the columns. srv_file_format: New variable: innodb_file_format. fil_create_new_single_table_tablespace(): Replace the parameter zip_size with table->flags. fil_open_single_table_tablespace(): Replace the parameter zip_size_in_k with table->flags. Check the flags. fil_space_struct, fil_space_create(), fil_op_write_log(): Replace zip_size with flags. fil_node_open_file(): Note a TODO item for InnoDB Hot Backup. Check that the tablespace flags match. fil_space_get_zip_size(): Rename to fil_space_get_flags(). Add a wrapper for fil_space_get_zip_size(). fsp_header_get_flags(): New function. fsp_header_init_fields(): Replace zip_size with flags. FSP_SPACE_FLAGS: New name for the tablespace flags. This field used to be called FSP_PAGE_ZIP_SIZE, or FSP_LOWEST_NO_WRITE. It has always been written as 0 in MySQL/InnoDB versions 4.1 to 5.1. MLOG_ZIP_FILE_CREATE: Rename to MLOG_FILE_CREATE2. Add a 32-bit parameter for the tablespace flags. ha_innobase::create(): Check the table attributes ROW_FORMAT and KEY_BLOCK_SIZE. Issue errors if they are inappropriate, or warnings if the inherited attributes (in ALTER TABLE) will be ignored. PAGE_ZIP_MIN_SIZE_SHIFT: New constant: the 2-logarithm of PAGE_ZIP_MIN_SIZE.
18 years ago
branches/zip: Replace the constant 3/8 ratio that controls the LRU_old size with the settable global variable innodb_old_blocks_pct. The minimum and maximum values are 5 and 95 per cent, respectively. The default is 100*3/8, in line with the old behavior. ut_time_ms(): New utility function, to return the current time in milliseconds. TODO: Is there a more efficient timestamp function, such as rdtsc divided by a power of two? buf_LRU_old_threshold_ms: New variable, corresponding to innodb_old_blocks_time. The value 0 is the default behaviour: no timeout before making blocks 'new'. bpage->accessed, bpage->LRU_position, buf_pool->ulint_clock: Remove. bpage->access_time: New field, replacing bpage->accessed. Protected by buf_pool_mutex instead of bpage->mutex. Updated when a page is created or accessed the first time in the buffer pool. buf_LRU_old_ratio, innobase_old_blocks_pct: New variables, corresponding to innodb_old_blocks_pct buf_LRU_old_ratio_update(), innobase_old_blocks_pct_update(): Update functions for buf_LRU_old_ratio, innobase_old_blocks_pct. buf_page_peek_if_too_old(): Compare ut_time_ms() to bpage->access_time if buf_LRU_old_threshold_ms && bpage->old. Else observe buf_LRU_old_ratio and bpage->freed_page_clock. buf_pool_t: Add n_pages_made_young, n_pages_not_made_young, n_pages_made_young_old, n_pages_not_made_young, for statistics. buf_print(): Display buf_pool->n_pages_made_young, buf_pool->n_pages_not_made_young. This function is only for crash diagnostics. buf_print_io(): Display buf_pool->LRU_old_len and quantities derived from buf_pool->n_pages_made_young, buf_pool->n_pages_not_made_young. This function is invoked by SHOW ENGINE INNODB STATUS. rb://129 approved by Heikki Tuuri. This addresses Bug #45015.
16 years ago
  1. /*****************************************************************************
  2. Copyright (c) 2000, 2009, MySQL AB & Innobase Oy. All Rights Reserved.
  3. Copyright (c) 2008, 2009 Google Inc.
  4. Portions of this file contain modifications contributed and copyrighted by
  5. Google, Inc. Those modifications are gratefully acknowledged and are described
  6. briefly in the InnoDB documentation. The contributions by Google are
  7. incorporated with their permission, and subject to the conditions contained in
  8. the file COPYING.Google.
  9. This program is free software; you can redistribute it and/or modify it under
  10. the terms of the GNU General Public License as published by the Free Software
  11. Foundation; version 2 of the License.
  12. This program is distributed in the hope that it will be useful, but WITHOUT
  13. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  14. FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  15. You should have received a copy of the GNU General Public License along with
  16. this program; if not, write to the Free Software Foundation, Inc., 59 Temple
  17. Place, Suite 330, Boston, MA 02111-1307 USA
  18. *****************************************************************************/
  19. /***********************************************************************
  20. Copyright (c) 1995, 2009, Innobase Oy. All Rights Reserved.
  21. Copyright (c) 2009, Percona Inc.
  22. Portions of this file contain modifications contributed and copyrighted
  23. by Percona Inc.. Those modifications are
  24. gratefully acknowledged and are described briefly in the InnoDB
  25. documentation. The contributions by Percona Inc. are incorporated with
  26. their permission, and subject to the conditions contained in the file
  27. COPYING.Percona.
  28. This program is free software; you can redistribute it and/or modify it
  29. under the terms of the GNU General Public License as published by the
  30. Free Software Foundation; version 2 of the License.
  31. This program is distributed in the hope that it will be useful, but
  32. WITHOUT ANY WARRANTY; without even the implied warranty of
  33. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
  34. Public License for more details.
  35. You should have received a copy of the GNU General Public License along
  36. with this program; if not, write to the Free Software Foundation, Inc.,
  37. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  38. ***********************************************************************/
  39. /* TODO list for the InnoDB handler in 5.0:
  40. - Remove the flag trx->active_trans and look at trx->conc_state
  41. - fix savepoint functions to use savepoint storage area
  42. - Find out what kind of problems the OS X case-insensitivity causes to
  43. table and database names; should we 'normalize' the names like we do
  44. in Windows?
  45. */
  46. #ifdef USE_PRAGMA_IMPLEMENTATION
  47. #pragma implementation // gcc: Class implementation
  48. #endif
  49. #include <mysql_priv.h>
  50. #include <m_ctype.h>
  51. #include <mysys_err.h>
  52. #include <mysql/plugin.h>
  53. /** @file ha_innodb.cc */
  54. /* Include necessary InnoDB headers */
  55. extern "C" {
  56. #include "univ.i"
  57. #include "buf0lru.h"
  58. #include "btr0sea.h"
  59. #include "os0file.h"
  60. #include "os0thread.h"
  61. #include "srv0start.h"
  62. #include "srv0srv.h"
  63. #include "trx0roll.h"
  64. #include "trx0trx.h"
  65. #include "trx0sys.h"
  66. #include "mtr0mtr.h"
  67. #include "row0ins.h"
  68. #include "row0mysql.h"
  69. #include "row0sel.h"
  70. #include "row0upd.h"
  71. #include "log0log.h"
  72. #include "lock0lock.h"
  73. #include "dict0crea.h"
  74. #include "btr0cur.h"
  75. #include "btr0btr.h"
  76. #include "fsp0fsp.h"
  77. #include "sync0sync.h"
  78. #include "fil0fil.h"
  79. #include "trx0xa.h"
  80. #include "row0merge.h"
  81. #include "thr0loc.h"
  82. #include "dict0boot.h"
  83. #include "ha_prototypes.h"
  84. #include "ut0mem.h"
  85. #include "ibuf0ibuf.h"
  86. }
  87. #include "ha_innodb.h"
  88. #include "i_s.h"
  89. #ifndef MYSQL_SERVER
  90. # ifndef MYSQL_PLUGIN_IMPORT
  91. # define MYSQL_PLUGIN_IMPORT /* nothing */
  92. # endif /* MYSQL_PLUGIN_IMPORT */
  93. /* This is needed because of Bug #3596. Let us hope that pthread_mutex_t
  94. is defined the same in both builds: the MySQL server and the InnoDB plugin. */
  95. extern MYSQL_PLUGIN_IMPORT pthread_mutex_t LOCK_thread_count;
  96. #if MYSQL_VERSION_ID < 50124
  97. /* this is defined in mysql_priv.h inside #ifdef MYSQL_SERVER
  98. but we need it here */
  99. bool check_global_access(THD *thd, ulong want_access);
  100. #endif /* MYSQL_VERSION_ID < 50124 */
  101. #endif /* MYSQL_SERVER */
  102. /** to protect innobase_open_files */
  103. static pthread_mutex_t innobase_share_mutex;
  104. /** to force correct commit order in binlog */
  105. static pthread_mutex_t prepare_commit_mutex;
  106. static ulong commit_threads = 0;
  107. static pthread_mutex_t commit_threads_m;
  108. static pthread_cond_t commit_cond;
  109. static pthread_mutex_t commit_cond_m;
  110. static pthread_mutex_t analyze_mutex;
  111. static bool innodb_inited = 0;
  112. #define INSIDE_HA_INNOBASE_CC
  113. /* In the Windows plugin, the return value of current_thd is
  114. undefined. Map it to NULL. */
  115. #define EQ_CURRENT_THD(thd) ((thd) == current_thd)
  116. static struct handlerton* innodb_hton_ptr;
  117. static const long AUTOINC_OLD_STYLE_LOCKING = 0;
  118. static const long AUTOINC_NEW_STYLE_LOCKING = 1;
  119. static const long AUTOINC_NO_LOCKING = 2;
  120. static long innobase_mirrored_log_groups, innobase_log_files_in_group,
  121. innobase_log_buffer_size,
  122. innobase_additional_mem_pool_size, innobase_file_io_threads,
  123. innobase_force_recovery, innobase_open_files,
  124. innobase_autoinc_lock_mode;
  125. static ulong innobase_commit_concurrency = 0;
  126. static ulong innobase_read_io_threads;
  127. static ulong innobase_write_io_threads;
  128. static long long innobase_buffer_pool_size, innobase_log_file_size;
  129. /** Percentage of the buffer pool to reserve for 'old' blocks.
  130. Connected to buf_LRU_old_ratio. */
  131. static uint innobase_old_blocks_pct;
  132. /* The default values for the following char* start-up parameters
  133. are determined in innobase_init below: */
  134. static char* innobase_data_home_dir = NULL;
  135. static char* innobase_data_file_path = NULL;
  136. static char* innobase_log_group_home_dir = NULL;
  137. static char* innobase_file_format_name = NULL;
  138. static char* innobase_change_buffering = NULL;
  139. /* Note: This variable can be set to on/off and any of the supported
  140. file formats in the configuration file, but can only be set to any
  141. of the supported file formats during runtime. */
  142. static char* innobase_file_format_check = NULL;
  143. static char* innobase_file_flush_method = NULL;
  144. /* Below we have boolean-valued start-up parameters, and their default
  145. values */
  146. static ulong innobase_fast_shutdown = 1;
  147. #ifdef UNIV_LOG_ARCHIVE
  148. static my_bool innobase_log_archive = FALSE;
  149. static char* innobase_log_arch_dir = NULL;
  150. #endif /* UNIV_LOG_ARCHIVE */
  151. static my_bool innobase_use_doublewrite = TRUE;
  152. static my_bool innobase_use_checksums = TRUE;
  153. static my_bool innobase_locks_unsafe_for_binlog = FALSE;
  154. static my_bool innobase_rollback_on_timeout = FALSE;
  155. static my_bool innobase_create_status_file = FALSE;
  156. static my_bool innobase_stats_on_metadata = TRUE;
  157. static char* internal_innobase_data_file_path = NULL;
  158. static char* innodb_version_str = (char*) INNODB_VERSION_STR;
  159. /* The following counter is used to convey information to InnoDB
  160. about server activity: in selects it is not sensible to call
  161. srv_active_wake_master_thread after each fetch or search, we only do
  162. it every INNOBASE_WAKE_INTERVAL'th step. */
  163. #define INNOBASE_WAKE_INTERVAL 32
  164. static ulong innobase_active_counter = 0;
  165. static hash_table_t* innobase_open_tables;
  166. #ifdef __NETWARE__ /* some special cleanup for NetWare */
  167. bool nw_panic = FALSE;
  168. #endif
  169. /** Allowed values of innodb_change_buffering */
  170. static const char* innobase_change_buffering_values[IBUF_USE_COUNT] = {
  171. "none", /* IBUF_USE_NONE */
  172. "inserts" /* IBUF_USE_INSERT */
  173. };
  174. static INNOBASE_SHARE *get_share(const char *table_name);
  175. static void free_share(INNOBASE_SHARE *share);
  176. static int innobase_close_connection(handlerton *hton, THD* thd);
  177. static int innobase_commit(handlerton *hton, THD* thd, bool all);
  178. static int innobase_rollback(handlerton *hton, THD* thd, bool all);
  179. static int innobase_rollback_to_savepoint(handlerton *hton, THD* thd,
  180. void *savepoint);
  181. static int innobase_savepoint(handlerton *hton, THD* thd, void *savepoint);
  182. static int innobase_release_savepoint(handlerton *hton, THD* thd,
  183. void *savepoint);
  184. static handler *innobase_create_handler(handlerton *hton,
  185. TABLE_SHARE *table,
  186. MEM_ROOT *mem_root);
  187. /* "GEN_CLUST_INDEX" is the name reserved for Innodb default
  188. system primary index. */
  189. static const char innobase_index_reserve_name[]= "GEN_CLUST_INDEX";
  190. /** @brief Initialize the default value of innodb_commit_concurrency.
  191. Once InnoDB is running, the innodb_commit_concurrency must not change
  192. from zero to nonzero. (Bug #42101)
  193. The initial default value is 0, and without this extra initialization,
  194. SET GLOBAL innodb_commit_concurrency=DEFAULT would set the parameter
  195. to 0, even if it was initially set to nonzero at the command line
  196. or configuration file. */
  197. static
  198. void
  199. innobase_commit_concurrency_init_default(void);
  200. /*==========================================*/
  201. /************************************************************//**
  202. Validate the file format name and return its corresponding id.
  203. @return valid file format id */
  204. static
  205. uint
  206. innobase_file_format_name_lookup(
  207. /*=============================*/
  208. const char* format_name); /*!< in: pointer to file format
  209. name */
  210. /************************************************************//**
  211. Validate the file format check config parameters, as a side effect it
  212. sets the srv_check_file_format_at_startup variable.
  213. @return true if one of "on" or "off" */
  214. static
  215. bool
  216. innobase_file_format_check_on_off(
  217. /*==============================*/
  218. const char* format_check); /*!< in: parameter value */
  219. /************************************************************//**
  220. Validate the file format check config parameters, as a side effect it
  221. sets the srv_check_file_format_at_startup variable.
  222. @return the format_id if valid config value, otherwise, return -1 */
  223. static
  224. int
  225. innobase_file_format_validate_and_set(
  226. /*================================*/
  227. const char* format_check); /*!< in: parameter value */
  228. /****************************************************************//**
  229. Return alter table flags supported in an InnoDB database. */
  230. static
  231. uint
  232. innobase_alter_table_flags(
  233. /*=======================*/
  234. uint flags);
  235. static const char innobase_hton_name[]= "InnoDB";
  236. /*************************************************************//**
  237. Check for a valid value of innobase_commit_concurrency.
  238. @return 0 for valid innodb_commit_concurrency */
  239. static
  240. int
  241. innobase_commit_concurrency_validate(
  242. /*=================================*/
  243. THD* thd, /*!< in: thread handle */
  244. struct st_mysql_sys_var* var, /*!< in: pointer to system
  245. variable */
  246. void* save, /*!< out: immediate result
  247. for update function */
  248. struct st_mysql_value* value) /*!< in: incoming string */
  249. {
  250. long long intbuf;
  251. ulong commit_concurrency;
  252. DBUG_ENTER("innobase_commit_concurrency_validate");
  253. if (value->val_int(value, &intbuf)) {
  254. /* The value is NULL. That is invalid. */
  255. DBUG_RETURN(1);
  256. }
  257. *reinterpret_cast<ulong*>(save) = commit_concurrency
  258. = static_cast<ulong>(intbuf);
  259. /* Allow the value to be updated, as long as it remains zero
  260. or nonzero. */
  261. DBUG_RETURN(!(!commit_concurrency == !innobase_commit_concurrency));
  262. }
  263. static MYSQL_THDVAR_BOOL(support_xa, PLUGIN_VAR_OPCMDARG,
  264. "Enable InnoDB support for the XA two-phase commit",
  265. /* check_func */ NULL, /* update_func */ NULL,
  266. /* default */ TRUE);
  267. static MYSQL_THDVAR_BOOL(table_locks, PLUGIN_VAR_OPCMDARG,
  268. "Enable InnoDB locking in LOCK TABLES",
  269. /* check_func */ NULL, /* update_func */ NULL,
  270. /* default */ TRUE);
  271. static MYSQL_THDVAR_BOOL(strict_mode, PLUGIN_VAR_OPCMDARG,
  272. "Use strict mode when evaluating create options.",
  273. NULL, NULL, FALSE);
  274. static MYSQL_THDVAR_ULONG(lock_wait_timeout, PLUGIN_VAR_RQCMDARG,
  275. "Timeout in seconds an InnoDB transaction may wait for a lock before being rolled back. Values above 100000000 disable the timeout.",
  276. NULL, NULL, 50, 1, 1024 * 1024 * 1024, 0);
  277. static handler *innobase_create_handler(handlerton *hton,
  278. TABLE_SHARE *table,
  279. MEM_ROOT *mem_root)
  280. {
  281. return new (mem_root) ha_innobase(hton, table);
  282. }
  283. /*******************************************************************//**
  284. This function is used to prepare an X/Open XA distributed transaction.
  285. @return 0 or error number */
  286. static
  287. int
  288. innobase_xa_prepare(
  289. /*================*/
  290. handlerton* hton, /*!< in: InnoDB handlerton */
  291. THD* thd, /*!< in: handle to the MySQL thread of
  292. the user whose XA transaction should
  293. be prepared */
  294. bool all); /*!< in: TRUE - commit transaction
  295. FALSE - the current SQL statement
  296. ended */
  297. /*******************************************************************//**
  298. This function is used to recover X/Open XA distributed transactions.
  299. @return number of prepared transactions stored in xid_list */
  300. static
  301. int
  302. innobase_xa_recover(
  303. /*================*/
  304. handlerton* hton, /*!< in: InnoDB handlerton */
  305. XID* xid_list,/*!< in/out: prepared transactions */
  306. uint len); /*!< in: number of slots in xid_list */
  307. /*******************************************************************//**
  308. This function is used to commit one X/Open XA distributed transaction
  309. which is in the prepared state
  310. @return 0 or error number */
  311. static
  312. int
  313. innobase_commit_by_xid(
  314. /*===================*/
  315. handlerton* hton,
  316. XID* xid); /*!< in: X/Open XA transaction identification */
  317. /*******************************************************************//**
  318. This function is used to rollback one X/Open XA distributed transaction
  319. which is in the prepared state
  320. @return 0 or error number */
  321. static
  322. int
  323. innobase_rollback_by_xid(
  324. /*=====================*/
  325. handlerton* hton, /*!< in: InnoDB handlerton */
  326. XID* xid); /*!< in: X/Open XA transaction
  327. identification */
  328. /*******************************************************************//**
  329. Create a consistent view for a cursor based on current transaction
  330. which is created if the corresponding MySQL thread still lacks one.
  331. This consistent view is then used inside of MySQL when accessing records
  332. using a cursor.
  333. @return pointer to cursor view or NULL */
  334. static
  335. void*
  336. innobase_create_cursor_view(
  337. /*========================*/
  338. handlerton* hton, /*!< in: innobase hton */
  339. THD* thd); /*!< in: user thread handle */
  340. /*******************************************************************//**
  341. Set the given consistent cursor view to a transaction which is created
  342. if the corresponding MySQL thread still lacks one. If the given
  343. consistent cursor view is NULL global read view of a transaction is
  344. restored to a transaction read view. */
  345. static
  346. void
  347. innobase_set_cursor_view(
  348. /*=====================*/
  349. handlerton* hton,
  350. THD* thd, /*!< in: user thread handle */
  351. void* curview);/*!< in: Consistent cursor view to be set */
  352. /*******************************************************************//**
  353. Close the given consistent cursor view of a transaction and restore
  354. global read view to a transaction read view. Transaction is created if the
  355. corresponding MySQL thread still lacks one. */
  356. static
  357. void
  358. innobase_close_cursor_view(
  359. /*=======================*/
  360. handlerton* hton,
  361. THD* thd, /*!< in: user thread handle */
  362. void* curview);/*!< in: Consistent read view to be closed */
  363. /*****************************************************************//**
  364. Removes all tables in the named database inside InnoDB. */
  365. static
  366. void
  367. innobase_drop_database(
  368. /*===================*/
  369. handlerton* hton, /*!< in: handlerton of Innodb */
  370. char* path); /*!< in: database path; inside InnoDB the name
  371. of the last directory in the path is used as
  372. the database name: for example, in 'mysql/data/test'
  373. the database name is 'test' */
  374. /*******************************************************************//**
  375. Closes an InnoDB database. */
  376. static
  377. int
  378. innobase_end(handlerton *hton, ha_panic_function type);
  379. /*****************************************************************//**
  380. Creates an InnoDB transaction struct for the thd if it does not yet have one.
  381. Starts a new InnoDB transaction if a transaction is not yet started. And
  382. assigns a new snapshot for a consistent read if the transaction does not yet
  383. have one.
  384. @return 0 */
  385. static
  386. int
  387. innobase_start_trx_and_assign_read_view(
  388. /*====================================*/
  389. handlerton* hton, /*!< in: Innodb handlerton */
  390. THD* thd); /*!< in: MySQL thread handle of the user for whom
  391. the transaction should be committed */
  392. /****************************************************************//**
  393. Flushes InnoDB logs to disk and makes a checkpoint. Really, a commit flushes
  394. the logs, and the name of this function should be innobase_checkpoint.
  395. @return TRUE if error */
  396. static
  397. bool
  398. innobase_flush_logs(
  399. /*================*/
  400. handlerton* hton); /*!< in: InnoDB handlerton */
  401. /************************************************************************//**
  402. Implements the SHOW INNODB STATUS command. Sends the output of the InnoDB
  403. Monitor to the client. */
  404. static
  405. bool
  406. innodb_show_status(
  407. /*===============*/
  408. handlerton* hton, /*!< in: the innodb handlerton */
  409. THD* thd, /*!< in: the MySQL query thread of the caller */
  410. stat_print_fn *stat_print);
  411. static
  412. bool innobase_show_status(handlerton *hton, THD* thd,
  413. stat_print_fn* stat_print,
  414. enum ha_stat_type stat_type);
  415. /*****************************************************************//**
  416. Commits a transaction in an InnoDB database. */
  417. static
  418. void
  419. innobase_commit_low(
  420. /*================*/
  421. trx_t* trx); /*!< in: transaction handle */
  422. static SHOW_VAR innodb_status_variables[]= {
  423. {"buffer_pool_pages_data",
  424. (char*) &export_vars.innodb_buffer_pool_pages_data, SHOW_LONG},
  425. {"buffer_pool_pages_dirty",
  426. (char*) &export_vars.innodb_buffer_pool_pages_dirty, SHOW_LONG},
  427. {"buffer_pool_pages_flushed",
  428. (char*) &export_vars.innodb_buffer_pool_pages_flushed, SHOW_LONG},
  429. {"buffer_pool_pages_free",
  430. (char*) &export_vars.innodb_buffer_pool_pages_free, SHOW_LONG},
  431. #ifdef UNIV_DEBUG
  432. {"buffer_pool_pages_latched",
  433. (char*) &export_vars.innodb_buffer_pool_pages_latched, SHOW_LONG},
  434. #endif /* UNIV_DEBUG */
  435. {"buffer_pool_pages_misc",
  436. (char*) &export_vars.innodb_buffer_pool_pages_misc, SHOW_LONG},
  437. {"buffer_pool_pages_total",
  438. (char*) &export_vars.innodb_buffer_pool_pages_total, SHOW_LONG},
  439. {"buffer_pool_read_ahead",
  440. (char*) &export_vars.innodb_buffer_pool_read_ahead, SHOW_LONG},
  441. {"buffer_pool_read_ahead_evicted",
  442. (char*) &export_vars.innodb_buffer_pool_read_ahead_evicted, SHOW_LONG},
  443. {"buffer_pool_read_requests",
  444. (char*) &export_vars.innodb_buffer_pool_read_requests, SHOW_LONG},
  445. {"buffer_pool_reads",
  446. (char*) &export_vars.innodb_buffer_pool_reads, SHOW_LONG},
  447. {"buffer_pool_wait_free",
  448. (char*) &export_vars.innodb_buffer_pool_wait_free, SHOW_LONG},
  449. {"buffer_pool_write_requests",
  450. (char*) &export_vars.innodb_buffer_pool_write_requests, SHOW_LONG},
  451. {"data_fsyncs",
  452. (char*) &export_vars.innodb_data_fsyncs, SHOW_LONG},
  453. {"data_pending_fsyncs",
  454. (char*) &export_vars.innodb_data_pending_fsyncs, SHOW_LONG},
  455. {"data_pending_reads",
  456. (char*) &export_vars.innodb_data_pending_reads, SHOW_LONG},
  457. {"data_pending_writes",
  458. (char*) &export_vars.innodb_data_pending_writes, SHOW_LONG},
  459. {"data_read",
  460. (char*) &export_vars.innodb_data_read, SHOW_LONG},
  461. {"data_reads",
  462. (char*) &export_vars.innodb_data_reads, SHOW_LONG},
  463. {"data_writes",
  464. (char*) &export_vars.innodb_data_writes, SHOW_LONG},
  465. {"data_written",
  466. (char*) &export_vars.innodb_data_written, SHOW_LONG},
  467. {"dblwr_pages_written",
  468. (char*) &export_vars.innodb_dblwr_pages_written, SHOW_LONG},
  469. {"dblwr_writes",
  470. (char*) &export_vars.innodb_dblwr_writes, SHOW_LONG},
  471. {"have_atomic_builtins",
  472. (char*) &export_vars.innodb_have_atomic_builtins, SHOW_BOOL},
  473. {"log_waits",
  474. (char*) &export_vars.innodb_log_waits, SHOW_LONG},
  475. {"log_write_requests",
  476. (char*) &export_vars.innodb_log_write_requests, SHOW_LONG},
  477. {"log_writes",
  478. (char*) &export_vars.innodb_log_writes, SHOW_LONG},
  479. {"os_log_fsyncs",
  480. (char*) &export_vars.innodb_os_log_fsyncs, SHOW_LONG},
  481. {"os_log_pending_fsyncs",
  482. (char*) &export_vars.innodb_os_log_pending_fsyncs, SHOW_LONG},
  483. {"os_log_pending_writes",
  484. (char*) &export_vars.innodb_os_log_pending_writes, SHOW_LONG},
  485. {"os_log_written",
  486. (char*) &export_vars.innodb_os_log_written, SHOW_LONG},
  487. {"page_size",
  488. (char*) &export_vars.innodb_page_size, SHOW_LONG},
  489. {"pages_created",
  490. (char*) &export_vars.innodb_pages_created, SHOW_LONG},
  491. {"pages_read",
  492. (char*) &export_vars.innodb_pages_read, SHOW_LONG},
  493. {"pages_written",
  494. (char*) &export_vars.innodb_pages_written, SHOW_LONG},
  495. {"row_lock_current_waits",
  496. (char*) &export_vars.innodb_row_lock_current_waits, SHOW_LONG},
  497. {"row_lock_time",
  498. (char*) &export_vars.innodb_row_lock_time, SHOW_LONGLONG},
  499. {"row_lock_time_avg",
  500. (char*) &export_vars.innodb_row_lock_time_avg, SHOW_LONG},
  501. {"row_lock_time_max",
  502. (char*) &export_vars.innodb_row_lock_time_max, SHOW_LONG},
  503. {"row_lock_waits",
  504. (char*) &export_vars.innodb_row_lock_waits, SHOW_LONG},
  505. {"rows_deleted",
  506. (char*) &export_vars.innodb_rows_deleted, SHOW_LONG},
  507. {"rows_inserted",
  508. (char*) &export_vars.innodb_rows_inserted, SHOW_LONG},
  509. {"rows_read",
  510. (char*) &export_vars.innodb_rows_read, SHOW_LONG},
  511. {"rows_updated",
  512. (char*) &export_vars.innodb_rows_updated, SHOW_LONG},
  513. {NullS, NullS, SHOW_LONG}
  514. };
  515. /* General functions */
  516. /******************************************************************//**
  517. Returns true if the thread is the replication thread on the slave
  518. server. Used in srv_conc_enter_innodb() to determine if the thread
  519. should be allowed to enter InnoDB - the replication thread is treated
  520. differently than other threads. Also used in
  521. srv_conc_force_exit_innodb().
  522. @return true if thd is the replication thread */
  523. extern "C" UNIV_INTERN
  524. ibool
  525. thd_is_replication_slave_thread(
  526. /*============================*/
  527. void* thd) /*!< in: thread handle (THD*) */
  528. {
  529. return((ibool) thd_slave_thread((THD*) thd));
  530. }
  531. /******************************************************************//**
  532. Save some CPU by testing the value of srv_thread_concurrency in inline
  533. functions. */
  534. static inline
  535. void
  536. innodb_srv_conc_enter_innodb(
  537. /*=========================*/
  538. trx_t* trx) /*!< in: transaction handle */
  539. {
  540. if (UNIV_LIKELY(!srv_thread_concurrency)) {
  541. return;
  542. }
  543. srv_conc_enter_innodb(trx);
  544. }
  545. /******************************************************************//**
  546. Save some CPU by testing the value of srv_thread_concurrency in inline
  547. functions. */
  548. static inline
  549. void
  550. innodb_srv_conc_exit_innodb(
  551. /*========================*/
  552. trx_t* trx) /*!< in: transaction handle */
  553. {
  554. if (UNIV_LIKELY(!trx->declared_to_be_inside_innodb)) {
  555. return;
  556. }
  557. srv_conc_exit_innodb(trx);
  558. }
  559. /******************************************************************//**
  560. Releases possible search latch and InnoDB thread FIFO ticket. These should
  561. be released at each SQL statement end, and also when mysqld passes the
  562. control to the client. It does no harm to release these also in the middle
  563. of an SQL statement. */
  564. static inline
  565. void
  566. innobase_release_stat_resources(
  567. /*============================*/
  568. trx_t* trx) /*!< in: transaction object */
  569. {
  570. if (trx->has_search_latch) {
  571. trx_search_latch_release_if_reserved(trx);
  572. }
  573. if (trx->declared_to_be_inside_innodb) {
  574. /* Release our possible ticket in the FIFO */
  575. srv_conc_force_exit_innodb(trx);
  576. }
  577. }
  578. /******************************************************************//**
  579. Returns true if the transaction this thread is processing has edited
  580. non-transactional tables. Used by the deadlock detector when deciding
  581. which transaction to rollback in case of a deadlock - we try to avoid
  582. rolling back transactions that have edited non-transactional tables.
  583. @return true if non-transactional tables have been edited */
  584. extern "C" UNIV_INTERN
  585. ibool
  586. thd_has_edited_nontrans_tables(
  587. /*===========================*/
  588. void* thd) /*!< in: thread handle (THD*) */
  589. {
  590. return((ibool) thd_non_transactional_update((THD*) thd));
  591. }
  592. /******************************************************************//**
  593. Returns true if the thread is executing a SELECT statement.
  594. @return true if thd is executing SELECT */
  595. extern "C" UNIV_INTERN
  596. ibool
  597. thd_is_select(
  598. /*==========*/
  599. const void* thd) /*!< in: thread handle (THD*) */
  600. {
  601. return(thd_sql_command((const THD*) thd) == SQLCOM_SELECT);
  602. }
  603. /******************************************************************//**
  604. Returns true if the thread supports XA,
  605. global value of innodb_supports_xa if thd is NULL.
  606. @return true if thd has XA support */
  607. extern "C" UNIV_INTERN
  608. ibool
  609. thd_supports_xa(
  610. /*============*/
  611. void* thd) /*!< in: thread handle (THD*), or NULL to query
  612. the global innodb_supports_xa */
  613. {
  614. return(THDVAR((THD*) thd, support_xa));
  615. }
  616. /******************************************************************//**
  617. Returns the lock wait timeout for the current connection.
  618. @return the lock wait timeout, in seconds */
  619. extern "C" UNIV_INTERN
  620. ulong
  621. thd_lock_wait_timeout(
  622. /*==================*/
  623. void* thd) /*!< in: thread handle (THD*), or NULL to query
  624. the global innodb_lock_wait_timeout */
  625. {
  626. /* According to <mysql/plugin.h>, passing thd == NULL
  627. returns the global value of the session variable. */
  628. return(THDVAR((THD*) thd, lock_wait_timeout));
  629. }
  630. /********************************************************************//**
  631. Obtain the InnoDB transaction of a MySQL thread.
  632. @return reference to transaction pointer */
  633. static inline
  634. trx_t*&
  635. thd_to_trx(
  636. /*=======*/
  637. THD* thd) /*!< in: MySQL thread */
  638. {
  639. return(*(trx_t**) thd_ha_data(thd, innodb_hton_ptr));
  640. }
  641. /********************************************************************//**
  642. Call this function when mysqld passes control to the client. That is to
  643. avoid deadlocks on the adaptive hash S-latch possibly held by thd. For more
  644. documentation, see handler.cc.
  645. @return 0 */
  646. static
  647. int
  648. innobase_release_temporary_latches(
  649. /*===============================*/
  650. handlerton* hton, /*!< in: handlerton */
  651. THD* thd) /*!< in: MySQL thread */
  652. {
  653. trx_t* trx;
  654. DBUG_ASSERT(hton == innodb_hton_ptr);
  655. if (!innodb_inited) {
  656. return(0);
  657. }
  658. trx = thd_to_trx(thd);
  659. if (trx) {
  660. innobase_release_stat_resources(trx);
  661. }
  662. return(0);
  663. }
  664. /********************************************************************//**
  665. Increments innobase_active_counter and every INNOBASE_WAKE_INTERVALth
  666. time calls srv_active_wake_master_thread. This function should be used
  667. when a single database operation may introduce a small need for
  668. server utility activity, like checkpointing. */
  669. static inline
  670. void
  671. innobase_active_small(void)
  672. /*=======================*/
  673. {
  674. innobase_active_counter++;
  675. if ((innobase_active_counter % INNOBASE_WAKE_INTERVAL) == 0) {
  676. srv_active_wake_master_thread();
  677. }
  678. }
  679. /********************************************************************//**
  680. Converts an InnoDB error code to a MySQL error code and also tells to MySQL
  681. about a possible transaction rollback inside InnoDB caused by a lock wait
  682. timeout or a deadlock.
  683. @return MySQL error code */
  684. extern "C" UNIV_INTERN
  685. int
  686. convert_error_code_to_mysql(
  687. /*========================*/
  688. int error, /*!< in: InnoDB error code */
  689. ulint flags, /*!< in: InnoDB table flags, or 0 */
  690. THD* thd) /*!< in: user thread handle or NULL */
  691. {
  692. switch (error) {
  693. case DB_SUCCESS:
  694. return(0);
  695. case DB_ERROR:
  696. default:
  697. return(-1); /* unspecified error */
  698. case DB_DUPLICATE_KEY:
  699. return(HA_ERR_FOUND_DUPP_KEY);
  700. case DB_FOREIGN_DUPLICATE_KEY:
  701. return(HA_ERR_FOREIGN_DUPLICATE_KEY);
  702. case DB_MISSING_HISTORY:
  703. return(HA_ERR_TABLE_DEF_CHANGED);
  704. case DB_RECORD_NOT_FOUND:
  705. return(HA_ERR_NO_ACTIVE_RECORD);
  706. case DB_DEADLOCK:
  707. /* Since we rolled back the whole transaction, we must
  708. tell it also to MySQL so that MySQL knows to empty the
  709. cached binlog for this transaction */
  710. if (thd) {
  711. thd_mark_transaction_to_rollback(thd, TRUE);
  712. }
  713. return(HA_ERR_LOCK_DEADLOCK);
  714. case DB_LOCK_WAIT_TIMEOUT:
  715. /* Starting from 5.0.13, we let MySQL just roll back the
  716. latest SQL statement in a lock wait timeout. Previously, we
  717. rolled back the whole transaction. */
  718. if (thd) {
  719. thd_mark_transaction_to_rollback(
  720. thd, (bool)row_rollback_on_timeout);
  721. }
  722. return(HA_ERR_LOCK_WAIT_TIMEOUT);
  723. case DB_NO_REFERENCED_ROW:
  724. return(HA_ERR_NO_REFERENCED_ROW);
  725. case DB_ROW_IS_REFERENCED:
  726. return(HA_ERR_ROW_IS_REFERENCED);
  727. case DB_CANNOT_ADD_CONSTRAINT:
  728. return(HA_ERR_CANNOT_ADD_FOREIGN);
  729. case DB_CANNOT_DROP_CONSTRAINT:
  730. return(HA_ERR_ROW_IS_REFERENCED); /* TODO: This is a bit
  731. misleading, a new MySQL error
  732. code should be introduced */
  733. case DB_COL_APPEARS_TWICE_IN_INDEX:
  734. case DB_CORRUPTION:
  735. return(HA_ERR_CRASHED);
  736. case DB_OUT_OF_FILE_SPACE:
  737. return(HA_ERR_RECORD_FILE_FULL);
  738. case DB_TABLE_IS_BEING_USED:
  739. return(HA_ERR_WRONG_COMMAND);
  740. case DB_TABLE_NOT_FOUND:
  741. return(HA_ERR_NO_SUCH_TABLE);
  742. case DB_TOO_BIG_RECORD:
  743. my_error(ER_TOO_BIG_ROWSIZE, MYF(0),
  744. page_get_free_space_of_empty(flags
  745. & DICT_TF_COMPACT) / 2);
  746. return(HA_ERR_TO_BIG_ROW);
  747. case DB_NO_SAVEPOINT:
  748. return(HA_ERR_NO_SAVEPOINT);
  749. case DB_LOCK_TABLE_FULL:
  750. /* Since we rolled back the whole transaction, we must
  751. tell it also to MySQL so that MySQL knows to empty the
  752. cached binlog for this transaction */
  753. if (thd) {
  754. thd_mark_transaction_to_rollback(thd, TRUE);
  755. }
  756. return(HA_ERR_LOCK_TABLE_FULL);
  757. case DB_PRIMARY_KEY_IS_NULL:
  758. return(ER_PRIMARY_CANT_HAVE_NULL);
  759. case DB_TOO_MANY_CONCURRENT_TRXS:
  760. /* New error code HA_ERR_TOO_MANY_CONCURRENT_TRXS is only
  761. available in 5.1.38 and later, but the plugin should still
  762. work with previous versions of MySQL. */
  763. #ifdef HA_ERR_TOO_MANY_CONCURRENT_TRXS
  764. return(HA_ERR_TOO_MANY_CONCURRENT_TRXS);
  765. #else /* HA_ERR_TOO_MANY_CONCURRENT_TRXS */
  766. return(HA_ERR_RECORD_FILE_FULL);
  767. #endif /* HA_ERR_TOO_MANY_CONCURRENT_TRXS */
  768. case DB_UNSUPPORTED:
  769. return(HA_ERR_UNSUPPORTED);
  770. }
  771. }
  772. /*************************************************************//**
  773. If you want to print a thd that is not associated with the current thread,
  774. you must call this function before reserving the InnoDB kernel_mutex, to
  775. protect MySQL from setting thd->query NULL. If you print a thd of the current
  776. thread, we know that MySQL cannot modify thd->query, and it is not necessary
  777. to call this. Call innobase_mysql_end_print_arbitrary_thd() after you release
  778. the kernel_mutex. */
  779. extern "C" UNIV_INTERN
  780. void
  781. innobase_mysql_prepare_print_arbitrary_thd(void)
  782. /*============================================*/
  783. {
  784. ut_ad(!mutex_own(&kernel_mutex));
  785. VOID(pthread_mutex_lock(&LOCK_thread_count));
  786. }
  787. /*************************************************************//**
  788. Releases the mutex reserved by innobase_mysql_prepare_print_arbitrary_thd().
  789. In the InnoDB latching order, the mutex sits right above the
  790. kernel_mutex. In debug builds, we assert that the kernel_mutex is
  791. released before this function is invoked. */
  792. extern "C" UNIV_INTERN
  793. void
  794. innobase_mysql_end_print_arbitrary_thd(void)
  795. /*========================================*/
  796. {
  797. ut_ad(!mutex_own(&kernel_mutex));
  798. VOID(pthread_mutex_unlock(&LOCK_thread_count));
  799. }
  800. /*************************************************************//**
  801. Prints info of a THD object (== user session thread) to the given file. */
  802. extern "C" UNIV_INTERN
  803. void
  804. innobase_mysql_print_thd(
  805. /*=====================*/
  806. FILE* f, /*!< in: output stream */
  807. void* thd, /*!< in: pointer to a MySQL THD object */
  808. uint max_query_len) /*!< in: max query length to print, or 0 to
  809. use the default max length */
  810. {
  811. char buffer[1024];
  812. fputs(thd_security_context((THD*) thd, buffer, sizeof buffer,
  813. max_query_len), f);
  814. putc('\n', f);
  815. }
  816. /******************************************************************//**
  817. Get the variable length bounds of the given character set. */
  818. extern "C" UNIV_INTERN
  819. void
  820. innobase_get_cset_width(
  821. /*====================*/
  822. ulint cset, /*!< in: MySQL charset-collation code */
  823. ulint* mbminlen, /*!< out: minimum length of a char (in bytes) */
  824. ulint* mbmaxlen) /*!< out: maximum length of a char (in bytes) */
  825. {
  826. CHARSET_INFO* cs;
  827. ut_ad(cset < 256);
  828. ut_ad(mbminlen);
  829. ut_ad(mbmaxlen);
  830. cs = all_charsets[cset];
  831. if (cs) {
  832. *mbminlen = cs->mbminlen;
  833. *mbmaxlen = cs->mbmaxlen;
  834. } else {
  835. THD* thd = current_thd;
  836. if (thd && thd_sql_command(thd) == SQLCOM_DROP_TABLE) {
  837. /* Fix bug#46256: allow tables to be dropped if the
  838. collation is not found, but issue a warning. */
  839. if ((global_system_variables.log_warnings)
  840. && (cset != 0)){
  841. sql_print_warning(
  842. "Unknown collation #%lu.", cset);
  843. }
  844. } else {
  845. ut_a(cset == 0);
  846. }
  847. *mbminlen = *mbmaxlen = 0;
  848. }
  849. }
  850. /******************************************************************//**
  851. Converts an identifier to a table name. */
  852. extern "C" UNIV_INTERN
  853. void
  854. innobase_convert_from_table_id(
  855. /*===========================*/
  856. struct charset_info_st* cs, /*!< in: the 'from' character set */
  857. char* to, /*!< out: converted identifier */
  858. const char* from, /*!< in: identifier to convert */
  859. ulint len) /*!< in: length of 'to', in bytes */
  860. {
  861. uint errors;
  862. strconvert(cs, from, &my_charset_filename, to, (uint) len, &errors);
  863. }
  864. /******************************************************************//**
  865. Converts an identifier to UTF-8. */
  866. extern "C" UNIV_INTERN
  867. void
  868. innobase_convert_from_id(
  869. /*=====================*/
  870. struct charset_info_st* cs, /*!< in: the 'from' character set */
  871. char* to, /*!< out: converted identifier */
  872. const char* from, /*!< in: identifier to convert */
  873. ulint len) /*!< in: length of 'to', in bytes */
  874. {
  875. uint errors;
  876. strconvert(cs, from, system_charset_info, to, (uint) len, &errors);
  877. }
  878. /******************************************************************//**
  879. Compares NUL-terminated UTF-8 strings case insensitively.
  880. @return 0 if a=b, <0 if a<b, >1 if a>b */
  881. extern "C" UNIV_INTERN
  882. int
  883. innobase_strcasecmp(
  884. /*================*/
  885. const char* a, /*!< in: first string to compare */
  886. const char* b) /*!< in: second string to compare */
  887. {
  888. return(my_strcasecmp(system_charset_info, a, b));
  889. }
  890. /******************************************************************//**
  891. Makes all characters in a NUL-terminated UTF-8 string lower case. */
  892. extern "C" UNIV_INTERN
  893. void
  894. innobase_casedn_str(
  895. /*================*/
  896. char* a) /*!< in/out: string to put in lower case */
  897. {
  898. my_casedn_str(system_charset_info, a);
  899. }
  900. /**********************************************************************//**
  901. Determines the connection character set.
  902. @return connection character set */
  903. extern "C" UNIV_INTERN
  904. struct charset_info_st*
  905. innobase_get_charset(
  906. /*=================*/
  907. void* mysql_thd) /*!< in: MySQL thread handle */
  908. {
  909. return(thd_charset((THD*) mysql_thd));
  910. }
  911. #if defined (__WIN__) && defined (MYSQL_DYNAMIC_PLUGIN)
  912. extern MYSQL_PLUGIN_IMPORT MY_TMPDIR mysql_tmpdir_list;
  913. /*******************************************************************//**
  914. Map an OS error to an errno value. The OS error number is stored in
  915. _doserrno and the mapped value is stored in errno) */
  916. extern "C"
  917. void __cdecl
  918. _dosmaperr(
  919. unsigned long); /*!< in: OS error value */
  920. /*********************************************************************//**
  921. Creates a temporary file.
  922. @return temporary file descriptor, or < 0 on error */
  923. extern "C" UNIV_INTERN
  924. int
  925. innobase_mysql_tmpfile(void)
  926. /*========================*/
  927. {
  928. int fd; /* handle of opened file */
  929. HANDLE osfh; /* OS handle of opened file */
  930. char* tmpdir; /* point to the directory
  931. where to create file */
  932. TCHAR path_buf[MAX_PATH - 14]; /* buffer for tmp file path.
  933. The length cannot be longer
  934. than MAX_PATH - 14, or
  935. GetTempFileName will fail. */
  936. char filename[MAX_PATH]; /* name of the tmpfile */
  937. DWORD fileaccess = GENERIC_READ /* OS file access */
  938. | GENERIC_WRITE
  939. | DELETE;
  940. DWORD fileshare = FILE_SHARE_READ /* OS file sharing mode */
  941. | FILE_SHARE_WRITE
  942. | FILE_SHARE_DELETE;
  943. DWORD filecreate = CREATE_ALWAYS; /* OS method of open/create */
  944. DWORD fileattrib = /* OS file attribute flags */
  945. FILE_ATTRIBUTE_NORMAL
  946. | FILE_FLAG_DELETE_ON_CLOSE
  947. | FILE_ATTRIBUTE_TEMPORARY
  948. | FILE_FLAG_SEQUENTIAL_SCAN;
  949. DBUG_ENTER("innobase_mysql_tmpfile");
  950. tmpdir = my_tmpdir(&mysql_tmpdir_list);
  951. /* The tmpdir parameter can not be NULL for GetTempFileName. */
  952. if (!tmpdir) {
  953. uint ret;
  954. /* Use GetTempPath to determine path for temporary files. */
  955. ret = GetTempPath(sizeof(path_buf), path_buf);
  956. if (ret > sizeof(path_buf) || (ret == 0)) {
  957. _dosmaperr(GetLastError()); /* map error */
  958. DBUG_RETURN(-1);
  959. }
  960. tmpdir = path_buf;
  961. }
  962. /* Use GetTempFileName to generate a unique filename. */
  963. if (!GetTempFileName(tmpdir, "ib", 0, filename)) {
  964. _dosmaperr(GetLastError()); /* map error */
  965. DBUG_RETURN(-1);
  966. }
  967. DBUG_PRINT("info", ("filename: %s", filename));
  968. /* Open/Create the file. */
  969. osfh = CreateFile(filename, fileaccess, fileshare, NULL,
  970. filecreate, fileattrib, NULL);
  971. if (osfh == INVALID_HANDLE_VALUE) {
  972. /* open/create file failed! */
  973. _dosmaperr(GetLastError()); /* map error */
  974. DBUG_RETURN(-1);
  975. }
  976. do {
  977. /* Associates a CRT file descriptor with the OS file handle. */
  978. fd = _open_osfhandle((intptr_t) osfh, 0);
  979. } while (fd == -1 && errno == EINTR);
  980. if (fd == -1) {
  981. /* Open failed, close the file handle. */
  982. _dosmaperr(GetLastError()); /* map error */
  983. CloseHandle(osfh); /* no need to check if
  984. CloseHandle fails */
  985. }
  986. DBUG_RETURN(fd);
  987. }
  988. #else
  989. /*********************************************************************//**
  990. Creates a temporary file.
  991. @return temporary file descriptor, or < 0 on error */
  992. extern "C" UNIV_INTERN
  993. int
  994. innobase_mysql_tmpfile(void)
  995. /*========================*/
  996. {
  997. int fd2 = -1;
  998. File fd = mysql_tmpfile("ib");
  999. if (fd >= 0) {
  1000. /* Copy the file descriptor, so that the additional resources
  1001. allocated by create_temp_file() can be freed by invoking
  1002. my_close().
  1003. Because the file descriptor returned by this function
  1004. will be passed to fdopen(), it will be closed by invoking
  1005. fclose(), which in turn will invoke close() instead of
  1006. my_close(). */
  1007. fd2 = dup(fd);
  1008. if (fd2 < 0) {
  1009. DBUG_PRINT("error",("Got error %d on dup",fd2));
  1010. my_errno=errno;
  1011. my_error(EE_OUT_OF_FILERESOURCES,
  1012. MYF(ME_BELL+ME_WAITTANG),
  1013. "ib*", my_errno);
  1014. }
  1015. my_close(fd, MYF(MY_WME));
  1016. }
  1017. return(fd2);
  1018. }
  1019. #endif /* defined (__WIN__) && defined (MYSQL_DYNAMIC_PLUGIN) */
  1020. /*********************************************************************//**
  1021. Wrapper around MySQL's copy_and_convert function.
  1022. @return number of bytes copied to 'to' */
  1023. extern "C" UNIV_INTERN
  1024. ulint
  1025. innobase_convert_string(
  1026. /*====================*/
  1027. void* to, /*!< out: converted string */
  1028. ulint to_length, /*!< in: number of bytes reserved
  1029. for the converted string */
  1030. CHARSET_INFO* to_cs, /*!< in: character set to convert to */
  1031. const void* from, /*!< in: string to convert */
  1032. ulint from_length, /*!< in: number of bytes to convert */
  1033. CHARSET_INFO* from_cs, /*!< in: character set to convert from */
  1034. uint* errors) /*!< out: number of errors encountered
  1035. during the conversion */
  1036. {
  1037. return(copy_and_convert((char*)to, (uint32) to_length, to_cs,
  1038. (const char*)from, (uint32) from_length, from_cs,
  1039. errors));
  1040. }
  1041. /*******************************************************************//**
  1042. Formats the raw data in "data" (in InnoDB on-disk format) that is of
  1043. type DATA_(CHAR|VARCHAR|MYSQL|VARMYSQL) using "charset_coll" and writes
  1044. the result to "buf". The result is converted to "system_charset_info".
  1045. Not more than "buf_size" bytes are written to "buf".
  1046. The result is always NUL-terminated (provided buf_size > 0) and the
  1047. number of bytes that were written to "buf" is returned (including the
  1048. terminating NUL).
  1049. @return number of bytes that were written */
  1050. extern "C" UNIV_INTERN
  1051. ulint
  1052. innobase_raw_format(
  1053. /*================*/
  1054. const char* data, /*!< in: raw data */
  1055. ulint data_len, /*!< in: raw data length
  1056. in bytes */
  1057. ulint charset_coll, /*!< in: charset collation */
  1058. char* buf, /*!< out: output buffer */
  1059. ulint buf_size) /*!< in: output buffer size
  1060. in bytes */
  1061. {
  1062. /* XXX we use a hard limit instead of allocating
  1063. but_size bytes from the heap */
  1064. CHARSET_INFO* data_cs;
  1065. char buf_tmp[8192];
  1066. ulint buf_tmp_used;
  1067. uint num_errors;
  1068. data_cs = all_charsets[charset_coll];
  1069. buf_tmp_used = innobase_convert_string(buf_tmp, sizeof(buf_tmp),
  1070. system_charset_info,
  1071. data, data_len, data_cs,
  1072. &num_errors);
  1073. return(ut_str_sql_format(buf_tmp, buf_tmp_used, buf, buf_size));
  1074. }
  1075. /*********************************************************************//**
  1076. Compute the next autoinc value.
  1077. For MySQL replication the autoincrement values can be partitioned among
  1078. the nodes. The offset is the start or origin of the autoincrement value
  1079. for a particular node. For n nodes the increment will be n and the offset
  1080. will be in the interval [1, n]. The formula tries to allocate the next
  1081. value for a particular node.
  1082. Note: This function is also called with increment set to the number of
  1083. values we want to reserve for multi-value inserts e.g.,
  1084. INSERT INTO T VALUES(), (), ();
  1085. innobase_next_autoinc() will be called with increment set to
  1086. n * 3 where autoinc_lock_mode != TRADITIONAL because we want
  1087. to reserve 3 values for the multi-value INSERT above.
  1088. @return the next value */
  1089. static
  1090. ulonglong
  1091. innobase_next_autoinc(
  1092. /*==================*/
  1093. ulonglong current, /*!< in: Current value */
  1094. ulonglong increment, /*!< in: increment current by */
  1095. ulonglong offset, /*!< in: AUTOINC offset */
  1096. ulonglong max_value) /*!< in: max value for type */
  1097. {
  1098. ulonglong next_value;
  1099. /* Should never be 0. */
  1100. ut_a(increment > 0);
  1101. /* According to MySQL documentation, if the offset is greater than
  1102. the increment then the offset is ignored. */
  1103. if (offset > increment) {
  1104. offset = 0;
  1105. }
  1106. if (max_value <= current) {
  1107. next_value = max_value;
  1108. } else if (offset <= 1) {
  1109. /* Offset 0 and 1 are the same, because there must be at
  1110. least one node in the system. */
  1111. if (max_value - current <= increment) {
  1112. next_value = max_value;
  1113. } else {
  1114. next_value = current + increment;
  1115. }
  1116. } else if (max_value > current) {
  1117. if (current > offset) {
  1118. next_value = ((current - offset) / increment) + 1;
  1119. } else {
  1120. next_value = ((offset - current) / increment) + 1;
  1121. }
  1122. ut_a(increment > 0);
  1123. ut_a(next_value > 0);
  1124. /* Check for multiplication overflow. */
  1125. if (increment > (max_value / next_value)) {
  1126. next_value = max_value;
  1127. } else {
  1128. next_value *= increment;
  1129. ut_a(max_value >= next_value);
  1130. /* Check for overflow. */
  1131. if (max_value - next_value <= offset) {
  1132. next_value = max_value;
  1133. } else {
  1134. next_value += offset;
  1135. }
  1136. }
  1137. } else {
  1138. next_value = max_value;
  1139. }
  1140. ut_a(next_value <= max_value);
  1141. return(next_value);
  1142. }
  1143. /*********************************************************************//**
  1144. Initializes some fields in an InnoDB transaction object. */
  1145. static
  1146. void
  1147. innobase_trx_init(
  1148. /*==============*/
  1149. THD* thd, /*!< in: user thread handle */
  1150. trx_t* trx) /*!< in/out: InnoDB transaction handle */
  1151. {
  1152. DBUG_ENTER("innobase_trx_init");
  1153. DBUG_ASSERT(EQ_CURRENT_THD(thd));
  1154. DBUG_ASSERT(thd == trx->mysql_thd);
  1155. trx->check_foreigns = !thd_test_options(
  1156. thd, OPTION_NO_FOREIGN_KEY_CHECKS);
  1157. trx->check_unique_secondary = !thd_test_options(
  1158. thd, OPTION_RELAXED_UNIQUE_CHECKS);
  1159. DBUG_VOID_RETURN;
  1160. }
  1161. /*********************************************************************//**
  1162. Allocates an InnoDB transaction for a MySQL handler object.
  1163. @return InnoDB transaction handle */
  1164. extern "C" UNIV_INTERN
  1165. trx_t*
  1166. innobase_trx_allocate(
  1167. /*==================*/
  1168. THD* thd) /*!< in: user thread handle */
  1169. {
  1170. trx_t* trx;
  1171. DBUG_ENTER("innobase_trx_allocate");
  1172. DBUG_ASSERT(thd != NULL);
  1173. DBUG_ASSERT(EQ_CURRENT_THD(thd));
  1174. trx = trx_allocate_for_mysql();
  1175. trx->mysql_thd = thd;
  1176. trx->mysql_query_str = thd_query(thd);
  1177. innobase_trx_init(thd, trx);
  1178. DBUG_RETURN(trx);
  1179. }
  1180. /*********************************************************************//**
  1181. Gets the InnoDB transaction handle for a MySQL handler object, creates
  1182. an InnoDB transaction struct if the corresponding MySQL thread struct still
  1183. lacks one.
  1184. @return InnoDB transaction handle */
  1185. static
  1186. trx_t*
  1187. check_trx_exists(
  1188. /*=============*/
  1189. THD* thd) /*!< in: user thread handle */
  1190. {
  1191. trx_t*& trx = thd_to_trx(thd);
  1192. ut_ad(EQ_CURRENT_THD(thd));
  1193. if (trx == NULL) {
  1194. trx = innobase_trx_allocate(thd);
  1195. } else if (UNIV_UNLIKELY(trx->magic_n != TRX_MAGIC_N)) {
  1196. mem_analyze_corruption(trx);
  1197. ut_error;
  1198. }
  1199. innobase_trx_init(thd, trx);
  1200. return(trx);
  1201. }
  1202. /*********************************************************************//**
  1203. Construct ha_innobase handler. */
  1204. UNIV_INTERN
  1205. ha_innobase::ha_innobase(handlerton *hton, TABLE_SHARE *table_arg)
  1206. :handler(hton, table_arg),
  1207. int_table_flags(HA_REC_NOT_IN_SEQ |
  1208. HA_NULL_IN_KEY |
  1209. HA_CAN_INDEX_BLOBS |
  1210. HA_CAN_SQL_HANDLER |
  1211. HA_PRIMARY_KEY_REQUIRED_FOR_POSITION |
  1212. HA_PRIMARY_KEY_IN_READ_INDEX |
  1213. HA_BINLOG_ROW_CAPABLE |
  1214. HA_CAN_GEOMETRY | HA_PARTIAL_COLUMN_READ |
  1215. HA_TABLE_SCAN_ON_INDEX),
  1216. start_of_scan(0),
  1217. num_write_row(0)
  1218. {}
  1219. /*********************************************************************//**
  1220. Destruct ha_innobase handler. */
  1221. UNIV_INTERN
  1222. ha_innobase::~ha_innobase()
  1223. {
  1224. }
  1225. /*********************************************************************//**
  1226. Updates the user_thd field in a handle and also allocates a new InnoDB
  1227. transaction handle if needed, and updates the transaction fields in the
  1228. prebuilt struct. */
  1229. UNIV_INTERN inline
  1230. void
  1231. ha_innobase::update_thd(
  1232. /*====================*/
  1233. THD* thd) /*!< in: thd to use the handle */
  1234. {
  1235. trx_t* trx;
  1236. trx = check_trx_exists(thd);
  1237. if (prebuilt->trx != trx) {
  1238. row_update_prebuilt_trx(prebuilt, trx);
  1239. }
  1240. user_thd = thd;
  1241. }
  1242. /*********************************************************************//**
  1243. Updates the user_thd field in a handle and also allocates a new InnoDB
  1244. transaction handle if needed, and updates the transaction fields in the
  1245. prebuilt struct. */
  1246. UNIV_INTERN
  1247. void
  1248. ha_innobase::update_thd()
  1249. /*=====================*/
  1250. {
  1251. THD* thd = ha_thd();
  1252. ut_ad(EQ_CURRENT_THD(thd));
  1253. update_thd(thd);
  1254. }
  1255. /*********************************************************************//**
  1256. Registers that InnoDB takes part in an SQL statement, so that MySQL knows to
  1257. roll back the statement if the statement results in an error. This MUST be
  1258. called for every SQL statement that may be rolled back by MySQL. Calling this
  1259. several times to register the same statement is allowed, too. */
  1260. static inline
  1261. void
  1262. innobase_register_stmt(
  1263. /*===================*/
  1264. handlerton* hton, /*!< in: Innobase hton */
  1265. THD* thd) /*!< in: MySQL thd (connection) object */
  1266. {
  1267. DBUG_ASSERT(hton == innodb_hton_ptr);
  1268. /* Register the statement */
  1269. trans_register_ha(thd, FALSE, hton);
  1270. }
  1271. /*********************************************************************//**
  1272. Registers an InnoDB transaction in MySQL, so that the MySQL XA code knows
  1273. to call the InnoDB prepare and commit, or rollback for the transaction. This
  1274. MUST be called for every transaction for which the user may call commit or
  1275. rollback. Calling this several times to register the same transaction is
  1276. allowed, too.
  1277. This function also registers the current SQL statement. */
  1278. static inline
  1279. void
  1280. innobase_register_trx_and_stmt(
  1281. /*===========================*/
  1282. handlerton *hton, /*!< in: Innobase handlerton */
  1283. THD* thd) /*!< in: MySQL thd (connection) object */
  1284. {
  1285. /* NOTE that actually innobase_register_stmt() registers also
  1286. the transaction in the AUTOCOMMIT=1 mode. */
  1287. innobase_register_stmt(hton, thd);
  1288. if (thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) {
  1289. /* No autocommit mode, register for a transaction */
  1290. trans_register_ha(thd, TRUE, hton);
  1291. }
  1292. }
  1293. /* BACKGROUND INFO: HOW THE MYSQL QUERY CACHE WORKS WITH INNODB
  1294. ------------------------------------------------------------
  1295. 1) The use of the query cache for TBL is disabled when there is an
  1296. uncommitted change to TBL.
  1297. 2) When a change to TBL commits, InnoDB stores the current value of
  1298. its global trx id counter, let us denote it by INV_TRX_ID, to the table object
  1299. in the InnoDB data dictionary, and does only allow such transactions whose
  1300. id <= INV_TRX_ID to use the query cache.
  1301. 3) When InnoDB does an INSERT/DELETE/UPDATE to a table TBL, or an implicit
  1302. modification because an ON DELETE CASCADE, we invalidate the MySQL query cache
  1303. of TBL immediately.
  1304. How this is implemented inside InnoDB:
  1305. 1) Since every modification always sets an IX type table lock on the InnoDB
  1306. table, it is easy to check if there can be uncommitted modifications for a
  1307. table: just check if there are locks in the lock list of the table.
  1308. 2) When a transaction inside InnoDB commits, it reads the global trx id
  1309. counter and stores the value INV_TRX_ID to the tables on which it had a lock.
  1310. 3) If there is an implicit table change from ON DELETE CASCADE or SET NULL,
  1311. InnoDB calls an invalidate method for the MySQL query cache for that table.
  1312. How this is implemented inside sql_cache.cc:
  1313. 1) The query cache for an InnoDB table TBL is invalidated immediately at an
  1314. INSERT/UPDATE/DELETE, just like in the case of MyISAM. No need to delay
  1315. invalidation to the transaction commit.
  1316. 2) To store or retrieve a value from the query cache of an InnoDB table TBL,
  1317. any query must first ask InnoDB's permission. We must pass the thd as a
  1318. parameter because InnoDB will look at the trx id, if any, associated with
  1319. that thd.
  1320. 3) Use of the query cache for InnoDB tables is now allowed also when
  1321. AUTOCOMMIT==0 or we are inside BEGIN ... COMMIT. Thus transactions no longer
  1322. put restrictions on the use of the query cache.
  1323. */
  1324. /******************************************************************//**
  1325. The MySQL query cache uses this to check from InnoDB if the query cache at
  1326. the moment is allowed to operate on an InnoDB table. The SQL query must
  1327. be a non-locking SELECT.
  1328. The query cache is allowed to operate on certain query only if this function
  1329. returns TRUE for all tables in the query.
  1330. If thd is not in the autocommit state, this function also starts a new
  1331. transaction for thd if there is no active trx yet, and assigns a consistent
  1332. read view to it if there is no read view yet.
  1333. Why a deadlock of threads is not possible: the query cache calls this function
  1334. at the start of a SELECT processing. Then the calling thread cannot be
  1335. holding any InnoDB semaphores. The calling thread is holding the
  1336. query cache mutex, and this function will reserver the InnoDB kernel mutex.
  1337. Thus, the 'rank' in sync0sync.h of the MySQL query cache mutex is above
  1338. the InnoDB kernel mutex.
  1339. @return TRUE if permitted, FALSE if not; note that the value FALSE
  1340. does not mean we should invalidate the query cache: invalidation is
  1341. called explicitly */
  1342. static
  1343. my_bool
  1344. innobase_query_caching_of_table_permitted(
  1345. /*======================================*/
  1346. THD* thd, /*!< in: thd of the user who is trying to
  1347. store a result to the query cache or
  1348. retrieve it */
  1349. char* full_name, /*!< in: concatenation of database name,
  1350. the null character NUL, and the table
  1351. name */
  1352. uint full_name_len, /*!< in: length of the full name, i.e.
  1353. len(dbname) + len(tablename) + 1 */
  1354. ulonglong *unused) /*!< unused for this engine */
  1355. {
  1356. ibool is_autocommit;
  1357. trx_t* trx;
  1358. char norm_name[1000];
  1359. ut_a(full_name_len < 999);
  1360. trx = check_trx_exists(thd);
  1361. if (trx->isolation_level == TRX_ISO_SERIALIZABLE) {
  1362. /* In the SERIALIZABLE mode we add LOCK IN SHARE MODE to every
  1363. plain SELECT if AUTOCOMMIT is not on. */
  1364. return((my_bool)FALSE);
  1365. }
  1366. if (trx->has_search_latch) {
  1367. sql_print_error("The calling thread is holding the adaptive "
  1368. "search, latch though calling "
  1369. "innobase_query_caching_of_table_permitted.");
  1370. mutex_enter(&kernel_mutex);
  1371. trx_print(stderr, trx, 1024);
  1372. mutex_exit(&kernel_mutex);
  1373. }
  1374. innobase_release_stat_resources(trx);
  1375. if (!thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) {
  1376. is_autocommit = TRUE;
  1377. } else {
  1378. is_autocommit = FALSE;
  1379. }
  1380. if (is_autocommit && trx->n_mysql_tables_in_use == 0) {
  1381. /* We are going to retrieve the query result from the query
  1382. cache. This cannot be a store operation to the query cache
  1383. because then MySQL would have locks on tables already.
  1384. TODO: if the user has used LOCK TABLES to lock the table,
  1385. then we open a transaction in the call of row_.. below.
  1386. That trx can stay open until UNLOCK TABLES. The same problem
  1387. exists even if we do not use the query cache. MySQL should be
  1388. modified so that it ALWAYS calls some cleanup function when
  1389. the processing of a query ends!
  1390. We can imagine we instantaneously serialize this consistent
  1391. read trx to the current trx id counter. If trx2 would have
  1392. changed the tables of a query result stored in the cache, and
  1393. trx2 would have already committed, making the result obsolete,
  1394. then trx2 would have already invalidated the cache. Thus we
  1395. can trust the result in the cache is ok for this query. */
  1396. return((my_bool)TRUE);
  1397. }
  1398. /* Normalize the table name to InnoDB format */
  1399. memcpy(norm_name, full_name, full_name_len);
  1400. norm_name[strlen(norm_name)] = '/'; /* InnoDB uses '/' as the
  1401. separator between db and table */
  1402. norm_name[full_name_len] = '\0';
  1403. #ifdef __WIN__
  1404. innobase_casedn_str(norm_name);
  1405. #endif
  1406. /* The call of row_search_.. will start a new transaction if it is
  1407. not yet started */
  1408. if (trx->active_trans == 0) {
  1409. innobase_register_trx_and_stmt(innodb_hton_ptr, thd);
  1410. trx->active_trans = 1;
  1411. }
  1412. if (row_search_check_if_query_cache_permitted(trx, norm_name)) {
  1413. /* printf("Query cache for %s permitted\n", norm_name); */
  1414. return((my_bool)TRUE);
  1415. }
  1416. /* printf("Query cache for %s NOT permitted\n", norm_name); */
  1417. return((my_bool)FALSE);
  1418. }
  1419. /*****************************************************************//**
  1420. Invalidates the MySQL query cache for the table. */
  1421. extern "C" UNIV_INTERN
  1422. void
  1423. innobase_invalidate_query_cache(
  1424. /*============================*/
  1425. trx_t* trx, /*!< in: transaction which
  1426. modifies the table */
  1427. const char* full_name, /*!< in: concatenation of
  1428. database name, null char NUL,
  1429. table name, null char NUL;
  1430. NOTE that in Windows this is
  1431. always in LOWER CASE! */
  1432. ulint full_name_len) /*!< in: full name length where
  1433. also the null chars count */
  1434. {
  1435. /* Note that the sync0sync.h rank of the query cache mutex is just
  1436. above the InnoDB kernel mutex. The caller of this function must not
  1437. have latches of a lower rank. */
  1438. /* Argument TRUE below means we are using transactions */
  1439. #ifdef HAVE_QUERY_CACHE
  1440. mysql_query_cache_invalidate4((THD*) trx->mysql_thd,
  1441. full_name,
  1442. (uint32) full_name_len,
  1443. TRUE);
  1444. #endif
  1445. }
  1446. /*****************************************************************//**
  1447. Convert an SQL identifier to the MySQL system_charset_info (UTF-8)
  1448. and quote it if needed.
  1449. @return pointer to the end of buf */
  1450. static
  1451. char*
  1452. innobase_convert_identifier(
  1453. /*========================*/
  1454. char* buf, /*!< out: buffer for converted identifier */
  1455. ulint buflen, /*!< in: length of buf, in bytes */
  1456. const char* id, /*!< in: identifier to convert */
  1457. ulint idlen, /*!< in: length of id, in bytes */
  1458. void* thd, /*!< in: MySQL connection thread, or NULL */
  1459. ibool file_id)/*!< in: TRUE=id is a table or database name;
  1460. FALSE=id is an UTF-8 string */
  1461. {
  1462. char nz[NAME_LEN + 1];
  1463. #if MYSQL_VERSION_ID >= 50141
  1464. char nz2[NAME_LEN + 1 + EXPLAIN_FILENAME_MAX_EXTRA_LENGTH];
  1465. #else /* MYSQL_VERSION_ID >= 50141 */
  1466. char nz2[NAME_LEN + 1 + sizeof srv_mysql50_table_name_prefix];
  1467. #endif /* MYSQL_VERSION_ID >= 50141 */
  1468. const char* s = id;
  1469. int q;
  1470. if (file_id) {
  1471. /* Decode the table name. The MySQL function expects
  1472. a NUL-terminated string. The input and output strings
  1473. buffers must not be shared. */
  1474. if (UNIV_UNLIKELY(idlen > (sizeof nz) - 1)) {
  1475. idlen = (sizeof nz) - 1;
  1476. }
  1477. memcpy(nz, id, idlen);
  1478. nz[idlen] = 0;
  1479. s = nz2;
  1480. #if MYSQL_VERSION_ID >= 50141
  1481. idlen = explain_filename((THD*) thd, nz, nz2, sizeof nz2,
  1482. EXPLAIN_PARTITIONS_AS_COMMENT);
  1483. goto no_quote;
  1484. #else /* MYSQL_VERSION_ID >= 50141 */
  1485. idlen = filename_to_tablename(nz, nz2, sizeof nz2);
  1486. #endif /* MYSQL_VERSION_ID >= 50141 */
  1487. }
  1488. /* See if the identifier needs to be quoted. */
  1489. if (UNIV_UNLIKELY(!thd)) {
  1490. q = '"';
  1491. } else {
  1492. q = get_quote_char_for_identifier((THD*) thd, s, (int) idlen);
  1493. }
  1494. if (q == EOF) {
  1495. #if MYSQL_VERSION_ID >= 50141
  1496. no_quote:
  1497. #endif /* MYSQL_VERSION_ID >= 50141 */
  1498. if (UNIV_UNLIKELY(idlen > buflen)) {
  1499. idlen = buflen;
  1500. }
  1501. memcpy(buf, s, idlen);
  1502. return(buf + idlen);
  1503. }
  1504. /* Quote the identifier. */
  1505. if (buflen < 2) {
  1506. return(buf);
  1507. }
  1508. *buf++ = q;
  1509. buflen--;
  1510. for (; idlen; idlen--) {
  1511. int c = *s++;
  1512. if (UNIV_UNLIKELY(c == q)) {
  1513. if (UNIV_UNLIKELY(buflen < 3)) {
  1514. break;
  1515. }
  1516. *buf++ = c;
  1517. *buf++ = c;
  1518. buflen -= 2;
  1519. } else {
  1520. if (UNIV_UNLIKELY(buflen < 2)) {
  1521. break;
  1522. }
  1523. *buf++ = c;
  1524. buflen--;
  1525. }
  1526. }
  1527. *buf++ = q;
  1528. return(buf);
  1529. }
  1530. /*****************************************************************//**
  1531. Convert a table or index name to the MySQL system_charset_info (UTF-8)
  1532. and quote it if needed.
  1533. @return pointer to the end of buf */
  1534. extern "C" UNIV_INTERN
  1535. char*
  1536. innobase_convert_name(
  1537. /*==================*/
  1538. char* buf, /*!< out: buffer for converted identifier */
  1539. ulint buflen, /*!< in: length of buf, in bytes */
  1540. const char* id, /*!< in: identifier to convert */
  1541. ulint idlen, /*!< in: length of id, in bytes */
  1542. void* thd, /*!< in: MySQL connection thread, or NULL */
  1543. ibool table_id)/*!< in: TRUE=id is a table or database name;
  1544. FALSE=id is an index name */
  1545. {
  1546. char* s = buf;
  1547. const char* bufend = buf + buflen;
  1548. if (table_id) {
  1549. const char* slash = (const char*) memchr(id, '/', idlen);
  1550. if (!slash) {
  1551. goto no_db_name;
  1552. }
  1553. /* Print the database name and table name separately. */
  1554. s = innobase_convert_identifier(s, bufend - s, id, slash - id,
  1555. thd, TRUE);
  1556. if (UNIV_LIKELY(s < bufend)) {
  1557. *s++ = '.';
  1558. s = innobase_convert_identifier(s, bufend - s,
  1559. slash + 1, idlen
  1560. - (slash - id) - 1,
  1561. thd, TRUE);
  1562. }
  1563. } else if (UNIV_UNLIKELY(*id == TEMP_INDEX_PREFIX)) {
  1564. /* Temporary index name (smart ALTER TABLE) */
  1565. const char temp_index_suffix[]= "--temporary--";
  1566. s = innobase_convert_identifier(buf, buflen, id + 1, idlen - 1,
  1567. thd, FALSE);
  1568. if (s - buf + (sizeof temp_index_suffix - 1) < buflen) {
  1569. memcpy(s, temp_index_suffix,
  1570. sizeof temp_index_suffix - 1);
  1571. s += sizeof temp_index_suffix - 1;
  1572. }
  1573. } else {
  1574. no_db_name:
  1575. s = innobase_convert_identifier(buf, buflen, id, idlen,
  1576. thd, table_id);
  1577. }
  1578. return(s);
  1579. }
  1580. /**********************************************************************//**
  1581. Determines if the currently running transaction has been interrupted.
  1582. @return TRUE if interrupted */
  1583. extern "C" UNIV_INTERN
  1584. ibool
  1585. trx_is_interrupted(
  1586. /*===============*/
  1587. trx_t* trx) /*!< in: transaction */
  1588. {
  1589. return(trx && trx->mysql_thd && thd_killed((THD*) trx->mysql_thd));
  1590. }
  1591. /**************************************************************//**
  1592. Resets some fields of a prebuilt struct. The template is used in fast
  1593. retrieval of just those column values MySQL needs in its processing. */
  1594. static
  1595. void
  1596. reset_template(
  1597. /*===========*/
  1598. row_prebuilt_t* prebuilt) /*!< in/out: prebuilt struct */
  1599. {
  1600. prebuilt->keep_other_fields_on_keyread = 0;
  1601. prebuilt->read_just_key = 0;
  1602. }
  1603. /*****************************************************************//**
  1604. Call this when you have opened a new table handle in HANDLER, before you
  1605. call index_read_idx() etc. Actually, we can let the cursor stay open even
  1606. over a transaction commit! Then you should call this before every operation,
  1607. fetch next etc. This function inits the necessary things even after a
  1608. transaction commit. */
  1609. UNIV_INTERN
  1610. void
  1611. ha_innobase::init_table_handle_for_HANDLER(void)
  1612. /*============================================*/
  1613. {
  1614. /* If current thd does not yet have a trx struct, create one.
  1615. If the current handle does not yet have a prebuilt struct, create
  1616. one. Update the trx pointers in the prebuilt struct. Normally
  1617. this operation is done in external_lock. */
  1618. update_thd(ha_thd());
  1619. /* Initialize the prebuilt struct much like it would be inited in
  1620. external_lock */
  1621. innobase_release_stat_resources(prebuilt->trx);
  1622. /* If the transaction is not started yet, start it */
  1623. trx_start_if_not_started(prebuilt->trx);
  1624. /* Assign a read view if the transaction does not have it yet */
  1625. trx_assign_read_view(prebuilt->trx);
  1626. /* Set the MySQL flag to mark that there is an active transaction */
  1627. if (prebuilt->trx->active_trans == 0) {
  1628. innobase_register_trx_and_stmt(ht, user_thd);
  1629. prebuilt->trx->active_trans = 1;
  1630. }
  1631. /* We did the necessary inits in this function, no need to repeat them
  1632. in row_search_for_mysql */
  1633. prebuilt->sql_stat_start = FALSE;
  1634. /* We let HANDLER always to do the reads as consistent reads, even
  1635. if the trx isolation level would have been specified as SERIALIZABLE */
  1636. prebuilt->select_lock_type = LOCK_NONE;
  1637. prebuilt->stored_select_lock_type = LOCK_NONE;
  1638. /* Always fetch all columns in the index record */
  1639. prebuilt->hint_need_to_fetch_extra_cols = ROW_RETRIEVE_ALL_COLS;
  1640. /* We want always to fetch all columns in the whole row? Or do
  1641. we???? */
  1642. prebuilt->used_in_HANDLER = TRUE;
  1643. reset_template(prebuilt);
  1644. }
  1645. /*********************************************************************//**
  1646. Opens an InnoDB database.
  1647. @return 0 on success, error code on failure */
  1648. static
  1649. int
  1650. innobase_init(
  1651. /*==========*/
  1652. void *p) /*!< in: InnoDB handlerton */
  1653. {
  1654. static char current_dir[3]; /*!< Set if using current lib */
  1655. int err;
  1656. bool ret;
  1657. char *default_path;
  1658. uint format_id;
  1659. DBUG_ENTER("innobase_init");
  1660. handlerton *innobase_hton= (handlerton *)p;
  1661. innodb_hton_ptr = innobase_hton;
  1662. innobase_hton->state = SHOW_OPTION_YES;
  1663. innobase_hton->db_type= DB_TYPE_INNODB;
  1664. innobase_hton->savepoint_offset=sizeof(trx_named_savept_t);
  1665. innobase_hton->close_connection=innobase_close_connection;
  1666. innobase_hton->savepoint_set=innobase_savepoint;
  1667. innobase_hton->savepoint_rollback=innobase_rollback_to_savepoint;
  1668. innobase_hton->savepoint_release=innobase_release_savepoint;
  1669. innobase_hton->commit=innobase_commit;
  1670. innobase_hton->rollback=innobase_rollback;
  1671. innobase_hton->prepare=innobase_xa_prepare;
  1672. innobase_hton->recover=innobase_xa_recover;
  1673. innobase_hton->commit_by_xid=innobase_commit_by_xid;
  1674. innobase_hton->rollback_by_xid=innobase_rollback_by_xid;
  1675. innobase_hton->create_cursor_read_view=innobase_create_cursor_view;
  1676. innobase_hton->set_cursor_read_view=innobase_set_cursor_view;
  1677. innobase_hton->close_cursor_read_view=innobase_close_cursor_view;
  1678. innobase_hton->create=innobase_create_handler;
  1679. innobase_hton->drop_database=innobase_drop_database;
  1680. innobase_hton->panic=innobase_end;
  1681. innobase_hton->start_consistent_snapshot=innobase_start_trx_and_assign_read_view;
  1682. innobase_hton->flush_logs=innobase_flush_logs;
  1683. innobase_hton->show_status=innobase_show_status;
  1684. innobase_hton->flags=HTON_NO_FLAGS;
  1685. innobase_hton->release_temporary_latches=innobase_release_temporary_latches;
  1686. innobase_hton->alter_table_flags = innobase_alter_table_flags;
  1687. ut_a(DATA_MYSQL_TRUE_VARCHAR == (ulint)MYSQL_TYPE_VARCHAR);
  1688. #ifdef UNIV_DEBUG
  1689. static const char test_filename[] = "-@";
  1690. char test_tablename[sizeof test_filename
  1691. + sizeof srv_mysql50_table_name_prefix];
  1692. if ((sizeof test_tablename) - 1
  1693. != filename_to_tablename(test_filename, test_tablename,
  1694. sizeof test_tablename)
  1695. || strncmp(test_tablename,
  1696. srv_mysql50_table_name_prefix,
  1697. sizeof srv_mysql50_table_name_prefix)
  1698. || strcmp(test_tablename
  1699. + sizeof srv_mysql50_table_name_prefix,
  1700. test_filename)) {
  1701. sql_print_error("tablename encoding has been changed");
  1702. goto error;
  1703. }
  1704. #endif /* UNIV_DEBUG */
  1705. /* Check that values don't overflow on 32-bit systems. */
  1706. if (sizeof(ulint) == 4) {
  1707. if (innobase_buffer_pool_size > UINT_MAX32) {
  1708. sql_print_error(
  1709. "innobase_buffer_pool_size can't be over 4GB"
  1710. " on 32-bit systems");
  1711. goto error;
  1712. }
  1713. if (innobase_log_file_size > UINT_MAX32) {
  1714. sql_print_error(
  1715. "innobase_log_file_size can't be over 4GB"
  1716. " on 32-bit systems");
  1717. goto error;
  1718. }
  1719. }
  1720. os_innodb_umask = (ulint)my_umask;
  1721. /* First calculate the default path for innodb_data_home_dir etc.,
  1722. in case the user has not given any value.
  1723. Note that when using the embedded server, the datadirectory is not
  1724. necessarily the current directory of this program. */
  1725. if (mysqld_embedded) {
  1726. default_path = mysql_real_data_home;
  1727. fil_path_to_mysql_datadir = mysql_real_data_home;
  1728. } else {
  1729. /* It's better to use current lib, to keep paths short */
  1730. current_dir[0] = FN_CURLIB;
  1731. current_dir[1] = FN_LIBCHAR;
  1732. current_dir[2] = 0;
  1733. default_path = current_dir;
  1734. }
  1735. ut_a(default_path);
  1736. if (specialflag & SPECIAL_NO_PRIOR) {
  1737. srv_set_thread_priorities = FALSE;
  1738. } else {
  1739. srv_set_thread_priorities = TRUE;
  1740. srv_query_thread_priority = QUERY_PRIOR;
  1741. }
  1742. /* Set InnoDB initialization parameters according to the values
  1743. read from MySQL .cnf file */
  1744. /*--------------- Data files -------------------------*/
  1745. /* The default dir for data files is the datadir of MySQL */
  1746. srv_data_home = (innobase_data_home_dir ? innobase_data_home_dir :
  1747. default_path);
  1748. /* Set default InnoDB data file size to 10 MB and let it be
  1749. auto-extending. Thus users can use InnoDB in >= 4.0 without having
  1750. to specify any startup options. */
  1751. if (!innobase_data_file_path) {
  1752. innobase_data_file_path = (char*) "ibdata1:10M:autoextend";
  1753. }
  1754. /* Since InnoDB edits the argument in the next call, we make another
  1755. copy of it: */
  1756. internal_innobase_data_file_path = my_strdup(innobase_data_file_path,
  1757. MYF(MY_FAE));
  1758. ret = (bool) srv_parse_data_file_paths_and_sizes(
  1759. internal_innobase_data_file_path);
  1760. if (ret == FALSE) {
  1761. sql_print_error(
  1762. "InnoDB: syntax error in innodb_data_file_path");
  1763. mem_free_and_error:
  1764. srv_free_paths_and_sizes();
  1765. my_free(internal_innobase_data_file_path,
  1766. MYF(MY_ALLOW_ZERO_PTR));
  1767. goto error;
  1768. }
  1769. /* -------------- Log files ---------------------------*/
  1770. /* The default dir for log files is the datadir of MySQL */
  1771. if (!innobase_log_group_home_dir) {
  1772. innobase_log_group_home_dir = default_path;
  1773. }
  1774. #ifdef UNIV_LOG_ARCHIVE
  1775. /* Since innodb_log_arch_dir has no relevance under MySQL,
  1776. starting from 4.0.6 we always set it the same as
  1777. innodb_log_group_home_dir: */
  1778. innobase_log_arch_dir = innobase_log_group_home_dir;
  1779. srv_arch_dir = innobase_log_arch_dir;
  1780. #endif /* UNIG_LOG_ARCHIVE */
  1781. ret = (bool)
  1782. srv_parse_log_group_home_dirs(innobase_log_group_home_dir);
  1783. if (ret == FALSE || innobase_mirrored_log_groups != 1) {
  1784. sql_print_error("syntax error in innodb_log_group_home_dir, or a "
  1785. "wrong number of mirrored log groups");
  1786. goto mem_free_and_error;
  1787. }
  1788. /* Validate the file format by animal name */
  1789. if (innobase_file_format_name != NULL) {
  1790. format_id = innobase_file_format_name_lookup(
  1791. innobase_file_format_name);
  1792. if (format_id > DICT_TF_FORMAT_MAX) {
  1793. sql_print_error("InnoDB: wrong innodb_file_format.");
  1794. goto mem_free_and_error;
  1795. }
  1796. } else {
  1797. /* Set it to the default file format id. Though this
  1798. should never happen. */
  1799. format_id = 0;
  1800. }
  1801. srv_file_format = format_id;
  1802. /* Given the type of innobase_file_format_name we have little
  1803. choice but to cast away the constness from the returned name.
  1804. innobase_file_format_name is used in the MySQL set variable
  1805. interface and so can't be const. */
  1806. innobase_file_format_name =
  1807. (char*) trx_sys_file_format_id_to_name(format_id);
  1808. /* Process innobase_file_format_check variable */
  1809. ut_a(innobase_file_format_check != NULL);
  1810. /* As a side effect it will set srv_check_file_format_at_startup
  1811. on valid input. First we check for "on"/"off". */
  1812. if (!innobase_file_format_check_on_off(innobase_file_format_check)) {
  1813. /* Did the user specify a format name that we support ?
  1814. As a side effect it will update the variable
  1815. srv_check_file_format_at_startup */
  1816. if (innobase_file_format_validate_and_set(
  1817. innobase_file_format_check) < 0) {
  1818. sql_print_error("InnoDB: invalid "
  1819. "innodb_file_format_check value: "
  1820. "should be either 'on' or 'off' or "
  1821. "any value up to %s or its "
  1822. "equivalent numeric id",
  1823. trx_sys_file_format_id_to_name(
  1824. DICT_TF_FORMAT_MAX));
  1825. goto mem_free_and_error;
  1826. }
  1827. }
  1828. if (innobase_change_buffering) {
  1829. ulint use;
  1830. for (use = 0;
  1831. use < UT_ARR_SIZE(innobase_change_buffering_values);
  1832. use++) {
  1833. if (!innobase_strcasecmp(
  1834. innobase_change_buffering,
  1835. innobase_change_buffering_values[use])) {
  1836. ibuf_use = (ibuf_use_t) use;
  1837. goto innobase_change_buffering_inited_ok;
  1838. }
  1839. }
  1840. sql_print_error("InnoDB: invalid value "
  1841. "innodb_file_format_check=%s",
  1842. innobase_change_buffering);
  1843. goto mem_free_and_error;
  1844. }
  1845. innobase_change_buffering_inited_ok:
  1846. ut_a((ulint) ibuf_use < UT_ARR_SIZE(innobase_change_buffering_values));
  1847. innobase_change_buffering = (char*)
  1848. innobase_change_buffering_values[ibuf_use];
  1849. /* --------------------------------------------------*/
  1850. srv_file_flush_method_str = innobase_file_flush_method;
  1851. srv_n_log_groups = (ulint) innobase_mirrored_log_groups;
  1852. srv_n_log_files = (ulint) innobase_log_files_in_group;
  1853. srv_log_file_size = (ulint) innobase_log_file_size;
  1854. #ifdef UNIV_LOG_ARCHIVE
  1855. srv_log_archive_on = (ulint) innobase_log_archive;
  1856. #endif /* UNIV_LOG_ARCHIVE */
  1857. srv_log_buffer_size = (ulint) innobase_log_buffer_size;
  1858. srv_buf_pool_size = (ulint) innobase_buffer_pool_size;
  1859. srv_mem_pool_size = (ulint) innobase_additional_mem_pool_size;
  1860. srv_n_file_io_threads = (ulint) innobase_file_io_threads;
  1861. srv_n_read_io_threads = (ulint) innobase_read_io_threads;
  1862. srv_n_write_io_threads = (ulint) innobase_write_io_threads;
  1863. srv_force_recovery = (ulint) innobase_force_recovery;
  1864. srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;
  1865. srv_use_checksums = (ibool) innobase_use_checksums;
  1866. #ifdef HAVE_LARGE_PAGES
  1867. if ((os_use_large_pages = (ibool) my_use_large_pages))
  1868. os_large_page_size = (ulint) opt_large_page_size;
  1869. #endif
  1870. row_rollback_on_timeout = (ibool) innobase_rollback_on_timeout;
  1871. srv_locks_unsafe_for_binlog = (ibool) innobase_locks_unsafe_for_binlog;
  1872. srv_max_n_open_files = (ulint) innobase_open_files;
  1873. srv_innodb_status = (ibool) innobase_create_status_file;
  1874. srv_print_verbose_log = mysqld_embedded ? 0 : 1;
  1875. /* Store the default charset-collation number of this MySQL
  1876. installation */
  1877. data_mysql_default_charset_coll = (ulint)default_charset_info->number;
  1878. ut_a(DATA_MYSQL_LATIN1_SWEDISH_CHARSET_COLL ==
  1879. my_charset_latin1.number);
  1880. ut_a(DATA_MYSQL_BINARY_CHARSET_COLL == my_charset_bin.number);
  1881. /* Store the latin1_swedish_ci character ordering table to InnoDB. For
  1882. non-latin1_swedish_ci charsets we use the MySQL comparison functions,
  1883. and consequently we do not need to know the ordering internally in
  1884. InnoDB. */
  1885. ut_a(0 == strcmp(my_charset_latin1.name, "latin1_swedish_ci"));
  1886. srv_latin1_ordering = my_charset_latin1.sort_order;
  1887. innobase_old_blocks_pct = buf_LRU_old_ratio_update(
  1888. innobase_old_blocks_pct, FALSE);
  1889. innobase_commit_concurrency_init_default();
  1890. /* Since we in this module access directly the fields of a trx
  1891. struct, and due to different headers and flags it might happen that
  1892. mutex_t has a different size in this module and in InnoDB
  1893. modules, we check at run time that the size is the same in
  1894. these compilation modules. */
  1895. err = innobase_start_or_create_for_mysql();
  1896. if (err != DB_SUCCESS) {
  1897. goto mem_free_and_error;
  1898. }
  1899. innobase_open_tables = hash_create(200);
  1900. pthread_mutex_init(&innobase_share_mutex, MY_MUTEX_INIT_FAST);
  1901. pthread_mutex_init(&prepare_commit_mutex, MY_MUTEX_INIT_FAST);
  1902. pthread_mutex_init(&commit_threads_m, MY_MUTEX_INIT_FAST);
  1903. pthread_mutex_init(&commit_cond_m, MY_MUTEX_INIT_FAST);
  1904. pthread_mutex_init(&analyze_mutex, MY_MUTEX_INIT_FAST);
  1905. pthread_cond_init(&commit_cond, NULL);
  1906. innodb_inited= 1;
  1907. #ifdef MYSQL_DYNAMIC_PLUGIN
  1908. if (innobase_hton != p) {
  1909. innobase_hton = reinterpret_cast<handlerton*>(p);
  1910. *innobase_hton = *innodb_hton_ptr;
  1911. }
  1912. #endif /* MYSQL_DYNAMIC_PLUGIN */
  1913. /* Get the current high water mark format. */
  1914. innobase_file_format_check = (char*) trx_sys_file_format_max_get();
  1915. DBUG_RETURN(FALSE);
  1916. error:
  1917. DBUG_RETURN(TRUE);
  1918. }
  1919. /*******************************************************************//**
  1920. Closes an InnoDB database.
  1921. @return TRUE if error */
  1922. static
  1923. int
  1924. innobase_end(
  1925. /*=========*/
  1926. handlerton* hton, /*!< in/out: InnoDB handlerton */
  1927. ha_panic_function type __attribute__((unused)))
  1928. /*!< in: ha_panic() parameter */
  1929. {
  1930. int err= 0;
  1931. DBUG_ENTER("innobase_end");
  1932. DBUG_ASSERT(hton == innodb_hton_ptr);
  1933. #ifdef __NETWARE__ /* some special cleanup for NetWare */
  1934. if (nw_panic) {
  1935. set_panic_flag_for_netware();
  1936. }
  1937. #endif
  1938. if (innodb_inited) {
  1939. srv_fast_shutdown = (ulint) innobase_fast_shutdown;
  1940. innodb_inited = 0;
  1941. hash_table_free(innobase_open_tables);
  1942. innobase_open_tables = NULL;
  1943. if (innobase_shutdown_for_mysql() != DB_SUCCESS) {
  1944. err = 1;
  1945. }
  1946. srv_free_paths_and_sizes();
  1947. my_free(internal_innobase_data_file_path,
  1948. MYF(MY_ALLOW_ZERO_PTR));
  1949. pthread_mutex_destroy(&innobase_share_mutex);
  1950. pthread_mutex_destroy(&prepare_commit_mutex);
  1951. pthread_mutex_destroy(&commit_threads_m);
  1952. pthread_mutex_destroy(&commit_cond_m);
  1953. pthread_mutex_destroy(&analyze_mutex);
  1954. pthread_cond_destroy(&commit_cond);
  1955. }
  1956. DBUG_RETURN(err);
  1957. }
  1958. /****************************************************************//**
  1959. Flushes InnoDB logs to disk and makes a checkpoint. Really, a commit flushes
  1960. the logs, and the name of this function should be innobase_checkpoint.
  1961. @return TRUE if error */
  1962. static
  1963. bool
  1964. innobase_flush_logs(
  1965. /*================*/
  1966. handlerton* hton) /*!< in/out: InnoDB handlerton */
  1967. {
  1968. bool result = 0;
  1969. DBUG_ENTER("innobase_flush_logs");
  1970. DBUG_ASSERT(hton == innodb_hton_ptr);
  1971. log_buffer_flush_to_disk();
  1972. DBUG_RETURN(result);
  1973. }
  1974. /****************************************************************//**
  1975. Return alter table flags supported in an InnoDB database. */
  1976. static
  1977. uint
  1978. innobase_alter_table_flags(
  1979. /*=======================*/
  1980. uint flags)
  1981. {
  1982. return(HA_ONLINE_ADD_INDEX_NO_WRITES
  1983. | HA_ONLINE_DROP_INDEX_NO_WRITES
  1984. | HA_ONLINE_ADD_UNIQUE_INDEX_NO_WRITES
  1985. | HA_ONLINE_DROP_UNIQUE_INDEX_NO_WRITES
  1986. | HA_ONLINE_ADD_PK_INDEX_NO_WRITES);
  1987. }
  1988. /*****************************************************************//**
  1989. Commits a transaction in an InnoDB database. */
  1990. static
  1991. void
  1992. innobase_commit_low(
  1993. /*================*/
  1994. trx_t* trx) /*!< in: transaction handle */
  1995. {
  1996. if (trx->conc_state == TRX_NOT_STARTED) {
  1997. return;
  1998. }
  1999. trx_commit_for_mysql(trx);
  2000. }
  2001. /*****************************************************************//**
  2002. Creates an InnoDB transaction struct for the thd if it does not yet have one.
  2003. Starts a new InnoDB transaction if a transaction is not yet started. And
  2004. assigns a new snapshot for a consistent read if the transaction does not yet
  2005. have one.
  2006. @return 0 */
  2007. static
  2008. int
  2009. innobase_start_trx_and_assign_read_view(
  2010. /*====================================*/
  2011. handlerton *hton, /*!< in: Innodb handlerton */
  2012. THD* thd) /*!< in: MySQL thread handle of the user for whom
  2013. the transaction should be committed */
  2014. {
  2015. trx_t* trx;
  2016. DBUG_ENTER("innobase_start_trx_and_assign_read_view");
  2017. DBUG_ASSERT(hton == innodb_hton_ptr);
  2018. /* Create a new trx struct for thd, if it does not yet have one */
  2019. trx = check_trx_exists(thd);
  2020. /* This is just to play safe: release a possible FIFO ticket and
  2021. search latch. Since we will reserve the kernel mutex, we have to
  2022. release the search system latch first to obey the latching order. */
  2023. innobase_release_stat_resources(trx);
  2024. /* If the transaction is not started yet, start it */
  2025. trx_start_if_not_started(trx);
  2026. /* Assign a read view if the transaction does not have it yet */
  2027. trx_assign_read_view(trx);
  2028. /* Set the MySQL flag to mark that there is an active transaction */
  2029. if (trx->active_trans == 0) {
  2030. innobase_register_trx_and_stmt(hton, thd);
  2031. trx->active_trans = 1;
  2032. }
  2033. DBUG_RETURN(0);
  2034. }
  2035. /*****************************************************************//**
  2036. Commits a transaction in an InnoDB database or marks an SQL statement
  2037. ended.
  2038. @return 0 */
  2039. static
  2040. int
  2041. innobase_commit(
  2042. /*============*/
  2043. handlerton *hton, /*!< in: Innodb handlerton */
  2044. THD* thd, /*!< in: MySQL thread handle of the user for whom
  2045. the transaction should be committed */
  2046. bool all) /*!< in: TRUE - commit transaction
  2047. FALSE - the current SQL statement ended */
  2048. {
  2049. trx_t* trx;
  2050. DBUG_ENTER("innobase_commit");
  2051. DBUG_ASSERT(hton == innodb_hton_ptr);
  2052. DBUG_PRINT("trans", ("ending transaction"));
  2053. trx = check_trx_exists(thd);
  2054. /* Since we will reserve the kernel mutex, we have to release
  2055. the search system latch first to obey the latching order. */
  2056. if (trx->has_search_latch) {
  2057. trx_search_latch_release_if_reserved(trx);
  2058. }
  2059. /* The flag trx->active_trans is set to 1 in
  2060. 1. ::external_lock(),
  2061. 2. ::start_stmt(),
  2062. 3. innobase_query_caching_of_table_permitted(),
  2063. 4. innobase_savepoint(),
  2064. 5. ::init_table_handle_for_HANDLER(),
  2065. 6. innobase_start_trx_and_assign_read_view(),
  2066. 7. ::transactional_table_lock()
  2067. and it is only set to 0 in a commit or a rollback. If it is 0 we know
  2068. there cannot be resources to be freed and we could return immediately.
  2069. For the time being, we play safe and do the cleanup though there should
  2070. be nothing to clean up. */
  2071. if (trx->active_trans == 0
  2072. && trx->conc_state != TRX_NOT_STARTED) {
  2073. sql_print_error("trx->active_trans == 0, but"
  2074. " trx->conc_state != TRX_NOT_STARTED");
  2075. }
  2076. if (all
  2077. || (!thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) {
  2078. /* We were instructed to commit the whole transaction, or
  2079. this is an SQL statement end and autocommit is on */
  2080. /* We need current binlog position for ibbackup to work.
  2081. Note, the position is current because of
  2082. prepare_commit_mutex */
  2083. retry:
  2084. if (innobase_commit_concurrency > 0) {
  2085. pthread_mutex_lock(&commit_cond_m);
  2086. commit_threads++;
  2087. if (commit_threads > innobase_commit_concurrency) {
  2088. commit_threads--;
  2089. pthread_cond_wait(&commit_cond,
  2090. &commit_cond_m);
  2091. pthread_mutex_unlock(&commit_cond_m);
  2092. goto retry;
  2093. }
  2094. else {
  2095. pthread_mutex_unlock(&commit_cond_m);
  2096. }
  2097. }
  2098. /* The following calls to read the MySQL binary log
  2099. file name and the position return consistent results:
  2100. 1) Other InnoDB transactions cannot intervene between
  2101. these calls as we are holding prepare_commit_mutex.
  2102. 2) Binary logging of other engines is not relevant
  2103. to InnoDB as all InnoDB requires is that committing
  2104. InnoDB transactions appear in the same order in the
  2105. MySQL binary log as they appear in InnoDB logs.
  2106. 3) A MySQL log file rotation cannot happen because
  2107. MySQL protects against this by having a counter of
  2108. transactions in prepared state and it only allows
  2109. a rotation when the counter drops to zero. See
  2110. LOCK_prep_xids and COND_prep_xids in log.cc. */
  2111. trx->mysql_log_file_name = mysql_bin_log_file_name();
  2112. trx->mysql_log_offset = (ib_int64_t) mysql_bin_log_file_pos();
  2113. /* Don't do write + flush right now. For group commit
  2114. to work we want to do the flush after releasing the
  2115. prepare_commit_mutex. */
  2116. trx->flush_log_later = TRUE;
  2117. innobase_commit_low(trx);
  2118. trx->flush_log_later = FALSE;
  2119. if (innobase_commit_concurrency > 0) {
  2120. pthread_mutex_lock(&commit_cond_m);
  2121. commit_threads--;
  2122. pthread_cond_signal(&commit_cond);
  2123. pthread_mutex_unlock(&commit_cond_m);
  2124. }
  2125. if (trx->active_trans == 2) {
  2126. pthread_mutex_unlock(&prepare_commit_mutex);
  2127. }
  2128. /* Now do a write + flush of logs. */
  2129. trx_commit_complete_for_mysql(trx);
  2130. trx->active_trans = 0;
  2131. } else {
  2132. /* We just mark the SQL statement ended and do not do a
  2133. transaction commit */
  2134. /* If we had reserved the auto-inc lock for some
  2135. table in this SQL statement we release it now */
  2136. row_unlock_table_autoinc_for_mysql(trx);
  2137. /* Store the current undo_no of the transaction so that we
  2138. know where to roll back if we have to roll back the next
  2139. SQL statement */
  2140. trx_mark_sql_stat_end(trx);
  2141. }
  2142. trx->n_autoinc_rows = 0; /* Reset the number AUTO-INC rows required */
  2143. if (trx->declared_to_be_inside_innodb) {
  2144. /* Release our possible ticket in the FIFO */
  2145. srv_conc_force_exit_innodb(trx);
  2146. }
  2147. /* Tell the InnoDB server that there might be work for utility
  2148. threads: */
  2149. srv_active_wake_master_thread();
  2150. DBUG_RETURN(0);
  2151. }
  2152. /*****************************************************************//**
  2153. Rolls back a transaction or the latest SQL statement.
  2154. @return 0 or error number */
  2155. static
  2156. int
  2157. innobase_rollback(
  2158. /*==============*/
  2159. handlerton *hton, /*!< in: Innodb handlerton */
  2160. THD* thd, /*!< in: handle to the MySQL thread of the user
  2161. whose transaction should be rolled back */
  2162. bool all) /*!< in: TRUE - commit transaction
  2163. FALSE - the current SQL statement ended */
  2164. {
  2165. int error = 0;
  2166. trx_t* trx;
  2167. DBUG_ENTER("innobase_rollback");
  2168. DBUG_ASSERT(hton == innodb_hton_ptr);
  2169. DBUG_PRINT("trans", ("aborting transaction"));
  2170. trx = check_trx_exists(thd);
  2171. /* Release a possible FIFO ticket and search latch. Since we will
  2172. reserve the kernel mutex, we have to release the search system latch
  2173. first to obey the latching order. */
  2174. innobase_release_stat_resources(trx);
  2175. trx->n_autoinc_rows = 0; /* Reset the number AUTO-INC rows required */
  2176. /* If we had reserved the auto-inc lock for some table (if
  2177. we come here to roll back the latest SQL statement) we
  2178. release it now before a possibly lengthy rollback */
  2179. row_unlock_table_autoinc_for_mysql(trx);
  2180. if (all
  2181. || !thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) {
  2182. error = trx_rollback_for_mysql(trx);
  2183. trx->active_trans = 0;
  2184. } else {
  2185. error = trx_rollback_last_sql_stat_for_mysql(trx);
  2186. }
  2187. DBUG_RETURN(convert_error_code_to_mysql(error, 0, NULL));
  2188. }
  2189. /*****************************************************************//**
  2190. Rolls back a transaction
  2191. @return 0 or error number */
  2192. static
  2193. int
  2194. innobase_rollback_trx(
  2195. /*==================*/
  2196. trx_t* trx) /*!< in: transaction */
  2197. {
  2198. int error = 0;
  2199. DBUG_ENTER("innobase_rollback_trx");
  2200. DBUG_PRINT("trans", ("aborting transaction"));
  2201. /* Release a possible FIFO ticket and search latch. Since we will
  2202. reserve the kernel mutex, we have to release the search system latch
  2203. first to obey the latching order. */
  2204. innobase_release_stat_resources(trx);
  2205. /* If we had reserved the auto-inc lock for some table (if
  2206. we come here to roll back the latest SQL statement) we
  2207. release it now before a possibly lengthy rollback */
  2208. row_unlock_table_autoinc_for_mysql(trx);
  2209. error = trx_rollback_for_mysql(trx);
  2210. DBUG_RETURN(convert_error_code_to_mysql(error, 0, NULL));
  2211. }
  2212. /*****************************************************************//**
  2213. Rolls back a transaction to a savepoint.
  2214. @return 0 if success, HA_ERR_NO_SAVEPOINT if no savepoint with the
  2215. given name */
  2216. static
  2217. int
  2218. innobase_rollback_to_savepoint(
  2219. /*===========================*/
  2220. handlerton *hton, /*!< in: Innodb handlerton */
  2221. THD* thd, /*!< in: handle to the MySQL thread of the user
  2222. whose transaction should be rolled back */
  2223. void* savepoint) /*!< in: savepoint data */
  2224. {
  2225. ib_int64_t mysql_binlog_cache_pos;
  2226. int error = 0;
  2227. trx_t* trx;
  2228. char name[64];
  2229. DBUG_ENTER("innobase_rollback_to_savepoint");
  2230. DBUG_ASSERT(hton == innodb_hton_ptr);
  2231. trx = check_trx_exists(thd);
  2232. /* Release a possible FIFO ticket and search latch. Since we will
  2233. reserve the kernel mutex, we have to release the search system latch
  2234. first to obey the latching order. */
  2235. innobase_release_stat_resources(trx);
  2236. /* TODO: use provided savepoint data area to store savepoint data */
  2237. longlong2str((ulint)savepoint, name, 36);
  2238. error = (int) trx_rollback_to_savepoint_for_mysql(trx, name,
  2239. &mysql_binlog_cache_pos);
  2240. DBUG_RETURN(convert_error_code_to_mysql(error, 0, NULL));
  2241. }
  2242. /*****************************************************************//**
  2243. Release transaction savepoint name.
  2244. @return 0 if success, HA_ERR_NO_SAVEPOINT if no savepoint with the
  2245. given name */
  2246. static
  2247. int
  2248. innobase_release_savepoint(
  2249. /*=======================*/
  2250. handlerton* hton, /*!< in: handlerton for Innodb */
  2251. THD* thd, /*!< in: handle to the MySQL thread of the user
  2252. whose transaction should be rolled back */
  2253. void* savepoint) /*!< in: savepoint data */
  2254. {
  2255. int error = 0;
  2256. trx_t* trx;
  2257. char name[64];
  2258. DBUG_ENTER("innobase_release_savepoint");
  2259. DBUG_ASSERT(hton == innodb_hton_ptr);
  2260. trx = check_trx_exists(thd);
  2261. /* TODO: use provided savepoint data area to store savepoint data */
  2262. longlong2str((ulint)savepoint, name, 36);
  2263. error = (int) trx_release_savepoint_for_mysql(trx, name);
  2264. DBUG_RETURN(convert_error_code_to_mysql(error, 0, NULL));
  2265. }
  2266. /*****************************************************************//**
  2267. Sets a transaction savepoint.
  2268. @return always 0, that is, always succeeds */
  2269. static
  2270. int
  2271. innobase_savepoint(
  2272. /*===============*/
  2273. handlerton* hton, /*!< in: handle to the Innodb handlerton */
  2274. THD* thd, /*!< in: handle to the MySQL thread */
  2275. void* savepoint) /*!< in: savepoint data */
  2276. {
  2277. int error = 0;
  2278. trx_t* trx;
  2279. DBUG_ENTER("innobase_savepoint");
  2280. DBUG_ASSERT(hton == innodb_hton_ptr);
  2281. /*
  2282. In the autocommit mode there is no sense to set a savepoint
  2283. (unless we are in sub-statement), so SQL layer ensures that
  2284. this method is never called in such situation.
  2285. */
  2286. #ifdef MYSQL_SERVER /* plugins cannot access thd->in_sub_stmt */
  2287. DBUG_ASSERT(thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN) ||
  2288. thd->in_sub_stmt);
  2289. #endif /* MYSQL_SERVER */
  2290. trx = check_trx_exists(thd);
  2291. /* Release a possible FIFO ticket and search latch. Since we will
  2292. reserve the kernel mutex, we have to release the search system latch
  2293. first to obey the latching order. */
  2294. innobase_release_stat_resources(trx);
  2295. /* cannot happen outside of transaction */
  2296. DBUG_ASSERT(trx->active_trans);
  2297. /* TODO: use provided savepoint data area to store savepoint data */
  2298. char name[64];
  2299. longlong2str((ulint)savepoint,name,36);
  2300. error = (int) trx_savepoint_for_mysql(trx, name, (ib_int64_t)0);
  2301. DBUG_RETURN(convert_error_code_to_mysql(error, 0, NULL));
  2302. }
  2303. /*****************************************************************//**
  2304. Frees a possible InnoDB trx object associated with the current THD.
  2305. @return 0 or error number */
  2306. static
  2307. int
  2308. innobase_close_connection(
  2309. /*======================*/
  2310. handlerton* hton, /*!< in: innobase handlerton */
  2311. THD* thd) /*!< in: handle to the MySQL thread of the user
  2312. whose resources should be free'd */
  2313. {
  2314. trx_t* trx;
  2315. DBUG_ENTER("innobase_close_connection");
  2316. DBUG_ASSERT(hton == innodb_hton_ptr);
  2317. trx = thd_to_trx(thd);
  2318. ut_a(trx);
  2319. if (trx->active_trans == 0
  2320. && trx->conc_state != TRX_NOT_STARTED) {
  2321. sql_print_error("trx->active_trans == 0, but"
  2322. " trx->conc_state != TRX_NOT_STARTED");
  2323. }
  2324. if (trx->conc_state != TRX_NOT_STARTED &&
  2325. global_system_variables.log_warnings) {
  2326. sql_print_warning(
  2327. "MySQL is closing a connection that has an active "
  2328. "InnoDB transaction. %lu row modifications will "
  2329. "roll back.",
  2330. (ulong) trx->undo_no.low);
  2331. }
  2332. innobase_rollback_trx(trx);
  2333. thr_local_free(trx->mysql_thread_id);
  2334. trx_free_for_mysql(trx);
  2335. DBUG_RETURN(0);
  2336. }
  2337. /*************************************************************************//**
  2338. ** InnoDB database tables
  2339. *****************************************************************************/
  2340. /****************************************************************//**
  2341. Get the record format from the data dictionary.
  2342. @return one of ROW_TYPE_REDUNDANT, ROW_TYPE_COMPACT,
  2343. ROW_TYPE_COMPRESSED, ROW_TYPE_DYNAMIC */
  2344. UNIV_INTERN
  2345. enum row_type
  2346. ha_innobase::get_row_type() const
  2347. /*=============================*/
  2348. {
  2349. if (prebuilt && prebuilt->table) {
  2350. const ulint flags = prebuilt->table->flags;
  2351. if (UNIV_UNLIKELY(!flags)) {
  2352. return(ROW_TYPE_REDUNDANT);
  2353. }
  2354. ut_ad(flags & DICT_TF_COMPACT);
  2355. switch (flags & DICT_TF_FORMAT_MASK) {
  2356. case DICT_TF_FORMAT_51 << DICT_TF_FORMAT_SHIFT:
  2357. return(ROW_TYPE_COMPACT);
  2358. case DICT_TF_FORMAT_ZIP << DICT_TF_FORMAT_SHIFT:
  2359. if (flags & DICT_TF_ZSSIZE_MASK) {
  2360. return(ROW_TYPE_COMPRESSED);
  2361. } else {
  2362. return(ROW_TYPE_DYNAMIC);
  2363. }
  2364. #if DICT_TF_FORMAT_ZIP != DICT_TF_FORMAT_MAX
  2365. # error "DICT_TF_FORMAT_ZIP != DICT_TF_FORMAT_MAX"
  2366. #endif
  2367. }
  2368. }
  2369. ut_ad(0);
  2370. return(ROW_TYPE_NOT_USED);
  2371. }
  2372. /****************************************************************//**
  2373. Get the table flags to use for the statement.
  2374. @return table flags */
  2375. UNIV_INTERN
  2376. handler::Table_flags
  2377. ha_innobase::table_flags() const
  2378. /*============================*/
  2379. {
  2380. /* Need to use tx_isolation here since table flags is (also)
  2381. called before prebuilt is inited. */
  2382. ulong const tx_isolation = thd_tx_isolation(ha_thd());
  2383. if (tx_isolation <= ISO_READ_COMMITTED)
  2384. return int_table_flags;
  2385. return int_table_flags | HA_BINLOG_STMT_CAPABLE;
  2386. }
  2387. /****************************************************************//**
  2388. Gives the file extension of an InnoDB single-table tablespace. */
  2389. static const char* ha_innobase_exts[] = {
  2390. ".ibd",
  2391. NullS
  2392. };
  2393. /****************************************************************//**
  2394. Returns the table type (storage engine name).
  2395. @return table type */
  2396. UNIV_INTERN
  2397. const char*
  2398. ha_innobase::table_type() const
  2399. /*===========================*/
  2400. {
  2401. return(innobase_hton_name);
  2402. }
  2403. /****************************************************************//**
  2404. Returns the index type. */
  2405. UNIV_INTERN
  2406. const char*
  2407. ha_innobase::index_type(
  2408. /*====================*/
  2409. uint)
  2410. /*!< out: index type */
  2411. {
  2412. return("BTREE");
  2413. }
  2414. /****************************************************************//**
  2415. Returns the table file name extension.
  2416. @return file extension string */
  2417. UNIV_INTERN
  2418. const char**
  2419. ha_innobase::bas_ext() const
  2420. /*========================*/
  2421. {
  2422. return(ha_innobase_exts);
  2423. }
  2424. /****************************************************************//**
  2425. Returns the operations supported for indexes.
  2426. @return flags of supported operations */
  2427. UNIV_INTERN
  2428. ulong
  2429. ha_innobase::index_flags(
  2430. /*=====================*/
  2431. uint,
  2432. uint,
  2433. bool)
  2434. const
  2435. {
  2436. return(HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER
  2437. | HA_READ_RANGE | HA_KEYREAD_ONLY);
  2438. }
  2439. /****************************************************************//**
  2440. Returns the maximum number of keys.
  2441. @return MAX_KEY */
  2442. UNIV_INTERN
  2443. uint
  2444. ha_innobase::max_supported_keys() const
  2445. /*===================================*/
  2446. {
  2447. return(MAX_KEY);
  2448. }
  2449. /****************************************************************//**
  2450. Returns the maximum key length.
  2451. @return maximum supported key length, in bytes */
  2452. UNIV_INTERN
  2453. uint
  2454. ha_innobase::max_supported_key_length() const
  2455. /*=========================================*/
  2456. {
  2457. /* An InnoDB page must store >= 2 keys; a secondary key record
  2458. must also contain the primary key value: max key length is
  2459. therefore set to slightly less than 1 / 4 of page size which
  2460. is 16 kB; but currently MySQL does not work with keys whose
  2461. size is > MAX_KEY_LENGTH */
  2462. return(3500);
  2463. }
  2464. /****************************************************************//**
  2465. Returns the key map of keys that are usable for scanning.
  2466. @return key_map_full */
  2467. UNIV_INTERN
  2468. const key_map*
  2469. ha_innobase::keys_to_use_for_scanning()
  2470. {
  2471. return(&key_map_full);
  2472. }
  2473. /****************************************************************//**
  2474. Determines if table caching is supported.
  2475. @return HA_CACHE_TBL_ASKTRANSACT */
  2476. UNIV_INTERN
  2477. uint8
  2478. ha_innobase::table_cache_type()
  2479. {
  2480. return(HA_CACHE_TBL_ASKTRANSACT);
  2481. }
  2482. /****************************************************************//**
  2483. Determines if the primary key is clustered index.
  2484. @return true */
  2485. UNIV_INTERN
  2486. bool
  2487. ha_innobase::primary_key_is_clustered()
  2488. {
  2489. return(true);
  2490. }
  2491. /*****************************************************************//**
  2492. Normalizes a table name string. A normalized name consists of the
  2493. database name catenated to '/' and table name. An example:
  2494. test/mytable. On Windows normalization puts both the database name and the
  2495. table name always to lower case. */
  2496. static
  2497. void
  2498. normalize_table_name(
  2499. /*=================*/
  2500. char* norm_name, /*!< out: normalized name as a
  2501. null-terminated string */
  2502. const char* name) /*!< in: table name string */
  2503. {
  2504. char* name_ptr;
  2505. char* db_ptr;
  2506. char* ptr;
  2507. /* Scan name from the end */
  2508. ptr = strend(name)-1;
  2509. while (ptr >= name && *ptr != '\\' && *ptr != '/') {
  2510. ptr--;
  2511. }
  2512. name_ptr = ptr + 1;
  2513. DBUG_ASSERT(ptr > name);
  2514. ptr--;
  2515. while (ptr >= name && *ptr != '\\' && *ptr != '/') {
  2516. ptr--;
  2517. }
  2518. db_ptr = ptr + 1;
  2519. memcpy(norm_name, db_ptr, strlen(name) + 1 - (db_ptr - name));
  2520. norm_name[name_ptr - db_ptr - 1] = '/';
  2521. #ifdef __WIN__
  2522. innobase_casedn_str(norm_name);
  2523. #endif
  2524. }
  2525. /********************************************************************//**
  2526. Set the autoinc column max value. This should only be called once from
  2527. ha_innobase::open(). Therefore there's no need for a covering lock.
  2528. @return DB_SUCCESS or error code */
  2529. UNIV_INTERN
  2530. ulint
  2531. ha_innobase::innobase_initialize_autoinc()
  2532. /*======================================*/
  2533. {
  2534. dict_index_t* index;
  2535. ulonglong auto_inc;
  2536. const char* col_name;
  2537. ulint error;
  2538. col_name = table->found_next_number_field->field_name;
  2539. index = innobase_get_index(table->s->next_number_index);
  2540. /* Execute SELECT MAX(col_name) FROM TABLE; */
  2541. error = row_search_max_autoinc(index, col_name, &auto_inc);
  2542. switch (error) {
  2543. case DB_SUCCESS:
  2544. /* At the this stage we don't know the increment
  2545. or the offset, so use default inrement of 1. */
  2546. ++auto_inc;
  2547. break;
  2548. case DB_RECORD_NOT_FOUND:
  2549. ut_print_timestamp(stderr);
  2550. fprintf(stderr, " InnoDB: MySQL and InnoDB data "
  2551. "dictionaries are out of sync.\n"
  2552. "InnoDB: Unable to find the AUTOINC column %s in the "
  2553. "InnoDB table %s.\n"
  2554. "InnoDB: We set the next AUTOINC column value to the "
  2555. "maximum possible value,\n"
  2556. "InnoDB: in effect disabling the AUTOINC next value "
  2557. "generation.\n"
  2558. "InnoDB: You can either set the next AUTOINC value "
  2559. "explicitly using ALTER TABLE\n"
  2560. "InnoDB: or fix the data dictionary by recreating "
  2561. "the table.\n",
  2562. col_name, index->table->name);
  2563. auto_inc = 0xFFFFFFFFFFFFFFFFULL;
  2564. break;
  2565. default:
  2566. return(error);
  2567. }
  2568. dict_table_autoinc_initialize(prebuilt->table, auto_inc);
  2569. return(DB_SUCCESS);
  2570. }
  2571. /*****************************************************************//**
  2572. Creates and opens a handle to a table which already exists in an InnoDB
  2573. database.
  2574. @return 1 if error, 0 if success */
  2575. UNIV_INTERN
  2576. int
  2577. ha_innobase::open(
  2578. /*==============*/
  2579. const char* name, /*!< in: table name */
  2580. int mode, /*!< in: not used */
  2581. uint test_if_locked) /*!< in: not used */
  2582. {
  2583. dict_table_t* ib_table;
  2584. char norm_name[1000];
  2585. THD* thd;
  2586. ulint retries = 0;
  2587. char* is_part = NULL;
  2588. DBUG_ENTER("ha_innobase::open");
  2589. UT_NOT_USED(mode);
  2590. UT_NOT_USED(test_if_locked);
  2591. thd = ha_thd();
  2592. /* Under some cases MySQL seems to call this function while
  2593. holding btr_search_latch. This breaks the latching order as
  2594. we acquire dict_sys->mutex below and leads to a deadlock. */
  2595. if (thd != NULL) {
  2596. innobase_release_temporary_latches(ht, thd);
  2597. }
  2598. normalize_table_name(norm_name, name);
  2599. user_thd = NULL;
  2600. if (!(share=get_share(name))) {
  2601. DBUG_RETURN(1);
  2602. }
  2603. /* Create buffers for packing the fields of a record. Why
  2604. table->reclength did not work here? Obviously, because char
  2605. fields when packed actually became 1 byte longer, when we also
  2606. stored the string length as the first byte. */
  2607. upd_and_key_val_buff_len =
  2608. table->s->reclength + table->s->max_key_length
  2609. + MAX_REF_PARTS * 3;
  2610. if (!(uchar*) my_multi_malloc(MYF(MY_WME),
  2611. &upd_buff, upd_and_key_val_buff_len,
  2612. &key_val_buff, upd_and_key_val_buff_len,
  2613. NullS)) {
  2614. free_share(share);
  2615. DBUG_RETURN(1);
  2616. }
  2617. /* We look for pattern #P# to see if the table is partitioned
  2618. MySQL table. The retry logic for partitioned tables is a
  2619. workaround for http://bugs.mysql.com/bug.php?id=33349. Look
  2620. at support issue https://support.mysql.com/view.php?id=21080
  2621. for more details. */
  2622. is_part = strstr(norm_name, "#P#");
  2623. retry:
  2624. /* Get pointer to a table object in InnoDB dictionary cache */
  2625. ib_table = dict_table_get(norm_name, TRUE);
  2626. if (NULL == ib_table) {
  2627. if (is_part && retries < 10) {
  2628. ++retries;
  2629. os_thread_sleep(100000);
  2630. goto retry;
  2631. }
  2632. if (is_part) {
  2633. sql_print_error("Failed to open table %s after "
  2634. "%lu attempts.\n", norm_name,
  2635. retries);
  2636. }
  2637. sql_print_error("Cannot find or open table %s from\n"
  2638. "the internal data dictionary of InnoDB "
  2639. "though the .frm file for the\n"
  2640. "table exists. Maybe you have deleted and "
  2641. "recreated InnoDB data\n"
  2642. "files but have forgotten to delete the "
  2643. "corresponding .frm files\n"
  2644. "of InnoDB tables, or you have moved .frm "
  2645. "files to another database?\n"
  2646. "or, the table contains indexes that this "
  2647. "version of the engine\n"
  2648. "doesn't support.\n"
  2649. "See " REFMAN "innodb-troubleshooting.html\n"
  2650. "how you can resolve the problem.\n",
  2651. norm_name);
  2652. free_share(share);
  2653. my_free(upd_buff, MYF(0));
  2654. my_errno = ENOENT;
  2655. DBUG_RETURN(HA_ERR_NO_SUCH_TABLE);
  2656. }
  2657. if (ib_table->ibd_file_missing && !thd_tablespace_op(thd)) {
  2658. sql_print_error("MySQL is trying to open a table handle but "
  2659. "the .ibd file for\ntable %s does not exist.\n"
  2660. "Have you deleted the .ibd file from the "
  2661. "database directory under\nthe MySQL datadir, "
  2662. "or have you used DISCARD TABLESPACE?\n"
  2663. "See " REFMAN "innodb-troubleshooting.html\n"
  2664. "how you can resolve the problem.\n",
  2665. norm_name);
  2666. free_share(share);
  2667. my_free(upd_buff, MYF(0));
  2668. my_errno = ENOENT;
  2669. dict_table_decrement_handle_count(ib_table, FALSE);
  2670. DBUG_RETURN(HA_ERR_NO_SUCH_TABLE);
  2671. }
  2672. prebuilt = row_create_prebuilt(ib_table);
  2673. prebuilt->mysql_row_len = table->s->reclength;
  2674. prebuilt->default_rec = table->s->default_values;
  2675. ut_ad(prebuilt->default_rec);
  2676. /* Looks like MySQL-3.23 sometimes has primary key number != 0 */
  2677. primary_key = table->s->primary_key;
  2678. key_used_on_scan = primary_key;
  2679. /* Allocate a buffer for a 'row reference'. A row reference is
  2680. a string of bytes of length ref_length which uniquely specifies
  2681. a row in our table. Note that MySQL may also compare two row
  2682. references for equality by doing a simple memcmp on the strings
  2683. of length ref_length! */
  2684. if (!row_table_got_default_clust_index(ib_table)) {
  2685. if (primary_key >= MAX_KEY) {
  2686. sql_print_error("Table %s has a primary key in InnoDB data "
  2687. "dictionary, but not in MySQL!", name);
  2688. }
  2689. prebuilt->clust_index_was_generated = FALSE;
  2690. /* MySQL allocates the buffer for ref. key_info->key_length
  2691. includes space for all key columns + one byte for each column
  2692. that may be NULL. ref_length must be as exact as possible to
  2693. save space, because all row reference buffers are allocated
  2694. based on ref_length. */
  2695. ref_length = table->key_info[primary_key].key_length;
  2696. } else {
  2697. if (primary_key != MAX_KEY) {
  2698. sql_print_error("Table %s has no primary key in InnoDB data "
  2699. "dictionary, but has one in MySQL! If you "
  2700. "created the table with a MySQL version < "
  2701. "3.23.54 and did not define a primary key, "
  2702. "but defined a unique key with all non-NULL "
  2703. "columns, then MySQL internally treats that "
  2704. "key as the primary key. You can fix this "
  2705. "error by dump + DROP + CREATE + reimport "
  2706. "of the table.", name);
  2707. }
  2708. prebuilt->clust_index_was_generated = TRUE;
  2709. ref_length = DATA_ROW_ID_LEN;
  2710. /* If we automatically created the clustered index, then
  2711. MySQL does not know about it, and MySQL must NOT be aware
  2712. of the index used on scan, to make it avoid checking if we
  2713. update the column of the index. That is why we assert below
  2714. that key_used_on_scan is the undefined value MAX_KEY.
  2715. The column is the row id in the automatical generation case,
  2716. and it will never be updated anyway. */
  2717. if (key_used_on_scan != MAX_KEY) {
  2718. sql_print_warning(
  2719. "Table %s key_used_on_scan is %lu even "
  2720. "though there is no primary key inside "
  2721. "InnoDB.", name, (ulong) key_used_on_scan);
  2722. }
  2723. }
  2724. /* Index block size in InnoDB: used by MySQL in query optimization */
  2725. stats.block_size = 16 * 1024;
  2726. /* Init table lock structure */
  2727. thr_lock_data_init(&share->lock,&lock,(void*) 0);
  2728. if (prebuilt->table) {
  2729. /* We update the highest file format in the system table
  2730. space, if this table has higher file format setting. */
  2731. trx_sys_file_format_max_upgrade(
  2732. (const char**) &innobase_file_format_check,
  2733. dict_table_get_format(prebuilt->table));
  2734. }
  2735. info(HA_STATUS_NO_LOCK | HA_STATUS_VARIABLE | HA_STATUS_CONST);
  2736. /* Only if the table has an AUTOINC column. */
  2737. if (prebuilt->table != NULL && table->found_next_number_field != NULL) {
  2738. ulint error;
  2739. dict_table_autoinc_lock(prebuilt->table);
  2740. /* Since a table can already be "open" in InnoDB's internal
  2741. data dictionary, we only init the autoinc counter once, the
  2742. first time the table is loaded. We can safely reuse the
  2743. autoinc value from a previous MySQL open. */
  2744. if (dict_table_autoinc_read(prebuilt->table) == 0) {
  2745. error = innobase_initialize_autoinc();
  2746. ut_a(error == DB_SUCCESS);
  2747. }
  2748. dict_table_autoinc_unlock(prebuilt->table);
  2749. }
  2750. DBUG_RETURN(0);
  2751. }
  2752. UNIV_INTERN
  2753. uint
  2754. ha_innobase::max_supported_key_part_length() const
  2755. {
  2756. return(DICT_MAX_INDEX_COL_LEN - 1);
  2757. }
  2758. /******************************************************************//**
  2759. Closes a handle to an InnoDB table.
  2760. @return 0 */
  2761. UNIV_INTERN
  2762. int
  2763. ha_innobase::close(void)
  2764. /*====================*/
  2765. {
  2766. THD* thd;
  2767. DBUG_ENTER("ha_innobase::close");
  2768. thd = ha_thd();
  2769. if (thd != NULL) {
  2770. innobase_release_temporary_latches(ht, thd);
  2771. }
  2772. row_prebuilt_free(prebuilt, FALSE);
  2773. my_free(upd_buff, MYF(0));
  2774. free_share(share);
  2775. /* Tell InnoDB server that there might be work for
  2776. utility threads: */
  2777. srv_active_wake_master_thread();
  2778. DBUG_RETURN(0);
  2779. }
  2780. /* The following accessor functions should really be inside MySQL code! */
  2781. /**************************************************************//**
  2782. Gets field offset for a field in a table.
  2783. @return offset */
  2784. static inline
  2785. uint
  2786. get_field_offset(
  2787. /*=============*/
  2788. TABLE* table, /*!< in: MySQL table object */
  2789. Field* field) /*!< in: MySQL field object */
  2790. {
  2791. return((uint) (field->ptr - table->record[0]));
  2792. }
  2793. /**************************************************************//**
  2794. Checks if a field in a record is SQL NULL. Uses the record format
  2795. information in table to track the null bit in record.
  2796. @return 1 if NULL, 0 otherwise */
  2797. static inline
  2798. uint
  2799. field_in_record_is_null(
  2800. /*====================*/
  2801. TABLE* table, /*!< in: MySQL table object */
  2802. Field* field, /*!< in: MySQL field object */
  2803. char* record) /*!< in: a row in MySQL format */
  2804. {
  2805. int null_offset;
  2806. if (!field->null_ptr) {
  2807. return(0);
  2808. }
  2809. null_offset = (uint) ((char*) field->null_ptr
  2810. - (char*) table->record[0]);
  2811. if (record[null_offset] & field->null_bit) {
  2812. return(1);
  2813. }
  2814. return(0);
  2815. }
  2816. /**************************************************************//**
  2817. Sets a field in a record to SQL NULL. Uses the record format
  2818. information in table to track the null bit in record. */
  2819. static inline
  2820. void
  2821. set_field_in_record_to_null(
  2822. /*========================*/
  2823. TABLE* table, /*!< in: MySQL table object */
  2824. Field* field, /*!< in: MySQL field object */
  2825. char* record) /*!< in: a row in MySQL format */
  2826. {
  2827. int null_offset;
  2828. null_offset = (uint) ((char*) field->null_ptr
  2829. - (char*) table->record[0]);
  2830. record[null_offset] = record[null_offset] | field->null_bit;
  2831. }
  2832. /*************************************************************//**
  2833. InnoDB uses this function to compare two data fields for which the data type
  2834. is such that we must use MySQL code to compare them. NOTE that the prototype
  2835. of this function is in rem0cmp.c in InnoDB source code! If you change this
  2836. function, remember to update the prototype there!
  2837. @return 1, 0, -1, if a is greater, equal, less than b, respectively */
  2838. extern "C" UNIV_INTERN
  2839. int
  2840. innobase_mysql_cmp(
  2841. /*===============*/
  2842. int mysql_type, /*!< in: MySQL type */
  2843. uint charset_number, /*!< in: number of the charset */
  2844. const unsigned char* a, /*!< in: data field */
  2845. unsigned int a_length, /*!< in: data field length,
  2846. not UNIV_SQL_NULL */
  2847. const unsigned char* b, /*!< in: data field */
  2848. unsigned int b_length) /*!< in: data field length,
  2849. not UNIV_SQL_NULL */
  2850. {
  2851. CHARSET_INFO* charset;
  2852. enum_field_types mysql_tp;
  2853. int ret;
  2854. DBUG_ASSERT(a_length != UNIV_SQL_NULL);
  2855. DBUG_ASSERT(b_length != UNIV_SQL_NULL);
  2856. mysql_tp = (enum_field_types) mysql_type;
  2857. switch (mysql_tp) {
  2858. case MYSQL_TYPE_BIT:
  2859. case MYSQL_TYPE_STRING:
  2860. case MYSQL_TYPE_VAR_STRING:
  2861. case MYSQL_TYPE_TINY_BLOB:
  2862. case MYSQL_TYPE_MEDIUM_BLOB:
  2863. case MYSQL_TYPE_BLOB:
  2864. case MYSQL_TYPE_LONG_BLOB:
  2865. case MYSQL_TYPE_VARCHAR:
  2866. /* Use the charset number to pick the right charset struct for
  2867. the comparison. Since the MySQL function get_charset may be
  2868. slow before Bar removes the mutex operation there, we first
  2869. look at 2 common charsets directly. */
  2870. if (charset_number == default_charset_info->number) {
  2871. charset = default_charset_info;
  2872. } else if (charset_number == my_charset_latin1.number) {
  2873. charset = &my_charset_latin1;
  2874. } else {
  2875. charset = get_charset(charset_number, MYF(MY_WME));
  2876. if (charset == NULL) {
  2877. sql_print_error("InnoDB needs charset %lu for doing "
  2878. "a comparison, but MySQL cannot "
  2879. "find that charset.",
  2880. (ulong) charset_number);
  2881. ut_a(0);
  2882. }
  2883. }
  2884. /* Starting from 4.1.3, we use strnncollsp() in comparisons of
  2885. non-latin1_swedish_ci strings. NOTE that the collation order
  2886. changes then: 'b\0\0...' is ordered BEFORE 'b ...'. Users
  2887. having indexes on such data need to rebuild their tables! */
  2888. ret = charset->coll->strnncollsp(charset,
  2889. a, a_length,
  2890. b, b_length, 0);
  2891. if (ret < 0) {
  2892. return(-1);
  2893. } else if (ret > 0) {
  2894. return(1);
  2895. } else {
  2896. return(0);
  2897. }
  2898. default:
  2899. ut_error;
  2900. }
  2901. return(0);
  2902. }
  2903. /**************************************************************//**
  2904. Converts a MySQL type to an InnoDB type. Note that this function returns
  2905. the 'mtype' of InnoDB. InnoDB differentiates between MySQL's old <= 4.1
  2906. VARCHAR and the new true VARCHAR in >= 5.0.3 by the 'prtype'.
  2907. @return DATA_BINARY, DATA_VARCHAR, ... */
  2908. extern "C" UNIV_INTERN
  2909. ulint
  2910. get_innobase_type_from_mysql_type(
  2911. /*==============================*/
  2912. ulint* unsigned_flag, /*!< out: DATA_UNSIGNED if an
  2913. 'unsigned type';
  2914. at least ENUM and SET,
  2915. and unsigned integer
  2916. types are 'unsigned types' */
  2917. const void* f) /*!< in: MySQL Field */
  2918. {
  2919. const class Field* field = reinterpret_cast<const class Field*>(f);
  2920. /* The following asserts try to check that the MySQL type code fits in
  2921. 8 bits: this is used in ibuf and also when DATA_NOT_NULL is ORed to
  2922. the type */
  2923. DBUG_ASSERT((ulint)MYSQL_TYPE_STRING < 256);
  2924. DBUG_ASSERT((ulint)MYSQL_TYPE_VAR_STRING < 256);
  2925. DBUG_ASSERT((ulint)MYSQL_TYPE_DOUBLE < 256);
  2926. DBUG_ASSERT((ulint)MYSQL_TYPE_FLOAT < 256);
  2927. DBUG_ASSERT((ulint)MYSQL_TYPE_DECIMAL < 256);
  2928. if (field->flags & UNSIGNED_FLAG) {
  2929. *unsigned_flag = DATA_UNSIGNED;
  2930. } else {
  2931. *unsigned_flag = 0;
  2932. }
  2933. if (field->real_type() == MYSQL_TYPE_ENUM
  2934. || field->real_type() == MYSQL_TYPE_SET) {
  2935. /* MySQL has field->type() a string type for these, but the
  2936. data is actually internally stored as an unsigned integer
  2937. code! */
  2938. *unsigned_flag = DATA_UNSIGNED; /* MySQL has its own unsigned
  2939. flag set to zero, even though
  2940. internally this is an unsigned
  2941. integer type */
  2942. return(DATA_INT);
  2943. }
  2944. switch (field->type()) {
  2945. /* NOTE that we only allow string types in DATA_MYSQL and
  2946. DATA_VARMYSQL */
  2947. case MYSQL_TYPE_VAR_STRING: /* old <= 4.1 VARCHAR */
  2948. case MYSQL_TYPE_VARCHAR: /* new >= 5.0.3 true VARCHAR */
  2949. if (field->binary()) {
  2950. return(DATA_BINARY);
  2951. } else if (strcmp(
  2952. field->charset()->name,
  2953. "latin1_swedish_ci") == 0) {
  2954. return(DATA_VARCHAR);
  2955. } else {
  2956. return(DATA_VARMYSQL);
  2957. }
  2958. case MYSQL_TYPE_BIT:
  2959. case MYSQL_TYPE_STRING: if (field->binary()) {
  2960. return(DATA_FIXBINARY);
  2961. } else if (strcmp(
  2962. field->charset()->name,
  2963. "latin1_swedish_ci") == 0) {
  2964. return(DATA_CHAR);
  2965. } else {
  2966. return(DATA_MYSQL);
  2967. }
  2968. case MYSQL_TYPE_NEWDECIMAL:
  2969. return(DATA_FIXBINARY);
  2970. case MYSQL_TYPE_LONG:
  2971. case MYSQL_TYPE_LONGLONG:
  2972. case MYSQL_TYPE_TINY:
  2973. case MYSQL_TYPE_SHORT:
  2974. case MYSQL_TYPE_INT24:
  2975. case MYSQL_TYPE_DATE:
  2976. case MYSQL_TYPE_DATETIME:
  2977. case MYSQL_TYPE_YEAR:
  2978. case MYSQL_TYPE_NEWDATE:
  2979. case MYSQL_TYPE_TIME:
  2980. case MYSQL_TYPE_TIMESTAMP:
  2981. return(DATA_INT);
  2982. case MYSQL_TYPE_FLOAT:
  2983. return(DATA_FLOAT);
  2984. case MYSQL_TYPE_DOUBLE:
  2985. return(DATA_DOUBLE);
  2986. case MYSQL_TYPE_DECIMAL:
  2987. return(DATA_DECIMAL);
  2988. case MYSQL_TYPE_GEOMETRY:
  2989. case MYSQL_TYPE_TINY_BLOB:
  2990. case MYSQL_TYPE_MEDIUM_BLOB:
  2991. case MYSQL_TYPE_BLOB:
  2992. case MYSQL_TYPE_LONG_BLOB:
  2993. return(DATA_BLOB);
  2994. default:
  2995. ut_error;
  2996. }
  2997. return(0);
  2998. }
  2999. /*******************************************************************//**
  3000. Writes an unsigned integer value < 64k to 2 bytes, in the little-endian
  3001. storage format. */
  3002. static inline
  3003. void
  3004. innobase_write_to_2_little_endian(
  3005. /*==============================*/
  3006. byte* buf, /*!< in: where to store */
  3007. ulint val) /*!< in: value to write, must be < 64k */
  3008. {
  3009. ut_a(val < 256 * 256);
  3010. buf[0] = (byte)(val & 0xFF);
  3011. buf[1] = (byte)(val / 256);
  3012. }
  3013. /*******************************************************************//**
  3014. Reads an unsigned integer value < 64k from 2 bytes, in the little-endian
  3015. storage format.
  3016. @return value */
  3017. static inline
  3018. uint
  3019. innobase_read_from_2_little_endian(
  3020. /*===============================*/
  3021. const uchar* buf) /*!< in: from where to read */
  3022. {
  3023. return (uint) ((ulint)(buf[0]) + 256 * ((ulint)(buf[1])));
  3024. }
  3025. /*******************************************************************//**
  3026. Stores a key value for a row to a buffer.
  3027. @return key value length as stored in buff */
  3028. UNIV_INTERN
  3029. uint
  3030. ha_innobase::store_key_val_for_row(
  3031. /*===============================*/
  3032. uint keynr, /*!< in: key number */
  3033. char* buff, /*!< in/out: buffer for the key value (in MySQL
  3034. format) */
  3035. uint buff_len,/*!< in: buffer length */
  3036. const uchar* record)/*!< in: row in MySQL format */
  3037. {
  3038. KEY* key_info = table->key_info + keynr;
  3039. KEY_PART_INFO* key_part = key_info->key_part;
  3040. KEY_PART_INFO* end = key_part + key_info->key_parts;
  3041. char* buff_start = buff;
  3042. enum_field_types mysql_type;
  3043. Field* field;
  3044. ibool is_null;
  3045. DBUG_ENTER("store_key_val_for_row");
  3046. /* The format for storing a key field in MySQL is the following:
  3047. 1. If the column can be NULL, then in the first byte we put 1 if the
  3048. field value is NULL, 0 otherwise.
  3049. 2. If the column is of a BLOB type (it must be a column prefix field
  3050. in this case), then we put the length of the data in the field to the
  3051. next 2 bytes, in the little-endian format. If the field is SQL NULL,
  3052. then these 2 bytes are set to 0. Note that the length of data in the
  3053. field is <= column prefix length.
  3054. 3. In a column prefix field, prefix_len next bytes are reserved for
  3055. data. In a normal field the max field length next bytes are reserved
  3056. for data. For a VARCHAR(n) the max field length is n. If the stored
  3057. value is the SQL NULL then these data bytes are set to 0.
  3058. 4. We always use a 2 byte length for a true >= 5.0.3 VARCHAR. Note that
  3059. in the MySQL row format, the length is stored in 1 or 2 bytes,
  3060. depending on the maximum allowed length. But in the MySQL key value
  3061. format, the length always takes 2 bytes.
  3062. We have to zero-fill the buffer so that MySQL is able to use a
  3063. simple memcmp to compare two key values to determine if they are
  3064. equal. MySQL does this to compare contents of two 'ref' values. */
  3065. bzero(buff, buff_len);
  3066. for (; key_part != end; key_part++) {
  3067. is_null = FALSE;
  3068. if (key_part->null_bit) {
  3069. if (record[key_part->null_offset]
  3070. & key_part->null_bit) {
  3071. *buff = 1;
  3072. is_null = TRUE;
  3073. } else {
  3074. *buff = 0;
  3075. }
  3076. buff++;
  3077. }
  3078. field = key_part->field;
  3079. mysql_type = field->type();
  3080. if (mysql_type == MYSQL_TYPE_VARCHAR) {
  3081. /* >= 5.0.3 true VARCHAR */
  3082. ulint lenlen;
  3083. ulint len;
  3084. const byte* data;
  3085. ulint key_len;
  3086. ulint true_len;
  3087. CHARSET_INFO* cs;
  3088. int error=0;
  3089. key_len = key_part->length;
  3090. if (is_null) {
  3091. buff += key_len + 2;
  3092. continue;
  3093. }
  3094. cs = field->charset();
  3095. lenlen = (ulint)
  3096. (((Field_varstring*)field)->length_bytes);
  3097. data = row_mysql_read_true_varchar(&len,
  3098. (byte*) (record
  3099. + (ulint)get_field_offset(table, field)),
  3100. lenlen);
  3101. true_len = len;
  3102. /* For multi byte character sets we need to calculate
  3103. the true length of the key */
  3104. if (len > 0 && cs->mbmaxlen > 1) {
  3105. true_len = (ulint) cs->cset->well_formed_len(cs,
  3106. (const char *) data,
  3107. (const char *) data + len,
  3108. (uint) (key_len /
  3109. cs->mbmaxlen),
  3110. &error);
  3111. }
  3112. /* In a column prefix index, we may need to truncate
  3113. the stored value: */
  3114. if (true_len > key_len) {
  3115. true_len = key_len;
  3116. }
  3117. /* The length in a key value is always stored in 2
  3118. bytes */
  3119. row_mysql_store_true_var_len((byte*)buff, true_len, 2);
  3120. buff += 2;
  3121. memcpy(buff, data, true_len);
  3122. /* Note that we always reserve the maximum possible
  3123. length of the true VARCHAR in the key value, though
  3124. only len first bytes after the 2 length bytes contain
  3125. actual data. The rest of the space was reset to zero
  3126. in the bzero() call above. */
  3127. buff += key_len;
  3128. } else if (mysql_type == MYSQL_TYPE_TINY_BLOB
  3129. || mysql_type == MYSQL_TYPE_MEDIUM_BLOB
  3130. || mysql_type == MYSQL_TYPE_BLOB
  3131. || mysql_type == MYSQL_TYPE_LONG_BLOB
  3132. /* MYSQL_TYPE_GEOMETRY data is treated
  3133. as BLOB data in innodb. */
  3134. || mysql_type == MYSQL_TYPE_GEOMETRY) {
  3135. CHARSET_INFO* cs;
  3136. ulint key_len;
  3137. ulint true_len;
  3138. int error=0;
  3139. ulint blob_len;
  3140. const byte* blob_data;
  3141. ut_a(key_part->key_part_flag & HA_PART_KEY_SEG);
  3142. key_len = key_part->length;
  3143. if (is_null) {
  3144. buff += key_len + 2;
  3145. continue;
  3146. }
  3147. cs = field->charset();
  3148. blob_data = row_mysql_read_blob_ref(&blob_len,
  3149. (byte*) (record
  3150. + (ulint)get_field_offset(table, field)),
  3151. (ulint) field->pack_length());
  3152. true_len = blob_len;
  3153. ut_a(get_field_offset(table, field)
  3154. == key_part->offset);
  3155. /* For multi byte character sets we need to calculate
  3156. the true length of the key */
  3157. if (blob_len > 0 && cs->mbmaxlen > 1) {
  3158. true_len = (ulint) cs->cset->well_formed_len(cs,
  3159. (const char *) blob_data,
  3160. (const char *) blob_data
  3161. + blob_len,
  3162. (uint) (key_len /
  3163. cs->mbmaxlen),
  3164. &error);
  3165. }
  3166. /* All indexes on BLOB and TEXT are column prefix
  3167. indexes, and we may need to truncate the data to be
  3168. stored in the key value: */
  3169. if (true_len > key_len) {
  3170. true_len = key_len;
  3171. }
  3172. /* MySQL reserves 2 bytes for the length and the
  3173. storage of the number is little-endian */
  3174. innobase_write_to_2_little_endian(
  3175. (byte*)buff, true_len);
  3176. buff += 2;
  3177. memcpy(buff, blob_data, true_len);
  3178. /* Note that we always reserve the maximum possible
  3179. length of the BLOB prefix in the key value. */
  3180. buff += key_len;
  3181. } else {
  3182. /* Here we handle all other data types except the
  3183. true VARCHAR, BLOB and TEXT. Note that the column
  3184. value we store may be also in a column prefix
  3185. index. */
  3186. CHARSET_INFO* cs;
  3187. ulint true_len;
  3188. ulint key_len;
  3189. const uchar* src_start;
  3190. int error=0;
  3191. enum_field_types real_type;
  3192. key_len = key_part->length;
  3193. if (is_null) {
  3194. buff += key_len;
  3195. continue;
  3196. }
  3197. src_start = record + key_part->offset;
  3198. real_type = field->real_type();
  3199. true_len = key_len;
  3200. /* Character set for the field is defined only
  3201. to fields whose type is string and real field
  3202. type is not enum or set. For these fields check
  3203. if character set is multi byte. */
  3204. if (real_type != MYSQL_TYPE_ENUM
  3205. && real_type != MYSQL_TYPE_SET
  3206. && ( mysql_type == MYSQL_TYPE_VAR_STRING
  3207. || mysql_type == MYSQL_TYPE_STRING)) {
  3208. cs = field->charset();
  3209. /* For multi byte character sets we need to
  3210. calculate the true length of the key */
  3211. if (key_len > 0 && cs->mbmaxlen > 1) {
  3212. true_len = (ulint)
  3213. cs->cset->well_formed_len(cs,
  3214. (const char *)src_start,
  3215. (const char *)src_start
  3216. + key_len,
  3217. (uint) (key_len /
  3218. cs->mbmaxlen),
  3219. &error);
  3220. }
  3221. }
  3222. memcpy(buff, src_start, true_len);
  3223. buff += true_len;
  3224. /* Pad the unused space with spaces. Note that no
  3225. padding is ever needed for UCS-2 because in MySQL,
  3226. all UCS2 characters are 2 bytes, as MySQL does not
  3227. support surrogate pairs, which are needed to represent
  3228. characters in the range U+10000 to U+10FFFF. */
  3229. if (true_len < key_len) {
  3230. ulint pad_len = key_len - true_len;
  3231. memset(buff, ' ', pad_len);
  3232. buff += pad_len;
  3233. }
  3234. }
  3235. }
  3236. ut_a(buff <= buff_start + buff_len);
  3237. DBUG_RETURN((uint)(buff - buff_start));
  3238. }
  3239. /**************************************************************//**
  3240. Builds a 'template' to the prebuilt struct. The template is used in fast
  3241. retrieval of just those column values MySQL needs in its processing. */
  3242. static
  3243. void
  3244. build_template(
  3245. /*===========*/
  3246. row_prebuilt_t* prebuilt, /*!< in/out: prebuilt struct */
  3247. THD* thd, /*!< in: current user thread, used
  3248. only if templ_type is
  3249. ROW_MYSQL_REC_FIELDS */
  3250. TABLE* table, /*!< in: MySQL table */
  3251. uint templ_type) /*!< in: ROW_MYSQL_WHOLE_ROW or
  3252. ROW_MYSQL_REC_FIELDS */
  3253. {
  3254. dict_index_t* index;
  3255. dict_index_t* clust_index;
  3256. mysql_row_templ_t* templ;
  3257. Field* field;
  3258. ulint n_fields;
  3259. ulint n_requested_fields = 0;
  3260. ibool fetch_all_in_key = FALSE;
  3261. ibool fetch_primary_key_cols = FALSE;
  3262. ulint i;
  3263. /* byte offset of the end of last requested column */
  3264. ulint mysql_prefix_len = 0;
  3265. if (prebuilt->select_lock_type == LOCK_X) {
  3266. /* We always retrieve the whole clustered index record if we
  3267. use exclusive row level locks, for example, if the read is
  3268. done in an UPDATE statement. */
  3269. templ_type = ROW_MYSQL_WHOLE_ROW;
  3270. }
  3271. if (templ_type == ROW_MYSQL_REC_FIELDS) {
  3272. if (prebuilt->hint_need_to_fetch_extra_cols
  3273. == ROW_RETRIEVE_ALL_COLS) {
  3274. /* We know we must at least fetch all columns in the
  3275. key, or all columns in the table */
  3276. if (prebuilt->read_just_key) {
  3277. /* MySQL has instructed us that it is enough
  3278. to fetch the columns in the key; looks like
  3279. MySQL can set this flag also when there is
  3280. only a prefix of the column in the key: in
  3281. that case we retrieve the whole column from
  3282. the clustered index */
  3283. fetch_all_in_key = TRUE;
  3284. } else {
  3285. templ_type = ROW_MYSQL_WHOLE_ROW;
  3286. }
  3287. } else if (prebuilt->hint_need_to_fetch_extra_cols
  3288. == ROW_RETRIEVE_PRIMARY_KEY) {
  3289. /* We must at least fetch all primary key cols. Note
  3290. that if the clustered index was internally generated
  3291. by InnoDB on the row id (no primary key was
  3292. defined), then row_search_for_mysql() will always
  3293. retrieve the row id to a special buffer in the
  3294. prebuilt struct. */
  3295. fetch_primary_key_cols = TRUE;
  3296. }
  3297. }
  3298. clust_index = dict_table_get_first_index(prebuilt->table);
  3299. if (templ_type == ROW_MYSQL_REC_FIELDS) {
  3300. index = prebuilt->index;
  3301. } else {
  3302. index = clust_index;
  3303. }
  3304. if (index == clust_index) {
  3305. prebuilt->need_to_access_clustered = TRUE;
  3306. } else {
  3307. prebuilt->need_to_access_clustered = FALSE;
  3308. /* Below we check column by column if we need to access
  3309. the clustered index */
  3310. }
  3311. n_fields = (ulint)table->s->fields; /* number of columns */
  3312. if (!prebuilt->mysql_template) {
  3313. prebuilt->mysql_template = (mysql_row_templ_t*)
  3314. mem_alloc(n_fields * sizeof(mysql_row_templ_t));
  3315. }
  3316. prebuilt->template_type = templ_type;
  3317. prebuilt->null_bitmap_len = table->s->null_bytes;
  3318. prebuilt->templ_contains_blob = FALSE;
  3319. /* Note that in InnoDB, i is the column number. MySQL calls columns
  3320. 'fields'. */
  3321. for (i = 0; i < n_fields; i++) {
  3322. templ = prebuilt->mysql_template + n_requested_fields;
  3323. field = table->field[i];
  3324. if (UNIV_LIKELY(templ_type == ROW_MYSQL_REC_FIELDS)) {
  3325. /* Decide which columns we should fetch
  3326. and which we can skip. */
  3327. register const ibool index_contains_field =
  3328. dict_index_contains_col_or_prefix(index, i);
  3329. if (!index_contains_field && prebuilt->read_just_key) {
  3330. /* If this is a 'key read', we do not need
  3331. columns that are not in the key */
  3332. goto skip_field;
  3333. }
  3334. if (index_contains_field && fetch_all_in_key) {
  3335. /* This field is needed in the query */
  3336. goto include_field;
  3337. }
  3338. if (bitmap_is_set(table->read_set, i) ||
  3339. bitmap_is_set(table->write_set, i)) {
  3340. /* This field is needed in the query */
  3341. goto include_field;
  3342. }
  3343. if (fetch_primary_key_cols
  3344. && dict_table_col_in_clustered_key(
  3345. index->table, i)) {
  3346. /* This field is needed in the query */
  3347. goto include_field;
  3348. }
  3349. /* This field is not needed in the query, skip it */
  3350. goto skip_field;
  3351. }
  3352. include_field:
  3353. n_requested_fields++;
  3354. templ->col_no = i;
  3355. if (index == clust_index) {
  3356. templ->rec_field_no = dict_col_get_clust_pos(
  3357. &index->table->cols[i], index);
  3358. } else {
  3359. templ->rec_field_no = dict_index_get_nth_col_pos(
  3360. index, i);
  3361. }
  3362. if (templ->rec_field_no == ULINT_UNDEFINED) {
  3363. prebuilt->need_to_access_clustered = TRUE;
  3364. }
  3365. if (field->null_ptr) {
  3366. templ->mysql_null_byte_offset =
  3367. (ulint) ((char*) field->null_ptr
  3368. - (char*) table->record[0]);
  3369. templ->mysql_null_bit_mask = (ulint) field->null_bit;
  3370. } else {
  3371. templ->mysql_null_bit_mask = 0;
  3372. }
  3373. templ->mysql_col_offset = (ulint)
  3374. get_field_offset(table, field);
  3375. templ->mysql_col_len = (ulint) field->pack_length();
  3376. if (mysql_prefix_len < templ->mysql_col_offset
  3377. + templ->mysql_col_len) {
  3378. mysql_prefix_len = templ->mysql_col_offset
  3379. + templ->mysql_col_len;
  3380. }
  3381. templ->type = index->table->cols[i].mtype;
  3382. templ->mysql_type = (ulint)field->type();
  3383. if (templ->mysql_type == DATA_MYSQL_TRUE_VARCHAR) {
  3384. templ->mysql_length_bytes = (ulint)
  3385. (((Field_varstring*)field)->length_bytes);
  3386. }
  3387. templ->charset = dtype_get_charset_coll(
  3388. index->table->cols[i].prtype);
  3389. templ->mbminlen = index->table->cols[i].mbminlen;
  3390. templ->mbmaxlen = index->table->cols[i].mbmaxlen;
  3391. templ->is_unsigned = index->table->cols[i].prtype
  3392. & DATA_UNSIGNED;
  3393. if (templ->type == DATA_BLOB) {
  3394. prebuilt->templ_contains_blob = TRUE;
  3395. }
  3396. skip_field:
  3397. ;
  3398. }
  3399. prebuilt->n_template = n_requested_fields;
  3400. prebuilt->mysql_prefix_len = mysql_prefix_len;
  3401. if (index != clust_index && prebuilt->need_to_access_clustered) {
  3402. /* Change rec_field_no's to correspond to the clustered index
  3403. record */
  3404. for (i = 0; i < n_requested_fields; i++) {
  3405. templ = prebuilt->mysql_template + i;
  3406. templ->rec_field_no = dict_col_get_clust_pos(
  3407. &index->table->cols[templ->col_no],
  3408. clust_index);
  3409. }
  3410. }
  3411. }
  3412. /********************************************************************//**
  3413. Get the upper limit of the MySQL integral and floating-point type. */
  3414. UNIV_INTERN
  3415. ulonglong
  3416. ha_innobase::innobase_get_int_col_max_value(
  3417. /*========================================*/
  3418. const Field* field)
  3419. {
  3420. ulonglong max_value = 0;
  3421. switch(field->key_type()) {
  3422. /* TINY */
  3423. case HA_KEYTYPE_BINARY:
  3424. max_value = 0xFFULL;
  3425. break;
  3426. case HA_KEYTYPE_INT8:
  3427. max_value = 0x7FULL;
  3428. break;
  3429. /* SHORT */
  3430. case HA_KEYTYPE_USHORT_INT:
  3431. max_value = 0xFFFFULL;
  3432. break;
  3433. case HA_KEYTYPE_SHORT_INT:
  3434. max_value = 0x7FFFULL;
  3435. break;
  3436. /* MEDIUM */
  3437. case HA_KEYTYPE_UINT24:
  3438. max_value = 0xFFFFFFULL;
  3439. break;
  3440. case HA_KEYTYPE_INT24:
  3441. max_value = 0x7FFFFFULL;
  3442. break;
  3443. /* LONG */
  3444. case HA_KEYTYPE_ULONG_INT:
  3445. max_value = 0xFFFFFFFFULL;
  3446. break;
  3447. case HA_KEYTYPE_LONG_INT:
  3448. max_value = 0x7FFFFFFFULL;
  3449. break;
  3450. /* BIG */
  3451. case HA_KEYTYPE_ULONGLONG:
  3452. max_value = 0xFFFFFFFFFFFFFFFFULL;
  3453. break;
  3454. case HA_KEYTYPE_LONGLONG:
  3455. max_value = 0x7FFFFFFFFFFFFFFFULL;
  3456. break;
  3457. case HA_KEYTYPE_FLOAT:
  3458. /* We use the maximum as per IEEE754-2008 standard, 2^24 */
  3459. max_value = 0x1000000ULL;
  3460. break;
  3461. case HA_KEYTYPE_DOUBLE:
  3462. /* We use the maximum as per IEEE754-2008 standard, 2^53 */
  3463. max_value = 0x20000000000000ULL;
  3464. break;
  3465. default:
  3466. ut_error;
  3467. }
  3468. return(max_value);
  3469. }
  3470. /********************************************************************//**
  3471. This special handling is really to overcome the limitations of MySQL's
  3472. binlogging. We need to eliminate the non-determinism that will arise in
  3473. INSERT ... SELECT type of statements, since MySQL binlog only stores the
  3474. min value of the autoinc interval. Once that is fixed we can get rid of
  3475. the special lock handling.
  3476. @return DB_SUCCESS if all OK else error code */
  3477. UNIV_INTERN
  3478. ulint
  3479. ha_innobase::innobase_lock_autoinc(void)
  3480. /*====================================*/
  3481. {
  3482. ulint error = DB_SUCCESS;
  3483. switch (innobase_autoinc_lock_mode) {
  3484. case AUTOINC_NO_LOCKING:
  3485. /* Acquire only the AUTOINC mutex. */
  3486. dict_table_autoinc_lock(prebuilt->table);
  3487. break;
  3488. case AUTOINC_NEW_STYLE_LOCKING:
  3489. /* For simple (single/multi) row INSERTs, we fallback to the
  3490. old style only if another transaction has already acquired
  3491. the AUTOINC lock on behalf of a LOAD FILE or INSERT ... SELECT
  3492. etc. type of statement. */
  3493. if (thd_sql_command(user_thd) == SQLCOM_INSERT
  3494. || thd_sql_command(user_thd) == SQLCOM_REPLACE) {
  3495. dict_table_t* table = prebuilt->table;
  3496. /* Acquire the AUTOINC mutex. */
  3497. dict_table_autoinc_lock(table);
  3498. /* We need to check that another transaction isn't
  3499. already holding the AUTOINC lock on the table. */
  3500. if (table->n_waiting_or_granted_auto_inc_locks) {
  3501. /* Release the mutex to avoid deadlocks. */
  3502. dict_table_autoinc_unlock(table);
  3503. } else {
  3504. break;
  3505. }
  3506. }
  3507. /* Fall through to old style locking. */
  3508. case AUTOINC_OLD_STYLE_LOCKING:
  3509. error = row_lock_table_autoinc_for_mysql(prebuilt);
  3510. if (error == DB_SUCCESS) {
  3511. /* Acquire the AUTOINC mutex. */
  3512. dict_table_autoinc_lock(prebuilt->table);
  3513. }
  3514. break;
  3515. default:
  3516. ut_error;
  3517. }
  3518. return(ulong(error));
  3519. }
  3520. /********************************************************************//**
  3521. Reset the autoinc value in the table.
  3522. @return DB_SUCCESS if all went well else error code */
  3523. UNIV_INTERN
  3524. ulint
  3525. ha_innobase::innobase_reset_autoinc(
  3526. /*================================*/
  3527. ulonglong autoinc) /*!< in: value to store */
  3528. {
  3529. ulint error;
  3530. error = innobase_lock_autoinc();
  3531. if (error == DB_SUCCESS) {
  3532. dict_table_autoinc_initialize(prebuilt->table, autoinc);
  3533. dict_table_autoinc_unlock(prebuilt->table);
  3534. }
  3535. return(ulong(error));
  3536. }
  3537. /********************************************************************//**
  3538. Store the autoinc value in the table. The autoinc value is only set if
  3539. it's greater than the existing autoinc value in the table.
  3540. @return DB_SUCCESS if all went well else error code */
  3541. UNIV_INTERN
  3542. ulint
  3543. ha_innobase::innobase_set_max_autoinc(
  3544. /*==================================*/
  3545. ulonglong auto_inc) /*!< in: value to store */
  3546. {
  3547. ulint error;
  3548. error = innobase_lock_autoinc();
  3549. if (error == DB_SUCCESS) {
  3550. dict_table_autoinc_update_if_greater(prebuilt->table, auto_inc);
  3551. dict_table_autoinc_unlock(prebuilt->table);
  3552. }
  3553. return(ulong(error));
  3554. }
  3555. /********************************************************************//**
  3556. Stores a row in an InnoDB database, to the table specified in this
  3557. handle.
  3558. @return error code */
  3559. UNIV_INTERN
  3560. int
  3561. ha_innobase::write_row(
  3562. /*===================*/
  3563. uchar* record) /*!< in: a row in MySQL format */
  3564. {
  3565. ulint error = 0;
  3566. int error_result= 0;
  3567. ibool auto_inc_used= FALSE;
  3568. ulint sql_command;
  3569. trx_t* trx = thd_to_trx(user_thd);
  3570. DBUG_ENTER("ha_innobase::write_row");
  3571. if (prebuilt->trx != trx) {
  3572. sql_print_error("The transaction object for the table handle is at "
  3573. "%p, but for the current thread it is at %p",
  3574. (const void*) prebuilt->trx, (const void*) trx);
  3575. fputs("InnoDB: Dump of 200 bytes around prebuilt: ", stderr);
  3576. ut_print_buf(stderr, ((const byte*)prebuilt) - 100, 200);
  3577. fputs("\n"
  3578. "InnoDB: Dump of 200 bytes around ha_data: ",
  3579. stderr);
  3580. ut_print_buf(stderr, ((const byte*) trx) - 100, 200);
  3581. putc('\n', stderr);
  3582. ut_error;
  3583. }
  3584. ha_statistic_increment(&SSV::ha_write_count);
  3585. if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
  3586. table->timestamp_field->set_time();
  3587. sql_command = thd_sql_command(user_thd);
  3588. if ((sql_command == SQLCOM_ALTER_TABLE
  3589. || sql_command == SQLCOM_OPTIMIZE
  3590. || sql_command == SQLCOM_CREATE_INDEX
  3591. || sql_command == SQLCOM_DROP_INDEX)
  3592. && num_write_row >= 10000) {
  3593. /* ALTER TABLE is COMMITted at every 10000 copied rows.
  3594. The IX table lock for the original table has to be re-issued.
  3595. As this method will be called on a temporary table where the
  3596. contents of the original table is being copied to, it is
  3597. a bit tricky to determine the source table. The cursor
  3598. position in the source table need not be adjusted after the
  3599. intermediate COMMIT, since writes by other transactions are
  3600. being blocked by a MySQL table lock TL_WRITE_ALLOW_READ. */
  3601. dict_table_t* src_table;
  3602. enum lock_mode mode;
  3603. num_write_row = 0;
  3604. /* Commit the transaction. This will release the table
  3605. locks, so they have to be acquired again. */
  3606. /* Altering an InnoDB table */
  3607. /* Get the source table. */
  3608. src_table = lock_get_src_table(
  3609. prebuilt->trx, prebuilt->table, &mode);
  3610. if (!src_table) {
  3611. no_commit:
  3612. /* Unknown situation: do not commit */
  3613. /*
  3614. ut_print_timestamp(stderr);
  3615. fprintf(stderr,
  3616. " InnoDB: ALTER TABLE is holding lock"
  3617. " on %lu tables!\n",
  3618. prebuilt->trx->mysql_n_tables_locked);
  3619. */
  3620. ;
  3621. } else if (src_table == prebuilt->table) {
  3622. /* Source table is not in InnoDB format:
  3623. no need to re-acquire locks on it. */
  3624. /* Altering to InnoDB format */
  3625. innobase_commit(ht, user_thd, 1);
  3626. /* Note that this transaction is still active. */
  3627. prebuilt->trx->active_trans = 1;
  3628. /* We will need an IX lock on the destination table. */
  3629. prebuilt->sql_stat_start = TRUE;
  3630. } else {
  3631. /* Ensure that there are no other table locks than
  3632. LOCK_IX and LOCK_AUTO_INC on the destination table. */
  3633. if (!lock_is_table_exclusive(prebuilt->table,
  3634. prebuilt->trx)) {
  3635. goto no_commit;
  3636. }
  3637. /* Commit the transaction. This will release the table
  3638. locks, so they have to be acquired again. */
  3639. innobase_commit(ht, user_thd, 1);
  3640. /* Note that this transaction is still active. */
  3641. prebuilt->trx->active_trans = 1;
  3642. /* Re-acquire the table lock on the source table. */
  3643. row_lock_table_for_mysql(prebuilt, src_table, mode);
  3644. /* We will need an IX lock on the destination table. */
  3645. prebuilt->sql_stat_start = TRUE;
  3646. }
  3647. }
  3648. num_write_row++;
  3649. /* This is the case where the table has an auto-increment column */
  3650. if (table->next_number_field && record == table->record[0]) {
  3651. /* Reset the error code before calling
  3652. innobase_get_auto_increment(). */
  3653. prebuilt->autoinc_error = DB_SUCCESS;
  3654. if ((error = update_auto_increment())) {
  3655. /* We don't want to mask autoinc overflow errors. */
  3656. if (prebuilt->autoinc_error != DB_SUCCESS) {
  3657. error = (int) prebuilt->autoinc_error;
  3658. goto report_error;
  3659. }
  3660. /* MySQL errors are passed straight back. */
  3661. error_result = (int) error;
  3662. goto func_exit;
  3663. }
  3664. auto_inc_used = TRUE;
  3665. }
  3666. if (prebuilt->mysql_template == NULL
  3667. || prebuilt->template_type != ROW_MYSQL_WHOLE_ROW) {
  3668. /* Build the template used in converting quickly between
  3669. the two database formats */
  3670. build_template(prebuilt, NULL, table, ROW_MYSQL_WHOLE_ROW);
  3671. }
  3672. innodb_srv_conc_enter_innodb(prebuilt->trx);
  3673. error = row_insert_for_mysql((byte*) record, prebuilt);
  3674. /* Handle duplicate key errors */
  3675. if (auto_inc_used) {
  3676. ulint err;
  3677. ulonglong auto_inc;
  3678. ulonglong col_max_value;
  3679. /* Note the number of rows processed for this statement, used
  3680. by get_auto_increment() to determine the number of AUTO-INC
  3681. values to reserve. This is only useful for a mult-value INSERT
  3682. and is a statement level counter.*/
  3683. if (trx->n_autoinc_rows > 0) {
  3684. --trx->n_autoinc_rows;
  3685. }
  3686. /* We need the upper limit of the col type to check for
  3687. whether we update the table autoinc counter or not. */
  3688. col_max_value = innobase_get_int_col_max_value(
  3689. table->next_number_field);
  3690. /* Get the value that MySQL attempted to store in the table.*/
  3691. auto_inc = table->next_number_field->val_int();
  3692. switch (error) {
  3693. case DB_DUPLICATE_KEY:
  3694. /* A REPLACE command and LOAD DATA INFILE REPLACE
  3695. handle a duplicate key error themselves, but we
  3696. must update the autoinc counter if we are performing
  3697. those statements. */
  3698. switch (sql_command) {
  3699. case SQLCOM_LOAD:
  3700. if ((trx->duplicates
  3701. & (TRX_DUP_IGNORE | TRX_DUP_REPLACE))) {
  3702. goto set_max_autoinc;
  3703. }
  3704. break;
  3705. case SQLCOM_REPLACE:
  3706. case SQLCOM_INSERT_SELECT:
  3707. case SQLCOM_REPLACE_SELECT:
  3708. goto set_max_autoinc;
  3709. default:
  3710. break;
  3711. }
  3712. break;
  3713. case DB_SUCCESS:
  3714. /* If the actual value inserted is greater than
  3715. the upper limit of the interval, then we try and
  3716. update the table upper limit. Note: last_value
  3717. will be 0 if get_auto_increment() was not called.*/
  3718. if (auto_inc <= col_max_value
  3719. && auto_inc >= prebuilt->autoinc_last_value) {
  3720. set_max_autoinc:
  3721. ut_a(prebuilt->autoinc_increment > 0);
  3722. ulonglong need;
  3723. ulonglong offset;
  3724. offset = prebuilt->autoinc_offset;
  3725. need = prebuilt->autoinc_increment;
  3726. auto_inc = innobase_next_autoinc(
  3727. auto_inc, need, offset, col_max_value);
  3728. err = innobase_set_max_autoinc(auto_inc);
  3729. if (err != DB_SUCCESS) {
  3730. error = err;
  3731. }
  3732. }
  3733. break;
  3734. }
  3735. }
  3736. innodb_srv_conc_exit_innodb(prebuilt->trx);
  3737. report_error:
  3738. error_result = convert_error_code_to_mysql((int) error,
  3739. prebuilt->table->flags,
  3740. user_thd);
  3741. func_exit:
  3742. innobase_active_small();
  3743. DBUG_RETURN(error_result);
  3744. }
  3745. /**********************************************************************//**
  3746. Checks which fields have changed in a row and stores information
  3747. of them to an update vector.
  3748. @return error number or 0 */
  3749. static
  3750. int
  3751. calc_row_difference(
  3752. /*================*/
  3753. upd_t* uvect, /*!< in/out: update vector */
  3754. uchar* old_row, /*!< in: old row in MySQL format */
  3755. uchar* new_row, /*!< in: new row in MySQL format */
  3756. struct st_table* table, /*!< in: table in MySQL data
  3757. dictionary */
  3758. uchar* upd_buff, /*!< in: buffer to use */
  3759. ulint buff_len, /*!< in: buffer length */
  3760. row_prebuilt_t* prebuilt, /*!< in: InnoDB prebuilt struct */
  3761. THD* thd) /*!< in: user thread */
  3762. {
  3763. uchar* original_upd_buff = upd_buff;
  3764. Field* field;
  3765. enum_field_types field_mysql_type;
  3766. uint n_fields;
  3767. ulint o_len;
  3768. ulint n_len;
  3769. ulint col_pack_len;
  3770. const byte* new_mysql_row_col;
  3771. const byte* o_ptr;
  3772. const byte* n_ptr;
  3773. byte* buf;
  3774. upd_field_t* ufield;
  3775. ulint col_type;
  3776. ulint n_changed = 0;
  3777. dfield_t dfield;
  3778. dict_index_t* clust_index;
  3779. uint i;
  3780. n_fields = table->s->fields;
  3781. clust_index = dict_table_get_first_index(prebuilt->table);
  3782. /* We use upd_buff to convert changed fields */
  3783. buf = (byte*) upd_buff;
  3784. for (i = 0; i < n_fields; i++) {
  3785. field = table->field[i];
  3786. o_ptr = (const byte*) old_row + get_field_offset(table, field);
  3787. n_ptr = (const byte*) new_row + get_field_offset(table, field);
  3788. /* Use new_mysql_row_col and col_pack_len save the values */
  3789. new_mysql_row_col = n_ptr;
  3790. col_pack_len = field->pack_length();
  3791. o_len = col_pack_len;
  3792. n_len = col_pack_len;
  3793. /* We use o_ptr and n_ptr to dig up the actual data for
  3794. comparison. */
  3795. field_mysql_type = field->type();
  3796. col_type = prebuilt->table->cols[i].mtype;
  3797. switch (col_type) {
  3798. case DATA_BLOB:
  3799. o_ptr = row_mysql_read_blob_ref(&o_len, o_ptr, o_len);
  3800. n_ptr = row_mysql_read_blob_ref(&n_len, n_ptr, n_len);
  3801. break;
  3802. case DATA_VARCHAR:
  3803. case DATA_BINARY:
  3804. case DATA_VARMYSQL:
  3805. if (field_mysql_type == MYSQL_TYPE_VARCHAR) {
  3806. /* This is a >= 5.0.3 type true VARCHAR where
  3807. the real payload data length is stored in
  3808. 1 or 2 bytes */
  3809. o_ptr = row_mysql_read_true_varchar(
  3810. &o_len, o_ptr,
  3811. (ulint)
  3812. (((Field_varstring*)field)->length_bytes));
  3813. n_ptr = row_mysql_read_true_varchar(
  3814. &n_len, n_ptr,
  3815. (ulint)
  3816. (((Field_varstring*)field)->length_bytes));
  3817. }
  3818. break;
  3819. default:
  3820. ;
  3821. }
  3822. if (field->null_ptr) {
  3823. if (field_in_record_is_null(table, field,
  3824. (char*) old_row)) {
  3825. o_len = UNIV_SQL_NULL;
  3826. }
  3827. if (field_in_record_is_null(table, field,
  3828. (char*) new_row)) {
  3829. n_len = UNIV_SQL_NULL;
  3830. }
  3831. }
  3832. if (o_len != n_len || (o_len != UNIV_SQL_NULL &&
  3833. 0 != memcmp(o_ptr, n_ptr, o_len))) {
  3834. /* The field has changed */
  3835. ufield = uvect->fields + n_changed;
  3836. /* Let us use a dummy dfield to make the conversion
  3837. from the MySQL column format to the InnoDB format */
  3838. dict_col_copy_type(prebuilt->table->cols + i,
  3839. dfield_get_type(&dfield));
  3840. if (n_len != UNIV_SQL_NULL) {
  3841. buf = row_mysql_store_col_in_innobase_format(
  3842. &dfield,
  3843. (byte*)buf,
  3844. TRUE,
  3845. new_mysql_row_col,
  3846. col_pack_len,
  3847. dict_table_is_comp(prebuilt->table));
  3848. dfield_copy_data(&ufield->new_val, &dfield);
  3849. } else {
  3850. dfield_set_null(&ufield->new_val);
  3851. }
  3852. ufield->exp = NULL;
  3853. ufield->orig_len = 0;
  3854. ufield->field_no = dict_col_get_clust_pos(
  3855. &prebuilt->table->cols[i], clust_index);
  3856. n_changed++;
  3857. }
  3858. }
  3859. uvect->n_fields = n_changed;
  3860. uvect->info_bits = 0;
  3861. ut_a(buf <= (byte*)original_upd_buff + buff_len);
  3862. return(0);
  3863. }
  3864. /**********************************************************************//**
  3865. Updates a row given as a parameter to a new value. Note that we are given
  3866. whole rows, not just the fields which are updated: this incurs some
  3867. overhead for CPU when we check which fields are actually updated.
  3868. TODO: currently InnoDB does not prevent the 'Halloween problem':
  3869. in a searched update a single row can get updated several times
  3870. if its index columns are updated!
  3871. @return error number or 0 */
  3872. UNIV_INTERN
  3873. int
  3874. ha_innobase::update_row(
  3875. /*====================*/
  3876. const uchar* old_row, /*!< in: old row in MySQL format */
  3877. uchar* new_row) /*!< in: new row in MySQL format */
  3878. {
  3879. upd_t* uvect;
  3880. int error = 0;
  3881. trx_t* trx = thd_to_trx(user_thd);
  3882. DBUG_ENTER("ha_innobase::update_row");
  3883. ut_a(prebuilt->trx == trx);
  3884. ha_statistic_increment(&SSV::ha_update_count);
  3885. if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
  3886. table->timestamp_field->set_time();
  3887. if (prebuilt->upd_node) {
  3888. uvect = prebuilt->upd_node->update;
  3889. } else {
  3890. uvect = row_get_prebuilt_update_vector(prebuilt);
  3891. }
  3892. /* Build an update vector from the modified fields in the rows
  3893. (uses upd_buff of the handle) */
  3894. calc_row_difference(uvect, (uchar*) old_row, new_row, table,
  3895. upd_buff, (ulint)upd_and_key_val_buff_len,
  3896. prebuilt, user_thd);
  3897. /* This is not a delete */
  3898. prebuilt->upd_node->is_delete = FALSE;
  3899. ut_a(prebuilt->template_type == ROW_MYSQL_WHOLE_ROW);
  3900. innodb_srv_conc_enter_innodb(trx);
  3901. error = row_update_for_mysql((byte*) old_row, prebuilt);
  3902. /* We need to do some special AUTOINC handling for the following case:
  3903. INSERT INTO t (c1,c2) VALUES(x,y) ON DUPLICATE KEY UPDATE ...
  3904. We need to use the AUTOINC counter that was actually used by
  3905. MySQL in the UPDATE statement, which can be different from the
  3906. value used in the INSERT statement.*/
  3907. if (error == DB_SUCCESS
  3908. && table->next_number_field
  3909. && new_row == table->record[0]
  3910. && thd_sql_command(user_thd) == SQLCOM_INSERT
  3911. && (trx->duplicates & (TRX_DUP_IGNORE | TRX_DUP_REPLACE))
  3912. == TRX_DUP_IGNORE) {
  3913. ulonglong auto_inc;
  3914. ulonglong col_max_value;
  3915. auto_inc = table->next_number_field->val_int();
  3916. /* We need the upper limit of the col type to check for
  3917. whether we update the table autoinc counter or not. */
  3918. col_max_value = innobase_get_int_col_max_value(
  3919. table->next_number_field);
  3920. if (auto_inc <= col_max_value && auto_inc != 0) {
  3921. ulonglong need;
  3922. ulonglong offset;
  3923. offset = prebuilt->autoinc_offset;
  3924. need = prebuilt->autoinc_increment;
  3925. auto_inc = innobase_next_autoinc(
  3926. auto_inc, need, offset, col_max_value);
  3927. error = innobase_set_max_autoinc(auto_inc);
  3928. }
  3929. }
  3930. innodb_srv_conc_exit_innodb(trx);
  3931. error = convert_error_code_to_mysql(error,
  3932. prebuilt->table->flags, user_thd);
  3933. if (error == 0 /* success */
  3934. && uvect->n_fields == 0 /* no columns were updated */) {
  3935. /* This is the same as success, but instructs
  3936. MySQL that the row is not really updated and it
  3937. should not increase the count of updated rows.
  3938. This is fix for http://bugs.mysql.com/29157 */
  3939. error = HA_ERR_RECORD_IS_THE_SAME;
  3940. }
  3941. /* Tell InnoDB server that there might be work for
  3942. utility threads: */
  3943. innobase_active_small();
  3944. DBUG_RETURN(error);
  3945. }
  3946. /**********************************************************************//**
  3947. Deletes a row given as the parameter.
  3948. @return error number or 0 */
  3949. UNIV_INTERN
  3950. int
  3951. ha_innobase::delete_row(
  3952. /*====================*/
  3953. const uchar* record) /*!< in: a row in MySQL format */
  3954. {
  3955. int error = 0;
  3956. trx_t* trx = thd_to_trx(user_thd);
  3957. DBUG_ENTER("ha_innobase::delete_row");
  3958. ut_a(prebuilt->trx == trx);
  3959. ha_statistic_increment(&SSV::ha_delete_count);
  3960. if (!prebuilt->upd_node) {
  3961. row_get_prebuilt_update_vector(prebuilt);
  3962. }
  3963. /* This is a delete */
  3964. prebuilt->upd_node->is_delete = TRUE;
  3965. innodb_srv_conc_enter_innodb(trx);
  3966. error = row_update_for_mysql((byte*) record, prebuilt);
  3967. innodb_srv_conc_exit_innodb(trx);
  3968. error = convert_error_code_to_mysql(
  3969. error, prebuilt->table->flags, user_thd);
  3970. /* Tell the InnoDB server that there might be work for
  3971. utility threads: */
  3972. innobase_active_small();
  3973. DBUG_RETURN(error);
  3974. }
  3975. /**********************************************************************//**
  3976. Removes a new lock set on a row, if it was not read optimistically. This can
  3977. be called after a row has been read in the processing of an UPDATE or a DELETE
  3978. query, if the option innodb_locks_unsafe_for_binlog is set. */
  3979. UNIV_INTERN
  3980. void
  3981. ha_innobase::unlock_row(void)
  3982. /*=========================*/
  3983. {
  3984. DBUG_ENTER("ha_innobase::unlock_row");
  3985. /* Consistent read does not take any locks, thus there is
  3986. nothing to unlock. */
  3987. if (prebuilt->select_lock_type == LOCK_NONE) {
  3988. DBUG_VOID_RETURN;
  3989. }
  3990. switch (prebuilt->row_read_type) {
  3991. case ROW_READ_WITH_LOCKS:
  3992. if (!srv_locks_unsafe_for_binlog
  3993. && prebuilt->trx->isolation_level
  3994. != TRX_ISO_READ_COMMITTED) {
  3995. break;
  3996. }
  3997. /* fall through */
  3998. case ROW_READ_TRY_SEMI_CONSISTENT:
  3999. row_unlock_for_mysql(prebuilt, FALSE);
  4000. break;
  4001. case ROW_READ_DID_SEMI_CONSISTENT:
  4002. prebuilt->row_read_type = ROW_READ_TRY_SEMI_CONSISTENT;
  4003. break;
  4004. }
  4005. DBUG_VOID_RETURN;
  4006. }
  4007. /* See handler.h and row0mysql.h for docs on this function. */
  4008. UNIV_INTERN
  4009. bool
  4010. ha_innobase::was_semi_consistent_read(void)
  4011. /*=======================================*/
  4012. {
  4013. return(prebuilt->row_read_type == ROW_READ_DID_SEMI_CONSISTENT);
  4014. }
  4015. /* See handler.h and row0mysql.h for docs on this function. */
  4016. UNIV_INTERN
  4017. void
  4018. ha_innobase::try_semi_consistent_read(bool yes)
  4019. /*===========================================*/
  4020. {
  4021. ut_a(prebuilt->trx == thd_to_trx(ha_thd()));
  4022. /* Row read type is set to semi consistent read if this was
  4023. requested by the MySQL and either innodb_locks_unsafe_for_binlog
  4024. option is used or this session is using READ COMMITTED isolation
  4025. level. */
  4026. if (yes
  4027. && (srv_locks_unsafe_for_binlog
  4028. || prebuilt->trx->isolation_level == TRX_ISO_READ_COMMITTED)) {
  4029. prebuilt->row_read_type = ROW_READ_TRY_SEMI_CONSISTENT;
  4030. } else {
  4031. prebuilt->row_read_type = ROW_READ_WITH_LOCKS;
  4032. }
  4033. }
  4034. /******************************************************************//**
  4035. Initializes a handle to use an index.
  4036. @return 0 or error number */
  4037. UNIV_INTERN
  4038. int
  4039. ha_innobase::index_init(
  4040. /*====================*/
  4041. uint keynr, /*!< in: key (index) number */
  4042. bool sorted) /*!< in: 1 if result MUST be sorted according to index */
  4043. {
  4044. DBUG_ENTER("index_init");
  4045. DBUG_RETURN(change_active_index(keynr));
  4046. }
  4047. /******************************************************************//**
  4048. Currently does nothing.
  4049. @return 0 */
  4050. UNIV_INTERN
  4051. int
  4052. ha_innobase::index_end(void)
  4053. /*========================*/
  4054. {
  4055. int error = 0;
  4056. DBUG_ENTER("index_end");
  4057. active_index=MAX_KEY;
  4058. DBUG_RETURN(error);
  4059. }
  4060. /*********************************************************************//**
  4061. Converts a search mode flag understood by MySQL to a flag understood
  4062. by InnoDB. */
  4063. static inline
  4064. ulint
  4065. convert_search_mode_to_innobase(
  4066. /*============================*/
  4067. enum ha_rkey_function find_flag)
  4068. {
  4069. switch (find_flag) {
  4070. case HA_READ_KEY_EXACT:
  4071. /* this does not require the index to be UNIQUE */
  4072. return(PAGE_CUR_GE);
  4073. case HA_READ_KEY_OR_NEXT:
  4074. return(PAGE_CUR_GE);
  4075. case HA_READ_KEY_OR_PREV:
  4076. return(PAGE_CUR_LE);
  4077. case HA_READ_AFTER_KEY:
  4078. return(PAGE_CUR_G);
  4079. case HA_READ_BEFORE_KEY:
  4080. return(PAGE_CUR_L);
  4081. case HA_READ_PREFIX:
  4082. return(PAGE_CUR_GE);
  4083. case HA_READ_PREFIX_LAST:
  4084. return(PAGE_CUR_LE);
  4085. case HA_READ_PREFIX_LAST_OR_PREV:
  4086. return(PAGE_CUR_LE);
  4087. /* In MySQL-4.0 HA_READ_PREFIX and HA_READ_PREFIX_LAST always
  4088. pass a complete-field prefix of a key value as the search
  4089. tuple. I.e., it is not allowed that the last field would
  4090. just contain n first bytes of the full field value.
  4091. MySQL uses a 'padding' trick to convert LIKE 'abc%'
  4092. type queries so that it can use as a search tuple
  4093. a complete-field-prefix of a key value. Thus, the InnoDB
  4094. search mode PAGE_CUR_LE_OR_EXTENDS is never used.
  4095. TODO: when/if MySQL starts to use also partial-field
  4096. prefixes, we have to deal with stripping of spaces
  4097. and comparison of non-latin1 char type fields in
  4098. innobase_mysql_cmp() to get PAGE_CUR_LE_OR_EXTENDS to
  4099. work correctly. */
  4100. case HA_READ_MBR_CONTAIN:
  4101. case HA_READ_MBR_INTERSECT:
  4102. case HA_READ_MBR_WITHIN:
  4103. case HA_READ_MBR_DISJOINT:
  4104. case HA_READ_MBR_EQUAL:
  4105. return(PAGE_CUR_UNSUPP);
  4106. /* do not use "default:" in order to produce a gcc warning:
  4107. enumeration value '...' not handled in switch
  4108. (if -Wswitch or -Wall is used) */
  4109. }
  4110. my_error(ER_CHECK_NOT_IMPLEMENTED, MYF(0), "this functionality");
  4111. return(PAGE_CUR_UNSUPP);
  4112. }
  4113. /*
  4114. BACKGROUND INFO: HOW A SELECT SQL QUERY IS EXECUTED
  4115. ---------------------------------------------------
  4116. The following does not cover all the details, but explains how we determine
  4117. the start of a new SQL statement, and what is associated with it.
  4118. For each table in the database the MySQL interpreter may have several
  4119. table handle instances in use, also in a single SQL query. For each table
  4120. handle instance there is an InnoDB 'prebuilt' struct which contains most
  4121. of the InnoDB data associated with this table handle instance.
  4122. A) if the user has not explicitly set any MySQL table level locks:
  4123. 1) MySQL calls ::external_lock to set an 'intention' table level lock on
  4124. the table of the handle instance. There we set
  4125. prebuilt->sql_stat_start = TRUE. The flag sql_stat_start should be set
  4126. true if we are taking this table handle instance to use in a new SQL
  4127. statement issued by the user. We also increment trx->n_mysql_tables_in_use.
  4128. 2) If prebuilt->sql_stat_start == TRUE we 'pre-compile' the MySQL search
  4129. instructions to prebuilt->template of the table handle instance in
  4130. ::index_read. The template is used to save CPU time in large joins.
  4131. 3) In row_search_for_mysql, if prebuilt->sql_stat_start is true, we
  4132. allocate a new consistent read view for the trx if it does not yet have one,
  4133. or in the case of a locking read, set an InnoDB 'intention' table level
  4134. lock on the table.
  4135. 4) We do the SELECT. MySQL may repeatedly call ::index_read for the
  4136. same table handle instance, if it is a join.
  4137. 5) When the SELECT ends, MySQL removes its intention table level locks
  4138. in ::external_lock. When trx->n_mysql_tables_in_use drops to zero,
  4139. (a) we execute a COMMIT there if the autocommit is on,
  4140. (b) we also release possible 'SQL statement level resources' InnoDB may
  4141. have for this SQL statement. The MySQL interpreter does NOT execute
  4142. autocommit for pure read transactions, though it should. That is why the
  4143. table handler in that case has to execute the COMMIT in ::external_lock.
  4144. B) If the user has explicitly set MySQL table level locks, then MySQL
  4145. does NOT call ::external_lock at the start of the statement. To determine
  4146. when we are at the start of a new SQL statement we at the start of
  4147. ::index_read also compare the query id to the latest query id where the
  4148. table handle instance was used. If it has changed, we know we are at the
  4149. start of a new SQL statement. Since the query id can theoretically
  4150. overwrap, we use this test only as a secondary way of determining the
  4151. start of a new SQL statement. */
  4152. /**********************************************************************//**
  4153. Positions an index cursor to the index specified in the handle. Fetches the
  4154. row if any.
  4155. @return 0, HA_ERR_KEY_NOT_FOUND, or error number */
  4156. UNIV_INTERN
  4157. int
  4158. ha_innobase::index_read(
  4159. /*====================*/
  4160. uchar* buf, /*!< in/out: buffer for the returned
  4161. row */
  4162. const uchar* key_ptr, /*!< in: key value; if this is NULL
  4163. we position the cursor at the
  4164. start or end of index; this can
  4165. also contain an InnoDB row id, in
  4166. which case key_len is the InnoDB
  4167. row id length; the key value can
  4168. also be a prefix of a full key value,
  4169. and the last column can be a prefix
  4170. of a full column */
  4171. uint key_len,/*!< in: key value length */
  4172. enum ha_rkey_function find_flag)/*!< in: search flags from my_base.h */
  4173. {
  4174. ulint mode;
  4175. dict_index_t* index;
  4176. ulint match_mode = 0;
  4177. int error;
  4178. ulint ret;
  4179. DBUG_ENTER("index_read");
  4180. ut_a(prebuilt->trx == thd_to_trx(user_thd));
  4181. ha_statistic_increment(&SSV::ha_read_key_count);
  4182. index = prebuilt->index;
  4183. if (UNIV_UNLIKELY(index == NULL)) {
  4184. prebuilt->index_usable = FALSE;
  4185. DBUG_RETURN(HA_ERR_CRASHED);
  4186. }
  4187. /* Note that if the index for which the search template is built is not
  4188. necessarily prebuilt->index, but can also be the clustered index */
  4189. if (prebuilt->sql_stat_start) {
  4190. build_template(prebuilt, user_thd, table, ROW_MYSQL_REC_FIELDS);
  4191. }
  4192. if (key_ptr) {
  4193. /* Convert the search key value to InnoDB format into
  4194. prebuilt->search_tuple */
  4195. row_sel_convert_mysql_key_to_innobase(
  4196. prebuilt->search_tuple,
  4197. (byte*) key_val_buff,
  4198. (ulint)upd_and_key_val_buff_len,
  4199. index,
  4200. (byte*) key_ptr,
  4201. (ulint) key_len,
  4202. prebuilt->trx);
  4203. } else {
  4204. /* We position the cursor to the last or the first entry
  4205. in the index */
  4206. dtuple_set_n_fields(prebuilt->search_tuple, 0);
  4207. }
  4208. mode = convert_search_mode_to_innobase(find_flag);
  4209. match_mode = 0;
  4210. if (find_flag == HA_READ_KEY_EXACT) {
  4211. match_mode = ROW_SEL_EXACT;
  4212. } else if (find_flag == HA_READ_PREFIX
  4213. || find_flag == HA_READ_PREFIX_LAST) {
  4214. match_mode = ROW_SEL_EXACT_PREFIX;
  4215. }
  4216. last_match_mode = (uint) match_mode;
  4217. if (mode != PAGE_CUR_UNSUPP) {
  4218. innodb_srv_conc_enter_innodb(prebuilt->trx);
  4219. ret = row_search_for_mysql((byte*) buf, mode, prebuilt,
  4220. match_mode, 0);
  4221. innodb_srv_conc_exit_innodb(prebuilt->trx);
  4222. } else {
  4223. ret = DB_UNSUPPORTED;
  4224. }
  4225. switch (ret) {
  4226. case DB_SUCCESS:
  4227. error = 0;
  4228. table->status = 0;
  4229. break;
  4230. case DB_RECORD_NOT_FOUND:
  4231. error = HA_ERR_KEY_NOT_FOUND;
  4232. table->status = STATUS_NOT_FOUND;
  4233. break;
  4234. case DB_END_OF_INDEX:
  4235. error = HA_ERR_KEY_NOT_FOUND;
  4236. table->status = STATUS_NOT_FOUND;
  4237. break;
  4238. default:
  4239. error = convert_error_code_to_mysql((int) ret,
  4240. prebuilt->table->flags,
  4241. user_thd);
  4242. table->status = STATUS_NOT_FOUND;
  4243. break;
  4244. }
  4245. DBUG_RETURN(error);
  4246. }
  4247. /*******************************************************************//**
  4248. The following functions works like index_read, but it find the last
  4249. row with the current key value or prefix.
  4250. @return 0, HA_ERR_KEY_NOT_FOUND, or an error code */
  4251. UNIV_INTERN
  4252. int
  4253. ha_innobase::index_read_last(
  4254. /*=========================*/
  4255. uchar* buf, /*!< out: fetched row */
  4256. const uchar* key_ptr,/*!< in: key value, or a prefix of a full
  4257. key value */
  4258. uint key_len)/*!< in: length of the key val or prefix
  4259. in bytes */
  4260. {
  4261. return(index_read(buf, key_ptr, key_len, HA_READ_PREFIX_LAST));
  4262. }
  4263. /********************************************************************//**
  4264. Get the index for a handle. Does not change active index.
  4265. @return NULL or index instance. */
  4266. UNIV_INTERN
  4267. dict_index_t*
  4268. ha_innobase::innobase_get_index(
  4269. /*============================*/
  4270. uint keynr) /*!< in: use this index; MAX_KEY means always
  4271. clustered index, even if it was internally
  4272. generated by InnoDB */
  4273. {
  4274. KEY* key = 0;
  4275. dict_index_t* index = 0;
  4276. DBUG_ENTER("innobase_get_index");
  4277. ha_statistic_increment(&SSV::ha_read_key_count);
  4278. ut_ad(user_thd == ha_thd());
  4279. ut_a(prebuilt->trx == thd_to_trx(user_thd));
  4280. if (keynr != MAX_KEY && table->s->keys > 0) {
  4281. key = table->key_info + keynr;
  4282. index = dict_table_get_index_on_name(prebuilt->table,
  4283. key->name);
  4284. } else {
  4285. index = dict_table_get_first_index(prebuilt->table);
  4286. }
  4287. if (!index) {
  4288. sql_print_error(
  4289. "Innodb could not find key n:o %u with name %s "
  4290. "from dict cache for table %s",
  4291. keynr, key ? key->name : "NULL",
  4292. prebuilt->table->name);
  4293. }
  4294. DBUG_RETURN(index);
  4295. }
  4296. /********************************************************************//**
  4297. Changes the active index of a handle.
  4298. @return 0 or error code */
  4299. UNIV_INTERN
  4300. int
  4301. ha_innobase::change_active_index(
  4302. /*=============================*/
  4303. uint keynr) /*!< in: use this index; MAX_KEY means always clustered
  4304. index, even if it was internally generated by
  4305. InnoDB */
  4306. {
  4307. DBUG_ENTER("change_active_index");
  4308. ut_ad(user_thd == ha_thd());
  4309. ut_a(prebuilt->trx == thd_to_trx(user_thd));
  4310. active_index = keynr;
  4311. prebuilt->index = innobase_get_index(keynr);
  4312. if (UNIV_UNLIKELY(!prebuilt->index)) {
  4313. sql_print_warning("InnoDB: change_active_index(%u) failed",
  4314. keynr);
  4315. prebuilt->index_usable = FALSE;
  4316. DBUG_RETURN(1);
  4317. }
  4318. prebuilt->index_usable = row_merge_is_index_usable(prebuilt->trx,
  4319. prebuilt->index);
  4320. if (UNIV_UNLIKELY(!prebuilt->index_usable)) {
  4321. sql_print_warning("InnoDB: insufficient history for index %u",
  4322. keynr);
  4323. /* The caller seems to ignore this. Thus, we must check
  4324. this again in row_search_for_mysql(). */
  4325. DBUG_RETURN(2);
  4326. }
  4327. ut_a(prebuilt->search_tuple != 0);
  4328. dtuple_set_n_fields(prebuilt->search_tuple, prebuilt->index->n_fields);
  4329. dict_index_copy_types(prebuilt->search_tuple, prebuilt->index,
  4330. prebuilt->index->n_fields);
  4331. /* MySQL changes the active index for a handle also during some
  4332. queries, for example SELECT MAX(a), SUM(a) first retrieves the MAX()
  4333. and then calculates the sum. Previously we played safe and used
  4334. the flag ROW_MYSQL_WHOLE_ROW below, but that caused unnecessary
  4335. copying. Starting from MySQL-4.1 we use a more efficient flag here. */
  4336. build_template(prebuilt, user_thd, table, ROW_MYSQL_REC_FIELDS);
  4337. DBUG_RETURN(0);
  4338. }
  4339. /**********************************************************************//**
  4340. Positions an index cursor to the index specified in keynr. Fetches the
  4341. row if any.
  4342. ??? This is only used to read whole keys ???
  4343. @return error number or 0 */
  4344. UNIV_INTERN
  4345. int
  4346. ha_innobase::index_read_idx(
  4347. /*========================*/
  4348. uchar* buf, /*!< in/out: buffer for the returned
  4349. row */
  4350. uint keynr, /*!< in: use this index */
  4351. const uchar* key, /*!< in: key value; if this is NULL
  4352. we position the cursor at the
  4353. start or end of index */
  4354. uint key_len, /*!< in: key value length */
  4355. enum ha_rkey_function find_flag)/*!< in: search flags from my_base.h */
  4356. {
  4357. if (change_active_index(keynr)) {
  4358. return(1);
  4359. }
  4360. return(index_read(buf, key, key_len, find_flag));
  4361. }
  4362. /***********************************************************************//**
  4363. Reads the next or previous row from a cursor, which must have previously been
  4364. positioned using index_read.
  4365. @return 0, HA_ERR_END_OF_FILE, or error number */
  4366. UNIV_INTERN
  4367. int
  4368. ha_innobase::general_fetch(
  4369. /*=======================*/
  4370. uchar* buf, /*!< in/out: buffer for next row in MySQL
  4371. format */
  4372. uint direction, /*!< in: ROW_SEL_NEXT or ROW_SEL_PREV */
  4373. uint match_mode) /*!< in: 0, ROW_SEL_EXACT, or
  4374. ROW_SEL_EXACT_PREFIX */
  4375. {
  4376. ulint ret;
  4377. int error = 0;
  4378. DBUG_ENTER("general_fetch");
  4379. ut_a(prebuilt->trx == thd_to_trx(user_thd));
  4380. innodb_srv_conc_enter_innodb(prebuilt->trx);
  4381. ret = row_search_for_mysql(
  4382. (byte*)buf, 0, prebuilt, match_mode, direction);
  4383. innodb_srv_conc_exit_innodb(prebuilt->trx);
  4384. switch (ret) {
  4385. case DB_SUCCESS:
  4386. error = 0;
  4387. table->status = 0;
  4388. break;
  4389. case DB_RECORD_NOT_FOUND:
  4390. error = HA_ERR_END_OF_FILE;
  4391. table->status = STATUS_NOT_FOUND;
  4392. break;
  4393. case DB_END_OF_INDEX:
  4394. error = HA_ERR_END_OF_FILE;
  4395. table->status = STATUS_NOT_FOUND;
  4396. break;
  4397. default:
  4398. error = convert_error_code_to_mysql(
  4399. (int) ret, prebuilt->table->flags, user_thd);
  4400. table->status = STATUS_NOT_FOUND;
  4401. break;
  4402. }
  4403. DBUG_RETURN(error);
  4404. }
  4405. /***********************************************************************//**
  4406. Reads the next row from a cursor, which must have previously been
  4407. positioned using index_read.
  4408. @return 0, HA_ERR_END_OF_FILE, or error number */
  4409. UNIV_INTERN
  4410. int
  4411. ha_innobase::index_next(
  4412. /*====================*/
  4413. uchar* buf) /*!< in/out: buffer for next row in MySQL
  4414. format */
  4415. {
  4416. ha_statistic_increment(&SSV::ha_read_next_count);
  4417. return(general_fetch(buf, ROW_SEL_NEXT, 0));
  4418. }
  4419. /*******************************************************************//**
  4420. Reads the next row matching to the key value given as the parameter.
  4421. @return 0, HA_ERR_END_OF_FILE, or error number */
  4422. UNIV_INTERN
  4423. int
  4424. ha_innobase::index_next_same(
  4425. /*=========================*/
  4426. uchar* buf, /*!< in/out: buffer for the row */
  4427. const uchar* key, /*!< in: key value */
  4428. uint keylen) /*!< in: key value length */
  4429. {
  4430. ha_statistic_increment(&SSV::ha_read_next_count);
  4431. return(general_fetch(buf, ROW_SEL_NEXT, last_match_mode));
  4432. }
  4433. /***********************************************************************//**
  4434. Reads the previous row from a cursor, which must have previously been
  4435. positioned using index_read.
  4436. @return 0, HA_ERR_END_OF_FILE, or error number */
  4437. UNIV_INTERN
  4438. int
  4439. ha_innobase::index_prev(
  4440. /*====================*/
  4441. uchar* buf) /*!< in/out: buffer for previous row in MySQL format */
  4442. {
  4443. ha_statistic_increment(&SSV::ha_read_prev_count);
  4444. return(general_fetch(buf, ROW_SEL_PREV, 0));
  4445. }
  4446. /********************************************************************//**
  4447. Positions a cursor on the first record in an index and reads the
  4448. corresponding row to buf.
  4449. @return 0, HA_ERR_END_OF_FILE, or error code */
  4450. UNIV_INTERN
  4451. int
  4452. ha_innobase::index_first(
  4453. /*=====================*/
  4454. uchar* buf) /*!< in/out: buffer for the row */
  4455. {
  4456. int error;
  4457. DBUG_ENTER("index_first");
  4458. ha_statistic_increment(&SSV::ha_read_first_count);
  4459. error = index_read(buf, NULL, 0, HA_READ_AFTER_KEY);
  4460. /* MySQL does not seem to allow this to return HA_ERR_KEY_NOT_FOUND */
  4461. if (error == HA_ERR_KEY_NOT_FOUND) {
  4462. error = HA_ERR_END_OF_FILE;
  4463. }
  4464. DBUG_RETURN(error);
  4465. }
  4466. /********************************************************************//**
  4467. Positions a cursor on the last record in an index and reads the
  4468. corresponding row to buf.
  4469. @return 0, HA_ERR_END_OF_FILE, or error code */
  4470. UNIV_INTERN
  4471. int
  4472. ha_innobase::index_last(
  4473. /*====================*/
  4474. uchar* buf) /*!< in/out: buffer for the row */
  4475. {
  4476. int error;
  4477. DBUG_ENTER("index_last");
  4478. ha_statistic_increment(&SSV::ha_read_last_count);
  4479. error = index_read(buf, NULL, 0, HA_READ_BEFORE_KEY);
  4480. /* MySQL does not seem to allow this to return HA_ERR_KEY_NOT_FOUND */
  4481. if (error == HA_ERR_KEY_NOT_FOUND) {
  4482. error = HA_ERR_END_OF_FILE;
  4483. }
  4484. DBUG_RETURN(error);
  4485. }
  4486. /****************************************************************//**
  4487. Initialize a table scan.
  4488. @return 0 or error number */
  4489. UNIV_INTERN
  4490. int
  4491. ha_innobase::rnd_init(
  4492. /*==================*/
  4493. bool scan) /*!< in: TRUE if table/index scan FALSE otherwise */
  4494. {
  4495. int err;
  4496. /* Store the active index value so that we can restore the original
  4497. value after a scan */
  4498. if (prebuilt->clust_index_was_generated) {
  4499. err = change_active_index(MAX_KEY);
  4500. } else {
  4501. err = change_active_index(primary_key);
  4502. }
  4503. /* Don't use semi-consistent read in random row reads (by position).
  4504. This means we must disable semi_consistent_read if scan is false */
  4505. if (!scan) {
  4506. try_semi_consistent_read(0);
  4507. }
  4508. start_of_scan = 1;
  4509. return(err);
  4510. }
  4511. /*****************************************************************//**
  4512. Ends a table scan.
  4513. @return 0 or error number */
  4514. UNIV_INTERN
  4515. int
  4516. ha_innobase::rnd_end(void)
  4517. /*======================*/
  4518. {
  4519. return(index_end());
  4520. }
  4521. /*****************************************************************//**
  4522. Reads the next row in a table scan (also used to read the FIRST row
  4523. in a table scan).
  4524. @return 0, HA_ERR_END_OF_FILE, or error number */
  4525. UNIV_INTERN
  4526. int
  4527. ha_innobase::rnd_next(
  4528. /*==================*/
  4529. uchar* buf) /*!< in/out: returns the row in this buffer,
  4530. in MySQL format */
  4531. {
  4532. int error;
  4533. DBUG_ENTER("rnd_next");
  4534. ha_statistic_increment(&SSV::ha_read_rnd_next_count);
  4535. if (start_of_scan) {
  4536. error = index_first(buf);
  4537. if (error == HA_ERR_KEY_NOT_FOUND) {
  4538. error = HA_ERR_END_OF_FILE;
  4539. }
  4540. start_of_scan = 0;
  4541. } else {
  4542. error = general_fetch(buf, ROW_SEL_NEXT, 0);
  4543. }
  4544. DBUG_RETURN(error);
  4545. }
  4546. /**********************************************************************//**
  4547. Fetches a row from the table based on a row reference.
  4548. @return 0, HA_ERR_KEY_NOT_FOUND, or error code */
  4549. UNIV_INTERN
  4550. int
  4551. ha_innobase::rnd_pos(
  4552. /*=================*/
  4553. uchar* buf, /*!< in/out: buffer for the row */
  4554. uchar* pos) /*!< in: primary key value of the row in the
  4555. MySQL format, or the row id if the clustered
  4556. index was internally generated by InnoDB; the
  4557. length of data in pos has to be ref_length */
  4558. {
  4559. int error;
  4560. uint keynr = active_index;
  4561. DBUG_ENTER("rnd_pos");
  4562. DBUG_DUMP("key", pos, ref_length);
  4563. ha_statistic_increment(&SSV::ha_read_rnd_count);
  4564. ut_a(prebuilt->trx == thd_to_trx(ha_thd()));
  4565. if (prebuilt->clust_index_was_generated) {
  4566. /* No primary key was defined for the table and we
  4567. generated the clustered index from the row id: the
  4568. row reference is the row id, not any key value
  4569. that MySQL knows of */
  4570. error = change_active_index(MAX_KEY);
  4571. } else {
  4572. error = change_active_index(primary_key);
  4573. }
  4574. if (error) {
  4575. DBUG_PRINT("error", ("Got error: %d", error));
  4576. DBUG_RETURN(error);
  4577. }
  4578. /* Note that we assume the length of the row reference is fixed
  4579. for the table, and it is == ref_length */
  4580. error = index_read(buf, pos, ref_length, HA_READ_KEY_EXACT);
  4581. if (error) {
  4582. DBUG_PRINT("error", ("Got error: %d", error));
  4583. }
  4584. change_active_index(keynr);
  4585. DBUG_RETURN(error);
  4586. }
  4587. /*********************************************************************//**
  4588. Stores a reference to the current row to 'ref' field of the handle. Note
  4589. that in the case where we have generated the clustered index for the
  4590. table, the function parameter is illogical: we MUST ASSUME that 'record'
  4591. is the current 'position' of the handle, because if row ref is actually
  4592. the row id internally generated in InnoDB, then 'record' does not contain
  4593. it. We just guess that the row id must be for the record where the handle
  4594. was positioned the last time. */
  4595. UNIV_INTERN
  4596. void
  4597. ha_innobase::position(
  4598. /*==================*/
  4599. const uchar* record) /*!< in: row in MySQL format */
  4600. {
  4601. uint len;
  4602. ut_a(prebuilt->trx == thd_to_trx(ha_thd()));
  4603. if (prebuilt->clust_index_was_generated) {
  4604. /* No primary key was defined for the table and we
  4605. generated the clustered index from row id: the
  4606. row reference will be the row id, not any key value
  4607. that MySQL knows of */
  4608. len = DATA_ROW_ID_LEN;
  4609. memcpy(ref, prebuilt->row_id, len);
  4610. } else {
  4611. len = store_key_val_for_row(primary_key, (char*)ref,
  4612. ref_length, record);
  4613. }
  4614. /* We assume that the 'ref' value len is always fixed for the same
  4615. table. */
  4616. if (len != ref_length) {
  4617. sql_print_error("Stored ref len is %lu, but table ref len is %lu",
  4618. (ulong) len, (ulong) ref_length);
  4619. }
  4620. }
  4621. /* limit innodb monitor access to users with PROCESS privilege.
  4622. See http://bugs.mysql.com/32710 for expl. why we choose PROCESS. */
  4623. #define IS_MAGIC_TABLE_AND_USER_DENIED_ACCESS(table_name, thd) \
  4624. (row_is_magic_monitor_table(table_name) \
  4625. && check_global_access(thd, PROCESS_ACL))
  4626. /*****************************************************************//**
  4627. Creates a table definition to an InnoDB database. */
  4628. static
  4629. int
  4630. create_table_def(
  4631. /*=============*/
  4632. trx_t* trx, /*!< in: InnoDB transaction handle */
  4633. TABLE* form, /*!< in: information on table
  4634. columns and indexes */
  4635. const char* table_name, /*!< in: table name */
  4636. const char* path_of_temp_table,/*!< in: if this is a table explicitly
  4637. created by the user with the
  4638. TEMPORARY keyword, then this
  4639. parameter is the dir path where the
  4640. table should be placed if we create
  4641. an .ibd file for it (no .ibd extension
  4642. in the path, though); otherwise this
  4643. is NULL */
  4644. ulint flags) /*!< in: table flags */
  4645. {
  4646. Field* field;
  4647. dict_table_t* table;
  4648. ulint n_cols;
  4649. int error;
  4650. ulint col_type;
  4651. ulint col_len;
  4652. ulint nulls_allowed;
  4653. ulint unsigned_type;
  4654. ulint binary_type;
  4655. ulint long_true_varchar;
  4656. ulint charset_no;
  4657. ulint i;
  4658. DBUG_ENTER("create_table_def");
  4659. DBUG_PRINT("enter", ("table_name: %s", table_name));
  4660. ut_a(trx->mysql_thd != NULL);
  4661. if (IS_MAGIC_TABLE_AND_USER_DENIED_ACCESS(table_name,
  4662. (THD*) trx->mysql_thd)) {
  4663. DBUG_RETURN(HA_ERR_GENERIC);
  4664. }
  4665. n_cols = form->s->fields;
  4666. /* We pass 0 as the space id, and determine at a lower level the space
  4667. id where to store the table */
  4668. table = dict_mem_table_create(table_name, 0, n_cols, flags);
  4669. if (path_of_temp_table) {
  4670. table->dir_path_of_temp_table =
  4671. mem_heap_strdup(table->heap, path_of_temp_table);
  4672. }
  4673. for (i = 0; i < n_cols; i++) {
  4674. field = form->field[i];
  4675. col_type = get_innobase_type_from_mysql_type(&unsigned_type,
  4676. field);
  4677. if (field->null_ptr) {
  4678. nulls_allowed = 0;
  4679. } else {
  4680. nulls_allowed = DATA_NOT_NULL;
  4681. }
  4682. if (field->binary()) {
  4683. binary_type = DATA_BINARY_TYPE;
  4684. } else {
  4685. binary_type = 0;
  4686. }
  4687. charset_no = 0;
  4688. if (dtype_is_string_type(col_type)) {
  4689. charset_no = (ulint)field->charset()->number;
  4690. if (UNIV_UNLIKELY(charset_no >= 256)) {
  4691. /* in data0type.h we assume that the
  4692. number fits in one byte in prtype */
  4693. push_warning_printf(
  4694. (THD*) trx->mysql_thd,
  4695. MYSQL_ERROR::WARN_LEVEL_WARN,
  4696. ER_CANT_CREATE_TABLE,
  4697. "In InnoDB, charset-collation codes"
  4698. " must be below 256."
  4699. " Unsupported code %lu.",
  4700. (ulong) charset_no);
  4701. DBUG_RETURN(ER_CANT_CREATE_TABLE);
  4702. }
  4703. }
  4704. ut_a(field->type() < 256); /* we assume in dtype_form_prtype()
  4705. that this fits in one byte */
  4706. col_len = field->pack_length();
  4707. /* The MySQL pack length contains 1 or 2 bytes length field
  4708. for a true VARCHAR. Let us subtract that, so that the InnoDB
  4709. column length in the InnoDB data dictionary is the real
  4710. maximum byte length of the actual data. */
  4711. long_true_varchar = 0;
  4712. if (field->type() == MYSQL_TYPE_VARCHAR) {
  4713. col_len -= ((Field_varstring*)field)->length_bytes;
  4714. if (((Field_varstring*)field)->length_bytes == 2) {
  4715. long_true_varchar = DATA_LONG_TRUE_VARCHAR;
  4716. }
  4717. }
  4718. /* First check whether the column to be added has a
  4719. system reserved name. */
  4720. if (dict_col_name_is_reserved(field->field_name)){
  4721. push_warning_printf(
  4722. (THD*) trx->mysql_thd,
  4723. MYSQL_ERROR::WARN_LEVEL_WARN,
  4724. ER_CANT_CREATE_TABLE,
  4725. "Error creating table '%s' with "
  4726. "column name '%s'. '%s' is a "
  4727. "reserved name. Please try to "
  4728. "re-create the table with a "
  4729. "different column name.",
  4730. table->name, (char*) field->field_name,
  4731. (char*) field->field_name);
  4732. dict_mem_table_free(table);
  4733. trx_commit_for_mysql(trx);
  4734. error = DB_ERROR;
  4735. goto error_ret;
  4736. }
  4737. dict_mem_table_add_col(table, table->heap,
  4738. (char*) field->field_name,
  4739. col_type,
  4740. dtype_form_prtype(
  4741. (ulint)field->type()
  4742. | nulls_allowed | unsigned_type
  4743. | binary_type | long_true_varchar,
  4744. charset_no),
  4745. col_len);
  4746. }
  4747. error = row_create_table_for_mysql(table, trx);
  4748. error_ret:
  4749. error = convert_error_code_to_mysql(error, flags, NULL);
  4750. DBUG_RETURN(error);
  4751. }
  4752. /*****************************************************************//**
  4753. Creates an index in an InnoDB database. */
  4754. static
  4755. int
  4756. create_index(
  4757. /*=========*/
  4758. trx_t* trx, /*!< in: InnoDB transaction handle */
  4759. TABLE* form, /*!< in: information on table
  4760. columns and indexes */
  4761. ulint flags, /*!< in: InnoDB table flags */
  4762. const char* table_name, /*!< in: table name */
  4763. uint key_num) /*!< in: index number */
  4764. {
  4765. Field* field;
  4766. dict_index_t* index;
  4767. int error;
  4768. ulint n_fields;
  4769. KEY* key;
  4770. KEY_PART_INFO* key_part;
  4771. ulint ind_type;
  4772. ulint col_type;
  4773. ulint prefix_len;
  4774. ulint is_unsigned;
  4775. ulint i;
  4776. ulint j;
  4777. ulint* field_lengths;
  4778. DBUG_ENTER("create_index");
  4779. key = form->key_info + key_num;
  4780. n_fields = key->key_parts;
  4781. /* Assert that "GEN_CLUST_INDEX" cannot be used as non-primary index */
  4782. ut_a(innobase_strcasecmp(key->name, innobase_index_reserve_name) != 0);
  4783. ind_type = 0;
  4784. if (key_num == form->s->primary_key) {
  4785. ind_type = ind_type | DICT_CLUSTERED;
  4786. }
  4787. if (key->flags & HA_NOSAME ) {
  4788. ind_type = ind_type | DICT_UNIQUE;
  4789. }
  4790. /* We pass 0 as the space id, and determine at a lower level the space
  4791. id where to store the table */
  4792. index = dict_mem_index_create(table_name, key->name, 0,
  4793. ind_type, n_fields);
  4794. field_lengths = (ulint*) my_malloc(sizeof(ulint) * n_fields,
  4795. MYF(MY_FAE));
  4796. for (i = 0; i < n_fields; i++) {
  4797. key_part = key->key_part + i;
  4798. /* (The flag HA_PART_KEY_SEG denotes in MySQL a column prefix
  4799. field in an index: we only store a specified number of first
  4800. bytes of the column to the index field.) The flag does not
  4801. seem to be properly set by MySQL. Let us fall back on testing
  4802. the length of the key part versus the column. */
  4803. field = NULL;
  4804. for (j = 0; j < form->s->fields; j++) {
  4805. field = form->field[j];
  4806. if (0 == innobase_strcasecmp(
  4807. field->field_name,
  4808. key_part->field->field_name)) {
  4809. /* Found the corresponding column */
  4810. break;
  4811. }
  4812. }
  4813. ut_a(j < form->s->fields);
  4814. col_type = get_innobase_type_from_mysql_type(
  4815. &is_unsigned, key_part->field);
  4816. if (DATA_BLOB == col_type
  4817. || (key_part->length < field->pack_length()
  4818. && field->type() != MYSQL_TYPE_VARCHAR)
  4819. || (field->type() == MYSQL_TYPE_VARCHAR
  4820. && key_part->length < field->pack_length()
  4821. - ((Field_varstring*)field)->length_bytes)) {
  4822. prefix_len = key_part->length;
  4823. if (col_type == DATA_INT
  4824. || col_type == DATA_FLOAT
  4825. || col_type == DATA_DOUBLE
  4826. || col_type == DATA_DECIMAL) {
  4827. sql_print_error(
  4828. "MySQL is trying to create a column "
  4829. "prefix index field, on an "
  4830. "inappropriate data type. Table "
  4831. "name %s, column name %s.",
  4832. table_name,
  4833. key_part->field->field_name);
  4834. prefix_len = 0;
  4835. }
  4836. } else {
  4837. prefix_len = 0;
  4838. }
  4839. field_lengths[i] = key_part->length;
  4840. dict_mem_index_add_field(index,
  4841. (char*) key_part->field->field_name, prefix_len);
  4842. }
  4843. /* Even though we've defined max_supported_key_part_length, we
  4844. still do our own checking using field_lengths to be absolutely
  4845. sure we don't create too long indexes. */
  4846. error = row_create_index_for_mysql(index, trx, field_lengths);
  4847. error = convert_error_code_to_mysql(error, flags, NULL);
  4848. my_free(field_lengths, MYF(0));
  4849. DBUG_RETURN(error);
  4850. }
  4851. /*****************************************************************//**
  4852. Creates an index to an InnoDB table when the user has defined no
  4853. primary index. */
  4854. static
  4855. int
  4856. create_clustered_index_when_no_primary(
  4857. /*===================================*/
  4858. trx_t* trx, /*!< in: InnoDB transaction handle */
  4859. ulint flags, /*!< in: InnoDB table flags */
  4860. const char* table_name) /*!< in: table name */
  4861. {
  4862. dict_index_t* index;
  4863. int error;
  4864. /* We pass 0 as the space id, and determine at a lower level the space
  4865. id where to store the table */
  4866. index = dict_mem_index_create(table_name,
  4867. innobase_index_reserve_name,
  4868. 0, DICT_CLUSTERED, 0);
  4869. error = row_create_index_for_mysql(index, trx, NULL);
  4870. error = convert_error_code_to_mysql(error, flags, NULL);
  4871. return(error);
  4872. }
  4873. /*****************************************************************//**
  4874. Validates the create options. We may build on this function
  4875. in future. For now, it checks two specifiers:
  4876. KEY_BLOCK_SIZE and ROW_FORMAT
  4877. If innodb_strict_mode is not set then this function is a no-op
  4878. @return TRUE if valid. */
  4879. static
  4880. ibool
  4881. create_options_are_valid(
  4882. /*=====================*/
  4883. THD* thd, /*!< in: connection thread. */
  4884. TABLE* form, /*!< in: information on table
  4885. columns and indexes */
  4886. HA_CREATE_INFO* create_info) /*!< in: create info. */
  4887. {
  4888. ibool kbs_specified = FALSE;
  4889. ibool ret = TRUE;
  4890. ut_ad(thd != NULL);
  4891. /* If innodb_strict_mode is not set don't do any validation. */
  4892. if (!(THDVAR(thd, strict_mode))) {
  4893. return(TRUE);
  4894. }
  4895. ut_ad(form != NULL);
  4896. ut_ad(create_info != NULL);
  4897. /* First check if KEY_BLOCK_SIZE was specified. */
  4898. if (create_info->key_block_size
  4899. || (create_info->used_fields & HA_CREATE_USED_KEY_BLOCK_SIZE)) {
  4900. kbs_specified = TRUE;
  4901. switch (create_info->key_block_size) {
  4902. case 1:
  4903. case 2:
  4904. case 4:
  4905. case 8:
  4906. case 16:
  4907. /* Valid value. */
  4908. break;
  4909. default:
  4910. push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
  4911. ER_ILLEGAL_HA_CREATE_OPTION,
  4912. "InnoDB: invalid"
  4913. " KEY_BLOCK_SIZE = %lu."
  4914. " Valid values are"
  4915. " [1, 2, 4, 8, 16]",
  4916. create_info->key_block_size);
  4917. ret = FALSE;
  4918. }
  4919. }
  4920. /* If KEY_BLOCK_SIZE was specified, check for its
  4921. dependencies. */
  4922. if (kbs_specified && !srv_file_per_table) {
  4923. push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
  4924. ER_ILLEGAL_HA_CREATE_OPTION,
  4925. "InnoDB: KEY_BLOCK_SIZE"
  4926. " requires innodb_file_per_table.");
  4927. ret = FALSE;
  4928. }
  4929. if (kbs_specified && srv_file_format < DICT_TF_FORMAT_ZIP) {
  4930. push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
  4931. ER_ILLEGAL_HA_CREATE_OPTION,
  4932. "InnoDB: KEY_BLOCK_SIZE"
  4933. " requires innodb_file_format >"
  4934. " Antelope.");
  4935. ret = FALSE;
  4936. }
  4937. /* Now check for ROW_FORMAT specifier. */
  4938. if (create_info->used_fields & HA_CREATE_USED_ROW_FORMAT) {
  4939. switch (form->s->row_type) {
  4940. const char* row_format_name;
  4941. case ROW_TYPE_COMPRESSED:
  4942. case ROW_TYPE_DYNAMIC:
  4943. row_format_name
  4944. = form->s->row_type == ROW_TYPE_COMPRESSED
  4945. ? "COMPRESSED"
  4946. : "DYNAMIC";
  4947. /* These two ROW_FORMATs require
  4948. srv_file_per_table and srv_file_format */
  4949. if (!srv_file_per_table) {
  4950. push_warning_printf(
  4951. thd,
  4952. MYSQL_ERROR::WARN_LEVEL_WARN,
  4953. ER_ILLEGAL_HA_CREATE_OPTION,
  4954. "InnoDB: ROW_FORMAT=%s"
  4955. " requires innodb_file_per_table.",
  4956. row_format_name);
  4957. ret = FALSE;
  4958. }
  4959. if (srv_file_format < DICT_TF_FORMAT_ZIP) {
  4960. push_warning_printf(
  4961. thd,
  4962. MYSQL_ERROR::WARN_LEVEL_WARN,
  4963. ER_ILLEGAL_HA_CREATE_OPTION,
  4964. "InnoDB: ROW_FORMAT=%s"
  4965. " requires innodb_file_format >"
  4966. " Antelope.",
  4967. row_format_name);
  4968. ret = FALSE;
  4969. }
  4970. /* Cannot specify KEY_BLOCK_SIZE with
  4971. ROW_FORMAT = DYNAMIC.
  4972. However, we do allow COMPRESSED to be
  4973. specified with KEY_BLOCK_SIZE. */
  4974. if (kbs_specified
  4975. && form->s->row_type == ROW_TYPE_DYNAMIC) {
  4976. push_warning_printf(
  4977. thd,
  4978. MYSQL_ERROR::WARN_LEVEL_WARN,
  4979. ER_ILLEGAL_HA_CREATE_OPTION,
  4980. "InnoDB: cannot specify"
  4981. " ROW_FORMAT = DYNAMIC with"
  4982. " KEY_BLOCK_SIZE.");
  4983. ret = FALSE;
  4984. }
  4985. break;
  4986. case ROW_TYPE_REDUNDANT:
  4987. case ROW_TYPE_COMPACT:
  4988. case ROW_TYPE_DEFAULT:
  4989. /* Default is COMPACT. */
  4990. row_format_name
  4991. = form->s->row_type == ROW_TYPE_REDUNDANT
  4992. ? "REDUNDANT"
  4993. : "COMPACT";
  4994. /* Cannot specify KEY_BLOCK_SIZE with these
  4995. format specifiers. */
  4996. if (kbs_specified) {
  4997. push_warning_printf(
  4998. thd,
  4999. MYSQL_ERROR::WARN_LEVEL_WARN,
  5000. ER_ILLEGAL_HA_CREATE_OPTION,
  5001. "InnoDB: cannot specify"
  5002. " ROW_FORMAT = %s with"
  5003. " KEY_BLOCK_SIZE.",
  5004. row_format_name);
  5005. ret = FALSE;
  5006. }
  5007. break;
  5008. default:
  5009. push_warning(thd,
  5010. MYSQL_ERROR::WARN_LEVEL_WARN,
  5011. ER_ILLEGAL_HA_CREATE_OPTION,
  5012. "InnoDB: invalid ROW_FORMAT specifier.");
  5013. ret = FALSE;
  5014. }
  5015. }
  5016. return(ret);
  5017. }
  5018. /*****************************************************************//**
  5019. Update create_info. Used in SHOW CREATE TABLE et al. */
  5020. UNIV_INTERN
  5021. void
  5022. ha_innobase::update_create_info(
  5023. /*============================*/
  5024. HA_CREATE_INFO* create_info) /*!< in/out: create info */
  5025. {
  5026. if (!(create_info->used_fields & HA_CREATE_USED_AUTO)) {
  5027. ha_innobase::info(HA_STATUS_AUTO);
  5028. create_info->auto_increment_value = stats.auto_increment_value;
  5029. }
  5030. }
  5031. /*****************************************************************//**
  5032. Creates a new table to an InnoDB database.
  5033. @return error number */
  5034. UNIV_INTERN
  5035. int
  5036. ha_innobase::create(
  5037. /*================*/
  5038. const char* name, /*!< in: table name */
  5039. TABLE* form, /*!< in: information on table
  5040. columns and indexes */
  5041. HA_CREATE_INFO* create_info) /*!< in: more information of the
  5042. created table, contains also the
  5043. create statement string */
  5044. {
  5045. int error;
  5046. dict_table_t* innobase_table;
  5047. trx_t* parent_trx;
  5048. trx_t* trx;
  5049. int primary_key_no;
  5050. uint i;
  5051. char name2[FN_REFLEN];
  5052. char norm_name[FN_REFLEN];
  5053. THD* thd = ha_thd();
  5054. ib_int64_t auto_inc_value;
  5055. ulint flags;
  5056. /* Cache the value of innodb_file_format, in case it is
  5057. modified by another thread while the table is being created. */
  5058. const ulint file_format = srv_file_format;
  5059. DBUG_ENTER("ha_innobase::create");
  5060. DBUG_ASSERT(thd != NULL);
  5061. DBUG_ASSERT(create_info != NULL);
  5062. #ifdef __WIN__
  5063. /* Names passed in from server are in two formats:
  5064. 1. <database_name>/<table_name>: for normal table creation
  5065. 2. full path: for temp table creation, or sym link
  5066. When srv_file_per_table is on and mysqld_embedded is off,
  5067. check for full path pattern, i.e.
  5068. X:\dir\..., X is a driver letter, or
  5069. \\dir1\dir2\..., UNC path
  5070. returns error if it is in full path format, but not creating a temp.
  5071. table. Currently InnoDB does not support symbolic link on Windows. */
  5072. if (srv_file_per_table
  5073. && !mysqld_embedded
  5074. && (!create_info->options & HA_LEX_CREATE_TMP_TABLE)) {
  5075. if ((name[1] == ':')
  5076. || (name[0] == '\\' && name[1] == '\\')) {
  5077. sql_print_error("Cannot create table %s\n", name);
  5078. DBUG_RETURN(HA_ERR_GENERIC);
  5079. }
  5080. }
  5081. #endif
  5082. if (form->s->fields > 1000) {
  5083. /* The limit probably should be REC_MAX_N_FIELDS - 3 = 1020,
  5084. but we play safe here */
  5085. DBUG_RETURN(HA_ERR_TO_BIG_ROW);
  5086. }
  5087. /* Get the transaction associated with the current thd, or create one
  5088. if not yet created */
  5089. parent_trx = check_trx_exists(thd);
  5090. /* In case MySQL calls this in the middle of a SELECT query, release
  5091. possible adaptive hash latch to avoid deadlocks of threads */
  5092. trx_search_latch_release_if_reserved(parent_trx);
  5093. trx = innobase_trx_allocate(thd);
  5094. if (lower_case_table_names) {
  5095. srv_lower_case_table_names = TRUE;
  5096. } else {
  5097. srv_lower_case_table_names = FALSE;
  5098. }
  5099. strcpy(name2, name);
  5100. normalize_table_name(norm_name, name2);
  5101. /* Latch the InnoDB data dictionary exclusively so that no deadlocks
  5102. or lock waits can happen in it during a table create operation.
  5103. Drop table etc. do this latching in row0mysql.c. */
  5104. row_mysql_lock_data_dictionary(trx);
  5105. /* Create the table definition in InnoDB */
  5106. flags = 0;
  5107. /* Validate create options if innodb_strict_mode is set. */
  5108. if (!create_options_are_valid(thd, form, create_info)) {
  5109. error = ER_ILLEGAL_HA_CREATE_OPTION;
  5110. goto cleanup;
  5111. }
  5112. if (create_info->key_block_size
  5113. || (create_info->used_fields & HA_CREATE_USED_KEY_BLOCK_SIZE)) {
  5114. /* Determine the page_zip.ssize corresponding to the
  5115. requested page size (key_block_size) in kilobytes. */
  5116. ulint ssize, ksize;
  5117. ulint key_block_size = create_info->key_block_size;
  5118. for (ssize = ksize = 1; ssize <= DICT_TF_ZSSIZE_MAX;
  5119. ssize++, ksize <<= 1) {
  5120. if (key_block_size == ksize) {
  5121. flags = ssize << DICT_TF_ZSSIZE_SHIFT
  5122. | DICT_TF_COMPACT
  5123. | DICT_TF_FORMAT_ZIP
  5124. << DICT_TF_FORMAT_SHIFT;
  5125. break;
  5126. }
  5127. }
  5128. if (!srv_file_per_table) {
  5129. push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
  5130. ER_ILLEGAL_HA_CREATE_OPTION,
  5131. "InnoDB: KEY_BLOCK_SIZE"
  5132. " requires innodb_file_per_table.");
  5133. flags = 0;
  5134. }
  5135. if (file_format < DICT_TF_FORMAT_ZIP) {
  5136. push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
  5137. ER_ILLEGAL_HA_CREATE_OPTION,
  5138. "InnoDB: KEY_BLOCK_SIZE"
  5139. " requires innodb_file_format >"
  5140. " Antelope.");
  5141. flags = 0;
  5142. }
  5143. if (!flags) {
  5144. push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
  5145. ER_ILLEGAL_HA_CREATE_OPTION,
  5146. "InnoDB: ignoring"
  5147. " KEY_BLOCK_SIZE=%lu.",
  5148. create_info->key_block_size);
  5149. }
  5150. }
  5151. if (create_info->used_fields & HA_CREATE_USED_ROW_FORMAT) {
  5152. if (flags) {
  5153. /* KEY_BLOCK_SIZE was specified. */
  5154. if (form->s->row_type != ROW_TYPE_COMPRESSED) {
  5155. /* ROW_FORMAT other than COMPRESSED
  5156. ignores KEY_BLOCK_SIZE. It does not
  5157. make sense to reject conflicting
  5158. KEY_BLOCK_SIZE and ROW_FORMAT, because
  5159. such combinations can be obtained
  5160. with ALTER TABLE anyway. */
  5161. push_warning_printf(
  5162. thd,
  5163. MYSQL_ERROR::WARN_LEVEL_WARN,
  5164. ER_ILLEGAL_HA_CREATE_OPTION,
  5165. "InnoDB: ignoring KEY_BLOCK_SIZE=%lu"
  5166. " unless ROW_FORMAT=COMPRESSED.",
  5167. create_info->key_block_size);
  5168. flags = 0;
  5169. }
  5170. } else {
  5171. /* No KEY_BLOCK_SIZE */
  5172. if (form->s->row_type == ROW_TYPE_COMPRESSED) {
  5173. /* ROW_FORMAT=COMPRESSED without
  5174. KEY_BLOCK_SIZE implies half the
  5175. maximum KEY_BLOCK_SIZE. */
  5176. flags = (DICT_TF_ZSSIZE_MAX - 1)
  5177. << DICT_TF_ZSSIZE_SHIFT
  5178. | DICT_TF_COMPACT
  5179. | DICT_TF_FORMAT_ZIP
  5180. << DICT_TF_FORMAT_SHIFT;
  5181. #if DICT_TF_ZSSIZE_MAX < 1
  5182. # error "DICT_TF_ZSSIZE_MAX < 1"
  5183. #endif
  5184. }
  5185. }
  5186. switch (form->s->row_type) {
  5187. const char* row_format_name;
  5188. case ROW_TYPE_REDUNDANT:
  5189. break;
  5190. case ROW_TYPE_COMPRESSED:
  5191. case ROW_TYPE_DYNAMIC:
  5192. row_format_name
  5193. = form->s->row_type == ROW_TYPE_COMPRESSED
  5194. ? "COMPRESSED"
  5195. : "DYNAMIC";
  5196. if (!srv_file_per_table) {
  5197. push_warning_printf(
  5198. thd,
  5199. MYSQL_ERROR::WARN_LEVEL_WARN,
  5200. ER_ILLEGAL_HA_CREATE_OPTION,
  5201. "InnoDB: ROW_FORMAT=%s"
  5202. " requires innodb_file_per_table.",
  5203. row_format_name);
  5204. } else if (file_format < DICT_TF_FORMAT_ZIP) {
  5205. push_warning_printf(
  5206. thd,
  5207. MYSQL_ERROR::WARN_LEVEL_WARN,
  5208. ER_ILLEGAL_HA_CREATE_OPTION,
  5209. "InnoDB: ROW_FORMAT=%s"
  5210. " requires innodb_file_format >"
  5211. " Antelope.",
  5212. row_format_name);
  5213. } else {
  5214. flags |= DICT_TF_COMPACT
  5215. | (DICT_TF_FORMAT_ZIP
  5216. << DICT_TF_FORMAT_SHIFT);
  5217. break;
  5218. }
  5219. /* fall through */
  5220. case ROW_TYPE_NOT_USED:
  5221. case ROW_TYPE_FIXED:
  5222. default:
  5223. push_warning(thd,
  5224. MYSQL_ERROR::WARN_LEVEL_WARN,
  5225. ER_ILLEGAL_HA_CREATE_OPTION,
  5226. "InnoDB: assuming ROW_FORMAT=COMPACT.");
  5227. case ROW_TYPE_DEFAULT:
  5228. case ROW_TYPE_COMPACT:
  5229. flags = DICT_TF_COMPACT;
  5230. break;
  5231. }
  5232. } else if (!flags) {
  5233. /* No KEY_BLOCK_SIZE or ROW_FORMAT specified:
  5234. use ROW_FORMAT=COMPACT by default. */
  5235. flags = DICT_TF_COMPACT;
  5236. }
  5237. /* Look for a primary key */
  5238. primary_key_no= (form->s->primary_key != MAX_KEY ?
  5239. (int) form->s->primary_key :
  5240. -1);
  5241. /* Our function row_get_mysql_key_number_for_index assumes
  5242. the primary key is always number 0, if it exists */
  5243. ut_a(primary_key_no == -1 || primary_key_no == 0);
  5244. /* Check for name conflicts (with reserved name) for
  5245. any user indices to be created. */
  5246. if (innobase_index_name_is_reserved(trx, form->key_info,
  5247. form->s->keys)) {
  5248. error = -1;
  5249. goto cleanup;
  5250. }
  5251. error = create_table_def(trx, form, norm_name,
  5252. create_info->options & HA_LEX_CREATE_TMP_TABLE ? name2 : NULL,
  5253. flags);
  5254. if (error) {
  5255. goto cleanup;
  5256. }
  5257. /* Create the keys */
  5258. if (form->s->keys == 0 || primary_key_no == -1) {
  5259. /* Create an index which is used as the clustered index;
  5260. order the rows by their row id which is internally generated
  5261. by InnoDB */
  5262. error = create_clustered_index_when_no_primary(
  5263. trx, flags, norm_name);
  5264. if (error) {
  5265. goto cleanup;
  5266. }
  5267. }
  5268. if (primary_key_no != -1) {
  5269. /* In InnoDB the clustered index must always be created
  5270. first */
  5271. if ((error = create_index(trx, form, flags, norm_name,
  5272. (uint) primary_key_no))) {
  5273. goto cleanup;
  5274. }
  5275. }
  5276. for (i = 0; i < form->s->keys; i++) {
  5277. if (i != (uint) primary_key_no) {
  5278. if ((error = create_index(trx, form, flags, norm_name,
  5279. i))) {
  5280. goto cleanup;
  5281. }
  5282. }
  5283. }
  5284. if (*trx->mysql_query_str) {
  5285. error = row_table_add_foreign_constraints(trx,
  5286. *trx->mysql_query_str, norm_name,
  5287. create_info->options & HA_LEX_CREATE_TMP_TABLE);
  5288. error = convert_error_code_to_mysql(error, flags, NULL);
  5289. if (error) {
  5290. goto cleanup;
  5291. }
  5292. }
  5293. innobase_commit_low(trx);
  5294. row_mysql_unlock_data_dictionary(trx);
  5295. /* Flush the log to reduce probability that the .frm files and
  5296. the InnoDB data dictionary get out-of-sync if the user runs
  5297. with innodb_flush_log_at_trx_commit = 0 */
  5298. log_buffer_flush_to_disk();
  5299. innobase_table = dict_table_get(norm_name, FALSE);
  5300. DBUG_ASSERT(innobase_table != 0);
  5301. if (innobase_table) {
  5302. /* We update the highest file format in the system table
  5303. space, if this table has higher file format setting. */
  5304. trx_sys_file_format_max_upgrade(
  5305. (const char**) &innobase_file_format_check,
  5306. dict_table_get_format(innobase_table));
  5307. }
  5308. /* Note: We can't call update_thd() as prebuilt will not be
  5309. setup at this stage and so we use thd. */
  5310. /* We need to copy the AUTOINC value from the old table if
  5311. this is an ALTER TABLE or CREATE INDEX because CREATE INDEX
  5312. does a table copy too. */
  5313. if (((create_info->used_fields & HA_CREATE_USED_AUTO)
  5314. || thd_sql_command(thd) == SQLCOM_ALTER_TABLE
  5315. || thd_sql_command(thd) == SQLCOM_CREATE_INDEX)
  5316. && create_info->auto_increment_value > 0) {
  5317. /* Query was one of :
  5318. CREATE TABLE ...AUTO_INCREMENT = x; or
  5319. ALTER TABLE...AUTO_INCREMENT = x; or
  5320. CREATE INDEX x on t(...);
  5321. Find out a table definition from the dictionary and get
  5322. the current value of the auto increment field. Set a new
  5323. value to the auto increment field if the value is greater
  5324. than the maximum value in the column. */
  5325. auto_inc_value = create_info->auto_increment_value;
  5326. dict_table_autoinc_lock(innobase_table);
  5327. dict_table_autoinc_initialize(innobase_table, auto_inc_value);
  5328. dict_table_autoinc_unlock(innobase_table);
  5329. }
  5330. /* Tell the InnoDB server that there might be work for
  5331. utility threads: */
  5332. srv_active_wake_master_thread();
  5333. trx_free_for_mysql(trx);
  5334. DBUG_RETURN(0);
  5335. cleanup:
  5336. innobase_commit_low(trx);
  5337. row_mysql_unlock_data_dictionary(trx);
  5338. trx_free_for_mysql(trx);
  5339. DBUG_RETURN(error);
  5340. }
  5341. /*****************************************************************//**
  5342. Discards or imports an InnoDB tablespace.
  5343. @return 0 == success, -1 == error */
  5344. UNIV_INTERN
  5345. int
  5346. ha_innobase::discard_or_import_tablespace(
  5347. /*======================================*/
  5348. my_bool discard) /*!< in: TRUE if discard, else import */
  5349. {
  5350. dict_table_t* dict_table;
  5351. trx_t* trx;
  5352. int err;
  5353. DBUG_ENTER("ha_innobase::discard_or_import_tablespace");
  5354. ut_a(prebuilt->trx);
  5355. ut_a(prebuilt->trx->magic_n == TRX_MAGIC_N);
  5356. ut_a(prebuilt->trx == thd_to_trx(ha_thd()));
  5357. dict_table = prebuilt->table;
  5358. trx = prebuilt->trx;
  5359. if (discard) {
  5360. err = row_discard_tablespace_for_mysql(dict_table->name, trx);
  5361. } else {
  5362. err = row_import_tablespace_for_mysql(dict_table->name, trx);
  5363. }
  5364. err = convert_error_code_to_mysql(err, dict_table->flags, NULL);
  5365. DBUG_RETURN(err);
  5366. }
  5367. /*****************************************************************//**
  5368. Deletes all rows of an InnoDB table.
  5369. @return error number */
  5370. UNIV_INTERN
  5371. int
  5372. ha_innobase::delete_all_rows(void)
  5373. /*==============================*/
  5374. {
  5375. int error;
  5376. DBUG_ENTER("ha_innobase::delete_all_rows");
  5377. /* Get the transaction associated with the current thd, or create one
  5378. if not yet created, and update prebuilt->trx */
  5379. update_thd(ha_thd());
  5380. if (thd_sql_command(user_thd) != SQLCOM_TRUNCATE) {
  5381. fallback:
  5382. /* We only handle TRUNCATE TABLE t as a special case.
  5383. DELETE FROM t will have to use ha_innobase::delete_row(),
  5384. because DELETE is transactional while TRUNCATE is not. */
  5385. DBUG_RETURN(my_errno=HA_ERR_WRONG_COMMAND);
  5386. }
  5387. /* Truncate the table in InnoDB */
  5388. error = row_truncate_table_for_mysql(prebuilt->table, prebuilt->trx);
  5389. if (error == DB_ERROR) {
  5390. /* Cannot truncate; resort to ha_innobase::delete_row() */
  5391. goto fallback;
  5392. }
  5393. error = convert_error_code_to_mysql(error, prebuilt->table->flags,
  5394. NULL);
  5395. DBUG_RETURN(error);
  5396. }
  5397. /*****************************************************************//**
  5398. Drops a table from an InnoDB database. Before calling this function,
  5399. MySQL calls innobase_commit to commit the transaction of the current user.
  5400. Then the current user cannot have locks set on the table. Drop table
  5401. operation inside InnoDB will remove all locks any user has on the table
  5402. inside InnoDB.
  5403. @return error number */
  5404. UNIV_INTERN
  5405. int
  5406. ha_innobase::delete_table(
  5407. /*======================*/
  5408. const char* name) /*!< in: table name */
  5409. {
  5410. ulint name_len;
  5411. int error;
  5412. trx_t* parent_trx;
  5413. trx_t* trx;
  5414. THD *thd = ha_thd();
  5415. char norm_name[1000];
  5416. DBUG_ENTER("ha_innobase::delete_table");
  5417. /* Strangely, MySQL passes the table name without the '.frm'
  5418. extension, in contrast to ::create */
  5419. normalize_table_name(norm_name, name);
  5420. if (IS_MAGIC_TABLE_AND_USER_DENIED_ACCESS(norm_name, thd)) {
  5421. DBUG_RETURN(HA_ERR_GENERIC);
  5422. }
  5423. /* Get the transaction associated with the current thd, or create one
  5424. if not yet created */
  5425. parent_trx = check_trx_exists(thd);
  5426. /* In case MySQL calls this in the middle of a SELECT query, release
  5427. possible adaptive hash latch to avoid deadlocks of threads */
  5428. trx_search_latch_release_if_reserved(parent_trx);
  5429. trx = innobase_trx_allocate(thd);
  5430. if (lower_case_table_names) {
  5431. srv_lower_case_table_names = TRUE;
  5432. } else {
  5433. srv_lower_case_table_names = FALSE;
  5434. }
  5435. name_len = strlen(name);
  5436. ut_a(name_len < 1000);
  5437. /* Drop the table in InnoDB */
  5438. error = row_drop_table_for_mysql(norm_name, trx,
  5439. thd_sql_command(thd)
  5440. == SQLCOM_DROP_DB);
  5441. /* Flush the log to reduce probability that the .frm files and
  5442. the InnoDB data dictionary get out-of-sync if the user runs
  5443. with innodb_flush_log_at_trx_commit = 0 */
  5444. log_buffer_flush_to_disk();
  5445. /* Tell the InnoDB server that there might be work for
  5446. utility threads: */
  5447. srv_active_wake_master_thread();
  5448. innobase_commit_low(trx);
  5449. trx_free_for_mysql(trx);
  5450. error = convert_error_code_to_mysql(error, 0, NULL);
  5451. DBUG_RETURN(error);
  5452. }
  5453. /*****************************************************************//**
  5454. Removes all tables in the named database inside InnoDB. */
  5455. static
  5456. void
  5457. innobase_drop_database(
  5458. /*===================*/
  5459. handlerton *hton, /*!< in: handlerton of Innodb */
  5460. char* path) /*!< in: database path; inside InnoDB the name
  5461. of the last directory in the path is used as
  5462. the database name: for example, in 'mysql/data/test'
  5463. the database name is 'test' */
  5464. {
  5465. ulint len = 0;
  5466. trx_t* trx;
  5467. char* ptr;
  5468. int error;
  5469. char* namebuf;
  5470. THD* thd = current_thd;
  5471. /* Get the transaction associated with the current thd, or create one
  5472. if not yet created */
  5473. DBUG_ASSERT(hton == innodb_hton_ptr);
  5474. /* In the Windows plugin, thd = current_thd is always NULL */
  5475. if (thd) {
  5476. trx_t* parent_trx = check_trx_exists(thd);
  5477. /* In case MySQL calls this in the middle of a SELECT
  5478. query, release possible adaptive hash latch to avoid
  5479. deadlocks of threads */
  5480. trx_search_latch_release_if_reserved(parent_trx);
  5481. }
  5482. ptr = strend(path) - 2;
  5483. while (ptr >= path && *ptr != '\\' && *ptr != '/') {
  5484. ptr--;
  5485. len++;
  5486. }
  5487. ptr++;
  5488. namebuf = (char*) my_malloc((uint) len + 2, MYF(0));
  5489. memcpy(namebuf, ptr, len);
  5490. namebuf[len] = '/';
  5491. namebuf[len + 1] = '\0';
  5492. #ifdef __WIN__
  5493. innobase_casedn_str(namebuf);
  5494. #endif
  5495. #if defined __WIN__ && !defined MYSQL_SERVER
  5496. /* In the Windows plugin, thd = current_thd is always NULL */
  5497. trx = trx_allocate_for_mysql();
  5498. trx->mysql_thd = NULL;
  5499. trx->mysql_query_str = NULL;
  5500. #else
  5501. trx = innobase_trx_allocate(thd);
  5502. #endif
  5503. error = row_drop_database_for_mysql(namebuf, trx);
  5504. my_free(namebuf, MYF(0));
  5505. /* Flush the log to reduce probability that the .frm files and
  5506. the InnoDB data dictionary get out-of-sync if the user runs
  5507. with innodb_flush_log_at_trx_commit = 0 */
  5508. log_buffer_flush_to_disk();
  5509. /* Tell the InnoDB server that there might be work for
  5510. utility threads: */
  5511. srv_active_wake_master_thread();
  5512. innobase_commit_low(trx);
  5513. trx_free_for_mysql(trx);
  5514. }
  5515. /*********************************************************************//**
  5516. Renames an InnoDB table.
  5517. @return 0 or error code */
  5518. static
  5519. int
  5520. innobase_rename_table(
  5521. /*==================*/
  5522. trx_t* trx, /*!< in: transaction */
  5523. const char* from, /*!< in: old name of the table */
  5524. const char* to, /*!< in: new name of the table */
  5525. ibool lock_and_commit)
  5526. /*!< in: TRUE=lock data dictionary and commit */
  5527. {
  5528. int error;
  5529. char* norm_to;
  5530. char* norm_from;
  5531. if (lower_case_table_names) {
  5532. srv_lower_case_table_names = TRUE;
  5533. } else {
  5534. srv_lower_case_table_names = FALSE;
  5535. }
  5536. // Magic number 64 arbitrary
  5537. norm_to = (char*) my_malloc(strlen(to) + 64, MYF(0));
  5538. norm_from = (char*) my_malloc(strlen(from) + 64, MYF(0));
  5539. normalize_table_name(norm_to, to);
  5540. normalize_table_name(norm_from, from);
  5541. /* Serialize data dictionary operations with dictionary mutex:
  5542. no deadlocks can occur then in these operations */
  5543. if (lock_and_commit) {
  5544. row_mysql_lock_data_dictionary(trx);
  5545. }
  5546. error = row_rename_table_for_mysql(
  5547. norm_from, norm_to, trx, lock_and_commit);
  5548. if (error != DB_SUCCESS) {
  5549. FILE* ef = dict_foreign_err_file;
  5550. fputs("InnoDB: Renaming table ", ef);
  5551. ut_print_name(ef, trx, TRUE, norm_from);
  5552. fputs(" to ", ef);
  5553. ut_print_name(ef, trx, TRUE, norm_to);
  5554. fputs(" failed!\n", ef);
  5555. }
  5556. if (lock_and_commit) {
  5557. row_mysql_unlock_data_dictionary(trx);
  5558. /* Flush the log to reduce probability that the .frm
  5559. files and the InnoDB data dictionary get out-of-sync
  5560. if the user runs with innodb_flush_log_at_trx_commit = 0 */
  5561. log_buffer_flush_to_disk();
  5562. }
  5563. my_free(norm_to, MYF(0));
  5564. my_free(norm_from, MYF(0));
  5565. return error;
  5566. }
  5567. /*********************************************************************//**
  5568. Renames an InnoDB table.
  5569. @return 0 or error code */
  5570. UNIV_INTERN
  5571. int
  5572. ha_innobase::rename_table(
  5573. /*======================*/
  5574. const char* from, /*!< in: old name of the table */
  5575. const char* to) /*!< in: new name of the table */
  5576. {
  5577. trx_t* trx;
  5578. int error;
  5579. trx_t* parent_trx;
  5580. THD* thd = ha_thd();
  5581. DBUG_ENTER("ha_innobase::rename_table");
  5582. /* Get the transaction associated with the current thd, or create one
  5583. if not yet created */
  5584. parent_trx = check_trx_exists(thd);
  5585. /* In case MySQL calls this in the middle of a SELECT query, release
  5586. possible adaptive hash latch to avoid deadlocks of threads */
  5587. trx_search_latch_release_if_reserved(parent_trx);
  5588. trx = innobase_trx_allocate(thd);
  5589. error = innobase_rename_table(trx, from, to, TRUE);
  5590. /* Tell the InnoDB server that there might be work for
  5591. utility threads: */
  5592. srv_active_wake_master_thread();
  5593. innobase_commit_low(trx);
  5594. trx_free_for_mysql(trx);
  5595. error = convert_error_code_to_mysql(error, 0, NULL);
  5596. DBUG_RETURN(error);
  5597. }
  5598. /*********************************************************************//**
  5599. Estimates the number of index records in a range.
  5600. @return estimated number of rows */
  5601. UNIV_INTERN
  5602. ha_rows
  5603. ha_innobase::records_in_range(
  5604. /*==========================*/
  5605. uint keynr, /*!< in: index number */
  5606. key_range *min_key, /*!< in: start key value of the
  5607. range, may also be 0 */
  5608. key_range *max_key) /*!< in: range end key val, may
  5609. also be 0 */
  5610. {
  5611. KEY* key;
  5612. dict_index_t* index;
  5613. uchar* key_val_buff2 = (uchar*) my_malloc(
  5614. table->s->reclength
  5615. + table->s->max_key_length + 100,
  5616. MYF(MY_FAE));
  5617. ulint buff2_len = table->s->reclength
  5618. + table->s->max_key_length + 100;
  5619. dtuple_t* range_start;
  5620. dtuple_t* range_end;
  5621. ib_int64_t n_rows;
  5622. ulint mode1;
  5623. ulint mode2;
  5624. mem_heap_t* heap;
  5625. DBUG_ENTER("records_in_range");
  5626. ut_a(prebuilt->trx == thd_to_trx(ha_thd()));
  5627. prebuilt->trx->op_info = (char*)"estimating records in index range";
  5628. /* In case MySQL calls this in the middle of a SELECT query, release
  5629. possible adaptive hash latch to avoid deadlocks of threads */
  5630. trx_search_latch_release_if_reserved(prebuilt->trx);
  5631. active_index = keynr;
  5632. key = table->key_info + active_index;
  5633. index = dict_table_get_index_on_name(prebuilt->table, key->name);
  5634. /* MySQL knows about this index and so we must be able to find it.*/
  5635. ut_a(index);
  5636. heap = mem_heap_create(2 * (key->key_parts * sizeof(dfield_t)
  5637. + sizeof(dtuple_t)));
  5638. range_start = dtuple_create(heap, key->key_parts);
  5639. dict_index_copy_types(range_start, index, key->key_parts);
  5640. range_end = dtuple_create(heap, key->key_parts);
  5641. dict_index_copy_types(range_end, index, key->key_parts);
  5642. row_sel_convert_mysql_key_to_innobase(
  5643. range_start, (byte*) key_val_buff,
  5644. (ulint)upd_and_key_val_buff_len,
  5645. index,
  5646. (byte*) (min_key ? min_key->key :
  5647. (const uchar*) 0),
  5648. (ulint) (min_key ? min_key->length : 0),
  5649. prebuilt->trx);
  5650. row_sel_convert_mysql_key_to_innobase(
  5651. range_end, (byte*) key_val_buff2,
  5652. buff2_len, index,
  5653. (byte*) (max_key ? max_key->key :
  5654. (const uchar*) 0),
  5655. (ulint) (max_key ? max_key->length : 0),
  5656. prebuilt->trx);
  5657. mode1 = convert_search_mode_to_innobase(min_key ? min_key->flag :
  5658. HA_READ_KEY_EXACT);
  5659. mode2 = convert_search_mode_to_innobase(max_key ? max_key->flag :
  5660. HA_READ_KEY_EXACT);
  5661. if (mode1 != PAGE_CUR_UNSUPP && mode2 != PAGE_CUR_UNSUPP) {
  5662. n_rows = btr_estimate_n_rows_in_range(index, range_start,
  5663. mode1, range_end,
  5664. mode2);
  5665. } else {
  5666. n_rows = HA_POS_ERROR;
  5667. }
  5668. mem_heap_free(heap);
  5669. my_free(key_val_buff2, MYF(0));
  5670. prebuilt->trx->op_info = (char*)"";
  5671. /* The MySQL optimizer seems to believe an estimate of 0 rows is
  5672. always accurate and may return the result 'Empty set' based on that.
  5673. The accuracy is not guaranteed, and even if it were, for a locking
  5674. read we should anyway perform the search to set the next-key lock.
  5675. Add 1 to the value to make sure MySQL does not make the assumption! */
  5676. if (n_rows == 0) {
  5677. n_rows = 1;
  5678. }
  5679. DBUG_RETURN((ha_rows) n_rows);
  5680. }
  5681. /*********************************************************************//**
  5682. Gives an UPPER BOUND to the number of rows in a table. This is used in
  5683. filesort.cc.
  5684. @return upper bound of rows */
  5685. UNIV_INTERN
  5686. ha_rows
  5687. ha_innobase::estimate_rows_upper_bound(void)
  5688. /*======================================*/
  5689. {
  5690. dict_index_t* index;
  5691. ulonglong estimate;
  5692. ulonglong local_data_file_length;
  5693. DBUG_ENTER("estimate_rows_upper_bound");
  5694. /* We do not know if MySQL can call this function before calling
  5695. external_lock(). To be safe, update the thd of the current table
  5696. handle. */
  5697. update_thd(ha_thd());
  5698. prebuilt->trx->op_info = (char*)
  5699. "calculating upper bound for table rows";
  5700. /* In case MySQL calls this in the middle of a SELECT query, release
  5701. possible adaptive hash latch to avoid deadlocks of threads */
  5702. trx_search_latch_release_if_reserved(prebuilt->trx);
  5703. index = dict_table_get_first_index(prebuilt->table);
  5704. ut_a(index->stat_n_leaf_pages > 0);
  5705. local_data_file_length =
  5706. ((ulonglong) index->stat_n_leaf_pages) * UNIV_PAGE_SIZE;
  5707. /* Calculate a minimum length for a clustered index record and from
  5708. that an upper bound for the number of rows. Since we only calculate
  5709. new statistics in row0mysql.c when a table has grown by a threshold
  5710. factor, we must add a safety factor 2 in front of the formula below. */
  5711. estimate = 2 * local_data_file_length /
  5712. dict_index_calc_min_rec_len(index);
  5713. prebuilt->trx->op_info = (char*)"";
  5714. DBUG_RETURN((ha_rows) estimate);
  5715. }
  5716. /*********************************************************************//**
  5717. How many seeks it will take to read through the table. This is to be
  5718. comparable to the number returned by records_in_range so that we can
  5719. decide if we should scan the table or use keys.
  5720. @return estimated time measured in disk seeks */
  5721. UNIV_INTERN
  5722. double
  5723. ha_innobase::scan_time()
  5724. /*====================*/
  5725. {
  5726. /* Since MySQL seems to favor table scans too much over index
  5727. searches, we pretend that a sequential read takes the same time
  5728. as a random disk read, that is, we do not divide the following
  5729. by 10, which would be physically realistic. */
  5730. return((double) (prebuilt->table->stat_clustered_index_size));
  5731. }
  5732. /******************************************************************//**
  5733. Calculate the time it takes to read a set of ranges through an index
  5734. This enables us to optimise reads for clustered indexes.
  5735. @return estimated time measured in disk seeks */
  5736. UNIV_INTERN
  5737. double
  5738. ha_innobase::read_time(
  5739. /*===================*/
  5740. uint index, /*!< in: key number */
  5741. uint ranges, /*!< in: how many ranges */
  5742. ha_rows rows) /*!< in: estimated number of rows in the ranges */
  5743. {
  5744. ha_rows total_rows;
  5745. double time_for_scan;
  5746. if (index != table->s->primary_key) {
  5747. /* Not clustered */
  5748. return(handler::read_time(index, ranges, rows));
  5749. }
  5750. if (rows <= 2) {
  5751. return((double) rows);
  5752. }
  5753. /* Assume that the read time is proportional to the scan time for all
  5754. rows + at most one seek per range. */
  5755. time_for_scan = scan_time();
  5756. if ((total_rows = estimate_rows_upper_bound()) < rows) {
  5757. return(time_for_scan);
  5758. }
  5759. return(ranges + (double) rows / (double) total_rows * time_for_scan);
  5760. }
  5761. /*********************************************************************//**
  5762. Returns statistics information of the table to the MySQL interpreter,
  5763. in various fields of the handle object. */
  5764. UNIV_INTERN
  5765. int
  5766. ha_innobase::info(
  5767. /*==============*/
  5768. uint flag) /*!< in: what information MySQL requests */
  5769. {
  5770. dict_table_t* ib_table;
  5771. dict_index_t* index;
  5772. ha_rows rec_per_key;
  5773. ib_int64_t n_rows;
  5774. ulong j;
  5775. ulong i;
  5776. char path[FN_REFLEN];
  5777. os_file_stat_t stat_info;
  5778. DBUG_ENTER("info");
  5779. /* If we are forcing recovery at a high level, we will suppress
  5780. statistics calculation on tables, because that may crash the
  5781. server if an index is badly corrupted. */
  5782. if (srv_force_recovery >= SRV_FORCE_NO_IBUF_MERGE) {
  5783. /* We return success (0) instead of HA_ERR_CRASHED,
  5784. because we want MySQL to process this query and not
  5785. stop, like it would do if it received the error code
  5786. HA_ERR_CRASHED. */
  5787. DBUG_RETURN(0);
  5788. }
  5789. /* We do not know if MySQL can call this function before calling
  5790. external_lock(). To be safe, update the thd of the current table
  5791. handle. */
  5792. update_thd(ha_thd());
  5793. /* In case MySQL calls this in the middle of a SELECT query, release
  5794. possible adaptive hash latch to avoid deadlocks of threads */
  5795. prebuilt->trx->op_info = (char*)"returning various info to MySQL";
  5796. trx_search_latch_release_if_reserved(prebuilt->trx);
  5797. ib_table = prebuilt->table;
  5798. if (flag & HA_STATUS_TIME) {
  5799. if (innobase_stats_on_metadata) {
  5800. /* In sql_show we call with this flag: update
  5801. then statistics so that they are up-to-date */
  5802. prebuilt->trx->op_info = "updating table statistics";
  5803. dict_update_statistics(ib_table);
  5804. prebuilt->trx->op_info = "returning various info to MySQL";
  5805. }
  5806. my_snprintf(path, sizeof(path), "%s/%s%s",
  5807. mysql_data_home, ib_table->name, reg_ext);
  5808. unpack_filename(path,path);
  5809. /* Note that we do not know the access time of the table,
  5810. nor the CHECK TABLE time, nor the UPDATE or INSERT time. */
  5811. if (os_file_get_status(path,&stat_info)) {
  5812. stats.create_time = (ulong) stat_info.ctime;
  5813. }
  5814. }
  5815. if (flag & HA_STATUS_VARIABLE) {
  5816. n_rows = ib_table->stat_n_rows;
  5817. /* Because we do not protect stat_n_rows by any mutex in a
  5818. delete, it is theoretically possible that the value can be
  5819. smaller than zero! TODO: fix this race.
  5820. The MySQL optimizer seems to assume in a left join that n_rows
  5821. is an accurate estimate if it is zero. Of course, it is not,
  5822. since we do not have any locks on the rows yet at this phase.
  5823. Since SHOW TABLE STATUS seems to call this function with the
  5824. HA_STATUS_TIME flag set, while the left join optimizer does not
  5825. set that flag, we add one to a zero value if the flag is not
  5826. set. That way SHOW TABLE STATUS will show the best estimate,
  5827. while the optimizer never sees the table empty. */
  5828. if (n_rows < 0) {
  5829. n_rows = 0;
  5830. }
  5831. if (n_rows == 0 && !(flag & HA_STATUS_TIME)) {
  5832. n_rows++;
  5833. }
  5834. /* Fix bug#40386: Not flushing query cache after truncate.
  5835. n_rows can not be 0 unless the table is empty, set to 1
  5836. instead. The original problem of bug#29507 is actually
  5837. fixed in the server code. */
  5838. if (thd_sql_command(user_thd) == SQLCOM_TRUNCATE) {
  5839. n_rows = 1;
  5840. /* We need to reset the prebuilt value too, otherwise
  5841. checks for values greater than the last value written
  5842. to the table will fail and the autoinc counter will
  5843. not be updated. This will force write_row() into
  5844. attempting an update of the table's AUTOINC counter. */
  5845. prebuilt->autoinc_last_value = 0;
  5846. }
  5847. stats.records = (ha_rows)n_rows;
  5848. stats.deleted = 0;
  5849. stats.data_file_length = ((ulonglong)
  5850. ib_table->stat_clustered_index_size)
  5851. * UNIV_PAGE_SIZE;
  5852. stats.index_file_length = ((ulonglong)
  5853. ib_table->stat_sum_of_other_index_sizes)
  5854. * UNIV_PAGE_SIZE;
  5855. /* Since fsp_get_available_space_in_free_extents() is
  5856. acquiring latches inside InnoDB, we do not call it if we
  5857. are asked by MySQL to avoid locking. Another reason to
  5858. avoid the call is that it uses quite a lot of CPU.
  5859. See Bug#38185.
  5860. We do not update delete_length if no locking is requested
  5861. so the "old" value can remain. delete_length is initialized
  5862. to 0 in the ha_statistics' constructor. */
  5863. if (!(flag & HA_STATUS_NO_LOCK)) {
  5864. /* lock the data dictionary to avoid races with
  5865. ibd_file_missing and tablespace_discarded */
  5866. row_mysql_lock_data_dictionary(prebuilt->trx);
  5867. /* ib_table->space must be an existent tablespace */
  5868. if (!ib_table->ibd_file_missing
  5869. && !ib_table->tablespace_discarded) {
  5870. stats.delete_length =
  5871. fsp_get_available_space_in_free_extents(
  5872. ib_table->space) * 1024;
  5873. } else {
  5874. THD* thd;
  5875. thd = ha_thd();
  5876. push_warning_printf(
  5877. thd,
  5878. MYSQL_ERROR::WARN_LEVEL_WARN,
  5879. ER_CANT_GET_STAT,
  5880. "InnoDB: Trying to get the free "
  5881. "space for table %s but its "
  5882. "tablespace has been discarded or "
  5883. "the .ibd file is missing. Setting "
  5884. "the free space to zero.",
  5885. ib_table->name);
  5886. stats.delete_length = 0;
  5887. }
  5888. row_mysql_unlock_data_dictionary(prebuilt->trx);
  5889. }
  5890. stats.check_time = 0;
  5891. if (stats.records == 0) {
  5892. stats.mean_rec_length = 0;
  5893. } else {
  5894. stats.mean_rec_length = (ulong) (stats.data_file_length / stats.records);
  5895. }
  5896. }
  5897. if (flag & HA_STATUS_CONST) {
  5898. index = dict_table_get_first_index(ib_table);
  5899. if (prebuilt->clust_index_was_generated) {
  5900. index = dict_table_get_next_index(index);
  5901. }
  5902. for (i = 0; i < table->s->keys; i++) {
  5903. if (index == NULL) {
  5904. sql_print_error("Table %s contains fewer "
  5905. "indexes inside InnoDB than "
  5906. "are defined in the MySQL "
  5907. ".frm file. Have you mixed up "
  5908. ".frm files from different "
  5909. "installations? See "
  5910. REFMAN
  5911. "innodb-troubleshooting.html\n",
  5912. ib_table->name);
  5913. break;
  5914. }
  5915. for (j = 0; j < table->key_info[i].key_parts; j++) {
  5916. if (j + 1 > index->n_uniq) {
  5917. sql_print_error(
  5918. "Index %s of %s has %lu columns unique inside InnoDB, but MySQL is asking "
  5919. "statistics for %lu columns. Have you mixed up .frm files from different "
  5920. "installations? "
  5921. "See " REFMAN "innodb-troubleshooting.html\n",
  5922. index->name,
  5923. ib_table->name,
  5924. (unsigned long)
  5925. index->n_uniq, j + 1);
  5926. break;
  5927. }
  5928. if (index->stat_n_diff_key_vals[j + 1] == 0) {
  5929. rec_per_key = stats.records;
  5930. } else {
  5931. rec_per_key = (ha_rows)(stats.records /
  5932. index->stat_n_diff_key_vals[j + 1]);
  5933. }
  5934. /* Since MySQL seems to favor table scans
  5935. too much over index searches, we pretend
  5936. index selectivity is 2 times better than
  5937. our estimate: */
  5938. rec_per_key = rec_per_key / 2;
  5939. if (rec_per_key == 0) {
  5940. rec_per_key = 1;
  5941. }
  5942. table->key_info[i].rec_per_key[j]=
  5943. rec_per_key >= ~(ulong) 0 ? ~(ulong) 0 :
  5944. (ulong) rec_per_key;
  5945. }
  5946. index = dict_table_get_next_index(index);
  5947. }
  5948. }
  5949. if (flag & HA_STATUS_ERRKEY) {
  5950. const dict_index_t* err_index;
  5951. ut_a(prebuilt->trx);
  5952. ut_a(prebuilt->trx->magic_n == TRX_MAGIC_N);
  5953. err_index = trx_get_error_info(prebuilt->trx);
  5954. if (err_index) {
  5955. errkey = (unsigned int)
  5956. row_get_mysql_key_number_for_index(err_index);
  5957. } else {
  5958. errkey = (unsigned int) prebuilt->trx->error_key_num;
  5959. }
  5960. }
  5961. if ((flag & HA_STATUS_AUTO) && table->found_next_number_field) {
  5962. stats.auto_increment_value = innobase_peek_autoinc();
  5963. }
  5964. prebuilt->trx->op_info = (char*)"";
  5965. DBUG_RETURN(0);
  5966. }
  5967. /**********************************************************************//**
  5968. Updates index cardinalities of the table, based on 8 random dives into
  5969. each index tree. This does NOT calculate exact statistics on the table.
  5970. @return returns always 0 (success) */
  5971. UNIV_INTERN
  5972. int
  5973. ha_innobase::analyze(
  5974. /*=================*/
  5975. THD* thd, /*!< in: connection thread handle */
  5976. HA_CHECK_OPT* check_opt) /*!< in: currently ignored */
  5977. {
  5978. /* Serialize ANALYZE TABLE inside InnoDB, see
  5979. Bug#38996 Race condition in ANALYZE TABLE */
  5980. pthread_mutex_lock(&analyze_mutex);
  5981. /* Simply call ::info() with all the flags */
  5982. info(HA_STATUS_TIME | HA_STATUS_CONST | HA_STATUS_VARIABLE);
  5983. pthread_mutex_unlock(&analyze_mutex);
  5984. return(0);
  5985. }
  5986. /**********************************************************************//**
  5987. This is mapped to "ALTER TABLE tablename ENGINE=InnoDB", which rebuilds
  5988. the table in MySQL. */
  5989. UNIV_INTERN
  5990. int
  5991. ha_innobase::optimize(
  5992. /*==================*/
  5993. THD* thd, /*!< in: connection thread handle */
  5994. HA_CHECK_OPT* check_opt) /*!< in: currently ignored */
  5995. {
  5996. return(HA_ADMIN_TRY_ALTER);
  5997. }
  5998. /*******************************************************************//**
  5999. Tries to check that an InnoDB table is not corrupted. If corruption is
  6000. noticed, prints to stderr information about it. In case of corruption
  6001. may also assert a failure and crash the server.
  6002. @return HA_ADMIN_CORRUPT or HA_ADMIN_OK */
  6003. UNIV_INTERN
  6004. int
  6005. ha_innobase::check(
  6006. /*===============*/
  6007. THD* thd, /*!< in: user thread handle */
  6008. HA_CHECK_OPT* check_opt) /*!< in: check options, currently
  6009. ignored */
  6010. {
  6011. ulint ret;
  6012. DBUG_ASSERT(thd == ha_thd());
  6013. ut_a(prebuilt->trx);
  6014. ut_a(prebuilt->trx->magic_n == TRX_MAGIC_N);
  6015. ut_a(prebuilt->trx == thd_to_trx(thd));
  6016. if (prebuilt->mysql_template == NULL) {
  6017. /* Build the template; we will use a dummy template
  6018. in index scans done in checking */
  6019. build_template(prebuilt, NULL, table, ROW_MYSQL_WHOLE_ROW);
  6020. }
  6021. ret = row_check_table_for_mysql(prebuilt);
  6022. if (ret == DB_SUCCESS) {
  6023. return(HA_ADMIN_OK);
  6024. }
  6025. return(HA_ADMIN_CORRUPT);
  6026. }
  6027. /*************************************************************//**
  6028. Adds information about free space in the InnoDB tablespace to a table comment
  6029. which is printed out when a user calls SHOW TABLE STATUS. Adds also info on
  6030. foreign keys.
  6031. @return table comment + InnoDB free space + info on foreign keys */
  6032. UNIV_INTERN
  6033. char*
  6034. ha_innobase::update_table_comment(
  6035. /*==============================*/
  6036. const char* comment)/*!< in: table comment defined by user */
  6037. {
  6038. uint length = (uint) strlen(comment);
  6039. char* str;
  6040. long flen;
  6041. /* We do not know if MySQL can call this function before calling
  6042. external_lock(). To be safe, update the thd of the current table
  6043. handle. */
  6044. if (length > 64000 - 3) {
  6045. return((char*)comment); /* string too long */
  6046. }
  6047. update_thd(ha_thd());
  6048. prebuilt->trx->op_info = (char*)"returning table comment";
  6049. /* In case MySQL calls this in the middle of a SELECT query, release
  6050. possible adaptive hash latch to avoid deadlocks of threads */
  6051. trx_search_latch_release_if_reserved(prebuilt->trx);
  6052. str = NULL;
  6053. /* output the data to a temporary file */
  6054. mutex_enter(&srv_dict_tmpfile_mutex);
  6055. rewind(srv_dict_tmpfile);
  6056. fprintf(srv_dict_tmpfile, "InnoDB free: %llu kB",
  6057. fsp_get_available_space_in_free_extents(
  6058. prebuilt->table->space));
  6059. dict_print_info_on_foreign_keys(FALSE, srv_dict_tmpfile,
  6060. prebuilt->trx, prebuilt->table);
  6061. flen = ftell(srv_dict_tmpfile);
  6062. if (flen < 0) {
  6063. flen = 0;
  6064. } else if (length + flen + 3 > 64000) {
  6065. flen = 64000 - 3 - length;
  6066. }
  6067. /* allocate buffer for the full string, and
  6068. read the contents of the temporary file */
  6069. str = (char*) my_malloc(length + flen + 3, MYF(0));
  6070. if (str) {
  6071. char* pos = str + length;
  6072. if (length) {
  6073. memcpy(str, comment, length);
  6074. *pos++ = ';';
  6075. *pos++ = ' ';
  6076. }
  6077. rewind(srv_dict_tmpfile);
  6078. flen = (uint) fread(pos, 1, flen, srv_dict_tmpfile);
  6079. pos[flen] = 0;
  6080. }
  6081. mutex_exit(&srv_dict_tmpfile_mutex);
  6082. prebuilt->trx->op_info = (char*)"";
  6083. return(str ? str : (char*) comment);
  6084. }
  6085. /*******************************************************************//**
  6086. Gets the foreign key create info for a table stored in InnoDB.
  6087. @return own: character string in the form which can be inserted to the
  6088. CREATE TABLE statement, MUST be freed with
  6089. ha_innobase::free_foreign_key_create_info */
  6090. UNIV_INTERN
  6091. char*
  6092. ha_innobase::get_foreign_key_create_info(void)
  6093. /*==========================================*/
  6094. {
  6095. char* str = 0;
  6096. long flen;
  6097. ut_a(prebuilt != NULL);
  6098. /* We do not know if MySQL can call this function before calling
  6099. external_lock(). To be safe, update the thd of the current table
  6100. handle. */
  6101. update_thd(ha_thd());
  6102. prebuilt->trx->op_info = (char*)"getting info on foreign keys";
  6103. /* In case MySQL calls this in the middle of a SELECT query,
  6104. release possible adaptive hash latch to avoid
  6105. deadlocks of threads */
  6106. trx_search_latch_release_if_reserved(prebuilt->trx);
  6107. mutex_enter(&srv_dict_tmpfile_mutex);
  6108. rewind(srv_dict_tmpfile);
  6109. /* output the data to a temporary file */
  6110. dict_print_info_on_foreign_keys(TRUE, srv_dict_tmpfile,
  6111. prebuilt->trx, prebuilt->table);
  6112. prebuilt->trx->op_info = (char*)"";
  6113. flen = ftell(srv_dict_tmpfile);
  6114. if (flen < 0) {
  6115. flen = 0;
  6116. } else if (flen > 64000 - 1) {
  6117. flen = 64000 - 1;
  6118. }
  6119. /* allocate buffer for the string, and
  6120. read the contents of the temporary file */
  6121. str = (char*) my_malloc(flen + 1, MYF(0));
  6122. if (str) {
  6123. rewind(srv_dict_tmpfile);
  6124. flen = (uint) fread(str, 1, flen, srv_dict_tmpfile);
  6125. str[flen] = 0;
  6126. }
  6127. mutex_exit(&srv_dict_tmpfile_mutex);
  6128. return(str);
  6129. }
  6130. UNIV_INTERN
  6131. int
  6132. ha_innobase::get_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list)
  6133. {
  6134. dict_foreign_t* foreign;
  6135. DBUG_ENTER("get_foreign_key_list");
  6136. ut_a(prebuilt != NULL);
  6137. update_thd(ha_thd());
  6138. prebuilt->trx->op_info = (char*)"getting list of foreign keys";
  6139. trx_search_latch_release_if_reserved(prebuilt->trx);
  6140. mutex_enter(&(dict_sys->mutex));
  6141. foreign = UT_LIST_GET_FIRST(prebuilt->table->foreign_list);
  6142. while (foreign != NULL) {
  6143. uint i;
  6144. FOREIGN_KEY_INFO f_key_info;
  6145. LEX_STRING *name= 0;
  6146. uint ulen;
  6147. char uname[NAME_LEN+1]; /* Unencoded name */
  6148. char db_name[NAME_LEN+1];
  6149. const char *tmp_buff;
  6150. tmp_buff= foreign->id;
  6151. i= 0;
  6152. while (tmp_buff[i] != '/')
  6153. i++;
  6154. tmp_buff+= i + 1;
  6155. f_key_info.forein_id = thd_make_lex_string(thd, 0,
  6156. tmp_buff, (uint) strlen(tmp_buff), 1);
  6157. tmp_buff= foreign->referenced_table_name;
  6158. /* Database name */
  6159. i= 0;
  6160. while (tmp_buff[i] != '/')
  6161. {
  6162. db_name[i]= tmp_buff[i];
  6163. i++;
  6164. }
  6165. db_name[i]= 0;
  6166. ulen= filename_to_tablename(db_name, uname, sizeof(uname));
  6167. f_key_info.referenced_db = thd_make_lex_string(thd, 0,
  6168. uname, ulen, 1);
  6169. /* Table name */
  6170. tmp_buff+= i + 1;
  6171. ulen= filename_to_tablename(tmp_buff, uname, sizeof(uname));
  6172. f_key_info.referenced_table = thd_make_lex_string(thd, 0,
  6173. uname, ulen, 1);
  6174. for (i= 0;;) {
  6175. tmp_buff= foreign->foreign_col_names[i];
  6176. name = thd_make_lex_string(thd, name,
  6177. tmp_buff, (uint) strlen(tmp_buff), 1);
  6178. f_key_info.foreign_fields.push_back(name);
  6179. tmp_buff= foreign->referenced_col_names[i];
  6180. name = thd_make_lex_string(thd, name,
  6181. tmp_buff, (uint) strlen(tmp_buff), 1);
  6182. f_key_info.referenced_fields.push_back(name);
  6183. if (++i >= foreign->n_fields)
  6184. break;
  6185. }
  6186. ulong length;
  6187. if (foreign->type & DICT_FOREIGN_ON_DELETE_CASCADE)
  6188. {
  6189. length=7;
  6190. tmp_buff= "CASCADE";
  6191. }
  6192. else if (foreign->type & DICT_FOREIGN_ON_DELETE_SET_NULL)
  6193. {
  6194. length=8;
  6195. tmp_buff= "SET NULL";
  6196. }
  6197. else if (foreign->type & DICT_FOREIGN_ON_DELETE_NO_ACTION)
  6198. {
  6199. length=9;
  6200. tmp_buff= "NO ACTION";
  6201. }
  6202. else
  6203. {
  6204. length=8;
  6205. tmp_buff= "RESTRICT";
  6206. }
  6207. f_key_info.delete_method = thd_make_lex_string(
  6208. thd, f_key_info.delete_method, tmp_buff, length, 1);
  6209. if (foreign->type & DICT_FOREIGN_ON_UPDATE_CASCADE)
  6210. {
  6211. length=7;
  6212. tmp_buff= "CASCADE";
  6213. }
  6214. else if (foreign->type & DICT_FOREIGN_ON_UPDATE_SET_NULL)
  6215. {
  6216. length=8;
  6217. tmp_buff= "SET NULL";
  6218. }
  6219. else if (foreign->type & DICT_FOREIGN_ON_UPDATE_NO_ACTION)
  6220. {
  6221. length=9;
  6222. tmp_buff= "NO ACTION";
  6223. }
  6224. else
  6225. {
  6226. length=8;
  6227. tmp_buff= "RESTRICT";
  6228. }
  6229. f_key_info.update_method = thd_make_lex_string(
  6230. thd, f_key_info.update_method, tmp_buff, length, 1);
  6231. if (foreign->referenced_index &&
  6232. foreign->referenced_index->name)
  6233. {
  6234. f_key_info.referenced_key_name = thd_make_lex_string(
  6235. thd, f_key_info.referenced_key_name,
  6236. foreign->referenced_index->name,
  6237. (uint) strlen(foreign->referenced_index->name), 1);
  6238. }
  6239. else
  6240. f_key_info.referenced_key_name= 0;
  6241. FOREIGN_KEY_INFO *pf_key_info = (FOREIGN_KEY_INFO *)
  6242. thd_memdup(thd, &f_key_info, sizeof(FOREIGN_KEY_INFO));
  6243. f_key_list->push_back(pf_key_info);
  6244. foreign = UT_LIST_GET_NEXT(foreign_list, foreign);
  6245. }
  6246. mutex_exit(&(dict_sys->mutex));
  6247. prebuilt->trx->op_info = (char*)"";
  6248. DBUG_RETURN(0);
  6249. }
  6250. /*****************************************************************//**
  6251. Checks if ALTER TABLE may change the storage engine of the table.
  6252. Changing storage engines is not allowed for tables for which there
  6253. are foreign key constraints (parent or child tables).
  6254. @return TRUE if can switch engines */
  6255. UNIV_INTERN
  6256. bool
  6257. ha_innobase::can_switch_engines(void)
  6258. /*=================================*/
  6259. {
  6260. bool can_switch;
  6261. DBUG_ENTER("ha_innobase::can_switch_engines");
  6262. ut_a(prebuilt->trx == thd_to_trx(ha_thd()));
  6263. prebuilt->trx->op_info =
  6264. "determining if there are foreign key constraints";
  6265. row_mysql_lock_data_dictionary(prebuilt->trx);
  6266. can_switch = !UT_LIST_GET_FIRST(prebuilt->table->referenced_list)
  6267. && !UT_LIST_GET_FIRST(prebuilt->table->foreign_list);
  6268. row_mysql_unlock_data_dictionary(prebuilt->trx);
  6269. prebuilt->trx->op_info = "";
  6270. DBUG_RETURN(can_switch);
  6271. }
  6272. /*******************************************************************//**
  6273. Checks if a table is referenced by a foreign key. The MySQL manual states that
  6274. a REPLACE is either equivalent to an INSERT, or DELETE(s) + INSERT. Only a
  6275. delete is then allowed internally to resolve a duplicate key conflict in
  6276. REPLACE, not an update.
  6277. @return > 0 if referenced by a FOREIGN KEY */
  6278. UNIV_INTERN
  6279. uint
  6280. ha_innobase::referenced_by_foreign_key(void)
  6281. /*========================================*/
  6282. {
  6283. if (dict_table_is_referenced_by_foreign_key(prebuilt->table)) {
  6284. return(1);
  6285. }
  6286. return(0);
  6287. }
  6288. /*******************************************************************//**
  6289. Frees the foreign key create info for a table stored in InnoDB, if it is
  6290. non-NULL. */
  6291. UNIV_INTERN
  6292. void
  6293. ha_innobase::free_foreign_key_create_info(
  6294. /*======================================*/
  6295. char* str) /*!< in, own: create info string to free */
  6296. {
  6297. if (str) {
  6298. my_free(str, MYF(0));
  6299. }
  6300. }
  6301. /*******************************************************************//**
  6302. Tells something additional to the handler about how to do things.
  6303. @return 0 or error number */
  6304. UNIV_INTERN
  6305. int
  6306. ha_innobase::extra(
  6307. /*===============*/
  6308. enum ha_extra_function operation)
  6309. /*!< in: HA_EXTRA_FLUSH or some other flag */
  6310. {
  6311. /* Warning: since it is not sure that MySQL calls external_lock
  6312. before calling this function, the trx field in prebuilt can be
  6313. obsolete! */
  6314. switch (operation) {
  6315. case HA_EXTRA_FLUSH:
  6316. if (prebuilt->blob_heap) {
  6317. row_mysql_prebuilt_free_blob_heap(prebuilt);
  6318. }
  6319. break;
  6320. case HA_EXTRA_RESET_STATE:
  6321. reset_template(prebuilt);
  6322. break;
  6323. case HA_EXTRA_NO_KEYREAD:
  6324. prebuilt->read_just_key = 0;
  6325. break;
  6326. case HA_EXTRA_KEYREAD:
  6327. prebuilt->read_just_key = 1;
  6328. break;
  6329. case HA_EXTRA_KEYREAD_PRESERVE_FIELDS:
  6330. prebuilt->keep_other_fields_on_keyread = 1;
  6331. break;
  6332. /* IMPORTANT: prebuilt->trx can be obsolete in
  6333. this method, because it is not sure that MySQL
  6334. calls external_lock before this method with the
  6335. parameters below. We must not invoke update_thd()
  6336. either, because the calling threads may change.
  6337. CAREFUL HERE, OR MEMORY CORRUPTION MAY OCCUR! */
  6338. case HA_EXTRA_IGNORE_DUP_KEY:
  6339. thd_to_trx(ha_thd())->duplicates |= TRX_DUP_IGNORE;
  6340. break;
  6341. case HA_EXTRA_WRITE_CAN_REPLACE:
  6342. thd_to_trx(ha_thd())->duplicates |= TRX_DUP_REPLACE;
  6343. break;
  6344. case HA_EXTRA_WRITE_CANNOT_REPLACE:
  6345. thd_to_trx(ha_thd())->duplicates &= ~TRX_DUP_REPLACE;
  6346. break;
  6347. case HA_EXTRA_NO_IGNORE_DUP_KEY:
  6348. thd_to_trx(ha_thd())->duplicates &=
  6349. ~(TRX_DUP_IGNORE | TRX_DUP_REPLACE);
  6350. break;
  6351. default:/* Do nothing */
  6352. ;
  6353. }
  6354. return(0);
  6355. }
  6356. UNIV_INTERN
  6357. int
  6358. ha_innobase::reset()
  6359. {
  6360. if (prebuilt->blob_heap) {
  6361. row_mysql_prebuilt_free_blob_heap(prebuilt);
  6362. }
  6363. reset_template(prebuilt);
  6364. /* TODO: This should really be reset in reset_template() but for now
  6365. it's safer to do it explicitly here. */
  6366. /* This is a statement level counter. */
  6367. prebuilt->autoinc_last_value = 0;
  6368. return(0);
  6369. }
  6370. /******************************************************************//**
  6371. MySQL calls this function at the start of each SQL statement inside LOCK
  6372. TABLES. Inside LOCK TABLES the ::external_lock method does not work to
  6373. mark SQL statement borders. Note also a special case: if a temporary table
  6374. is created inside LOCK TABLES, MySQL has not called external_lock() at all
  6375. on that table.
  6376. MySQL-5.0 also calls this before each statement in an execution of a stored
  6377. procedure. To make the execution more deterministic for binlogging, MySQL-5.0
  6378. locks all tables involved in a stored procedure with full explicit table
  6379. locks (thd_in_lock_tables(thd) holds in store_lock()) before executing the
  6380. procedure.
  6381. @return 0 or error code */
  6382. UNIV_INTERN
  6383. int
  6384. ha_innobase::start_stmt(
  6385. /*====================*/
  6386. THD* thd, /*!< in: handle to the user thread */
  6387. thr_lock_type lock_type)
  6388. {
  6389. trx_t* trx;
  6390. update_thd(thd);
  6391. trx = prebuilt->trx;
  6392. /* Here we release the search latch and the InnoDB thread FIFO ticket
  6393. if they were reserved. They should have been released already at the
  6394. end of the previous statement, but because inside LOCK TABLES the
  6395. lock count method does not work to mark the end of a SELECT statement,
  6396. that may not be the case. We MUST release the search latch before an
  6397. INSERT, for example. */
  6398. innobase_release_stat_resources(trx);
  6399. /* Reset the AUTOINC statement level counter for multi-row INSERTs. */
  6400. trx->n_autoinc_rows = 0;
  6401. prebuilt->sql_stat_start = TRUE;
  6402. prebuilt->hint_need_to_fetch_extra_cols = 0;
  6403. reset_template(prebuilt);
  6404. if (!prebuilt->mysql_has_locked) {
  6405. /* This handle is for a temporary table created inside
  6406. this same LOCK TABLES; since MySQL does NOT call external_lock
  6407. in this case, we must use x-row locks inside InnoDB to be
  6408. prepared for an update of a row */
  6409. prebuilt->select_lock_type = LOCK_X;
  6410. } else {
  6411. if (trx->isolation_level != TRX_ISO_SERIALIZABLE
  6412. && thd_sql_command(thd) == SQLCOM_SELECT
  6413. && lock_type == TL_READ) {
  6414. /* For other than temporary tables, we obtain
  6415. no lock for consistent read (plain SELECT). */
  6416. prebuilt->select_lock_type = LOCK_NONE;
  6417. } else {
  6418. /* Not a consistent read: restore the
  6419. select_lock_type value. The value of
  6420. stored_select_lock_type was decided in:
  6421. 1) ::store_lock(),
  6422. 2) ::external_lock(),
  6423. 3) ::init_table_handle_for_HANDLER(), and
  6424. 4) ::transactional_table_lock(). */
  6425. prebuilt->select_lock_type =
  6426. prebuilt->stored_select_lock_type;
  6427. }
  6428. }
  6429. trx->detailed_error[0] = '\0';
  6430. /* Set the MySQL flag to mark that there is an active transaction */
  6431. if (trx->active_trans == 0) {
  6432. innobase_register_trx_and_stmt(ht, thd);
  6433. trx->active_trans = 1;
  6434. } else {
  6435. innobase_register_stmt(ht, thd);
  6436. }
  6437. return(0);
  6438. }
  6439. /******************************************************************//**
  6440. Maps a MySQL trx isolation level code to the InnoDB isolation level code
  6441. @return InnoDB isolation level */
  6442. static inline
  6443. ulint
  6444. innobase_map_isolation_level(
  6445. /*=========================*/
  6446. enum_tx_isolation iso) /*!< in: MySQL isolation level code */
  6447. {
  6448. switch(iso) {
  6449. case ISO_REPEATABLE_READ: return(TRX_ISO_REPEATABLE_READ);
  6450. case ISO_READ_COMMITTED: return(TRX_ISO_READ_COMMITTED);
  6451. case ISO_SERIALIZABLE: return(TRX_ISO_SERIALIZABLE);
  6452. case ISO_READ_UNCOMMITTED: return(TRX_ISO_READ_UNCOMMITTED);
  6453. default: ut_a(0); return(0);
  6454. }
  6455. }
  6456. /******************************************************************//**
  6457. As MySQL will execute an external lock for every new table it uses when it
  6458. starts to process an SQL statement (an exception is when MySQL calls
  6459. start_stmt for the handle) we can use this function to store the pointer to
  6460. the THD in the handle. We will also use this function to communicate
  6461. to InnoDB that a new SQL statement has started and that we must store a
  6462. savepoint to our transaction handle, so that we are able to roll back
  6463. the SQL statement in case of an error.
  6464. @return 0 */
  6465. UNIV_INTERN
  6466. int
  6467. ha_innobase::external_lock(
  6468. /*=======================*/
  6469. THD* thd, /*!< in: handle to the user thread */
  6470. int lock_type) /*!< in: lock type */
  6471. {
  6472. trx_t* trx;
  6473. DBUG_ENTER("ha_innobase::external_lock");
  6474. DBUG_PRINT("enter",("lock_type: %d", lock_type));
  6475. update_thd(thd);
  6476. /* Statement based binlogging does not work in isolation level
  6477. READ UNCOMMITTED and READ COMMITTED since the necessary
  6478. locks cannot be taken. In this case, we print an
  6479. informative error message and return with an error. */
  6480. if (lock_type == F_WRLCK)
  6481. {
  6482. ulong const binlog_format= thd_binlog_format(thd);
  6483. ulong const tx_isolation = thd_tx_isolation(ha_thd());
  6484. if (tx_isolation <= ISO_READ_COMMITTED &&
  6485. binlog_format == BINLOG_FORMAT_STMT)
  6486. {
  6487. char buf[256];
  6488. my_snprintf(buf, sizeof(buf),
  6489. "Transaction level '%s' in"
  6490. " InnoDB is not safe for binlog mode '%s'",
  6491. tx_isolation_names[tx_isolation],
  6492. binlog_format_names[binlog_format]);
  6493. my_error(ER_BINLOG_LOGGING_IMPOSSIBLE, MYF(0), buf);
  6494. DBUG_RETURN(HA_ERR_LOGGING_IMPOSSIBLE);
  6495. }
  6496. }
  6497. trx = prebuilt->trx;
  6498. prebuilt->sql_stat_start = TRUE;
  6499. prebuilt->hint_need_to_fetch_extra_cols = 0;
  6500. reset_template(prebuilt);
  6501. if (lock_type == F_WRLCK) {
  6502. /* If this is a SELECT, then it is in UPDATE TABLE ...
  6503. or SELECT ... FOR UPDATE */
  6504. prebuilt->select_lock_type = LOCK_X;
  6505. prebuilt->stored_select_lock_type = LOCK_X;
  6506. }
  6507. if (lock_type != F_UNLCK) {
  6508. /* MySQL is setting a new table lock */
  6509. trx->detailed_error[0] = '\0';
  6510. /* Set the MySQL flag to mark that there is an active
  6511. transaction */
  6512. if (trx->active_trans == 0) {
  6513. innobase_register_trx_and_stmt(ht, thd);
  6514. trx->active_trans = 1;
  6515. } else if (trx->n_mysql_tables_in_use == 0) {
  6516. innobase_register_stmt(ht, thd);
  6517. }
  6518. if (trx->isolation_level == TRX_ISO_SERIALIZABLE
  6519. && prebuilt->select_lock_type == LOCK_NONE
  6520. && thd_test_options(thd,
  6521. OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) {
  6522. /* To get serializable execution, we let InnoDB
  6523. conceptually add 'LOCK IN SHARE MODE' to all SELECTs
  6524. which otherwise would have been consistent reads. An
  6525. exception is consistent reads in the AUTOCOMMIT=1 mode:
  6526. we know that they are read-only transactions, and they
  6527. can be serialized also if performed as consistent
  6528. reads. */
  6529. prebuilt->select_lock_type = LOCK_S;
  6530. prebuilt->stored_select_lock_type = LOCK_S;
  6531. }
  6532. /* Starting from 4.1.9, no InnoDB table lock is taken in LOCK
  6533. TABLES if AUTOCOMMIT=1. It does not make much sense to acquire
  6534. an InnoDB table lock if it is released immediately at the end
  6535. of LOCK TABLES, and InnoDB's table locks in that case cause
  6536. VERY easily deadlocks.
  6537. We do not set InnoDB table locks if user has not explicitly
  6538. requested a table lock. Note that thd_in_lock_tables(thd)
  6539. can hold in some cases, e.g., at the start of a stored
  6540. procedure call (SQLCOM_CALL). */
  6541. if (prebuilt->select_lock_type != LOCK_NONE) {
  6542. if (thd_sql_command(thd) == SQLCOM_LOCK_TABLES
  6543. && THDVAR(thd, table_locks)
  6544. && thd_test_options(thd, OPTION_NOT_AUTOCOMMIT)
  6545. && thd_in_lock_tables(thd)) {
  6546. ulint error = row_lock_table_for_mysql(
  6547. prebuilt, NULL, 0);
  6548. if (error != DB_SUCCESS) {
  6549. error = convert_error_code_to_mysql(
  6550. (int) error, 0, thd);
  6551. DBUG_RETURN((int) error);
  6552. }
  6553. }
  6554. trx->mysql_n_tables_locked++;
  6555. }
  6556. trx->n_mysql_tables_in_use++;
  6557. prebuilt->mysql_has_locked = TRUE;
  6558. DBUG_RETURN(0);
  6559. }
  6560. /* MySQL is releasing a table lock */
  6561. trx->n_mysql_tables_in_use--;
  6562. prebuilt->mysql_has_locked = FALSE;
  6563. /* Release a possible FIFO ticket and search latch. Since we
  6564. may reserve the kernel mutex, we have to release the search
  6565. system latch first to obey the latching order. */
  6566. innobase_release_stat_resources(trx);
  6567. /* If the MySQL lock count drops to zero we know that the current SQL
  6568. statement has ended */
  6569. if (trx->n_mysql_tables_in_use == 0) {
  6570. trx->mysql_n_tables_locked = 0;
  6571. prebuilt->used_in_HANDLER = FALSE;
  6572. if (!thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) {
  6573. if (trx->active_trans != 0) {
  6574. innobase_commit(ht, thd, TRUE);
  6575. }
  6576. } else {
  6577. if (trx->isolation_level <= TRX_ISO_READ_COMMITTED
  6578. && trx->global_read_view) {
  6579. /* At low transaction isolation levels we let
  6580. each consistent read set its own snapshot */
  6581. read_view_close_for_mysql(trx);
  6582. }
  6583. }
  6584. }
  6585. DBUG_RETURN(0);
  6586. }
  6587. /******************************************************************//**
  6588. With this function MySQL request a transactional lock to a table when
  6589. user issued query LOCK TABLES..WHERE ENGINE = InnoDB.
  6590. @return error code */
  6591. UNIV_INTERN
  6592. int
  6593. ha_innobase::transactional_table_lock(
  6594. /*==================================*/
  6595. THD* thd, /*!< in: handle to the user thread */
  6596. int lock_type) /*!< in: lock type */
  6597. {
  6598. trx_t* trx;
  6599. DBUG_ENTER("ha_innobase::transactional_table_lock");
  6600. DBUG_PRINT("enter",("lock_type: %d", lock_type));
  6601. /* We do not know if MySQL can call this function before calling
  6602. external_lock(). To be safe, update the thd of the current table
  6603. handle. */
  6604. update_thd(thd);
  6605. if (prebuilt->table->ibd_file_missing && !thd_tablespace_op(thd)) {
  6606. ut_print_timestamp(stderr);
  6607. fprintf(stderr,
  6608. " InnoDB: MySQL is trying to use a table handle"
  6609. " but the .ibd file for\n"
  6610. "InnoDB: table %s does not exist.\n"
  6611. "InnoDB: Have you deleted the .ibd file"
  6612. " from the database directory under\n"
  6613. "InnoDB: the MySQL datadir?"
  6614. "InnoDB: See " REFMAN
  6615. "innodb-troubleshooting.html\n"
  6616. "InnoDB: how you can resolve the problem.\n",
  6617. prebuilt->table->name);
  6618. DBUG_RETURN(HA_ERR_CRASHED);
  6619. }
  6620. trx = prebuilt->trx;
  6621. prebuilt->sql_stat_start = TRUE;
  6622. prebuilt->hint_need_to_fetch_extra_cols = 0;
  6623. reset_template(prebuilt);
  6624. if (lock_type == F_WRLCK) {
  6625. prebuilt->select_lock_type = LOCK_X;
  6626. prebuilt->stored_select_lock_type = LOCK_X;
  6627. } else if (lock_type == F_RDLCK) {
  6628. prebuilt->select_lock_type = LOCK_S;
  6629. prebuilt->stored_select_lock_type = LOCK_S;
  6630. } else {
  6631. ut_print_timestamp(stderr);
  6632. fprintf(stderr, " InnoDB error:\n"
  6633. "MySQL is trying to set transactional table lock with corrupted lock type\n"
  6634. "to table %s, lock type %d does not exist.\n",
  6635. prebuilt->table->name, lock_type);
  6636. DBUG_RETURN(HA_ERR_CRASHED);
  6637. }
  6638. /* MySQL is setting a new transactional table lock */
  6639. /* Set the MySQL flag to mark that there is an active transaction */
  6640. if (trx->active_trans == 0) {
  6641. innobase_register_trx_and_stmt(ht, thd);
  6642. trx->active_trans = 1;
  6643. }
  6644. if (THDVAR(thd, table_locks) && thd_in_lock_tables(thd)) {
  6645. ulint error = DB_SUCCESS;
  6646. error = row_lock_table_for_mysql(prebuilt, NULL, 0);
  6647. if (error != DB_SUCCESS) {
  6648. error = convert_error_code_to_mysql(
  6649. (int) error, prebuilt->table->flags, thd);
  6650. DBUG_RETURN((int) error);
  6651. }
  6652. if (thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) {
  6653. /* Store the current undo_no of the transaction
  6654. so that we know where to roll back if we have
  6655. to roll back the next SQL statement */
  6656. trx_mark_sql_stat_end(trx);
  6657. }
  6658. }
  6659. DBUG_RETURN(0);
  6660. }
  6661. /************************************************************************//**
  6662. Here we export InnoDB status variables to MySQL. */
  6663. static
  6664. void
  6665. innodb_export_status(void)
  6666. /*======================*/
  6667. {
  6668. if (innodb_inited) {
  6669. srv_export_innodb_status();
  6670. }
  6671. }
  6672. /************************************************************************//**
  6673. Implements the SHOW INNODB STATUS command. Sends the output of the InnoDB
  6674. Monitor to the client. */
  6675. static
  6676. bool
  6677. innodb_show_status(
  6678. /*===============*/
  6679. handlerton* hton, /*!< in: the innodb handlerton */
  6680. THD* thd, /*!< in: the MySQL query thread of the caller */
  6681. stat_print_fn *stat_print)
  6682. {
  6683. trx_t* trx;
  6684. static const char truncated_msg[] = "... truncated...\n";
  6685. const long MAX_STATUS_SIZE = 64000;
  6686. ulint trx_list_start = ULINT_UNDEFINED;
  6687. ulint trx_list_end = ULINT_UNDEFINED;
  6688. DBUG_ENTER("innodb_show_status");
  6689. DBUG_ASSERT(hton == innodb_hton_ptr);
  6690. trx = check_trx_exists(thd);
  6691. innobase_release_stat_resources(trx);
  6692. /* We let the InnoDB Monitor to output at most MAX_STATUS_SIZE
  6693. bytes of text. */
  6694. long flen, usable_len;
  6695. char* str;
  6696. mutex_enter(&srv_monitor_file_mutex);
  6697. rewind(srv_monitor_file);
  6698. srv_printf_innodb_monitor(srv_monitor_file,
  6699. &trx_list_start, &trx_list_end);
  6700. flen = ftell(srv_monitor_file);
  6701. os_file_set_eof(srv_monitor_file);
  6702. if (flen < 0) {
  6703. flen = 0;
  6704. }
  6705. if (flen > MAX_STATUS_SIZE) {
  6706. usable_len = MAX_STATUS_SIZE;
  6707. } else {
  6708. usable_len = flen;
  6709. }
  6710. /* allocate buffer for the string, and
  6711. read the contents of the temporary file */
  6712. if (!(str = (char*) my_malloc(usable_len + 1, MYF(0)))) {
  6713. mutex_exit(&srv_monitor_file_mutex);
  6714. DBUG_RETURN(TRUE);
  6715. }
  6716. rewind(srv_monitor_file);
  6717. if (flen < MAX_STATUS_SIZE) {
  6718. /* Display the entire output. */
  6719. flen = (long) fread(str, 1, flen, srv_monitor_file);
  6720. } else if (trx_list_end < (ulint) flen
  6721. && trx_list_start < trx_list_end
  6722. && trx_list_start + (flen - trx_list_end)
  6723. < MAX_STATUS_SIZE - sizeof truncated_msg - 1) {
  6724. /* Omit the beginning of the list of active transactions. */
  6725. long len = (long) fread(str, 1, trx_list_start, srv_monitor_file);
  6726. memcpy(str + len, truncated_msg, sizeof truncated_msg - 1);
  6727. len += sizeof truncated_msg - 1;
  6728. usable_len = (MAX_STATUS_SIZE - 1) - len;
  6729. fseek(srv_monitor_file, flen - usable_len, SEEK_SET);
  6730. len += (long) fread(str + len, 1, usable_len, srv_monitor_file);
  6731. flen = len;
  6732. } else {
  6733. /* Omit the end of the output. */
  6734. flen = (long) fread(str, 1, MAX_STATUS_SIZE - 1, srv_monitor_file);
  6735. }
  6736. mutex_exit(&srv_monitor_file_mutex);
  6737. bool result = FALSE;
  6738. if (stat_print(thd, innobase_hton_name, (uint) strlen(innobase_hton_name),
  6739. STRING_WITH_LEN(""), str, flen)) {
  6740. result= TRUE;
  6741. }
  6742. my_free(str, MYF(0));
  6743. DBUG_RETURN(FALSE);
  6744. }
  6745. /************************************************************************//**
  6746. Implements the SHOW MUTEX STATUS command. . */
  6747. static
  6748. bool
  6749. innodb_mutex_show_status(
  6750. /*=====================*/
  6751. handlerton* hton, /*!< in: the innodb handlerton */
  6752. THD* thd, /*!< in: the MySQL query thread of the
  6753. caller */
  6754. stat_print_fn* stat_print)
  6755. {
  6756. char buf1[IO_SIZE], buf2[IO_SIZE];
  6757. mutex_t* mutex;
  6758. rw_lock_t* lock;
  6759. #ifdef UNIV_DEBUG
  6760. ulint rw_lock_count= 0;
  6761. ulint rw_lock_count_spin_loop= 0;
  6762. ulint rw_lock_count_spin_rounds= 0;
  6763. ulint rw_lock_count_os_wait= 0;
  6764. ulint rw_lock_count_os_yield= 0;
  6765. ulonglong rw_lock_wait_time= 0;
  6766. #endif /* UNIV_DEBUG */
  6767. uint hton_name_len= (uint) strlen(innobase_hton_name), buf1len, buf2len;
  6768. DBUG_ENTER("innodb_mutex_show_status");
  6769. DBUG_ASSERT(hton == innodb_hton_ptr);
  6770. mutex_enter(&mutex_list_mutex);
  6771. mutex = UT_LIST_GET_FIRST(mutex_list);
  6772. while (mutex != NULL) {
  6773. if (mutex->count_os_wait == 0
  6774. || buf_pool_is_block_mutex(mutex)) {
  6775. goto next_mutex;
  6776. }
  6777. #ifdef UNIV_DEBUG
  6778. if (mutex->mutex_type != 1) {
  6779. if (mutex->count_using > 0) {
  6780. buf1len= my_snprintf(buf1, sizeof(buf1),
  6781. "%s:%s",
  6782. mutex->cmutex_name, mutex->cfile_name);
  6783. buf2len= my_snprintf(buf2, sizeof(buf2),
  6784. "count=%lu, spin_waits=%lu,"
  6785. " spin_rounds=%lu, "
  6786. "os_waits=%lu, os_yields=%lu,"
  6787. " os_wait_times=%lu",
  6788. mutex->count_using,
  6789. mutex->count_spin_loop,
  6790. mutex->count_spin_rounds,
  6791. mutex->count_os_wait,
  6792. mutex->count_os_yield,
  6793. (ulong) (mutex->lspent_time/1000));
  6794. if (stat_print(thd, innobase_hton_name,
  6795. hton_name_len, buf1, buf1len,
  6796. buf2, buf2len)) {
  6797. mutex_exit(&mutex_list_mutex);
  6798. DBUG_RETURN(1);
  6799. }
  6800. }
  6801. }
  6802. else {
  6803. rw_lock_count += mutex->count_using;
  6804. rw_lock_count_spin_loop += mutex->count_spin_loop;
  6805. rw_lock_count_spin_rounds += mutex->count_spin_rounds;
  6806. rw_lock_count_os_wait += mutex->count_os_wait;
  6807. rw_lock_count_os_yield += mutex->count_os_yield;
  6808. rw_lock_wait_time += mutex->lspent_time;
  6809. }
  6810. #else /* UNIV_DEBUG */
  6811. buf1len= (uint) my_snprintf(buf1, sizeof(buf1), "%s:%lu",
  6812. mutex->cfile_name, (ulong) mutex->cline);
  6813. buf2len= (uint) my_snprintf(buf2, sizeof(buf2), "os_waits=%lu",
  6814. mutex->count_os_wait);
  6815. if (stat_print(thd, innobase_hton_name,
  6816. hton_name_len, buf1, buf1len,
  6817. buf2, buf2len)) {
  6818. mutex_exit(&mutex_list_mutex);
  6819. DBUG_RETURN(1);
  6820. }
  6821. #endif /* UNIV_DEBUG */
  6822. next_mutex:
  6823. mutex = UT_LIST_GET_NEXT(list, mutex);
  6824. }
  6825. mutex_exit(&mutex_list_mutex);
  6826. mutex_enter(&rw_lock_list_mutex);
  6827. lock = UT_LIST_GET_FIRST(rw_lock_list);
  6828. while (lock != NULL) {
  6829. if (lock->count_os_wait
  6830. && !buf_pool_is_block_lock(lock)) {
  6831. buf1len= my_snprintf(buf1, sizeof(buf1), "%s:%lu",
  6832. lock->cfile_name, (ulong) lock->cline);
  6833. buf2len= my_snprintf(buf2, sizeof(buf2),
  6834. "os_waits=%lu", lock->count_os_wait);
  6835. if (stat_print(thd, innobase_hton_name,
  6836. hton_name_len, buf1, buf1len,
  6837. buf2, buf2len)) {
  6838. mutex_exit(&rw_lock_list_mutex);
  6839. DBUG_RETURN(1);
  6840. }
  6841. }
  6842. lock = UT_LIST_GET_NEXT(list, lock);
  6843. }
  6844. mutex_exit(&rw_lock_list_mutex);
  6845. #ifdef UNIV_DEBUG
  6846. buf2len= my_snprintf(buf2, sizeof(buf2),
  6847. "count=%lu, spin_waits=%lu, spin_rounds=%lu, "
  6848. "os_waits=%lu, os_yields=%lu, os_wait_times=%lu",
  6849. rw_lock_count, rw_lock_count_spin_loop,
  6850. rw_lock_count_spin_rounds,
  6851. rw_lock_count_os_wait, rw_lock_count_os_yield,
  6852. (ulong) (rw_lock_wait_time/1000));
  6853. if (stat_print(thd, innobase_hton_name, hton_name_len,
  6854. STRING_WITH_LEN("rw_lock_mutexes"), buf2, buf2len)) {
  6855. DBUG_RETURN(1);
  6856. }
  6857. #endif /* UNIV_DEBUG */
  6858. DBUG_RETURN(FALSE);
  6859. }
  6860. static
  6861. bool innobase_show_status(handlerton *hton, THD* thd,
  6862. stat_print_fn* stat_print,
  6863. enum ha_stat_type stat_type)
  6864. {
  6865. DBUG_ASSERT(hton == innodb_hton_ptr);
  6866. switch (stat_type) {
  6867. case HA_ENGINE_STATUS:
  6868. return innodb_show_status(hton, thd, stat_print);
  6869. case HA_ENGINE_MUTEX:
  6870. return innodb_mutex_show_status(hton, thd, stat_print);
  6871. default:
  6872. return(FALSE);
  6873. }
  6874. }
  6875. /************************************************************************//**
  6876. Handling the shared INNOBASE_SHARE structure that is needed to provide table
  6877. locking.
  6878. ****************************************************************************/
  6879. static INNOBASE_SHARE* get_share(const char* table_name)
  6880. {
  6881. INNOBASE_SHARE *share;
  6882. pthread_mutex_lock(&innobase_share_mutex);
  6883. ulint fold = ut_fold_string(table_name);
  6884. HASH_SEARCH(table_name_hash, innobase_open_tables, fold,
  6885. INNOBASE_SHARE*, share,
  6886. ut_ad(share->use_count > 0),
  6887. !strcmp(share->table_name, table_name));
  6888. if (!share) {
  6889. uint length = (uint) strlen(table_name);
  6890. /* TODO: invoke HASH_MIGRATE if innobase_open_tables
  6891. grows too big */
  6892. share = (INNOBASE_SHARE *) my_malloc(sizeof(*share)+length+1,
  6893. MYF(MY_FAE | MY_ZEROFILL));
  6894. share->table_name = (char*) memcpy(share + 1,
  6895. table_name, length + 1);
  6896. HASH_INSERT(INNOBASE_SHARE, table_name_hash,
  6897. innobase_open_tables, fold, share);
  6898. thr_lock_init(&share->lock);
  6899. }
  6900. share->use_count++;
  6901. pthread_mutex_unlock(&innobase_share_mutex);
  6902. return(share);
  6903. }
  6904. static void free_share(INNOBASE_SHARE* share)
  6905. {
  6906. pthread_mutex_lock(&innobase_share_mutex);
  6907. #ifdef UNIV_DEBUG
  6908. INNOBASE_SHARE* share2;
  6909. ulint fold = ut_fold_string(share->table_name);
  6910. HASH_SEARCH(table_name_hash, innobase_open_tables, fold,
  6911. INNOBASE_SHARE*, share2,
  6912. ut_ad(share->use_count > 0),
  6913. !strcmp(share->table_name, share2->table_name));
  6914. ut_a(share2 == share);
  6915. #endif /* UNIV_DEBUG */
  6916. if (!--share->use_count) {
  6917. ulint fold = ut_fold_string(share->table_name);
  6918. HASH_DELETE(INNOBASE_SHARE, table_name_hash,
  6919. innobase_open_tables, fold, share);
  6920. thr_lock_delete(&share->lock);
  6921. my_free(share, MYF(0));
  6922. /* TODO: invoke HASH_MIGRATE if innobase_open_tables
  6923. shrinks too much */
  6924. }
  6925. pthread_mutex_unlock(&innobase_share_mutex);
  6926. }
  6927. /*****************************************************************//**
  6928. Converts a MySQL table lock stored in the 'lock' field of the handle to
  6929. a proper type before storing pointer to the lock into an array of pointers.
  6930. MySQL also calls this if it wants to reset some table locks to a not-locked
  6931. state during the processing of an SQL query. An example is that during a
  6932. SELECT the read lock is released early on the 'const' tables where we only
  6933. fetch one row. MySQL does not call this when it releases all locks at the
  6934. end of an SQL statement.
  6935. @return pointer to the next element in the 'to' array */
  6936. UNIV_INTERN
  6937. THR_LOCK_DATA**
  6938. ha_innobase::store_lock(
  6939. /*====================*/
  6940. THD* thd, /*!< in: user thread handle */
  6941. THR_LOCK_DATA** to, /*!< in: pointer to an array
  6942. of pointers to lock structs;
  6943. pointer to the 'lock' field
  6944. of current handle is stored
  6945. next to this array */
  6946. enum thr_lock_type lock_type) /*!< in: lock type to store in
  6947. 'lock'; this may also be
  6948. TL_IGNORE */
  6949. {
  6950. trx_t* trx;
  6951. /* Note that trx in this function is NOT necessarily prebuilt->trx
  6952. because we call update_thd() later, in ::external_lock()! Failure to
  6953. understand this caused a serious memory corruption bug in 5.1.11. */
  6954. trx = check_trx_exists(thd);
  6955. /* NOTE: MySQL can call this function with lock 'type' TL_IGNORE!
  6956. Be careful to ignore TL_IGNORE if we are going to do something with
  6957. only 'real' locks! */
  6958. /* If no MySQL table is in use, we need to set the isolation level
  6959. of the transaction. */
  6960. if (lock_type != TL_IGNORE
  6961. && trx->n_mysql_tables_in_use == 0) {
  6962. trx->isolation_level = innobase_map_isolation_level(
  6963. (enum_tx_isolation) thd_tx_isolation(thd));
  6964. if (trx->isolation_level <= TRX_ISO_READ_COMMITTED
  6965. && trx->global_read_view) {
  6966. /* At low transaction isolation levels we let
  6967. each consistent read set its own snapshot */
  6968. read_view_close_for_mysql(trx);
  6969. }
  6970. }
  6971. DBUG_ASSERT(EQ_CURRENT_THD(thd));
  6972. const bool in_lock_tables = thd_in_lock_tables(thd);
  6973. const uint sql_command = thd_sql_command(thd);
  6974. if (sql_command == SQLCOM_DROP_TABLE) {
  6975. /* MySQL calls this function in DROP TABLE though this table
  6976. handle may belong to another thd that is running a query. Let
  6977. us in that case skip any changes to the prebuilt struct. */
  6978. } else if ((lock_type == TL_READ && in_lock_tables)
  6979. || (lock_type == TL_READ_HIGH_PRIORITY && in_lock_tables)
  6980. || lock_type == TL_READ_WITH_SHARED_LOCKS
  6981. || lock_type == TL_READ_NO_INSERT
  6982. || (lock_type != TL_IGNORE
  6983. && sql_command != SQLCOM_SELECT)) {
  6984. /* The OR cases above are in this order:
  6985. 1) MySQL is doing LOCK TABLES ... READ LOCAL, or we
  6986. are processing a stored procedure or function, or
  6987. 2) (we do not know when TL_READ_HIGH_PRIORITY is used), or
  6988. 3) this is a SELECT ... IN SHARE MODE, or
  6989. 4) we are doing a complex SQL statement like
  6990. INSERT INTO ... SELECT ... and the logical logging (MySQL
  6991. binlog) requires the use of a locking read, or
  6992. MySQL is doing LOCK TABLES ... READ.
  6993. 5) we let InnoDB do locking reads for all SQL statements that
  6994. are not simple SELECTs; note that select_lock_type in this
  6995. case may get strengthened in ::external_lock() to LOCK_X.
  6996. Note that we MUST use a locking read in all data modifying
  6997. SQL statements, because otherwise the execution would not be
  6998. serializable, and also the results from the update could be
  6999. unexpected if an obsolete consistent read view would be
  7000. used. */
  7001. ulint isolation_level;
  7002. isolation_level = trx->isolation_level;
  7003. if ((srv_locks_unsafe_for_binlog
  7004. || isolation_level == TRX_ISO_READ_COMMITTED)
  7005. && isolation_level != TRX_ISO_SERIALIZABLE
  7006. && (lock_type == TL_READ || lock_type == TL_READ_NO_INSERT)
  7007. && (sql_command == SQLCOM_INSERT_SELECT
  7008. || sql_command == SQLCOM_REPLACE_SELECT
  7009. || sql_command == SQLCOM_UPDATE
  7010. || sql_command == SQLCOM_CREATE_TABLE)) {
  7011. /* If we either have innobase_locks_unsafe_for_binlog
  7012. option set or this session is using READ COMMITTED
  7013. isolation level and isolation level of the transaction
  7014. is not set to serializable and MySQL is doing
  7015. INSERT INTO...SELECT or REPLACE INTO...SELECT
  7016. or UPDATE ... = (SELECT ...) or CREATE ...
  7017. SELECT... without FOR UPDATE or IN SHARE
  7018. MODE in select, then we use consistent read
  7019. for select. */
  7020. prebuilt->select_lock_type = LOCK_NONE;
  7021. prebuilt->stored_select_lock_type = LOCK_NONE;
  7022. } else if (sql_command == SQLCOM_CHECKSUM) {
  7023. /* Use consistent read for checksum table */
  7024. prebuilt->select_lock_type = LOCK_NONE;
  7025. prebuilt->stored_select_lock_type = LOCK_NONE;
  7026. } else {
  7027. prebuilt->select_lock_type = LOCK_S;
  7028. prebuilt->stored_select_lock_type = LOCK_S;
  7029. }
  7030. } else if (lock_type != TL_IGNORE) {
  7031. /* We set possible LOCK_X value in external_lock, not yet
  7032. here even if this would be SELECT ... FOR UPDATE */
  7033. prebuilt->select_lock_type = LOCK_NONE;
  7034. prebuilt->stored_select_lock_type = LOCK_NONE;
  7035. }
  7036. if (lock_type != TL_IGNORE && lock.type == TL_UNLOCK) {
  7037. /* Starting from 5.0.7, we weaken also the table locks
  7038. set at the start of a MySQL stored procedure call, just like
  7039. we weaken the locks set at the start of an SQL statement.
  7040. MySQL does set in_lock_tables TRUE there, but in reality
  7041. we do not need table locks to make the execution of a
  7042. single transaction stored procedure call deterministic
  7043. (if it does not use a consistent read). */
  7044. if (lock_type == TL_READ
  7045. && sql_command == SQLCOM_LOCK_TABLES) {
  7046. /* We come here if MySQL is processing LOCK TABLES
  7047. ... READ LOCAL. MyISAM under that table lock type
  7048. reads the table as it was at the time the lock was
  7049. granted (new inserts are allowed, but not seen by the
  7050. reader). To get a similar effect on an InnoDB table,
  7051. we must use LOCK TABLES ... READ. We convert the lock
  7052. type here, so that for InnoDB, READ LOCAL is
  7053. equivalent to READ. This will change the InnoDB
  7054. behavior in mysqldump, so that dumps of InnoDB tables
  7055. are consistent with dumps of MyISAM tables. */
  7056. lock_type = TL_READ_NO_INSERT;
  7057. }
  7058. /* If we are not doing a LOCK TABLE, DISCARD/IMPORT
  7059. TABLESPACE or TRUNCATE TABLE then allow multiple
  7060. writers. Note that ALTER TABLE uses a TL_WRITE_ALLOW_READ
  7061. < TL_WRITE_CONCURRENT_INSERT.
  7062. We especially allow multiple writers if MySQL is at the
  7063. start of a stored procedure call (SQLCOM_CALL) or a
  7064. stored function call (MySQL does have in_lock_tables
  7065. TRUE there). */
  7066. if ((lock_type >= TL_WRITE_CONCURRENT_INSERT
  7067. && lock_type <= TL_WRITE)
  7068. && !(in_lock_tables
  7069. && sql_command == SQLCOM_LOCK_TABLES)
  7070. && !thd_tablespace_op(thd)
  7071. && sql_command != SQLCOM_TRUNCATE
  7072. && sql_command != SQLCOM_OPTIMIZE
  7073. && sql_command != SQLCOM_CREATE_TABLE) {
  7074. lock_type = TL_WRITE_ALLOW_WRITE;
  7075. }
  7076. /* In queries of type INSERT INTO t1 SELECT ... FROM t2 ...
  7077. MySQL would use the lock TL_READ_NO_INSERT on t2, and that
  7078. would conflict with TL_WRITE_ALLOW_WRITE, blocking all inserts
  7079. to t2. Convert the lock to a normal read lock to allow
  7080. concurrent inserts to t2.
  7081. We especially allow concurrent inserts if MySQL is at the
  7082. start of a stored procedure call (SQLCOM_CALL)
  7083. (MySQL does have thd_in_lock_tables() TRUE there). */
  7084. if (lock_type == TL_READ_NO_INSERT
  7085. && sql_command != SQLCOM_LOCK_TABLES) {
  7086. lock_type = TL_READ;
  7087. }
  7088. lock.type = lock_type;
  7089. }
  7090. *to++= &lock;
  7091. return(to);
  7092. }
  7093. /*********************************************************************//**
  7094. Read the next autoinc value. Acquire the relevant locks before reading
  7095. the AUTOINC value. If SUCCESS then the table AUTOINC mutex will be locked
  7096. on return and all relevant locks acquired.
  7097. @return DB_SUCCESS or error code */
  7098. UNIV_INTERN
  7099. ulint
  7100. ha_innobase::innobase_get_autoinc(
  7101. /*==============================*/
  7102. ulonglong* value) /*!< out: autoinc value */
  7103. {
  7104. *value = 0;
  7105. prebuilt->autoinc_error = innobase_lock_autoinc();
  7106. if (prebuilt->autoinc_error == DB_SUCCESS) {
  7107. /* Determine the first value of the interval */
  7108. *value = dict_table_autoinc_read(prebuilt->table);
  7109. /* It should have been initialized during open. */
  7110. ut_a(*value != 0);
  7111. }
  7112. return(prebuilt->autoinc_error);
  7113. }
  7114. /*******************************************************************//**
  7115. This function reads the global auto-inc counter. It doesn't use the
  7116. AUTOINC lock even if the lock mode is set to TRADITIONAL.
  7117. @return the autoinc value */
  7118. UNIV_INTERN
  7119. ulonglong
  7120. ha_innobase::innobase_peek_autoinc(void)
  7121. /*====================================*/
  7122. {
  7123. ulonglong auto_inc;
  7124. dict_table_t* innodb_table;
  7125. ut_a(prebuilt != NULL);
  7126. ut_a(prebuilt->table != NULL);
  7127. innodb_table = prebuilt->table;
  7128. dict_table_autoinc_lock(innodb_table);
  7129. auto_inc = dict_table_autoinc_read(innodb_table);
  7130. ut_a(auto_inc > 0);
  7131. dict_table_autoinc_unlock(innodb_table);
  7132. return(auto_inc);
  7133. }
  7134. /*********************************************************************//**
  7135. This function initializes the auto-inc counter if it has not been
  7136. initialized yet. This function does not change the value of the auto-inc
  7137. counter if it already has been initialized. Returns the value of the
  7138. auto-inc counter in *first_value, and ULONGLONG_MAX in *nb_reserved_values (as
  7139. we have a table-level lock). offset, increment, nb_desired_values are ignored.
  7140. *first_value is set to -1 if error (deadlock or lock wait timeout) */
  7141. UNIV_INTERN
  7142. void
  7143. ha_innobase::get_auto_increment(
  7144. /*============================*/
  7145. ulonglong offset, /*!< in: table autoinc offset */
  7146. ulonglong increment, /*!< in: table autoinc increment */
  7147. ulonglong nb_desired_values, /*!< in: number of values reqd */
  7148. ulonglong *first_value, /*!< out: the autoinc value */
  7149. ulonglong *nb_reserved_values) /*!< out: count of reserved values */
  7150. {
  7151. trx_t* trx;
  7152. ulint error;
  7153. ulonglong autoinc = 0;
  7154. /* Prepare prebuilt->trx in the table handle */
  7155. update_thd(ha_thd());
  7156. error = innobase_get_autoinc(&autoinc);
  7157. if (error != DB_SUCCESS) {
  7158. *first_value = (~(ulonglong) 0);
  7159. return;
  7160. }
  7161. /* This is a hack, since nb_desired_values seems to be accurate only
  7162. for the first call to get_auto_increment() for multi-row INSERT and
  7163. meaningless for other statements e.g, LOAD etc. Subsequent calls to
  7164. this method for the same statement results in different values which
  7165. don't make sense. Therefore we store the value the first time we are
  7166. called and count down from that as rows are written (see write_row()).
  7167. */
  7168. trx = prebuilt->trx;
  7169. /* Note: We can't rely on *first_value since some MySQL engines,
  7170. in particular the partition engine, don't initialize it to 0 when
  7171. invoking this method. So we are not sure if it's guaranteed to
  7172. be 0 or not. */
  7173. /* Called for the first time ? */
  7174. if (trx->n_autoinc_rows == 0) {
  7175. trx->n_autoinc_rows = (ulint) nb_desired_values;
  7176. /* It's possible for nb_desired_values to be 0:
  7177. e.g., INSERT INTO T1(C) SELECT C FROM T2; */
  7178. if (nb_desired_values == 0) {
  7179. trx->n_autoinc_rows = 1;
  7180. }
  7181. set_if_bigger(*first_value, autoinc);
  7182. /* Not in the middle of a mult-row INSERT. */
  7183. } else if (prebuilt->autoinc_last_value == 0) {
  7184. set_if_bigger(*first_value, autoinc);
  7185. }
  7186. *nb_reserved_values = trx->n_autoinc_rows;
  7187. /* With old style AUTOINC locking we only update the table's
  7188. AUTOINC counter after attempting to insert the row. */
  7189. if (innobase_autoinc_lock_mode != AUTOINC_OLD_STYLE_LOCKING) {
  7190. ulonglong need;
  7191. ulonglong current;
  7192. ulonglong next_value;
  7193. ulonglong col_max_value;
  7194. /* We need the upper limit of the col type to check for
  7195. whether we update the table autoinc counter or not. */
  7196. col_max_value = innobase_get_int_col_max_value(
  7197. table->next_number_field);
  7198. current = *first_value > col_max_value ? autoinc : *first_value;
  7199. need = *nb_reserved_values * increment;
  7200. /* Compute the last value in the interval */
  7201. next_value = innobase_next_autoinc(
  7202. current, need, offset, col_max_value);
  7203. prebuilt->autoinc_last_value = next_value;
  7204. if (prebuilt->autoinc_last_value < *first_value) {
  7205. *first_value = (~(ulonglong) 0);
  7206. } else {
  7207. /* Update the table autoinc variable */
  7208. dict_table_autoinc_update_if_greater(
  7209. prebuilt->table, prebuilt->autoinc_last_value);
  7210. }
  7211. } else {
  7212. /* This will force write_row() into attempting an update
  7213. of the table's AUTOINC counter. */
  7214. prebuilt->autoinc_last_value = 0;
  7215. }
  7216. /* The increment to be used to increase the AUTOINC value, we use
  7217. this in write_row() and update_row() to increase the autoinc counter
  7218. for columns that are filled by the user. We need the offset and
  7219. the increment. */
  7220. prebuilt->autoinc_offset = offset;
  7221. prebuilt->autoinc_increment = increment;
  7222. dict_table_autoinc_unlock(prebuilt->table);
  7223. }
  7224. /*******************************************************************//**
  7225. Reset the auto-increment counter to the given value, i.e. the next row
  7226. inserted will get the given value. This is called e.g. after TRUNCATE
  7227. is emulated by doing a 'DELETE FROM t'. HA_ERR_WRONG_COMMAND is
  7228. returned by storage engines that don't support this operation.
  7229. @return 0 or error code */
  7230. UNIV_INTERN
  7231. int
  7232. ha_innobase::reset_auto_increment(
  7233. /*==============================*/
  7234. ulonglong value) /*!< in: new value for table autoinc */
  7235. {
  7236. DBUG_ENTER("ha_innobase::reset_auto_increment");
  7237. int error;
  7238. update_thd(ha_thd());
  7239. error = row_lock_table_autoinc_for_mysql(prebuilt);
  7240. if (error != DB_SUCCESS) {
  7241. error = convert_error_code_to_mysql(error,
  7242. prebuilt->table->flags,
  7243. user_thd);
  7244. DBUG_RETURN(error);
  7245. }
  7246. /* The next value can never be 0. */
  7247. if (value == 0) {
  7248. value = 1;
  7249. }
  7250. innobase_reset_autoinc(value);
  7251. DBUG_RETURN(0);
  7252. }
  7253. /* See comment in handler.cc */
  7254. UNIV_INTERN
  7255. bool
  7256. ha_innobase::get_error_message(int error, String *buf)
  7257. {
  7258. trx_t* trx = check_trx_exists(ha_thd());
  7259. buf->copy(trx->detailed_error, (uint) strlen(trx->detailed_error),
  7260. system_charset_info);
  7261. return(FALSE);
  7262. }
  7263. /*******************************************************************//**
  7264. Compares two 'refs'. A 'ref' is the (internal) primary key value of the row.
  7265. If there is no explicitly declared non-null unique key or a primary key, then
  7266. InnoDB internally uses the row id as the primary key.
  7267. @return < 0 if ref1 < ref2, 0 if equal, else > 0 */
  7268. UNIV_INTERN
  7269. int
  7270. ha_innobase::cmp_ref(
  7271. /*=================*/
  7272. const uchar* ref1, /*!< in: an (internal) primary key value in the
  7273. MySQL key value format */
  7274. const uchar* ref2) /*!< in: an (internal) primary key value in the
  7275. MySQL key value format */
  7276. {
  7277. enum_field_types mysql_type;
  7278. Field* field;
  7279. KEY_PART_INFO* key_part;
  7280. KEY_PART_INFO* key_part_end;
  7281. uint len1;
  7282. uint len2;
  7283. int result;
  7284. if (prebuilt->clust_index_was_generated) {
  7285. /* The 'ref' is an InnoDB row id */
  7286. return(memcmp(ref1, ref2, DATA_ROW_ID_LEN));
  7287. }
  7288. /* Do a type-aware comparison of primary key fields. PK fields
  7289. are always NOT NULL, so no checks for NULL are performed. */
  7290. key_part = table->key_info[table->s->primary_key].key_part;
  7291. key_part_end = key_part
  7292. + table->key_info[table->s->primary_key].key_parts;
  7293. for (; key_part != key_part_end; ++key_part) {
  7294. field = key_part->field;
  7295. mysql_type = field->type();
  7296. if (mysql_type == MYSQL_TYPE_TINY_BLOB
  7297. || mysql_type == MYSQL_TYPE_MEDIUM_BLOB
  7298. || mysql_type == MYSQL_TYPE_BLOB
  7299. || mysql_type == MYSQL_TYPE_LONG_BLOB) {
  7300. /* In the MySQL key value format, a column prefix of
  7301. a BLOB is preceded by a 2-byte length field */
  7302. len1 = innobase_read_from_2_little_endian(ref1);
  7303. len2 = innobase_read_from_2_little_endian(ref2);
  7304. ref1 += 2;
  7305. ref2 += 2;
  7306. result = ((Field_blob*)field)->cmp( ref1, len1,
  7307. ref2, len2);
  7308. } else {
  7309. result = field->key_cmp(ref1, ref2);
  7310. }
  7311. if (result) {
  7312. return(result);
  7313. }
  7314. ref1 += key_part->store_length;
  7315. ref2 += key_part->store_length;
  7316. }
  7317. return(0);
  7318. }
  7319. /*******************************************************************//**
  7320. Ask InnoDB if a query to a table can be cached.
  7321. @return TRUE if query caching of the table is permitted */
  7322. UNIV_INTERN
  7323. my_bool
  7324. ha_innobase::register_query_cache_table(
  7325. /*====================================*/
  7326. THD* thd, /*!< in: user thread handle */
  7327. char* table_key, /*!< in: concatenation of database name,
  7328. the null character NUL,
  7329. and the table name */
  7330. uint key_length, /*!< in: length of the full name, i.e.
  7331. len(dbname) + len(tablename) + 1 */
  7332. qc_engine_callback*
  7333. call_back, /*!< out: pointer to function for
  7334. checking if query caching
  7335. is permitted */
  7336. ulonglong *engine_data) /*!< in/out: data to call_back */
  7337. {
  7338. *call_back = innobase_query_caching_of_table_permitted;
  7339. *engine_data = 0;
  7340. return(innobase_query_caching_of_table_permitted(thd, table_key,
  7341. key_length,
  7342. engine_data));
  7343. }
  7344. UNIV_INTERN
  7345. char*
  7346. ha_innobase::get_mysql_bin_log_name()
  7347. {
  7348. return(trx_sys_mysql_bin_log_name);
  7349. }
  7350. UNIV_INTERN
  7351. ulonglong
  7352. ha_innobase::get_mysql_bin_log_pos()
  7353. {
  7354. /* trx... is ib_int64_t, which is a typedef for a 64-bit integer
  7355. (__int64 or longlong) so it's ok to cast it to ulonglong. */
  7356. return(trx_sys_mysql_bin_log_pos);
  7357. }
  7358. /******************************************************************//**
  7359. This function is used to find the storage length in bytes of the first n
  7360. characters for prefix indexes using a multibyte character set. The function
  7361. finds charset information and returns length of prefix_len characters in the
  7362. index field in bytes.
  7363. @return number of bytes occupied by the first n characters */
  7364. extern "C" UNIV_INTERN
  7365. ulint
  7366. innobase_get_at_most_n_mbchars(
  7367. /*===========================*/
  7368. ulint charset_id, /*!< in: character set id */
  7369. ulint prefix_len, /*!< in: prefix length in bytes of the index
  7370. (this has to be divided by mbmaxlen to get the
  7371. number of CHARACTERS n in the prefix) */
  7372. ulint data_len, /*!< in: length of the string in bytes */
  7373. const char* str) /*!< in: character string */
  7374. {
  7375. ulint char_length; /*!< character length in bytes */
  7376. ulint n_chars; /*!< number of characters in prefix */
  7377. CHARSET_INFO* charset; /*!< charset used in the field */
  7378. charset = get_charset((uint) charset_id, MYF(MY_WME));
  7379. ut_ad(charset);
  7380. ut_ad(charset->mbmaxlen);
  7381. /* Calculate how many characters at most the prefix index contains */
  7382. n_chars = prefix_len / charset->mbmaxlen;
  7383. /* If the charset is multi-byte, then we must find the length of the
  7384. first at most n chars in the string. If the string contains less
  7385. characters than n, then we return the length to the end of the last
  7386. character. */
  7387. if (charset->mbmaxlen > 1) {
  7388. /* my_charpos() returns the byte length of the first n_chars
  7389. characters, or a value bigger than the length of str, if
  7390. there were not enough full characters in str.
  7391. Why does the code below work:
  7392. Suppose that we are looking for n UTF-8 characters.
  7393. 1) If the string is long enough, then the prefix contains at
  7394. least n complete UTF-8 characters + maybe some extra
  7395. characters + an incomplete UTF-8 character. No problem in
  7396. this case. The function returns the pointer to the
  7397. end of the nth character.
  7398. 2) If the string is not long enough, then the string contains
  7399. the complete value of a column, that is, only complete UTF-8
  7400. characters, and we can store in the column prefix index the
  7401. whole string. */
  7402. char_length = my_charpos(charset, str,
  7403. str + data_len, (int) n_chars);
  7404. if (char_length > data_len) {
  7405. char_length = data_len;
  7406. }
  7407. } else {
  7408. if (data_len < prefix_len) {
  7409. char_length = data_len;
  7410. } else {
  7411. char_length = prefix_len;
  7412. }
  7413. }
  7414. return(char_length);
  7415. }
  7416. /*******************************************************************//**
  7417. This function is used to prepare an X/Open XA distributed transaction.
  7418. @return 0 or error number */
  7419. static
  7420. int
  7421. innobase_xa_prepare(
  7422. /*================*/
  7423. handlerton* hton, /*!< in: InnoDB handlerton */
  7424. THD* thd, /*!< in: handle to the MySQL thread of
  7425. the user whose XA transaction should
  7426. be prepared */
  7427. bool all) /*!< in: TRUE - commit transaction
  7428. FALSE - the current SQL statement
  7429. ended */
  7430. {
  7431. int error = 0;
  7432. trx_t* trx = check_trx_exists(thd);
  7433. DBUG_ASSERT(hton == innodb_hton_ptr);
  7434. /* we use support_xa value as it was seen at transaction start
  7435. time, not the current session variable value. Any possible changes
  7436. to the session variable take effect only in the next transaction */
  7437. if (!trx->support_xa) {
  7438. return(0);
  7439. }
  7440. thd_get_xid(thd, (MYSQL_XID*) &trx->xid);
  7441. /* Release a possible FIFO ticket and search latch. Since we will
  7442. reserve the kernel mutex, we have to release the search system latch
  7443. first to obey the latching order. */
  7444. innobase_release_stat_resources(trx);
  7445. if (trx->active_trans == 0 && trx->conc_state != TRX_NOT_STARTED) {
  7446. sql_print_error("trx->active_trans == 0, but trx->conc_state != "
  7447. "TRX_NOT_STARTED");
  7448. }
  7449. if (all
  7450. || (!thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) {
  7451. /* We were instructed to prepare the whole transaction, or
  7452. this is an SQL statement end and autocommit is on */
  7453. ut_ad(trx->active_trans);
  7454. error = (int) trx_prepare_for_mysql(trx);
  7455. } else {
  7456. /* We just mark the SQL statement ended and do not do a
  7457. transaction prepare */
  7458. /* If we had reserved the auto-inc lock for some
  7459. table in this SQL statement we release it now */
  7460. row_unlock_table_autoinc_for_mysql(trx);
  7461. /* Store the current undo_no of the transaction so that we
  7462. know where to roll back if we have to roll back the next
  7463. SQL statement */
  7464. trx_mark_sql_stat_end(trx);
  7465. }
  7466. /* Tell the InnoDB server that there might be work for utility
  7467. threads: */
  7468. srv_active_wake_master_thread();
  7469. if (thd_sql_command(thd) != SQLCOM_XA_PREPARE &&
  7470. (all || !thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
  7471. {
  7472. /* For ibbackup to work the order of transactions in binlog
  7473. and InnoDB must be the same. Consider the situation
  7474. thread1> prepare; write to binlog; ...
  7475. <context switch>
  7476. thread2> prepare; write to binlog; commit
  7477. thread1> ... commit
  7478. To ensure this will not happen we're taking the mutex on
  7479. prepare, and releasing it on commit.
  7480. Note: only do it for normal commits, done via ha_commit_trans.
  7481. If 2pc protocol is executed by external transaction
  7482. coordinator, it will be just a regular MySQL client
  7483. executing XA PREPARE and XA COMMIT commands.
  7484. In this case we cannot know how many minutes or hours
  7485. will be between XA PREPARE and XA COMMIT, and we don't want
  7486. to block for undefined period of time. */
  7487. pthread_mutex_lock(&prepare_commit_mutex);
  7488. trx->active_trans = 2;
  7489. }
  7490. return(error);
  7491. }
  7492. /*******************************************************************//**
  7493. This function is used to recover X/Open XA distributed transactions.
  7494. @return number of prepared transactions stored in xid_list */
  7495. static
  7496. int
  7497. innobase_xa_recover(
  7498. /*================*/
  7499. handlerton* hton, /*!< in: InnoDB handlerton */
  7500. XID* xid_list,/*!< in/out: prepared transactions */
  7501. uint len) /*!< in: number of slots in xid_list */
  7502. {
  7503. DBUG_ASSERT(hton == innodb_hton_ptr);
  7504. if (len == 0 || xid_list == NULL) {
  7505. return(0);
  7506. }
  7507. return(trx_recover_for_mysql(xid_list, len));
  7508. }
  7509. /*******************************************************************//**
  7510. This function is used to commit one X/Open XA distributed transaction
  7511. which is in the prepared state
  7512. @return 0 or error number */
  7513. static
  7514. int
  7515. innobase_commit_by_xid(
  7516. /*===================*/
  7517. handlerton *hton,
  7518. XID* xid) /*!< in: X/Open XA transaction identification */
  7519. {
  7520. trx_t* trx;
  7521. DBUG_ASSERT(hton == innodb_hton_ptr);
  7522. trx = trx_get_trx_by_xid(xid);
  7523. if (trx) {
  7524. innobase_commit_low(trx);
  7525. return(XA_OK);
  7526. } else {
  7527. return(XAER_NOTA);
  7528. }
  7529. }
  7530. /*******************************************************************//**
  7531. This function is used to rollback one X/Open XA distributed transaction
  7532. which is in the prepared state
  7533. @return 0 or error number */
  7534. static
  7535. int
  7536. innobase_rollback_by_xid(
  7537. /*=====================*/
  7538. handlerton* hton, /*!< in: InnoDB handlerton */
  7539. XID* xid) /*!< in: X/Open XA transaction
  7540. identification */
  7541. {
  7542. trx_t* trx;
  7543. DBUG_ASSERT(hton == innodb_hton_ptr);
  7544. trx = trx_get_trx_by_xid(xid);
  7545. if (trx) {
  7546. return(innobase_rollback_trx(trx));
  7547. } else {
  7548. return(XAER_NOTA);
  7549. }
  7550. }
  7551. /*******************************************************************//**
  7552. Create a consistent view for a cursor based on current transaction
  7553. which is created if the corresponding MySQL thread still lacks one.
  7554. This consistent view is then used inside of MySQL when accessing records
  7555. using a cursor.
  7556. @return pointer to cursor view or NULL */
  7557. static
  7558. void*
  7559. innobase_create_cursor_view(
  7560. /*========================*/
  7561. handlerton *hton, /*!< in: innobase hton */
  7562. THD* thd) /*!< in: user thread handle */
  7563. {
  7564. DBUG_ASSERT(hton == innodb_hton_ptr);
  7565. return(read_cursor_view_create_for_mysql(check_trx_exists(thd)));
  7566. }
  7567. /*******************************************************************//**
  7568. Close the given consistent cursor view of a transaction and restore
  7569. global read view to a transaction read view. Transaction is created if the
  7570. corresponding MySQL thread still lacks one. */
  7571. static
  7572. void
  7573. innobase_close_cursor_view(
  7574. /*=======================*/
  7575. handlerton *hton,
  7576. THD* thd, /*!< in: user thread handle */
  7577. void* curview)/*!< in: Consistent read view to be closed */
  7578. {
  7579. DBUG_ASSERT(hton == innodb_hton_ptr);
  7580. read_cursor_view_close_for_mysql(check_trx_exists(thd),
  7581. (cursor_view_t*) curview);
  7582. }
  7583. /*******************************************************************//**
  7584. Set the given consistent cursor view to a transaction which is created
  7585. if the corresponding MySQL thread still lacks one. If the given
  7586. consistent cursor view is NULL global read view of a transaction is
  7587. restored to a transaction read view. */
  7588. static
  7589. void
  7590. innobase_set_cursor_view(
  7591. /*=====================*/
  7592. handlerton *hton,
  7593. THD* thd, /*!< in: user thread handle */
  7594. void* curview)/*!< in: Consistent cursor view to be set */
  7595. {
  7596. DBUG_ASSERT(hton == innodb_hton_ptr);
  7597. read_cursor_set_for_mysql(check_trx_exists(thd),
  7598. (cursor_view_t*) curview);
  7599. }
  7600. /***********************************************************************
  7601. Check whether any of the given columns is being renamed in the table. */
  7602. static
  7603. bool
  7604. column_is_being_renamed(
  7605. /*====================*/
  7606. /* out: true if any of col_names is
  7607. being renamed in table */
  7608. TABLE* table, /* in: MySQL table */
  7609. uint n_cols, /* in: number of columns */
  7610. const char** col_names) /* in: names of the columns */
  7611. {
  7612. uint j;
  7613. uint k;
  7614. Field* field;
  7615. const char* col_name;
  7616. for (j = 0; j < n_cols; j++) {
  7617. col_name = col_names[j];
  7618. for (k = 0; k < table->s->fields; k++) {
  7619. field = table->field[k];
  7620. if ((field->flags & FIELD_IS_RENAMED)
  7621. && innobase_strcasecmp(field->field_name,
  7622. col_name) == 0) {
  7623. return(true);
  7624. }
  7625. }
  7626. }
  7627. return(false);
  7628. }
  7629. /***********************************************************************
  7630. Check whether a column in table "table" is being renamed and if this column
  7631. is part of a foreign key, either part of another table, referencing this
  7632. table or part of this table, referencing another table. */
  7633. static
  7634. bool
  7635. foreign_key_column_is_being_renamed(
  7636. /*================================*/
  7637. /* out: true if a column that
  7638. participates in a foreign key definition
  7639. is being renamed */
  7640. row_prebuilt_t* prebuilt, /* in: InnoDB prebuilt struct */
  7641. TABLE* table) /* in: MySQL table */
  7642. {
  7643. dict_foreign_t* foreign;
  7644. /* check whether there are foreign keys at all */
  7645. if (UT_LIST_GET_LEN(prebuilt->table->foreign_list) == 0
  7646. && UT_LIST_GET_LEN(prebuilt->table->referenced_list) == 0) {
  7647. /* no foreign keys involved with prebuilt->table */
  7648. return(false);
  7649. }
  7650. row_mysql_lock_data_dictionary(prebuilt->trx);
  7651. /* Check whether any column in the foreign key constraints which refer
  7652. to this table is being renamed. */
  7653. for (foreign = UT_LIST_GET_FIRST(prebuilt->table->referenced_list);
  7654. foreign != NULL;
  7655. foreign = UT_LIST_GET_NEXT(referenced_list, foreign)) {
  7656. if (column_is_being_renamed(table, foreign->n_fields,
  7657. foreign->referenced_col_names)) {
  7658. row_mysql_unlock_data_dictionary(prebuilt->trx);
  7659. return(true);
  7660. }
  7661. }
  7662. /* Check whether any column in the foreign key constraints in the
  7663. table is being renamed. */
  7664. for (foreign = UT_LIST_GET_FIRST(prebuilt->table->foreign_list);
  7665. foreign != NULL;
  7666. foreign = UT_LIST_GET_NEXT(foreign_list, foreign)) {
  7667. if (column_is_being_renamed(table, foreign->n_fields,
  7668. foreign->foreign_col_names)) {
  7669. row_mysql_unlock_data_dictionary(prebuilt->trx);
  7670. return(true);
  7671. }
  7672. }
  7673. row_mysql_unlock_data_dictionary(prebuilt->trx);
  7674. return(false);
  7675. }
  7676. UNIV_INTERN
  7677. bool
  7678. ha_innobase::check_if_incompatible_data(
  7679. HA_CREATE_INFO* info,
  7680. uint table_changes)
  7681. {
  7682. if (table_changes != IS_EQUAL_YES) {
  7683. return(COMPATIBLE_DATA_NO);
  7684. }
  7685. /* Check that auto_increment value was not changed */
  7686. if ((info->used_fields & HA_CREATE_USED_AUTO) &&
  7687. info->auto_increment_value != 0) {
  7688. return(COMPATIBLE_DATA_NO);
  7689. }
  7690. /* Check if a column participating in a foreign key is being renamed.
  7691. There is no mechanism for updating InnoDB foreign key definitions. */
  7692. if (foreign_key_column_is_being_renamed(prebuilt, table)) {
  7693. return COMPATIBLE_DATA_NO;
  7694. }
  7695. /* Check that row format didn't change */
  7696. if ((info->used_fields & HA_CREATE_USED_ROW_FORMAT)
  7697. && info->row_type != ROW_TYPE_DEFAULT
  7698. && info->row_type != get_row_type()) {
  7699. return(COMPATIBLE_DATA_NO);
  7700. }
  7701. /* Specifying KEY_BLOCK_SIZE requests a rebuild of the table. */
  7702. if (info->used_fields & HA_CREATE_USED_KEY_BLOCK_SIZE) {
  7703. return(COMPATIBLE_DATA_NO);
  7704. }
  7705. return(COMPATIBLE_DATA_YES);
  7706. }
  7707. /************************************************************//**
  7708. Validate the file format name and return its corresponding id.
  7709. @return valid file format id */
  7710. static
  7711. uint
  7712. innobase_file_format_name_lookup(
  7713. /*=============================*/
  7714. const char* format_name) /*!< in: pointer to file format name */
  7715. {
  7716. char* endp;
  7717. uint format_id;
  7718. ut_a(format_name != NULL);
  7719. /* The format name can contain the format id itself instead of
  7720. the name and we check for that. */
  7721. format_id = (uint) strtoul(format_name, &endp, 10);
  7722. /* Check for valid parse. */
  7723. if (*endp == '\0' && *format_name != '\0') {
  7724. if (format_id <= DICT_TF_FORMAT_MAX) {
  7725. return(format_id);
  7726. }
  7727. } else {
  7728. for (format_id = 0; format_id <= DICT_TF_FORMAT_MAX;
  7729. format_id++) {
  7730. const char* name;
  7731. name = trx_sys_file_format_id_to_name(format_id);
  7732. if (!innobase_strcasecmp(format_name, name)) {
  7733. return(format_id);
  7734. }
  7735. }
  7736. }
  7737. return(DICT_TF_FORMAT_MAX + 1);
  7738. }
  7739. /************************************************************//**
  7740. Validate the file format check value, is it one of "on" or "off",
  7741. as a side effect it sets the srv_check_file_format_at_startup variable.
  7742. @return true if config value one of "on" or "off" */
  7743. static
  7744. bool
  7745. innobase_file_format_check_on_off(
  7746. /*==============================*/
  7747. const char* format_check) /*!< in: parameter value */
  7748. {
  7749. bool ret = true;
  7750. if (!innobase_strcasecmp(format_check, "off")) {
  7751. /* Set the value to disable checking. */
  7752. srv_check_file_format_at_startup = DICT_TF_FORMAT_MAX + 1;
  7753. } else if (!innobase_strcasecmp(format_check, "on")) {
  7754. /* Set the value to the lowest supported format. */
  7755. srv_check_file_format_at_startup = DICT_TF_FORMAT_51;
  7756. } else {
  7757. ret = FALSE;
  7758. }
  7759. return(ret);
  7760. }
  7761. /************************************************************//**
  7762. Validate the file format check config parameters, as a side effect it
  7763. sets the srv_check_file_format_at_startup variable.
  7764. @return the format_id if valid config value, otherwise, return -1 */
  7765. static
  7766. int
  7767. innobase_file_format_validate_and_set(
  7768. /*================================*/
  7769. const char* format_check) /*!< in: parameter value */
  7770. {
  7771. uint format_id;
  7772. format_id = innobase_file_format_name_lookup(format_check);
  7773. if (format_id < DICT_TF_FORMAT_MAX + 1) {
  7774. srv_check_file_format_at_startup = format_id;
  7775. return((int) format_id);
  7776. } else {
  7777. return(-1);
  7778. }
  7779. }
  7780. /*************************************************************//**
  7781. Check if it is a valid file format. This function is registered as
  7782. a callback with MySQL.
  7783. @return 0 for valid file format */
  7784. static
  7785. int
  7786. innodb_file_format_name_validate(
  7787. /*=============================*/
  7788. THD* thd, /*!< in: thread handle */
  7789. struct st_mysql_sys_var* var, /*!< in: pointer to system
  7790. variable */
  7791. void* save, /*!< out: immediate result
  7792. for update function */
  7793. struct st_mysql_value* value) /*!< in: incoming string */
  7794. {
  7795. const char* file_format_input;
  7796. char buff[STRING_BUFFER_USUAL_SIZE];
  7797. int len = sizeof(buff);
  7798. ut_a(save != NULL);
  7799. ut_a(value != NULL);
  7800. file_format_input = value->val_str(value, buff, &len);
  7801. if (file_format_input != NULL) {
  7802. uint format_id;
  7803. format_id = innobase_file_format_name_lookup(
  7804. file_format_input);
  7805. if (format_id <= DICT_TF_FORMAT_MAX) {
  7806. /* Save a pointer to the name in the
  7807. 'file_format_name_map' constant array. */
  7808. *static_cast<const char**>(save) =
  7809. trx_sys_file_format_id_to_name(format_id);
  7810. return(0);
  7811. }
  7812. }
  7813. *static_cast<const char**>(save) = NULL;
  7814. return(1);
  7815. }
  7816. /****************************************************************//**
  7817. Update the system variable innodb_file_format using the "saved"
  7818. value. This function is registered as a callback with MySQL. */
  7819. static
  7820. void
  7821. innodb_file_format_name_update(
  7822. /*===========================*/
  7823. THD* thd, /*!< in: thread handle */
  7824. struct st_mysql_sys_var* var, /*!< in: pointer to
  7825. system variable */
  7826. void* var_ptr, /*!< out: where the
  7827. formal string goes */
  7828. const void* save) /*!< in: immediate result
  7829. from check function */
  7830. {
  7831. const char* format_name;
  7832. ut_a(var_ptr != NULL);
  7833. ut_a(save != NULL);
  7834. format_name = *static_cast<const char*const*>(save);
  7835. if (format_name) {
  7836. uint format_id;
  7837. format_id = innobase_file_format_name_lookup(format_name);
  7838. if (format_id <= DICT_TF_FORMAT_MAX) {
  7839. srv_file_format = format_id;
  7840. }
  7841. }
  7842. *static_cast<const char**>(var_ptr)
  7843. = trx_sys_file_format_id_to_name(srv_file_format);
  7844. }
  7845. /*************************************************************//**
  7846. Check if valid argument to innodb_file_format_check. This
  7847. function is registered as a callback with MySQL.
  7848. @return 0 for valid file format */
  7849. static
  7850. int
  7851. innodb_file_format_check_validate(
  7852. /*==============================*/
  7853. THD* thd, /*!< in: thread handle */
  7854. struct st_mysql_sys_var* var, /*!< in: pointer to system
  7855. variable */
  7856. void* save, /*!< out: immediate result
  7857. for update function */
  7858. struct st_mysql_value* value) /*!< in: incoming string */
  7859. {
  7860. const char* file_format_input;
  7861. char buff[STRING_BUFFER_USUAL_SIZE];
  7862. int len = sizeof(buff);
  7863. int format_id;
  7864. ut_a(save != NULL);
  7865. ut_a(value != NULL);
  7866. file_format_input = value->val_str(value, buff, &len);
  7867. if (file_format_input != NULL) {
  7868. /* Check if user set on/off, we want to print a suitable
  7869. message if they did so. */
  7870. if (innobase_file_format_check_on_off(file_format_input)) {
  7871. push_warning_printf(thd,
  7872. MYSQL_ERROR::WARN_LEVEL_WARN,
  7873. ER_WRONG_ARGUMENTS,
  7874. "InnoDB: invalid innodb_file_format_check "
  7875. "value; on/off can only be set at startup or "
  7876. "in the configuration file");
  7877. } else {
  7878. format_id = innobase_file_format_validate_and_set(
  7879. file_format_input);
  7880. if (format_id >= 0) {
  7881. /* Save a pointer to the name in the
  7882. 'file_format_name_map' constant array. */
  7883. *static_cast<const char**>(save) =
  7884. trx_sys_file_format_id_to_name(
  7885. (uint)format_id);
  7886. return(0);
  7887. } else {
  7888. push_warning_printf(thd,
  7889. MYSQL_ERROR::WARN_LEVEL_WARN,
  7890. ER_WRONG_ARGUMENTS,
  7891. "InnoDB: invalid innodb_file_format_check "
  7892. "value; can be any format up to %s "
  7893. "or its equivalent numeric id",
  7894. trx_sys_file_format_id_to_name(
  7895. DICT_TF_FORMAT_MAX));
  7896. }
  7897. }
  7898. }
  7899. *static_cast<const char**>(save) = NULL;
  7900. return(1);
  7901. }
  7902. /****************************************************************//**
  7903. Update the system variable innodb_file_format_check using the "saved"
  7904. value. This function is registered as a callback with MySQL. */
  7905. static
  7906. void
  7907. innodb_file_format_check_update(
  7908. /*============================*/
  7909. THD* thd, /*!< in: thread handle */
  7910. struct st_mysql_sys_var* var, /*!< in: pointer to
  7911. system variable */
  7912. void* var_ptr, /*!< out: where the
  7913. formal string goes */
  7914. const void* save) /*!< in: immediate result
  7915. from check function */
  7916. {
  7917. const char* format_name_in;
  7918. const char** format_name_out;
  7919. uint format_id;
  7920. ut_a(save != NULL);
  7921. ut_a(var_ptr != NULL);
  7922. format_name_in = *static_cast<const char*const*>(save);
  7923. if (!format_name_in) {
  7924. return;
  7925. }
  7926. format_id = innobase_file_format_name_lookup(format_name_in);
  7927. if (format_id > DICT_TF_FORMAT_MAX) {
  7928. /* DEFAULT is "on", which is invalid at runtime. */
  7929. push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
  7930. ER_WRONG_ARGUMENTS,
  7931. "Ignoring SET innodb_file_format=%s",
  7932. format_name_in);
  7933. return;
  7934. }
  7935. format_name_out = static_cast<const char**>(var_ptr);
  7936. /* Update the max format id in the system tablespace. */
  7937. if (trx_sys_file_format_max_set(format_id, format_name_out)) {
  7938. ut_print_timestamp(stderr);
  7939. fprintf(stderr,
  7940. " [Info] InnoDB: the file format in the system "
  7941. "tablespace is now set to %s.\n", *format_name_out);
  7942. }
  7943. }
  7944. /****************************************************************//**
  7945. Update the system variable innodb_adaptive_hash_index using the "saved"
  7946. value. This function is registered as a callback with MySQL. */
  7947. static
  7948. void
  7949. innodb_adaptive_hash_index_update(
  7950. /*==============================*/
  7951. THD* thd, /*!< in: thread handle */
  7952. struct st_mysql_sys_var* var, /*!< in: pointer to
  7953. system variable */
  7954. void* var_ptr, /*!< out: where the
  7955. formal string goes */
  7956. const void* save) /*!< in: immediate result
  7957. from check function */
  7958. {
  7959. if (*(my_bool*) save) {
  7960. btr_search_enable();
  7961. } else {
  7962. btr_search_disable();
  7963. }
  7964. }
  7965. /****************************************************************//**
  7966. Update the system variable innodb_old_blocks_pct using the "saved"
  7967. value. This function is registered as a callback with MySQL. */
  7968. static
  7969. void
  7970. innodb_old_blocks_pct_update(
  7971. /*=========================*/
  7972. THD* thd, /*!< in: thread handle */
  7973. struct st_mysql_sys_var* var, /*!< in: pointer to
  7974. system variable */
  7975. void* var_ptr,/*!< out: where the
  7976. formal string goes */
  7977. const void* save) /*!< in: immediate result
  7978. from check function */
  7979. {
  7980. innobase_old_blocks_pct = buf_LRU_old_ratio_update(
  7981. *static_cast<const uint*>(save), TRUE);
  7982. }
  7983. /*************************************************************//**
  7984. Check if it is a valid value of innodb_change_buffering. This function is
  7985. registered as a callback with MySQL.
  7986. @return 0 for valid innodb_change_buffering */
  7987. static
  7988. int
  7989. innodb_change_buffering_validate(
  7990. /*=============================*/
  7991. THD* thd, /*!< in: thread handle */
  7992. struct st_mysql_sys_var* var, /*!< in: pointer to system
  7993. variable */
  7994. void* save, /*!< out: immediate result
  7995. for update function */
  7996. struct st_mysql_value* value) /*!< in: incoming string */
  7997. {
  7998. const char* change_buffering_input;
  7999. char buff[STRING_BUFFER_USUAL_SIZE];
  8000. int len = sizeof(buff);
  8001. ut_a(save != NULL);
  8002. ut_a(value != NULL);
  8003. change_buffering_input = value->val_str(value, buff, &len);
  8004. if (change_buffering_input != NULL) {
  8005. ulint use;
  8006. for (use = 0; use < UT_ARR_SIZE(innobase_change_buffering_values);
  8007. use++) {
  8008. if (!innobase_strcasecmp(
  8009. change_buffering_input,
  8010. innobase_change_buffering_values[use])) {
  8011. *(ibuf_use_t*) save = (ibuf_use_t) use;
  8012. return(0);
  8013. }
  8014. }
  8015. }
  8016. return(1);
  8017. }
  8018. /****************************************************************//**
  8019. Update the system variable innodb_change_buffering using the "saved"
  8020. value. This function is registered as a callback with MySQL. */
  8021. static
  8022. void
  8023. innodb_change_buffering_update(
  8024. /*===========================*/
  8025. THD* thd, /*!< in: thread handle */
  8026. struct st_mysql_sys_var* var, /*!< in: pointer to
  8027. system variable */
  8028. void* var_ptr, /*!< out: where the
  8029. formal string goes */
  8030. const void* save) /*!< in: immediate result
  8031. from check function */
  8032. {
  8033. ut_a(var_ptr != NULL);
  8034. ut_a(save != NULL);
  8035. ut_a((*(ibuf_use_t*) save) < IBUF_USE_COUNT);
  8036. ibuf_use = *(const ibuf_use_t*) save;
  8037. *(const char**) var_ptr = innobase_change_buffering_values[ibuf_use];
  8038. }
  8039. static int show_innodb_vars(THD *thd, SHOW_VAR *var, char *buff)
  8040. {
  8041. innodb_export_status();
  8042. var->type= SHOW_ARRAY;
  8043. var->value= (char *) &innodb_status_variables;
  8044. return 0;
  8045. }
  8046. /***********************************************************************
  8047. This function checks each index name for a table against reserved
  8048. system default primary index name 'GEN_CLUST_INDEX'. If a name matches,
  8049. this function pushes an warning message to the client, and returns true. */
  8050. extern "C" UNIV_INTERN
  8051. bool
  8052. innobase_index_name_is_reserved(
  8053. /*============================*/
  8054. /* out: true if an index name
  8055. matches the reserved name */
  8056. const trx_t* trx, /* in: InnoDB transaction handle */
  8057. const KEY* key_info, /* in: Indexes to be created */
  8058. ulint num_of_keys) /* in: Number of indexes to
  8059. be created. */
  8060. {
  8061. const KEY* key;
  8062. uint key_num; /* index number */
  8063. for (key_num = 0; key_num < num_of_keys; key_num++) {
  8064. key = &key_info[key_num];
  8065. if (innobase_strcasecmp(key->name,
  8066. innobase_index_reserve_name) == 0) {
  8067. /* Push warning to mysql */
  8068. push_warning_printf((THD*) trx->mysql_thd,
  8069. MYSQL_ERROR::WARN_LEVEL_WARN,
  8070. ER_WRONG_NAME_FOR_INDEX,
  8071. "Cannot Create Index with name "
  8072. "'%s'. The name is reserved "
  8073. "for the system default primary "
  8074. "index.",
  8075. innobase_index_reserve_name);
  8076. my_error(ER_WRONG_NAME_FOR_INDEX, MYF(0),
  8077. innobase_index_reserve_name);
  8078. return(true);
  8079. }
  8080. }
  8081. return(false);
  8082. }
  8083. static SHOW_VAR innodb_status_variables_export[]= {
  8084. {"Innodb", (char*) &show_innodb_vars, SHOW_FUNC},
  8085. {NullS, NullS, SHOW_LONG}
  8086. };
  8087. static struct st_mysql_storage_engine innobase_storage_engine=
  8088. { MYSQL_HANDLERTON_INTERFACE_VERSION };
  8089. /* plugin options */
  8090. static MYSQL_SYSVAR_BOOL(checksums, innobase_use_checksums,
  8091. PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
  8092. "Enable InnoDB checksums validation (enabled by default). "
  8093. "Disable with --skip-innodb-checksums.",
  8094. NULL, NULL, TRUE);
  8095. static MYSQL_SYSVAR_STR(data_home_dir, innobase_data_home_dir,
  8096. PLUGIN_VAR_READONLY,
  8097. "The common part for InnoDB table spaces.",
  8098. NULL, NULL, NULL);
  8099. static MYSQL_SYSVAR_BOOL(doublewrite, innobase_use_doublewrite,
  8100. PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
  8101. "Enable InnoDB doublewrite buffer (enabled by default). "
  8102. "Disable with --skip-innodb-doublewrite.",
  8103. NULL, NULL, TRUE);
  8104. static MYSQL_SYSVAR_ULONG(io_capacity, srv_io_capacity,
  8105. PLUGIN_VAR_RQCMDARG,
  8106. "Number of IOPs the server can do. Tunes the background IO rate",
  8107. NULL, NULL, 200, 100, ~0L, 0);
  8108. static MYSQL_SYSVAR_ULONG(fast_shutdown, innobase_fast_shutdown,
  8109. PLUGIN_VAR_OPCMDARG,
  8110. "Speeds up the shutdown process of the InnoDB storage engine. Possible "
  8111. "values are 0, 1 (faster)"
  8112. /*
  8113. NetWare can't close unclosed files, can't automatically kill remaining
  8114. threads, etc, so on this OS we disable the crash-like InnoDB shutdown.
  8115. */
  8116. IF_NETWARE("", " or 2 (fastest - crash-like)")
  8117. ".",
  8118. NULL, NULL, 1, 0, IF_NETWARE(1,2), 0);
  8119. static MYSQL_SYSVAR_BOOL(file_per_table, srv_file_per_table,
  8120. PLUGIN_VAR_NOCMDARG,
  8121. "Stores each InnoDB table to an .ibd file in the database dir.",
  8122. NULL, NULL, FALSE);
  8123. static MYSQL_SYSVAR_STR(file_format, innobase_file_format_name,
  8124. PLUGIN_VAR_RQCMDARG,
  8125. "File format to use for new tables in .ibd files.",
  8126. innodb_file_format_name_validate,
  8127. innodb_file_format_name_update, "Antelope");
  8128. /* If a new file format is introduced, the file format
  8129. name needs to be updated accordingly. Please refer to
  8130. file_format_name_map[] defined in trx0sys.c for the next
  8131. file format name. */
  8132. static MYSQL_SYSVAR_STR(file_format_check, innobase_file_format_check,
  8133. PLUGIN_VAR_OPCMDARG,
  8134. "The highest file format in the tablespace.",
  8135. innodb_file_format_check_validate,
  8136. innodb_file_format_check_update, "Barracuda");
  8137. static MYSQL_SYSVAR_ULONG(flush_log_at_trx_commit, srv_flush_log_at_trx_commit,
  8138. PLUGIN_VAR_OPCMDARG,
  8139. "Set to 0 (write and flush once per second),"
  8140. " 1 (write and flush at each commit)"
  8141. " or 2 (write at commit, flush once per second).",
  8142. NULL, NULL, 1, 0, 2, 0);
  8143. static MYSQL_SYSVAR_STR(flush_method, innobase_file_flush_method,
  8144. PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
  8145. "With which method to flush data.", NULL, NULL, NULL);
  8146. static MYSQL_SYSVAR_BOOL(locks_unsafe_for_binlog, innobase_locks_unsafe_for_binlog,
  8147. PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
  8148. "Force InnoDB to not use next-key locking, to use only row-level locking.",
  8149. NULL, NULL, FALSE);
  8150. #ifdef UNIV_LOG_ARCHIVE
  8151. static MYSQL_SYSVAR_STR(log_arch_dir, innobase_log_arch_dir,
  8152. PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
  8153. "Where full logs should be archived.", NULL, NULL, NULL);
  8154. static MYSQL_SYSVAR_BOOL(log_archive, innobase_log_archive,
  8155. PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY,
  8156. "Set to 1 if you want to have logs archived.", NULL, NULL, FALSE);
  8157. #endif /* UNIV_LOG_ARCHIVE */
  8158. static MYSQL_SYSVAR_STR(log_group_home_dir, innobase_log_group_home_dir,
  8159. PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
  8160. "Path to InnoDB log files.", NULL, NULL, NULL);
  8161. static MYSQL_SYSVAR_ULONG(max_dirty_pages_pct, srv_max_buf_pool_modified_pct,
  8162. PLUGIN_VAR_RQCMDARG,
  8163. "Percentage of dirty pages allowed in bufferpool.",
  8164. NULL, NULL, 75, 0, 99, 0);
  8165. static MYSQL_SYSVAR_BOOL(adaptive_flushing, srv_adaptive_flushing,
  8166. PLUGIN_VAR_NOCMDARG,
  8167. "Attempt flushing dirty pages to avoid IO bursts at checkpoints.",
  8168. NULL, NULL, TRUE);
  8169. static MYSQL_SYSVAR_ULONG(max_purge_lag, srv_max_purge_lag,
  8170. PLUGIN_VAR_RQCMDARG,
  8171. "Desired maximum length of the purge queue (0 = no limit)",
  8172. NULL, NULL, 0, 0, ~0L, 0);
  8173. static MYSQL_SYSVAR_BOOL(rollback_on_timeout, innobase_rollback_on_timeout,
  8174. PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY,
  8175. "Roll back the complete transaction on lock wait timeout, for 4.x compatibility (disabled by default)",
  8176. NULL, NULL, FALSE);
  8177. static MYSQL_SYSVAR_BOOL(status_file, innobase_create_status_file,
  8178. PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_NOSYSVAR,
  8179. "Enable SHOW INNODB STATUS output in the innodb_status.<pid> file",
  8180. NULL, NULL, FALSE);
  8181. static MYSQL_SYSVAR_BOOL(stats_on_metadata, innobase_stats_on_metadata,
  8182. PLUGIN_VAR_OPCMDARG,
  8183. "Enable statistics gathering for metadata commands such as SHOW TABLE STATUS (on by default)",
  8184. NULL, NULL, TRUE);
  8185. static MYSQL_SYSVAR_ULONGLONG(stats_sample_pages, srv_stats_sample_pages,
  8186. PLUGIN_VAR_RQCMDARG,
  8187. "The number of index pages to sample when calculating statistics (default 8)",
  8188. NULL, NULL, 8, 1, ~0ULL, 0);
  8189. static MYSQL_SYSVAR_BOOL(adaptive_hash_index, btr_search_enabled,
  8190. PLUGIN_VAR_OPCMDARG,
  8191. "Enable InnoDB adaptive hash index (enabled by default). "
  8192. "Disable with --skip-innodb-adaptive-hash-index.",
  8193. NULL, innodb_adaptive_hash_index_update, TRUE);
  8194. static MYSQL_SYSVAR_ULONG(replication_delay, srv_replication_delay,
  8195. PLUGIN_VAR_RQCMDARG,
  8196. "Replication thread delay (ms) on the slave server if "
  8197. "innodb_thread_concurrency is reached (0 by default)",
  8198. NULL, NULL, 0, 0, ~0UL, 0);
  8199. static MYSQL_SYSVAR_LONG(additional_mem_pool_size, innobase_additional_mem_pool_size,
  8200. PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
  8201. "Size of a memory pool InnoDB uses to store data dictionary information and other internal data structures.",
  8202. NULL, NULL, 8*1024*1024L, 512*1024L, LONG_MAX, 1024);
  8203. static MYSQL_SYSVAR_ULONG(autoextend_increment, srv_auto_extend_increment,
  8204. PLUGIN_VAR_RQCMDARG,
  8205. "Data file autoextend increment in megabytes",
  8206. NULL, NULL, 8L, 1L, 1000L, 0);
  8207. static MYSQL_SYSVAR_LONGLONG(buffer_pool_size, innobase_buffer_pool_size,
  8208. PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
  8209. "The size of the memory buffer InnoDB uses to cache data and indexes of its tables.",
  8210. NULL, NULL, 128*1024*1024L, 5*1024*1024L, LONGLONG_MAX, 1024*1024L);
  8211. static MYSQL_SYSVAR_ULONG(commit_concurrency, innobase_commit_concurrency,
  8212. PLUGIN_VAR_RQCMDARG,
  8213. "Helps in performance tuning in heavily concurrent environments.",
  8214. innobase_commit_concurrency_validate, NULL, 0, 0, 1000, 0);
  8215. static MYSQL_SYSVAR_ULONG(concurrency_tickets, srv_n_free_tickets_to_enter,
  8216. PLUGIN_VAR_RQCMDARG,
  8217. "Number of times a thread is allowed to enter InnoDB within the same SQL query after it has once got the ticket",
  8218. NULL, NULL, 500L, 1L, ~0L, 0);
  8219. static MYSQL_SYSVAR_LONG(file_io_threads, innobase_file_io_threads,
  8220. PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY | PLUGIN_VAR_NOSYSVAR,
  8221. "Number of file I/O threads in InnoDB.",
  8222. NULL, NULL, 4, 4, 64, 0);
  8223. static MYSQL_SYSVAR_ULONG(read_io_threads, innobase_read_io_threads,
  8224. PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
  8225. "Number of background read I/O threads in InnoDB.",
  8226. NULL, NULL, 4, 1, 64, 0);
  8227. static MYSQL_SYSVAR_ULONG(write_io_threads, innobase_write_io_threads,
  8228. PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
  8229. "Number of background write I/O threads in InnoDB.",
  8230. NULL, NULL, 4, 1, 64, 0);
  8231. static MYSQL_SYSVAR_LONG(force_recovery, innobase_force_recovery,
  8232. PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
  8233. "Helps to save your data in case the disk image of the database becomes corrupt.",
  8234. NULL, NULL, 0, 0, 6, 0);
  8235. static MYSQL_SYSVAR_LONG(log_buffer_size, innobase_log_buffer_size,
  8236. PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
  8237. "The size of the buffer which InnoDB uses to write log to the log files on disk.",
  8238. NULL, NULL, 8*1024*1024L, 256*1024L, LONG_MAX, 1024);
  8239. static MYSQL_SYSVAR_LONGLONG(log_file_size, innobase_log_file_size,
  8240. PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
  8241. "Size of each log file in a log group.",
  8242. NULL, NULL, 5*1024*1024L, 1*1024*1024L, LONGLONG_MAX, 1024*1024L);
  8243. static MYSQL_SYSVAR_LONG(log_files_in_group, innobase_log_files_in_group,
  8244. PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
  8245. "Number of log files in the log group. InnoDB writes to the files in a circular fashion. Value 3 is recommended here.",
  8246. NULL, NULL, 2, 2, 100, 0);
  8247. static MYSQL_SYSVAR_LONG(mirrored_log_groups, innobase_mirrored_log_groups,
  8248. PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
  8249. "Number of identical copies of log groups we keep for the database. Currently this should be set to 1.",
  8250. NULL, NULL, 1, 1, 10, 0);
  8251. static MYSQL_SYSVAR_UINT(old_blocks_pct, innobase_old_blocks_pct,
  8252. PLUGIN_VAR_RQCMDARG,
  8253. "Percentage of the buffer pool to reserve for 'old' blocks.",
  8254. NULL, innodb_old_blocks_pct_update, 100 * 3 / 8, 5, 95, 0);
  8255. static MYSQL_SYSVAR_UINT(old_blocks_time, buf_LRU_old_threshold_ms,
  8256. PLUGIN_VAR_RQCMDARG,
  8257. "Move blocks to the 'new' end of the buffer pool if the first access"
  8258. " was at least this many milliseconds ago."
  8259. " The timeout is disabled if 0 (the default).",
  8260. NULL, NULL, 0, 0, UINT_MAX32, 0);
  8261. static MYSQL_SYSVAR_LONG(open_files, innobase_open_files,
  8262. PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
  8263. "How many files at the maximum InnoDB keeps open at the same time.",
  8264. NULL, NULL, 300L, 10L, LONG_MAX, 0);
  8265. static MYSQL_SYSVAR_ULONG(sync_spin_loops, srv_n_spin_wait_rounds,
  8266. PLUGIN_VAR_RQCMDARG,
  8267. "Count of spin-loop rounds in InnoDB mutexes (30 by default)",
  8268. NULL, NULL, 30L, 0L, ~0L, 0);
  8269. static MYSQL_SYSVAR_ULONG(spin_wait_delay, srv_spin_wait_delay,
  8270. PLUGIN_VAR_OPCMDARG,
  8271. "Maximum delay between polling for a spin lock (6 by default)",
  8272. NULL, NULL, 6L, 0L, ~0L, 0);
  8273. static MYSQL_SYSVAR_ULONG(thread_concurrency, srv_thread_concurrency,
  8274. PLUGIN_VAR_RQCMDARG,
  8275. "Helps in performance tuning in heavily concurrent environments. Sets the maximum number of threads allowed inside InnoDB. Value 0 will disable the thread throttling.",
  8276. NULL, NULL, 0, 0, 1000, 0);
  8277. static MYSQL_SYSVAR_ULONG(thread_sleep_delay, srv_thread_sleep_delay,
  8278. PLUGIN_VAR_RQCMDARG,
  8279. "Time of innodb thread sleeping before joining InnoDB queue (usec). Value 0 disable a sleep",
  8280. NULL, NULL, 10000L, 0L, ~0L, 0);
  8281. static MYSQL_SYSVAR_STR(data_file_path, innobase_data_file_path,
  8282. PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
  8283. "Path to individual files and their sizes.",
  8284. NULL, NULL, NULL);
  8285. static MYSQL_SYSVAR_LONG(autoinc_lock_mode, innobase_autoinc_lock_mode,
  8286. PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
  8287. "The AUTOINC lock modes supported by InnoDB: "
  8288. "0 => Old style AUTOINC locking (for backward"
  8289. " compatibility) "
  8290. "1 => New style AUTOINC locking "
  8291. "2 => No AUTOINC locking (unsafe for SBR)",
  8292. NULL, NULL,
  8293. AUTOINC_NEW_STYLE_LOCKING, /* Default setting */
  8294. AUTOINC_OLD_STYLE_LOCKING, /* Minimum value */
  8295. AUTOINC_NO_LOCKING, 0); /* Maximum value */
  8296. static MYSQL_SYSVAR_STR(version, innodb_version_str,
  8297. PLUGIN_VAR_NOCMDOPT | PLUGIN_VAR_READONLY,
  8298. "InnoDB version", NULL, NULL, INNODB_VERSION_STR);
  8299. static MYSQL_SYSVAR_BOOL(use_sys_malloc, srv_use_sys_malloc,
  8300. PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
  8301. "Use OS memory allocator instead of InnoDB's internal memory allocator",
  8302. NULL, NULL, TRUE);
  8303. static MYSQL_SYSVAR_STR(change_buffering, innobase_change_buffering,
  8304. PLUGIN_VAR_RQCMDARG,
  8305. "Buffer changes to reduce random access: "
  8306. "OFF, ON, inserting, deleting, changing, or purging.",
  8307. innodb_change_buffering_validate,
  8308. innodb_change_buffering_update, NULL);
  8309. static MYSQL_SYSVAR_ULONG(read_ahead_threshold, srv_read_ahead_threshold,
  8310. PLUGIN_VAR_RQCMDARG,
  8311. "Number of pages that must be accessed sequentially for InnoDB to"
  8312. "trigger a readahead.",
  8313. NULL, NULL, 56, 0, 64, 0);
  8314. static struct st_mysql_sys_var* innobase_system_variables[]= {
  8315. MYSQL_SYSVAR(additional_mem_pool_size),
  8316. MYSQL_SYSVAR(autoextend_increment),
  8317. MYSQL_SYSVAR(buffer_pool_size),
  8318. MYSQL_SYSVAR(checksums),
  8319. MYSQL_SYSVAR(commit_concurrency),
  8320. MYSQL_SYSVAR(concurrency_tickets),
  8321. MYSQL_SYSVAR(data_file_path),
  8322. MYSQL_SYSVAR(data_home_dir),
  8323. MYSQL_SYSVAR(doublewrite),
  8324. MYSQL_SYSVAR(fast_shutdown),
  8325. MYSQL_SYSVAR(file_io_threads),
  8326. MYSQL_SYSVAR(read_io_threads),
  8327. MYSQL_SYSVAR(write_io_threads),
  8328. MYSQL_SYSVAR(file_per_table),
  8329. MYSQL_SYSVAR(file_format),
  8330. MYSQL_SYSVAR(file_format_check),
  8331. MYSQL_SYSVAR(flush_log_at_trx_commit),
  8332. MYSQL_SYSVAR(flush_method),
  8333. MYSQL_SYSVAR(force_recovery),
  8334. MYSQL_SYSVAR(locks_unsafe_for_binlog),
  8335. MYSQL_SYSVAR(lock_wait_timeout),
  8336. #ifdef UNIV_LOG_ARCHIVE
  8337. MYSQL_SYSVAR(log_arch_dir),
  8338. MYSQL_SYSVAR(log_archive),
  8339. #endif /* UNIV_LOG_ARCHIVE */
  8340. MYSQL_SYSVAR(log_buffer_size),
  8341. MYSQL_SYSVAR(log_file_size),
  8342. MYSQL_SYSVAR(log_files_in_group),
  8343. MYSQL_SYSVAR(log_group_home_dir),
  8344. MYSQL_SYSVAR(max_dirty_pages_pct),
  8345. MYSQL_SYSVAR(adaptive_flushing),
  8346. MYSQL_SYSVAR(max_purge_lag),
  8347. MYSQL_SYSVAR(mirrored_log_groups),
  8348. MYSQL_SYSVAR(old_blocks_pct),
  8349. MYSQL_SYSVAR(old_blocks_time),
  8350. MYSQL_SYSVAR(open_files),
  8351. MYSQL_SYSVAR(rollback_on_timeout),
  8352. MYSQL_SYSVAR(stats_on_metadata),
  8353. MYSQL_SYSVAR(stats_sample_pages),
  8354. MYSQL_SYSVAR(adaptive_hash_index),
  8355. MYSQL_SYSVAR(replication_delay),
  8356. MYSQL_SYSVAR(status_file),
  8357. MYSQL_SYSVAR(strict_mode),
  8358. MYSQL_SYSVAR(support_xa),
  8359. MYSQL_SYSVAR(sync_spin_loops),
  8360. MYSQL_SYSVAR(spin_wait_delay),
  8361. MYSQL_SYSVAR(table_locks),
  8362. MYSQL_SYSVAR(thread_concurrency),
  8363. MYSQL_SYSVAR(thread_sleep_delay),
  8364. MYSQL_SYSVAR(autoinc_lock_mode),
  8365. MYSQL_SYSVAR(version),
  8366. MYSQL_SYSVAR(use_sys_malloc),
  8367. MYSQL_SYSVAR(change_buffering),
  8368. MYSQL_SYSVAR(read_ahead_threshold),
  8369. MYSQL_SYSVAR(io_capacity),
  8370. NULL
  8371. };
  8372. mysql_declare_plugin(innobase)
  8373. {
  8374. MYSQL_STORAGE_ENGINE_PLUGIN,
  8375. &innobase_storage_engine,
  8376. innobase_hton_name,
  8377. "Innobase Oy",
  8378. "Supports transactions, row-level locking, and foreign keys",
  8379. PLUGIN_LICENSE_GPL,
  8380. innobase_init, /* Plugin Init */
  8381. NULL, /* Plugin Deinit */
  8382. INNODB_VERSION_SHORT,
  8383. innodb_status_variables_export,/* status variables */
  8384. innobase_system_variables, /* system variables */
  8385. NULL /* reserved */
  8386. },
  8387. i_s_innodb_trx,
  8388. i_s_innodb_locks,
  8389. i_s_innodb_lock_waits,
  8390. i_s_innodb_cmp,
  8391. i_s_innodb_cmp_reset,
  8392. i_s_innodb_cmpmem,
  8393. i_s_innodb_cmpmem_reset
  8394. mysql_declare_plugin_end;
  8395. /** @brief Initialize the default value of innodb_commit_concurrency.
  8396. Once InnoDB is running, the innodb_commit_concurrency must not change
  8397. from zero to nonzero. (Bug #42101)
  8398. The initial default value is 0, and without this extra initialization,
  8399. SET GLOBAL innodb_commit_concurrency=DEFAULT would set the parameter
  8400. to 0, even if it was initially set to nonzero at the command line
  8401. or configuration file. */
  8402. static
  8403. void
  8404. innobase_commit_concurrency_init_default(void)
  8405. /*==========================================*/
  8406. {
  8407. MYSQL_SYSVAR_NAME(commit_concurrency).def_val
  8408. = innobase_commit_concurrency;
  8409. }
  8410. #ifdef UNIV_COMPILE_TEST_FUNCS
  8411. typedef struct innobase_convert_name_test_struct {
  8412. char* buf;
  8413. ulint buflen;
  8414. const char* id;
  8415. ulint idlen;
  8416. void* thd;
  8417. ibool file_id;
  8418. const char* expected;
  8419. } innobase_convert_name_test_t;
  8420. void
  8421. test_innobase_convert_name()
  8422. {
  8423. char buf[1024];
  8424. ulint i;
  8425. innobase_convert_name_test_t test_input[] = {
  8426. {buf, sizeof(buf), "abcd", 4, NULL, TRUE, "\"abcd\""},
  8427. {buf, 7, "abcd", 4, NULL, TRUE, "\"abcd\""},
  8428. {buf, 6, "abcd", 4, NULL, TRUE, "\"abcd\""},
  8429. {buf, 5, "abcd", 4, NULL, TRUE, "\"abc\""},
  8430. {buf, 4, "abcd", 4, NULL, TRUE, "\"ab\""},
  8431. {buf, sizeof(buf), "ab@0060cd", 9, NULL, TRUE, "\"ab`cd\""},
  8432. {buf, 9, "ab@0060cd", 9, NULL, TRUE, "\"ab`cd\""},
  8433. {buf, 8, "ab@0060cd", 9, NULL, TRUE, "\"ab`cd\""},
  8434. {buf, 7, "ab@0060cd", 9, NULL, TRUE, "\"ab`cd\""},
  8435. {buf, 6, "ab@0060cd", 9, NULL, TRUE, "\"ab`c\""},
  8436. {buf, 5, "ab@0060cd", 9, NULL, TRUE, "\"ab`\""},
  8437. {buf, 4, "ab@0060cd", 9, NULL, TRUE, "\"ab\""},
  8438. {buf, sizeof(buf), "ab\"cd", 5, NULL, TRUE,
  8439. "\"#mysql50#ab\"\"cd\""},
  8440. {buf, 17, "ab\"cd", 5, NULL, TRUE,
  8441. "\"#mysql50#ab\"\"cd\""},
  8442. {buf, 16, "ab\"cd", 5, NULL, TRUE,
  8443. "\"#mysql50#ab\"\"c\""},
  8444. {buf, 15, "ab\"cd", 5, NULL, TRUE,
  8445. "\"#mysql50#ab\"\"\""},
  8446. {buf, 14, "ab\"cd", 5, NULL, TRUE,
  8447. "\"#mysql50#ab\""},
  8448. {buf, 13, "ab\"cd", 5, NULL, TRUE,
  8449. "\"#mysql50#ab\""},
  8450. {buf, 12, "ab\"cd", 5, NULL, TRUE,
  8451. "\"#mysql50#a\""},
  8452. {buf, 11, "ab\"cd", 5, NULL, TRUE,
  8453. "\"#mysql50#\""},
  8454. {buf, 10, "ab\"cd", 5, NULL, TRUE,
  8455. "\"#mysql50\""},
  8456. {buf, sizeof(buf), "ab/cd", 5, NULL, TRUE, "\"ab\".\"cd\""},
  8457. {buf, 9, "ab/cd", 5, NULL, TRUE, "\"ab\".\"cd\""},
  8458. {buf, 8, "ab/cd", 5, NULL, TRUE, "\"ab\".\"c\""},
  8459. {buf, 7, "ab/cd", 5, NULL, TRUE, "\"ab\".\"\""},
  8460. {buf, 6, "ab/cd", 5, NULL, TRUE, "\"ab\"."},
  8461. {buf, 5, "ab/cd", 5, NULL, TRUE, "\"ab\"."},
  8462. {buf, 4, "ab/cd", 5, NULL, TRUE, "\"ab\""},
  8463. {buf, 3, "ab/cd", 5, NULL, TRUE, "\"a\""},
  8464. {buf, 2, "ab/cd", 5, NULL, TRUE, "\"\""},
  8465. /* XXX probably "" is a better result in this case
  8466. {buf, 1, "ab/cd", 5, NULL, TRUE, "."},
  8467. */
  8468. {buf, 0, "ab/cd", 5, NULL, TRUE, ""},
  8469. };
  8470. for (i = 0; i < sizeof(test_input) / sizeof(test_input[0]); i++) {
  8471. char* end;
  8472. ibool ok = TRUE;
  8473. size_t res_len;
  8474. fprintf(stderr, "TESTING %lu, %s, %lu, %s\n",
  8475. test_input[i].buflen,
  8476. test_input[i].id,
  8477. test_input[i].idlen,
  8478. test_input[i].expected);
  8479. end = innobase_convert_name(
  8480. test_input[i].buf,
  8481. test_input[i].buflen,
  8482. test_input[i].id,
  8483. test_input[i].idlen,
  8484. test_input[i].thd,
  8485. test_input[i].file_id);
  8486. res_len = (size_t) (end - test_input[i].buf);
  8487. if (res_len != strlen(test_input[i].expected)) {
  8488. fprintf(stderr, "unexpected len of the result: %u, "
  8489. "expected: %u\n", (unsigned) res_len,
  8490. (unsigned) strlen(test_input[i].expected));
  8491. ok = FALSE;
  8492. }
  8493. if (memcmp(test_input[i].buf,
  8494. test_input[i].expected,
  8495. strlen(test_input[i].expected)) != 0
  8496. || !ok) {
  8497. fprintf(stderr, "unexpected result: %.*s, "
  8498. "expected: %s\n", (int) res_len,
  8499. test_input[i].buf,
  8500. test_input[i].expected);
  8501. ok = FALSE;
  8502. }
  8503. if (ok) {
  8504. fprintf(stderr, "OK: res: %.*s\n\n", (int) res_len,
  8505. buf);
  8506. } else {
  8507. fprintf(stderr, "FAILED\n\n");
  8508. return;
  8509. }
  8510. }
  8511. }
  8512. #endif /* UNIV_COMPILE_TEST_FUNCS */