The main.ps_ddl test does SELECT * FROM mysql.general_log; that can be really
expensive with --valgrind if previous test cases put lots of data in the
general log since last server restart. Fix by truncating the log at test start.
The condition over the outer tables now are extracted from
the on condition of any outer join. This condition is
saved in a special field of the JOIN_TAB structure for
the first inner table of the outer join. The condition
is checked before the first inner table is accessed. If
it turns out to be false the table is not accessed at all
and a null complemented row is generated immediately.
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.
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.
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.
Item_func_spatial_collection::fix_length_and_dec()
changed to use argument's print() method to print
the ER_ILLEGAL_VALUE_FOR_TYPE error.
mysql-test/r/gis.result:
Fix for bug#56679: gis.test: valgrind error
- test result adjusted.
sql/item_geofunc.h:
Fix for bug#56679: gis.test: valgrind error
- use argument's print() method instead of improper val_str()
call in the Item_func_spatial_collection::fix_length_and_dec(), as
it's applicable only for constant items.
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.
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
Convertion from a floating point number to a string caused a
crash.
During rare circumstances a String object could crash when
it was requested to allocate new memory.
A crash could occcur in Field_double::val_str() because of
a pointer referencing memory inside a String object which was
of unknown size.
And finally, the geometric collection should not accept
arguments which are non geometric.
mysql-test/r/gis.result:
* Test cases change because we intercept the error behind the
previous crashes much earlier.
sql/field.cc:
* It makes no sense to impose a lower limit on the length
and not setting a upper limit will cause crashes later.
sql/item_geofunc.h:
* Disallow for binding with field- and item types which
differ from MYSQL_TYPE_GEOMETRY types.
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.
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
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
Made long file names from previous patch shorter
mysql-test/r/archive.result:
Added testing of repair (for upgrade) of 5.0 tables.
mysql-test/std_data/archive_5_0.ARM:
Archive table created in MySQL 5.0
mysql-test/std_data/archive_5_0.ARZ:
Archive table created in MySQL 5.0
mysql-test/std_data/archive_5_0.frm:
Archive table created in MySQL 5.0
mysql-test/std_data/long_table_name.MYD:
Made long file names shorter
mysql-test/std_data/long_table_name.MYI:
Made long file names shorter
mysql-test/std_data/long_table_name.frm:
Made long file names shorter
mysql-test/t/archive.test:
Added testing of repair (for upgrade) of 5.0 tables.
sql/sql_table.cc:
Allow recreate to open crashed tables.
sql/table.cc:
Fix error message if storage engine doesn't exists.
storage/archive/azio.c:
Reset status values in case archive is of old versions
storage/archive/ha_archive.cc:
Fix to allow one to open old versions of table during repair
Reset status variables for old version tables
If the the table is of old version, force upgrade with ALTER TABLE when doing repair
storage/archive/ha_archive.h:
Added variables to detect old versions
Fall back to use ALTER TABLE for engines that doesn't support REPAIR when doing repair for upgrade.
Nicer output from mysql_upgrade and mysql_check
Updated all arrays that used NAME_LEN to use SAFE_NAME_LEN to ensure that we don't break things accidently as names can now have a #mysql50# prefix.
client/mysql_upgrade.c:
If we are using verbose, also run mysqlcheck in verbose mode.
client/mysqlcheck.c:
Add more information if running in verbose mode
Print 'Needs upgrade' instead of complex error if table needs to be upgraded
Don't write connect information if verbose is not 2 or above
mysql-test/r/drop.result:
Updated test and results as we now support full table names
mysql-test/r/grant.result:
Now you get a correct error message if using #mysql with paths
mysql-test/r/show_check.result:
Update results as table names can temporarly be bigger than NAME_LEN (during upgrade)
mysql-test/r/upgrade.result:
Test upgrade for long table names.
mysql-test/suite/funcs_1/r/is_tables_is.result:
Updated old test result (had note been updated in a while)
mysql-test/t/drop.test:
Updated test and results as we now support full table names
mysql-test/t/grant.test:
Now you get a correct error message if using #mysql with paths
mysql-test/t/upgrade.test:
Test upgrade for long table names.
sql/ha_partition.cc:
NAME_LEN -> SAFE_NAME_LEN
sql/item.cc:
NAME_LEN -> SAFE_NAME_LEN
sql/log_event.cc:
NAME_LEN -> SAFE_NAME_LEN
sql/mysql_priv.h:
Added SAFE_NAME_LEN
sql/rpl_filter.cc:
NAME_LEN -> SAFE_NAME_LEN
sql/sp.cc:
NAME_LEN -> SAFE_NAME_LEN
sql/sp_head.cc:
NAME_LEN -> SAFE_NAME_LEN
sql/sql_acl.cc:
NAME_LEN -> SAFE_NAME_LEN
sql/sql_base.cc:
NAME_LEN -> SAFE_NAME_LEN
sql/sql_connect.cc:
NAME_LEN -> SAFE_NAME_LEN
sql/sql_parse.cc:
NAME_LEN -> SAFE_NAME_LEN
sql/sql_prepare.cc:
NAME_LEN -> SAFE_NAME_LEN
sql/sql_select.cc:
NAME_LEN -> SAFE_NAME_LEN
sql/sql_show.cc:
NAME_LEN -> SAFE_NAME_LEN
Enlarge table names for SHOW TABLES to also include optional #mysql50#
sql/sql_table.cc:
Fall back to use ALTER TABLE for engines that doesn't support REPAIR when doing repair for upgrade.
sql/sql_trigger.cc:
NAME_LEN -> SAFE_NAME_LEN
sql/sql_udf.cc:
NAME_LEN -> SAFE_NAME_LEN
sql/sql_view.cc:
NAME_LEN -> SAFE_NAME_LEN
sql/table.cc:
Fixed check_table_name() to not count #mysql50# as part of name
If #mysql50# is part of the name, don't allow path characters in name.