Commit graph

709 commits

Author SHA1 Message Date
Michael Widenius
6da8ac5f71 Added option "AND DISABLE CHECKPOINT" to "FLUSH TABLES WITH READ LOCK"
This makes it possible to do safe multi volume snapshots as long as one snapshots the volume with the transaction logs last.


include/mysql_com.h:
  Added REFRESH_CHECKPOINT
mysql-test/r/flush.result:
  Added test of new FLUSH TABLES syntax + calls to checkpoint_status handler calls
mysql-test/t/flush.test:
  Added test of new FLUSH TABLES syntax + calls to checkpoint_status handler calls
sql/handler.cc:
  Added code to call checkpoint_state for all handlertons that supports it
sql/handler.h:
  Added new checkpoint_state() handlerton call to temporarly disable checkpoints.
sql/lex.h:
  Added CHECKPOINT keyword
sql/sql_yacc.yy:
  Added support for FLUSH TABLES WITH READ LOCK AND DISABLE CHECKPOINT
storage/maria/ha_maria.cc:
  Added handlerton call to disable checkpoints.
storage/maria/ma_checkpoint.c:
  Don't do checkpoint if checkpoints are disabled.
storage/maria/ma_static.c:
  Added maria_checkpoint_disabled
storage/maria/maria_def.h:
  Added maria_checkpoint_disabled
storage/xtradb/handler/ha_innodb.cc:
  Added handlerton call to disable checkpoints.
storage/xtradb/include/log0log.h:
  Added option to log_checkpoint() to allow one to ignore not critical checkpoints during the time checkpoints are disabled.
storage/xtradb/log/log0log.c:
  Added code to allow one to disable checkpoints during a FLUSH TABLES ... DISABLE CHECKPOINT
  This was done by adding a new argument to log_checkpoint() which tells us when the checkpoint is called by srv_master_thread (which are safe to ignore)
storage/xtradb/srv/srv0srv.c:
  Tell log_checkpoint() that checkpoints from srv_master_thread() are safe to ignore (will just delay recovery time a bit).
2011-04-28 18:02:26 +03:00
unknown
64e43e1cc8 Merge various replication-related patches into MariaDB 5.3:
- MWL#116 Group commit
 - MWL#136 Enhancements for START TRANSACTION WITH CONSISTENT SNAPSHOT
 - MWL#47 Annotate_rows_log_event
 - MWL#163 innodb_release_locks_early
 - Percona patch enhancing row-based replication for tables with no primary key
2011-04-08 09:39:33 +02:00
Sergey Petrunya
d4ce827226 Amend the previous cset:
Make EXPLAIN better at displaying MRR/BKA:
- Update all .result files
- Extra comments
2011-04-04 12:32:52 +04:00
Sergey Petrunya
997445bc8e Make EXPLAIN better at displaying MRR/BKA:
- "Using MRR" is no longer shown with range access.
- Instead, both range and BKA accesses will show one of the following:
  = "Rowid-ordered scan"
  = "Key-ordered scan"
  = "Key-ordered Rowid-ordered scan"
depending on whether DS-MRR implementation will do scan keys in order, rowids in order,
or both.
- The patch also introduces a way for other storage engines/MRR implementations to
  pass information to EXPLAIN output about the properties of employed MRR scans.
2011-04-02 14:04:45 +04:00
unknown
c677fea7d0 Merge MariaDB 5.2.5 release into MariaDB-5.2-rpl. 2011-04-01 15:07:10 +02:00
unknown
92dfbd4242 Merge MWL#116 after-review fixes. 2011-03-31 15:32:04 +02:00
unknown
bc9f6021ff MWL#116: After-review fixes. 2011-03-31 14:29:23 +02:00
Sergey Petrunya
e6bd643c75 MRR interface: change range_info's type from char* to range_id_t typedef. The goals are:
- cleaner code
- ability to change from using pointers to offsets at some point
2011-03-04 12:06:03 +03:00
Michael Widenius
4ad6d6b6c9 Merge in new handler and handlersocket code into 5.3 main 2011-02-22 11:15:47 +02:00
unknown
6dbd796074 Merge three Percona patches into mariadb-5.2-rpl:
- MWL#47, allowing to annotate row-based binlog events with the SQL test of
   the originating query (eg. in mysqlbinlog output).

 - row_based_replication_without_primary_key.patch, providing more intelligent
   selection of index to use on slave when applying row-based binlog events
   for tables with no primary key.

 - Make mysqlbinlog omit redundant `use` around BEGIN/SAVEPOINT/COMMIT/
   ROLLBACK in 5.0 binlogs.
2011-01-26 15:35:03 +01:00
Sergei Golubchik
6554977fe5 Added ha_write_tmp_row() for slightly faster write_row for internal temp tables.
This will also enable us in the future to collect statistics for
writes to internal tmp tables.

sql/handler.h:
  Added ha_write_tmp_row()
sql/opt_subselect.cc:
  ha_write_row -> ha_write_tmp_row
sql/sql_class.h:
  Added ha_write_tmp_row()
sql/sql_select.cc:
  ha_write_row -> ha_write_tmp_row
2011-01-14 11:58:45 +01:00
Michael Widenius
1fbcaf2e61 Merge with 5.2 2011-01-12 17:50:29 +02:00
Michael Widenius
4c576fd492 Merge with 5.1 2011-01-12 17:38:13 +02:00
Michael Widenius
213321206e Fix for LP#697610 ha_index_prev(uchar*): Assertion `inited==INDEX' failed with HANDLER + InnoDB in maria-5.3
mysql-test/suite/handler/innodb.result:
  Added test case
mysql-test/suite/handler/innodb.test:
  Added test case
sql/handler.h:
  Move setting/resetting of active_index to ha_index_init()/ha_index_end() to simplify handler functions index_init()/index_end()
  Fixed that get_index() returns MAX_KEY if index is not inited (this fixed LP#697610)
storage/federated/ha_federated.cc:
  Settting of active_index is not needed anymore
storage/maria/ma_pagecache.c:
  Added error message if we have too little memory for Maria page cache
2011-01-12 15:41:39 +02:00
Michael Widenius
050c004f5e Merge with 5.1
Fixes to get Aria handler tests to work.
Fixes LP#697597 "HANDLER + Aria asserts in maria-5.3-handler"
2011-01-11 15:36:41 +02:00
Michael Widenius
2eaa76b844 Automatic merge with 5.1 2011-01-10 23:42:47 +02:00
Michael Widenius
505c663a1e - Fixed that Aria works with HANDLER commands
- Added test case for Aria
- Tested HANDLER with HEAP (changes to HEAP code will be pushed in 5.3)
- Moved all HANDLER test to suite/handler.


mysql-test/Makefile.am:
  Added suite/handler
mysql-test/mysql-test-run.pl:
  Added suite/handler
mysql-test/r/lock_multi.result:
  Remove test that is already in handler test suite
mysql-test/suite/handler/aria.result:
  Test for HANDLER with Aria storage engine
mysql-test/suite/handler/aria.test:
  Test for HANDLER with Aria storage engine
mysql-test/suite/handler/handler.inc:
  Extended the general handler test
  Moved interface testing to 'interface.test'
mysql-test/suite/handler/init.inc:
  Common init for handler tests.
mysql-test/suite/handler/innodb.result:
  New results
mysql-test/suite/handler/innodb.test:
  Update to use new include files
mysql-test/suite/handler/interface.result:
  Test of HANDLER interface (not storage engine dependent parts)
mysql-test/suite/handler/interface.test:
  Test of HANDLER interface (not storage engine dependent parts)
mysql-test/suite/handler/myisam.result:
  New results
mysql-test/suite/handler/myisam.test:
  Update to use new include files
mysql-test/t/lock_multi.test:
  Remove test that is already in handler test suite
mysys/tree.c:
  Added missing handling of read previous (showed up in HEAP testing)
sql/handler.cc:
  Don't marka 'HA_ERR_RECORD_CHANGED' as fatal (can be used with HANDLER READ, especially with MEMORY ENGINE)
sql/handler.h:
  Added prototype for can_continue_handler_scan()
sql/sql_handler.cc:
  Re-initialize search if we switch from key to table search.
  Check if handler can continue searching between calls (via can_continue_handler_scan())
  Don't write common not fatal errors to log
storage/maria/ma_extra.c:
  Don't set index 0 as default. This forces call to ma_check_index() to set up index variables.
storage/maria/ma_ft_boolean_search.c:
  Ensure that info->last_key.keyinfo is set
storage/maria/ma_open.c:
  Don't set index 0 as default. This forces call to ma_check_index() to set up index variables.
storage/maria/ma_rkey.c:
  Trivial optimization
storage/maria/ma_rnext.c:
  Added missing code from mi_rnext.c to ensure that handler next/prev works.
storage/maria/ma_rsame.c:
  Simple optimizations
storage/maria/ma_search.c:
  Initialize info->last_key once and for all when we change keys.
storage/maria/ma_unique.c:
  Ensure that info->last_key.keyinfo is up to date.
2011-01-10 23:22:40 +02:00
Sergei Golubchik
31a78529bc virtual columns:
* move a capability from a virtual handler method to table_flags()
 * rephrase error messages to avoid hard-coded English parts
 * admit in test cases that they need xtradb, not innodb

mysql-test/suite/vcol/t/rpl_vcol.test:
  this test needs xtradb, it will fail with innodb
mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_innodb.test:
  this test needs xtradb, it will fail with innodb
mysql-test/suite/vcol/t/vcol_column_def_options_innodb.test:
  this test needs xtradb, it will fail with innodb
mysql-test/suite/vcol/t/vcol_handler_innodb.test:
  this test needs xtradb, it will fail with innodb
mysql-test/suite/vcol/t/vcol_ins_upd_innodb.test:
  this test needs xtradb, it will fail with innodb
mysql-test/suite/vcol/t/vcol_keys_innodb.test:
  this test needs xtradb, it will fail with innodb
mysql-test/suite/vcol/t/vcol_non_stored_columns_innodb.test:
  this test needs xtradb, it will fail with innodb
mysql-test/suite/vcol/t/vcol_partition_innodb.test:
  this test needs xtradb, it will fail with innodb
mysql-test/suite/vcol/t/vcol_select_innodb.test:
  this test needs xtradb, it will fail with innodb
mysql-test/suite/vcol/t/vcol_supported_sql_funcs_innodb.test:
  this test needs xtradb, it will fail with innodb
mysql-test/suite/vcol/t/vcol_trigger_sp_innodb.test:
  this test needs xtradb, it will fail with innodb
mysql-test/suite/vcol/t/vcol_view_innodb.test:
  this test needs xtradb, it will fail with innodb
sql/ha_partition.h:
  check_if_supported_virtual_columns() -> HA_CAN_VIRTUAL_COLUMNS
sql/handler.h:
  check_if_supported_virtual_columns() -> HA_CAN_VIRTUAL_COLUMNS
sql/share/errmsg.txt:
  no hard-coded english parts in the error messages (ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN)
sql/sql_table.cc:
  no hard-coded english parts in the error messages
sql/table.cc:
  * check_if_supported_virtual_columns() -> HA_CAN_VIRTUAL_COLUMNS
  * no "csv workaround" is needed
  * no hard-coded english parts in the error messages
storage/maria/ha_maria.cc:
  check_if_supported_virtual_columns() -> HA_CAN_VIRTUAL_COLUMNS
storage/maria/ha_maria.h:
  check_if_supported_virtual_columns() -> HA_CAN_VIRTUAL_COLUMNS
storage/myisam/ha_myisam.cc:
  check_if_supported_virtual_columns() -> HA_CAN_VIRTUAL_COLUMNS
storage/myisam/ha_myisam.h:
  check_if_supported_virtual_columns() -> HA_CAN_VIRTUAL_COLUMNS
storage/xtradb/handler/ha_innodb.cc:
  check_if_supported_virtual_columns() -> HA_CAN_VIRTUAL_COLUMNS
storage/xtradb/handler/ha_innodb.h:
  check_if_supported_virtual_columns() -> HA_CAN_VIRTUAL_COLUMNS
2010-12-31 10:39:14 +01:00
unknown
34a48dd4a0 Merge MWL#116 into mariadb-5.2-rpl. 2010-12-25 15:42:33 +01:00
Sergey Petrunya
eafc4bef33 MWL#121-125 DS-MRR improvements
- Address review feedback: change return type of RANGE_SEQ_IF::next()
2010-12-13 20:01:32 +03:00
Sergey Petrunya
58b646001a Merge DS-MRR/CPK improvements into 5.3-main 2010-12-13 13:42:40 +03:00
Igor Babaev
7f52af655a Merge. 2010-12-10 23:23:34 -08:00
Michael Widenius
b7b25dc666 Merge with 5.1-release.
- Fixed problem with oqgraph and 'make dist'

Note that after this merge we have a problem show in join_outer where we examine too many rows in one specific case (related to BUG#57024).
This will be fixed when mwl#128 is merged into 5.3.
2010-12-06 10:25:44 +02:00
Sergey Petrunya
44be131cd3 MWL#121-125 DS-MRR improvements
- Address Monty's review feedback, part 5
2010-12-02 14:10:52 +03:00
Michael Widenius
7c56b08216 Added TRASH() to table->record[0] to find out if we access not initialzed data.
- Changed Cached_item_field not copy data for fields with NULL value
- In key_copy() and key_restore() don't copy data for fields with NULL value

Fixed code to avoid valgrind warnings
- Use c_ptr_safe instead of c_ptr()

Removed "QQ" from comments (QQ was ment to be used for internal comments that should be removed before pushing)
Fixed wrong alias used (from previous patch)


sql/event_db_repository.cc:
  Update testing if event table is valid (to avoid valgrind errors)
sql/ha_partition.cc:
  m_ordered_scan_ongoing was not initialized
  Reset null bits in record to avoid valgrind errors
sql/handler.h:
  Added flag if storage engine will write row verbatim and the row contains varchar or null fields
  (in which case we must clear the row to avoid valgrind warnings)
sql/item_buff.cc:
  Changed Cached_item_field not copy data for fields with NULL value
  (Optimization and avoids valgrind warnings)
sql/item_func.cc:
  c_ptr() -> c_ptr_safe()
sql/key.cc:
  In key_copy() and key_restore() don't copy data for fields with NULL value
sql/opt_range.cc:
  c_ptr() -> c_ptr_safe()
sql/sql_base.cc:
  Added TRASH() to table->record[0] to find out if we access not initialzed data.
  Initialize null_bytes to:
  - Get consistent tests
  - Ensure we don't get valgrind warnings for null fields (as we may only update a couple of bits in a byte)
sql/sql_class.cc:
  Removed "QQ" from comments
sql/sql_insert.cc:
  Initialize row to default values if we are using valgrind and row will be copied verbatim to disk in storage engine.
sql/sql_load.cc:
  QQ -> TODO
sql/sql_parse.cc:
  Removed old not used code marked QQ and withing "#ifdef REMOVED"
sql/sql_select.cc:
  QQ -> TODO
  Initialize some variables that was used uninitialized
  Added DBUG_ASSERT() to find out if thd was not properly initialized for sub queries
sql/sql_test.cc:
  Fixed format for printing to DBUG file
  Fixed wrong alias used (from previous patch)
sql/sql_trigger.h:
  QQ -> TODO
sql/table.cc:
  QQ -> TODO
storage/maria/ha_maria.cc:
  Mark table with HA_RECORD_MUST_BE_CLEAN_ON_WRITE, if row is written verbatim to disk and contains varchar or null fields.
storage/maria/ma_open.c:
  Added flags if table has varchar or null fields
storage/maria/maria_def.h:
  Added flags if table has varchar or null fields
storage/myisam/ha_myisam.cc:
  Mark table with HA_RECORD_MUST_BE_CLEAN_ON_WRITE, if row is written verbatim to disk and contains varchar or null fields.
storage/myisam/mi_open.c:
  Fixed memory overrun bug when using fulltext keys
storage/xtradb/row/row0sel.c:
  Removed initialization of null bits. (not needed anymore)
2010-11-27 17:29:52 +02:00
unknown
95b37a254b Merge MariaDB 5.1->5.2 2010-11-19 22:33:47 +01:00
Michael Widenius
9d68ccdeb8 Added option BACKUP_ALL to mysqld --myisam-recover to also get a backup of the index file before it's repaired.
Removed wrong call to translog_buffer_unlock() that caused 'unlocking not locked mutex' failure in Aria log handler.

extra/replace.c:
  Updated call to my_redel()
include/maria.h:
  Updated prototype for maria_change_to_newfile
include/my_sys.h:
  Updated prototypes
  Added my_create_backup_name
include/myisam.h:
  Updated prototypes
include/myisamchk.h:
  Added 'backup_time' to st_handler_check_param to be able to generate same name for backuped data and index file
mysys/my_redel.c:
  Added time_t option to my_redel() to be able to generate same backup extensions for many files
sql/handler.cc:
  Added start_time to st_ha_check_opt
sql/handler.h:
  Added start_time to HA_CHECK_OPT
sql/mysqld.cc:
  Added option BACKUP_ALL to --myisam-recover
storage/maria/ha_maria.cc:
  Remember start time for repair
storage/maria/ma_check.c:
  Use remembered start time for backup file names
  Removed some dead code
storage/maria/ma_loghandler.c:
  Removed wrong call to translog_buffer_unlock() that caused 'unlocking not locked mutex' failure in log handler.
storage/maria/maria_chk.c:
  Removed dead code (O_NEW_INDEX was never set)
  Report if table was 'crashed on repair'
storage/maria/maria_pack.c:
  Updated parameters to my_redel()
storage/myisam/ha_myisam.cc:
  Added recover option BACKUP_ALL to get a backup of the index file before it's repaired.
  Print information to log if we make a backup of data as part of repair.
storage/myisam/ha_myisam.h:
  Added HA_RECOVER_FULL_BACKUP
storage/myisam/mi_check.c:
  Use remembered start time for backup file names
  Added mi_make_backup_of_index()
storage/myisam/myisamchk.c:
  Removed dead code (O_NEW_INDEX was never set)
  Report if table was 'crashed on repair'
storage/myisam/myisampack.c:
  Updated call to my_redel()
2010-11-07 14:25:29 +02:00
Sergey Petrunya
7f059782d0 Merge MWL#121-124 DS-MRR support for key-ordered reads + MWL#128 BNL-Hash join 2010-11-01 20:43:02 +03:00
Sergey Petrunya
6c15806b68 MWL#121-124 DS-MRR support for key-ordered retrieval, etc
- Merge into 5.3-main
2010-11-01 18:49:59 +03:00
unknown
a786357be1 Minor whitespace/comment cleanup. 2010-11-01 16:01:25 +01:00
unknown
fb8244a57c Merge latest MariaDB 5.1 into MWL#116. 2010-11-01 15:41:09 +01:00
Igor Babaev
0b72fd88a1 Merge. 2010-10-30 06:07:45 -07:00
Sergei Golubchik
8e7ebfbce8 5.2 merge 2010-10-28 19:04:23 +02:00
Igor Babaev
4f75a8254a Merge 5.3-mwl128 -> 5.3 2010-10-27 16:31:22 -07:00
Sergey Petrunya
d8efc3b155 DS-MRR improvements: address review feedback for R3 version of the patch 2010-10-26 15:35:13 +04:00
Sergei Golubchik
04a4b43346 merge with 5.1 2010-10-25 15:21:16 +02:00
Sergei Golubchik
60c15066db better fix for MySQL bugs
BUG#26447 prefer a clustered key for an index scan, as secondary index is always slower
  ... which was fixed to cause
BUG#35850 queries take 50% longer
  ... and was reverted

and

BUG#39653 prefer a secondary index for an index scan, as clustered key is always slower
  ... which was fixed to cause
BUG#55656 mysqldump takes six days instead of half an hour
  ... and was amended with a special case workaround


sql/opt_range.cc:
  move get_index_only_read_time() into the handler class
sql/sql_select.cc:
  use cost not an index length when choosing a cheaper index
2010-10-20 12:58:43 +02:00
Sergey Petrunya
72dd7575cd Merge 5.2->5.3
- Re-commit Monty's merge, partially fixed by Igor and SergeyP, 
  but still broken
2010-10-10 17:18:11 +03:00
unknown
8bc445360e MWL#116: Efficient group commit
Tweak the commit_ordered() semantics. Now it is only called for transactions
that go through 2-phase commit. This avoids forcing engines to make commits
visible before they are durable.

Also take LOCK_commit_ordered() around START TRANSACTION WITH CONSISTENT
SNAPSHOT, to get a truly consistent snapshot.
2010-10-04 20:40:31 +02:00
unknown
498f10a2be Merge with latest MariaDB 5.1 2010-10-01 10:49:57 +02:00
unknown
0394cf2030 MWL#116: Efficient group commit for binary log
Preliminary commit for testing
2010-09-30 15:20:15 +02:00
Sergey Petrunya
4f56acb676 Better comments, move Lifo_buffer to separate file. 2010-09-28 12:19:50 +04:00
Sergei Golubchik
a3d80d952d merge with 5.1 2010-09-11 20:43:48 +02:00
Sergey Petrunya
dbc63bed22 MWL#121-125: DS-MRR improvements
- Address review feedback, step 1
2010-09-05 14:32:14 +04:00
Igor Babaev
94cfcbd9df The main patch for MWL#128: Implement Block Nested Loop Hash Join. 2010-08-31 09:34:21 -07:00
Michael Widenius
ad6d95d3cb Merge with MySQL 5.1.50
- Changed to still use bcmp() in certain cases becasue
  - Faster for short unaligneed strings than memcmp()
  - Bettern when using valgrind
- Changed to use my_sprintf() instead of sprintf() to get higher portability for old systems
- Changed code to use MariaDB version of select->skip_record()
- Removed -%::SCCS/s.% from Makefile.am:s to remove automake warnings
2010-08-27 17:12:44 +03:00
Michael Widenius
569c37163e Merge with MariaDB 5.1 2010-08-06 15:51:07 +03:00
Michael Widenius
50b43cf805 Fix for LP#614265 Crash in _ma_unpin_all_pages / _ma_search on DELETE with Aria search engine
Fixed compiler warnings

client/mysqlslap.c:
  Fixed compiler warnings
mysql-test/suite/maria/r/maria.result:
  Test case for LP#614265
mysql-test/suite/maria/t/maria.test:
  Test case for LP#614265
mysql-test/suite/pbxt/t/skip_name_resolve-master.opt:
  Ensure that we get restart before test (as test uses show processlist)
sql/handler.cc:
  Added cloned marker if clone was called (for safety checks & debugging)
sql/handler.h:
  Added cloned marker if clone was called (for safety checks & debugging)
storage/maria/ha_maria.cc:
  In clone call, set file->trn if cloned file had this set. This is needed as maria_create_trn_for_mysql() and thus file->trn is never set for cloned table.
  Ensure that file->trn is properly reset after calls to repair/check/zerofill.
  Increment locked table count if file->trn is set (as we decrement this in the unlock call)
tests/mysql_client_test.c:
  Fixed compiler warnings
2010-08-06 15:39:37 +03:00
Michael Widenius
d042146e5b Merge with MariaDB 5.1.49
Removed references to HA_END_SPACE_KEY (which has been 0 for a long time)
2010-08-05 22:56:11 +03:00
Michael Widenius
e0a6b02c5d Merge with MySQL 5.1.49
Fixed Bug#52005 'JOIN_TAB->dependent' may be incorrectly propageted for multilevel outer joins' in a better way (patch from Sergey Petrunya)
2010-08-02 12:01:24 +03:00