Commit graph

64747 commits

Author SHA1 Message Date
Igor Babaev
7970b3346a Merge 2010-09-27 23:24:46 -07:00
Igor Babaev
81dab93638 Merge 2010-09-22 19:10:19 -07:00
Igor Babaev
8757c0c5d2 Merge 2010-09-20 12:39:41 -07:00
Sergei Golubchik
9132fab777 fixes for windows 2010-09-20 15:17:59 +02:00
Igor Babaev
3c313312bb Fixed bug #56862 (lp bug #640419).
Made sure that rr_quick is used to read the next record whenever
a quick select is used to retrieve the table records.
2010-09-19 18:46:39 -07:00
Sergei Golubchik
44fc5897a1 bug in plugin.m4 that prevented group list in the MYSQL_PLUGIN declaration from working. 2010-09-18 09:53:48 +02:00
Igor Babaev
1a3bb0c5c2 Fixed bug #637978.
Fixed a bug in the new code for WL#24 that caused generation of
an invalid index-merge access plan.
2010-09-15 16:42:56 -07:00
Igor Babaev
af834a424a Merge 2010-09-15 16:36:32 -07:00
Michael Widenius
b4b6494643 Automatic merge 2010-09-15 16:01:03 +03:00
Michael Widenius
f4820ea62e mysqltest now gives error messages with error code for my_delete, my_rename, my_copy etc.
Fixed crashing bug when doing ALTER TABLE RENAME with transactional tables.

client/mysqltest.cc:
  Added errno to error message for system calls (delete, rename etc)
  Write error message for failures of system calls
mysql-test/include/cleanup_fake_relay_log.inc:
  Disable warnings for remove_file
mysql-test/include/diff_tables.inc:
  Disable warnings for remove_file
mysql-test/include/maria_empty_logs.inc:
  Disable warnings for remove_file
mysql-test/include/maria_make_snapshot.inc:
  Disable warnings for remove_file
mysql-test/include/maria_make_snapshot_for_feeding_recovery.inc:
  Disable warnings for remove_file
mysql-test/include/mysqlhotcopy.inc:
  Disable warnings for remove_file
mysql-test/include/ndb_backup.inc:
  Disable warnings for remove_file
mysql-test/include/ndb_backup_print.inc:
  Disable warnings for remove_file
mysql-test/r/alter_table_trans.result:
  Test of crashing ALTER TABLE RENAME bug
mysql-test/t/alter_table_trans.test:
  Test of crashing ALTER TABLE RENAME bug
mysql-test/t/mysqltest.test:
  Disable warnings for remove_file and move_file
mysys/my_copy.c:
  Fixed wrong error message
sql/sql_table.cc:
  Fixed crashing bug when doing ALTER TABLE RENAME with transactional tables.
2010-09-15 15:48:15 +03:00
unknown
b708b87240 Fix preserving mysqld error log across server restarts, broken by recent mtr changes. 2010-09-14 20:00:10 +02:00
Sergey Petrunya
0dd37e87c4 Merge: fix valgrind failure in Unique class 2010-09-14 21:29:15 +04:00
Sergey Petrunya
58c0fdc999 Fix valgrind failure with Unique class 2010-09-14 20:48:51 +04:00
Sergei Golubchik
df0817c07f don't build dynamic plugins when configured with --disable-shared.
libtool does not like it and fails the build.
2010-09-14 13:29:14 +02:00
Igor Babaev
69dd773b67 An implementation of index intersect via a modified Unique class.
This code is planned to be used for mwl#21.
2010-09-13 15:22:11 -07:00
Sergei Golubchik
617ae44078 merged 2010-09-13 21:55:32 +02:00
Igor Babaev
65d66ae1fc Adjusted the results of pbxt.join_nested after the fix for bug 49600 2010-09-13 10:55:06 -07:00
Michael Widenius
209b6f9a08 Merge 2010-09-13 10:42:44 +03:00
Michael Widenius
456422a23d Fixed Aria recovery bug:
- When reopening table during recovery, don't set file length from file sizes as file is not flushed.
New feature in Aria recovery:
- Create database directory if missing.



storage/maria/ma_recovery.c:
  Don't print Query: twice when running maria_read_log
  Create database directory if missing. (Needed when running maria_read_log on an empty database direcory during testing)
  More DBUG_print
  Fixed bug: When reopening table during recovery, don't set file length from file sizes as file is not flushed.
2010-09-13 10:15:52 +03:00
Igor Babaev
64244a34e6 Merge 2010-09-12 21:25:57 -07:00
Igor Babaev
8f80663b9d Merge 2010-09-12 13:23:16 -07:00
Igor Babaev
f491ab5372 Pulled in the latest changes in 5.1. 2010-09-12 13:01:31 -07:00
Igor Babaev
5719ca5c51 Pulled in the latest changes of 5.1 2010-09-11 23:56:51 -07:00
Igor Babaev
93c22e0699 Pulled in the ltest changes of 5.1 2010-09-11 13:27:22 -07:00
Igor Babaev
3a61fbe972 WL#24: post review fixes. 2010-09-11 12:18:58 -07:00
Igor Babaev
577b7345c7 Fixed bug #49600.
The problem could be demonstrated with an outer join of two single-row
tables where the values of the join attributes were null. Any query
with such a join could return a wrong result set if the where
condition of the query was not empty. For queries with empty
where conditions the result sets were correct.
This was the consequence of two bugs in the code:
 - Item_equal objects for on conditions of outer joins were
   not built if the processed query had no where condition
 - the check for null values in the code that evaluated constant 
   Item_equal objects was incorrect.
Fixed both above problems.
Added a test case for the bug and adjusted results for some other
test cases.
2010-09-11 08:20:35 -07:00
Sergei Golubchik
966661c8cc to simpliy and unify the code 2010-09-11 09:46:33 +02:00
Michael Widenius
b9890b0544 Fix for LP#634943 "marked as crashed", "zerofilling" and "wrong data in bitmap" when recovering Aria tables
This was an interaction of several bugs:
- Tables marked as opened was not properly unmarked on recovery if there was not changes since checkpoint
- zerofill of tables put wrong data in bitmap if directory for page was full
- Tables was thought as 'moved' during recovery if they had a create_lsn bigger than the lsn in the control file.


storage/maria/ha_maria.cc:
  If table is moved and crashed, threat it as crashed.
  (Not a related to this bug, but still good to have fixed)
storage/maria/ma_blockrec.c:
  Make enough_free_entries_on_page() global
storage/maria/ma_blockrec.h:
  Make enough_free_entries_on_page() global
storage/maria/ma_check.c:
  If directory is full, mark page full. Fixes bug in zerofill
storage/maria/ma_open.c:
  Don't marke files as MOVED during recovery if create_trid > trnman_max_trid, as this fails for tables created after checkpoint.
storage/maria/ma_recovery.c:
  Reset open_count in file that was open during crash and was part of checkpoint.
  Fixed wrong warning of 'open count' after recovery of files that was not touched since checkpoint.
storage/maria/maria_chk.c:
  Changed not documented option --log-dir to --logdir
  Document more of the options.
  Clean up output for --help
storage/maria/trnman.c:
  Added DBUG_PRINT
2010-09-10 23:27:26 +03:00
Igor Babaev
b3cd40e0d2 Fixed bug #49322.
When not-exists optimization was applied to a table that
happened to be an inner table of two outer joins, one
embedded into another, then setting the match flag for
the embedding outer join on could be skipped. This caused
generation of extra null complemented rows.
Made sure that the match flags are set correctly in all cases
when not-exists optimization is used.
2010-09-09 21:16:01 -07:00
Michael Widenius
b7158601d3 Fixed bug LP#605798 "wrong data in bitmap" after recovery.
Extend remove_function_from_trace.pl to work with many threads (patch from Sergei)


dbug/remove_function_from_trace.pl:
  Extend remove_function_from_trace.pl to work with many threads (patch from Sergei)
storage/maria/ma_bitmap.c:
  Added marker that table had changed since last checkpoint.
  This ensures that we will flush all bitmap pages from cache at checkpoint.
  This fixes bug LP#605798 "wrong data in bitmap" after recovery.
storage/maria/ma_check.c:
  Cleaned up error output
storage/maria/ma_recovery.c:
  Cleaned up error output
storage/maria/maria_def.h:
  Added changed_not_flushed
2010-09-10 02:42:12 +03:00
Michael Widenius
6f59c41d2d Updated failure text for maria_install_db
Don't give warning about block_insert if table is crashed.

scripts/mysql_install_db.sh:
  Added link to KB.
storage/maria/ma_recovery.c:
  Don't give warning about block_insert if table is crashed.
2010-09-09 18:12:06 +03:00
Sergei Golubchik
44fec70b79 build dynamic plugins with the -shared libtool option to avoid
double compilation
2010-09-09 15:35:47 +02:00
Michael Widenius
f7a701ae95 Automatic merge with 5.1-release (5.1.50) 2010-09-09 02:12:55 +03:00
Michael Widenius
1a0315f1e7 Write message to stderr if recovery is not likely to succeed because we don't log records for batch inserts.
Don't do UNDO or REDO on a crashed table.
More DBUG_PRINT

sql/sql_parse.cc:
  Remove display of 'packet' which is not useful
storage/maria/ma_blockrec.c:
  More DBUG_PRINT()
storage/maria/ma_key_recover.c:
  Write page number instead of page position
storage/maria/ma_recovery.c:
  Write message to stderr if recovery is not likely to succeed because we don't log records for batch inserts.
  In normal cases this should never be an issue as we would recreate an empty table if MariaDB dies under batch insert.
  This warning will be given if you remove all tables and try to recreate them with maria_read_log, which can't be done as
  the log doesn't contain all data.
  Don't do UNDO or REDO on a crashed table.
storage/maria/ma_write.c:
  Write page number instead of page position.
2010-09-09 02:01:05 +03:00
Michael Widenius
01b100b5dd Give a more precise warning why something fails.
Fixed typo that caused warnings from mysql-test-run

mysql-test/mysql-test-run.pl:
  Fixed typo
sql/mysqld.cc:
  Give a more precise warning why something fails.
2010-09-08 02:00:12 +03:00
Michael Widenius
172356b081 Automatic merge 2010-09-07 23:57:00 +03:00
Michael Widenius
7027c7facc Added --skip-bdb as a compatibility option for old config files
mysql-test/mysql-test-run.pl:
  Added suppression
mysql-test/t/upgrade.test:
  Added missing path
2010-09-07 23:46:10 +03:00
Michael Widenius
89e62085c6 Fixed recovery bug where bitmap pages would not be correctly updated after processing UNDO rows.
Fixed test failures in buildbot
Don't write errors when failing to send ok packet

mysql-test/suite/pbxt/r/range.result:
  Don't write number of rows as it varies.
mysql-test/suite/pbxt/t/range.test:
  Don't write number of rows as it varies.
sql/mysqld.cc:
  Don't write errors when failing to send ok packet
storage/maria/ma_bitmap.c:
  Added DBUG_ASSERT to detect wrong bitmap pages
storage/maria/ma_blockrec.c:
  Don't reset BLOCKUSED_USE_ORG_BITMAP flag. This fixed a bug where bitmap could be wrong after UNDO of row with blobs
2010-09-07 19:58:39 +03:00
Michael Widenius
5288f8c021 Fixed compiler failures when compiling non debug build
storage/maria/ha_maria.cc:
  Don't use 'trn' variable to avoid warning about not used variable
storage/maria/ma_delete.c:
  Added __attribute__((unused))
storage/maria/ma_key_recover.c:
  Added __attribute__((unused))
  Fixed wrong placement of #endif
storage/maria/ma_key_recover.h:
  Fixed typo
2010-09-07 13:59:34 +03:00
Michael Widenius
b4a21b52fd Fixed compiler warnings 2010-09-07 13:57:59 +03:00
unknown
7ff256d3c2 Fix compile failures and warnings on Windows from XtraDB "shm buffer pool" patch.
(It is not legal C to do pointer arithmetics on void *).
2010-09-06 13:42:12 +02:00
Michael Widenius
4ccb89bec0 Automatic merge 2010-09-06 02:48:51 +03:00
Michael Widenius
c507c02808 Added missing include file (to get rid of compiler warning) 2010-09-06 02:31:19 +03:00
Michael Widenius
0f3d4b2f76 Fixed bug that 'maria_read_log -a' didn't set max_trid when reparing tables.
Fixed bug in Aria when replacing short keys with long keys and a key tree both overflow and underflow at same time.
Fixed several bugs when generating recovery logs when using RGQ with replacing long keys with short keys and vice versa.
Lots of new DBUG_ASSERT()'s
Added more information to recovery log to make it easier to know from where log entry orginated.
Introduced MARIA_PAGE->org_size that tells what the size of the page was in last log entry. This allows us to find out if all key changes for index page was logged.
Small code cleanups:
- Introduced _ma_log_key_changes() to log crc of key page changes
- Added share->max_index_block_size as max size of data one can put in key block (block_size - KEYPAGE_CHECKSUM_SIZE)
  This will later simplify adding a directory to index pages.
- Write page number instead of page postition to DBUG log



mysql-test/lib/v1/mysql-test-run.pl:
  Use --general-log instead of --log to disable warning when using RQG
sql/mysqld.cc:
  If we have already sent ok to client when we get an error, log this to stderr
  Don't disable option --log-output if CSV engine is not supported.
storage/maria/ha_maria.cc:
  Log queries to recovery log also in LOCK TABLES
storage/maria/ma_check.c:
  If param->max_trid is set, use this value instead of max_trid_in_system().
  This is used by recovery to set max_trid to max seen trid so far.
  keyinfo->block_length - KEYPAGE_CHECKSUM_SIZE -> max_index_block_size (Style optimization)
storage/maria/ma_delete.c:
  Mark tables crashed early
  Write page number instead of page position to debug log.
  Added parameter to ma_log_delete() and ma_log_prefix() that is logged so that we can find where wrong log entries where generated.
  Fixed bug where a page was not proplerly written when same key tree had both an overflow and underflow when deleting a key.
  keyinfo->block_length - KEYPAGE_CHECKSUM_SIZE => max_index_block_size (Style optimization)
  ma_log_delete() now has extra parameter of how many bytes from end of page should be appended to log for page (for page overflows)
storage/maria/ma_key_recover.c:
  Added extra parameter to ma_log_prefix() to indicate what caused log entry.
  Update MARIA_PAGE->org_size when logging info about page.
  Much more DBUG_ASSERT()'s.
  Fix some bugs in maria_log_add() to handle page overflows.
  Added _ma_log_key_changes() to log crc of key page changes.
  If EXTRA_STORE_FULL_PAGE_IN_KEY_CHANGES is defines, log the resulting pages to log so one can trivally
  see how the resulting page should have looked like (for errors in CRC values)
storage/maria/ma_key_recover.h:
  Added _ma_log_key_changes() which is only called if EXTRA_DEBUG_KEY_CHANGES is defined.
  Updated function prototypes.
storage/maria/ma_loghandler.h:
  Added more values to en_key_debug, to get more exact location where things went wrong when logging to recovery log.
storage/maria/ma_open.c:
  Initialize share->max_index_block_size
storage/maria/ma_page.c:
  Added updating and testing of MARIA_PAGE->org_size
  Write page number instead of page postition to DBUG log
  Generate error if we read page with wrong data.
  Removed wrong assert: key_del_current != share->state.key_del.
  Simplify _ma_log_compact_keypage()
storage/maria/ma_recovery.c:
  Set param.max_trid to max seen trid before running repair table (used for alter table to create index)
storage/maria/ma_rt_key.c:
  Update call to _ma_log_delete()
storage/maria/ma_rt_split.c:
  Use _ma_log_key_changes()
  Update MARIA_PAGE->org_size
storage/maria/ma_unique.c:
  Remove casts
storage/maria/ma_write.c:
  keyinfo->block_length - KEYPAGE_CHECKSUM_SIZE => share->max_index_block_length.
  Updated calls to _ma_log_prefix()
  Changed code to use _ma_log_key_changes()
  Update ma_page->org_size
  Fixed bug in _ma_log_split() for pages that overflow
  Added KEY_OP_DEBUG logging to functions
  Log KEYPAGE_FLAG in all log entries
storage/maria/maria_def.h:
  Added SHARE->max_index_block_size
  Added MARIA_PAGE->org_size
storage/maria/trnman.c:
  Reset flags for new transaction.
2010-09-06 02:25:44 +03:00
Michael Widenius
4c7af343e0 Fixed build failures
Cleaned up mysql_upgrade --help and mysqlcheck --help

client/mysql_upgrade.c:
  Increased version number.
  Marked all options that are not used 'Not used'.
  Don't write 'Looking for tool' if not using --verbose
client/mysqlcheck.c:
  Cleanup output for --help
  Reset not initialzed variable
mysql-test/r/log_tables_upgrade.result:
  Updated results
mysql-test/r/mysql_upgrade.result:
  Updated results
mysql-test/r/mysqlcheck.result:
  Updated results
mysql-test/t/log_tables_upgrade.test:
  mysql_upgrade is now run without --skip-verbose
mysql-test/t/mysql_upgrade.test:
  mysql_upgrade is now run without --skip-verbose
2010-09-06 02:15:34 +03:00
Michael Widenius
b74cd1b6b6 Fixed failing test cases after update of xtradb
mysql-test/r/not_partition.result:
  Test result changed after I fixed the error message for not existing engine
mysql-test/suite/funcs_1/r/is_columns_is.result:
  Updated results
mysql-test/suite/funcs_1/r/is_engines_innodb.result:
  Updated results
mysql-test/suite/funcs_1/r/is_tables_is.result:
  Updated results
mysql-test/suite/funcs_1/t/is_tables_is.test:
  Test requires innodb as results depends on innodb
mysql-test/suite/innodb_plugin/t/disabled.def:
  Disable test as it shows errors in valgrind
mysql-test/suite/innodb_plugin/t/innodb-use-sys-malloc.test:
  Test can't be run under valgrind as mysql-test-run resets the innodb_use_sys_malloc flag
storage/xtradb/buf/buf0buf.c:
  Fixed compiler warning by adding casts
2010-09-05 13:52:33 +03:00
Michael Widenius
74af6dfad0 Nicer output for mysql_upgrade
Added --silent option to mysql_upgrade so that one can only get errors printed
Don't write unnecessary warning about log tables during upgrade



client/mysql_upgrade.c:
  Don't print connect arguments if not using --verbose --verbose
  Added option --silent to only print errors. This options is passed to mysqlcheck.
  Write out phase names
  The 'verbose' code is a bit strange as I wanted to keep compatibility with old mysql_upgrade
client/mysqlcheck.c:
  Don't upgrade log tables (to avoid confusing warning message that they can't be locked)
2010-09-05 12:39:17 +03:00
unknown
688064f87f Result file update following XtraDB merge. 2010-09-04 21:37:50 +02:00
unknown
a584366a3d Merge XtraDB from Percona Server 5.1.49-12 into MariaDB. 2010-09-04 10:56:22 +02:00
unknown
49915031d5 Enable tests that were previously disabled waiting for XtraDB merge. 2010-09-03 21:47:16 +02:00