- 12 Oct, 2018 2 commits
-
-
Marko Mäkelä authored
row_build_index_entry_low(): Clean up the code, removing redundant variables and conditions. For instantly dropped columns, generate a dummy value that is NULL, the empty string, or a fixed length of NUL bytes, depending on the type of the dropped column. FIXME: For some reason, during the test gcol.innodb_virtual_debug_purge we are returning NULL for indexes on virtual columns, meaning that purge on the indexes is being skipped. Does this lead to missed purge, or is it merely causing unnecessary memory allocation? Why are we not evaluating the virtual column values before calling this function? (And why not write all index keys (virtual columns or spatial index MBR) directly to the undo log records?)
-
Marko Mäkelä authored
row_upd_clust_rec_by_insert_inherit_func(): On the update of PRIMARY KEY of a record that contained a dropped column whose value was stored externally, we will be inserting a dummy NULL or empty string value to the field of the dropped column. The externally stored column would eventually be dropped when purge removes the delete-marked record for the old PRIMARY KEY value.
-
- 11 Oct, 2018 5 commits
-
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
dict_index_t::clear_instant_alter(): Move the fields for the dropped columns to the end, and sort the surviving index fields in ascending order of column position.
-
Marko Mäkelä authored
Reduce the test diff from 10.4.
-
Marko Mäkelä authored
This reverts commit 26897301 and adds some changes. Only a table on which the 10.3 ADD COLUMN...LAST was performed can "lose its instantness" when it becomes empty. After instant DROP COLUMN or reordering columns, we cannot simply convert the table to the canonical format, because the data dictionary cache and all possibly existing references to it from other client connection threads would have to be adjusted. rec_init_offsets_comp_ordinary(): Remove a FIXME comment. row_log_allocate(): Replace dict_index_t::is_instant() with a more appropriate condition that ignores dict_table_t::instant.
-
- 10 Oct, 2018 15 commits
-
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
On the rollback of changes to SYS_COLUMNS, MDEV-15562 will break the assumption that the only instantaneous changes to columns are the addition to the end of the column list. The function dict_table_t::rollback_instant(unsigned n) is inherently incompatible with instantly dropping or reordering columns. When a change to SYS_COLUMNS is rolled back, we must simply evict the affected table definition, at the end of the rollback. We cannot free the table object immediately, because the current transaction that is being rolled back may be holding a lock on the table and its metadata record. dict_table_remove_from_cache_low(): Replaced by dict_table_remove_from_cache(). dict_table_remove_from_cache(): Add a third parameter keep=false, so that the table can be freed by the caller. trx_lock_t::evicted_tables: List of tables on which trx_t::evict_table() was invoked. trx_t::evict_table(): Evict a table definition during rollback. trx_commit_in_memory(): Empty the trx->lock.evicted_tables list after the locks were released, by freeing the table objects. row_undo_ins_remove_clust_rec(), row_undo_mod_clust_low(): Invoke trx_t::evict_table() on the affected table if a change to SYS_COLUMNS is being rolled back.
-
Marko Mäkelä authored
The error handling for ALTER TABLE…ALGORITHM=COPY as well as CREATE TABLE used to commit the CREATE TABLE transaction and then issue DROP TABLE in a separate transaction. This is unnecessarily breaking atomicity during DDL operations. Let us revise it so that the DROP TABLE will be executed within the same transaction, which will finally be rolled back. FIXME: Introduce an undo log record so that the data file would be deleted on rollback and no DROP TABLE would be needed at all. FIXME: Avoid unnecessary access to per-table tablespace during DROP TABLE. If the .ibd file is going to be deleted anyway, we should not bother to mark the pages free. dict_create_add_foreigns_to_dictionary(): Do not commit the transaction. We want simple rollback in case dict_load_foreigns() would fail. create_table_info_t::create_table(), row_create_index_for_mysql(), row_table_add_foreign_constraints(): Before invoking rollback, drop the table. Rollback would invoke trx_t::evict_table(), and after that dropping the table would be a no-op. ha_innobase::create(): Before rollback, drop the table. If the SQL layer invoked ha_innobase::delete_table() later, it would be a no-op because the rollback would have invoked trx_t::evict_table().
-
Marko Mäkelä authored
dict_index_t::first_user_field(): Return the first data field in a clustered index, that is, the field after the PRIMARY KEY and the two system columns DB_TRX_ID, DB_ROLL_PTR. dtuple_convert_big_rec(): Remove some local variables.
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
Ensure that no redo log checkpoint occurs in a critical section of a recovery test.
-
Marko Mäkelä authored
The test is shutting down InnoDB, corrupting a file, and finally restarting InnoDB. Before the shutdown, the test created the table and inserted some records. Before MDEV-12288, there would be no access to the table after server restart, but after MDEV-12288 purge would reset the transaction identifier after the INSERT, and this would sometimes happen after the restart. To make the test deterministic, wait for purge to complete before the shutdown.
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
- 09 Oct, 2018 10 commits
-
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
FIXME: DB_TRX_ID,DB_ROLL_PTR are not reset for the metadata record
-
Marko Mäkelä authored
FIXME: The virtual column code does not really support any reordering of virtual columns. The function check_v_col_in_order() should be removed and all the code fixed. ha_innobase::check_if_supported_inplace_alter(): For now, forbid ADD COLUMN of a stored column together with ADD/DROP of virtual columns. This works around an assertion failure in gcol.innodb_virtual_basic line 541. dict_table_t::instant_column(): Copy and adjust v_cols[]. dict_table_t::rollback_instant(): Roll back v_cols[]. innobase_build_col_map(): Skip added virtual columns. prepare_inplace_add_virtual(): Correctly compute num_to_add_vcol. Remove some unnecessary code. Note that the call to innodb_base_col_setup() should be executed later. innobase_add_virtual_try(), innobase_drop_virtual_try(): Let the caller invoke innodb_update_cols(). ha_innobase::commit_inplace_alter_table(): Add a FIXME comment that we should not reload the table when virtual columns are added or dropped. Currently, reloading is the only way to add the base columns of virtual columns into the InnoDB data dictionary cache. innobase_instant_try(): If any virtual column is dropped, rewrite all virtual column metadata. Use a shortcut only for adding virtual columns. This is because innobase_drop_virtual_try() assumes that the dropped virtual columns still exist in the cache.
-
Sergei Petrunia authored
Make the testcase stable
-
Marko Mäkelä authored
dict_create_add_foreigns_to_dictionary(): Do not commit the transaction. We want simple rollback in case dict_load_foreigns() would fail. create_table_info_t::create_table(), row_create_index_for_mysql(), row_table_add_foreign_constraints(): Before invoking rollback, drop the table. Rollback would invoke trx_t::evict_table(), and after that dropping the table would be a no-op. ha_innobase::create(): Before rollback, drop the table. If the SQL layer invoked ha_innobase::delete_table() later, it would be a no-op because the rollback would have invoked trx_t::evict_table(). FIXME: Introduce an undo log record so that the data file would be deleted on rollback. Also, avoid unnecessary access to the tablespace during DROP TABLE or the rollback of CREATE TABLE. If the file is going to be deleted anyway, we should not bother to mark the pages free.
-
Alexander Barkov authored
MDEV-17216 Assertion `!dt->fraction_remainder(decimals())' failed in Field_temporal_with_date::store_TIME_with_warning The problem happened because {{Field_xxx::store(longlong nr, bool unsigned_val)}} erroneously passed {{unsigned_flag}} to the {{usec}} parameter of this constructor: {code:cpp} Datetime(int *warn, longlong sec, ulong usec, date_conv_mode_t flags) {code} 1. Changing Time and Datetime constructors to accept data as Sec6 rather than as longlong/double/my_decimal, so it's not possible to do such mistakes in the future. Additional good effect of these changes: - This reduced some amount of similar code (minus ~35 lines). - The code now does not rely on the fact that "unsigned_flag" is not important inside Datetime(). The constructor always gets all three parts: sign, integer part, fractional part. The simple the better. 2. Fixing Field_xxx::store() to use the new Datetime constructor format. This change actually fixes the problem. 3. Adding "explicit" keyword to all Sec6 constructors, to avoid automatic hidden conversion from double/my_decimal to Sec6, as well as from longlong/ulonglong through double to Sec6. 4. Change#1 caused (as a dependency) changes in a few places with code like this: bool neg= nr < 0 && !unsigned_val; ulonglong value= m_neg ? (ulonglong) -nr : (ulonglong) nr; These fragments relied on a non-standard behavior with the operator "minus" applied to the lowest possible negative signed long long value. This can lead to different results depending on the platform and compilation flags. We have fixed such bugs a few times already. So instead of modifying the old wrong code to a new wrong code, replacing all such fragments to use Longlong_hybrid, which correctly handles this special case with -LONGLONG_MIN in its method abs(). This also reduced the amount of similar code (1 or 2 new lines instead 3 old lines in all 6 such fragments). 5. Removing ErrConvInteger(longlong nr, bool unsigned_flag= false) and adding ErrConvInteger(Longlong_hybrid) instead, to encourage use of safe Longlong_hybrid instead of unsafe pairs nr+neg. 6. Removing unused ErrConvInteger from Item_cache_temporal::get_date()
-
Vladislav Vaintroub authored
Changed the build to use /MD flag so that DDL version of C runtime is used. To make sure MariaDB is always runnable on target system, include redistributable CRT libraries into installer. For MSI package, use Microsoft's merge modules. For ZIP use "applocal" approach,i.e place redistributable dlls into the bin directory of the package(via InstallRequiredSystemLibraries cmake module) The space overhead of libraries in negligible, ~ 3MB unpacked. There are 2 cases, where we still link C runtime statically - Upgrade wizard, it uses MFC, and we link statically to avoid redistribute also whole MFC (for this single application, does not make much sense). - MSI installer's custom action dll wixca.dll.Here, we need static link so that MSI won't fail on a target system that does not have VC++2015 runtime already installed.
-
Marko Mäkelä authored
-
Alexander Barkov authored
- Fixing portabibily problems in sql-common/my_time.c (and additionally in sql/sql_time.cc) - Re-enabling func_time.test Now all new chunks added in MDEV-17351 work fine on all platforms.
-
- 08 Oct, 2018 8 commits
-
-
Marko Mäkelä authored
row_metadata_to_tuple(), row_rec_to_index_entry_impl(): Add the parameter "pad" to determine whether the tuple should be padded to the index fields (on ALTER TABLE it should), or whether it should remain at its original size (on rollback). trx_undo_page_report_modify(): Avoid out-of-bounds access to record fields. row_quiesce_write_index_fields(): Do not crash when the table contains an instantly dropped column.
-
Thirunarayanan Balathandayuthapani authored
table for purge thread Problem: ======= Purge tries to fetch mdl lock for the whole table even though it tries to open one of the partition. But table name length was wrongly set to indicate the partition name too. Solution: ======== - Table name length should identify the table name only not the partition name.
-
Thirunarayanan Balathandayuthapani authored
table for purge thread Problem: ======= Purge tries to fetch mdl lock for the whole table even though it tries to open one of the partition. But table name length was wrongly set to indicate the partition name too. Solution: ======== - Table name length should identify the table name only not the partition name.
-
Igor Babaev authored
and join_cache_level=6 This bug was fixed by the patch for mdev-17382 applied to 5.5.
-
Marko Mäkelä authored
-
Alexander Barkov authored
-
Igor Babaev authored
derived table / view by equality Now rows of a materialized derived table are always put into a temporary table before join operation. If BNLH is used to join this table with the result of a partial join then both operands of the join are actually put into main memory. In most cases this is not efficient. We could avoid this by sending the rows of the derived table directly to the join operation. However this kind of data flow is not supported yet. Fixed by not allowing usage of hash join algorithm to join a materialized derived table if it's joined by an equality predicate of the form f=e where f is a field of the derived table. Change for the test case in 10.3: splitting must be turned off to preserve the explain.
-
Marko Mäkelä authored
-