diff options
author | Monty <monty@mariadb.org> | 2020-01-13 18:30:13 +0200 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2020-03-24 21:00:02 +0200 |
commit | 4ef437558ae8a278f24726276bec57141db086da (patch) | |
tree | d625704ca7a8fae4bc8f240b8daf7d2d3642d39b /sql/sql_load.cc | |
parent | 736998cb75ba1d7bf8969329d649d9d1337353ff (diff) | |
download | mariadb-git-4ef437558ae8a278f24726276bec57141db086da.tar.gz |
Improve update handler (long unique keys on blobs)
MDEV-21606 Improve update handler (long unique keys on blobs)
MDEV-21470 MyISAM and Aria start_bulk_insert doesn't work with long unique
MDEV-21606 Bug fix for previous version of this code
MDEV-21819 2 Assertion `inited == NONE || update_handler != this'
- Move update_handler from TABLE to handler
- Move out initialization of update handler from ha_write_row() to
prepare_for_insert()
- Fixed that INSERT DELAYED works with update handler
- Give an error if using long unique with an autoincrement column
- Added handler function to check if table has long unique hash indexes
- Disable write cache in MyISAM and Aria when using update_handler as
if cache is used, the row will not be inserted until end of statement
and update_handler would not find conflicting rows.
- Removed not used handler argument from
check_duplicate_long_entries_update()
- Syntax cleanups
- Indentation fixes
- Don't use single character indentifiers for arguments
Diffstat (limited to 'sql/sql_load.cc')
-rw-r--r-- | sql/sql_load.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sql/sql_load.cc b/sql/sql_load.cc index 6d3f9e540a7..efbbe28bcad 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -391,6 +391,7 @@ int mysql_load(THD *thd, const sql_exchange *ex, TABLE_LIST *table_list, DBUG_RETURN(TRUE); if (thd->lex->handle_list_of_derived(table_list, DT_PREPARE)) DBUG_RETURN(TRUE); + if (setup_tables_and_check_access(thd, &thd->lex->first_select_lex()->context, &thd->lex->first_select_lex()-> @@ -647,10 +648,12 @@ int mysql_load(THD *thd, const sql_exchange *ex, TABLE_LIST *table_list, thd->abort_on_warning= !ignore && thd->is_strict_mode(); - if ((table_list->table->file->ha_table_flags() & HA_DUPLICATE_POS) && - (error= table_list->table->file->ha_rnd_init_with_error(0))) - goto err; - + if ((table_list->table->file->ha_table_flags() & HA_DUPLICATE_POS)) + { + if ((error= table_list->table->file->ha_rnd_init_with_error(0))) + goto err; + table->file->prepare_for_insert(); + } thd_progress_init(thd, 2); if (table_list->table->validate_default_values_of_unset_fields(thd)) { |