summaryrefslogtreecommitdiff
path: root/storage/sphinx
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-25602 get rid of __WIN__ in favor of standard _WIN32Vladislav Vaintroub2021-06-062-10/+10
| | | | | | | | | | This fixed the MySQL bug# 20338 about misuse of double underscore prefix __WIN__, which was old MySQL's idea of identifying Windows Replace it by _WIN32 standard symbol for targeting Windows OS (both 32 and 64 bit) Not that connect storage engine is not fixed in this patch (must be fixed in "upstream" branch)
* Reduce usage of strlen()Monty2021-05-191-19/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes: - To detect automatic strlen() I removed the methods in String that uses 'const char *' without a length: - String::append(const char*) - Binary_string(const char *str) - String(const char *str, CHARSET_INFO *cs) - append_for_single_quote(const char *) All usage of append(const char*) is changed to either use String::append(char), String::append(const char*, size_t length) or String::append(LEX_CSTRING) - Added STRING_WITH_LEN() around constant string arguments to String::append() - Added overflow argument to escape_string_for_mysql() and escape_quotes_for_mysql() instead of returning (size_t) -1 on overflow. This was needed as most usage of the above functions never tested the result for -1 and would have given wrong results or crashes in case of overflows. - Added Item_func_or_sum::func_name_cstring(), which returns LEX_CSTRING. Changed all Item_func::func_name()'s to func_name_cstring()'s. The old Item_func_or_sum::func_name() is now an inline function that returns func_name_cstring().str. - Changed Item::mode_name() and Item::func_name_ext() to return LEX_CSTRING. - Changed for some functions the name argument from const char * to to const LEX_CSTRING &: - Item::Item_func_fix_attributes() - Item::check_type_...() - Type_std_attributes::agg_item_collations() - Type_std_attributes::agg_item_set_converter() - Type_std_attributes::agg_arg_charsets...() - Type_handler_hybrid_field_type::aggregate_for_result() - Type_handler_geometry::check_type_geom_or_binary() - Type_handler::Item_func_or_sum_illegal_param() - Predicant_to_list_comparator::add_value_skip_null() - Predicant_to_list_comparator::add_value() - cmp_item_row::prepare_comparators() - cmp_item_row::aggregate_row_elements_for_comparison() - Cursor_ref::print_func() - Removes String_space() as it was only used in one cases and that could be simplified to not use String_space(), thanks to the fixed my_vsnprintf(). - Added some const LEX_CSTRING's for common strings: - NULL_clex_str, DATA_clex_str, INDEX_clex_str. - Changed primary_key_name to a LEX_CSTRING - Renamed String::set_quick() to String::set_buffer_if_not_allocated() to clarify what the function really does. - Rename of protocol function: bool store(const char *from, CHARSET_INFO *cs) to bool store_string_or_null(const char *from, CHARSET_INFO *cs). This was done to both clarify the difference between this 'store' function and also to make it easier to find unoptimal usage of store() calls. - Added Protocol::store(const LEX_CSTRING*, CHARSET_INFO*) - Changed some 'const char*' arrays to instead be of type LEX_CSTRING. - class Item_func_units now used LEX_CSTRING for name. Other things: - Fixed a bug in mysql.cc:construct_prompt() where a wrong escape character in the prompt would cause some part of the prompt to be duplicated. - Fixed a lot of instances where the length of the argument to append is known or easily obtain but was not used. - Removed some not needed 'virtual' definition for functions that was inherited from the parent. I added override to these. - Fixed Ordered_key::print() to preallocate needed buffer. Old code could case memory overruns. - Simplified some loops when adding char * to a String with delimiters.
* Merge branch 'bb-10.4-release' into bb-10.5-releaseSergei Golubchik2021-02-151-2/+2
|\
| * Merge branch 'bb-10.3-release' into bb-10.4-releaseSergei Golubchik2021-02-121-2/+2
| |\ | | | | | | | | | | | | Note, the fix for "MDEV-23328 Server hang due to Galera lock conflict resolution" was null-merged. 10.4 version of the fix is coming up separately
| | * MDEV-17556 Assertion `bitmap_is_set_all(&table->s->all_set)' failedNikita Malyavin2021-01-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The assertion failed in handler::ha_reset upon SELECT under READ UNCOMMITTED from table with index on virtual column. This was the debug-only failure, though the problem is mush wider: * MY_BITMAP is a structure containing my_bitmap_map, the latter is a raw bitmap. * read_set, write_set and vcol_set of TABLE are the pointers to MY_BITMAP * The rest of MY_BITMAPs are stored in TABLE and TABLE_SHARE * The pointers to the stored MY_BITMAPs, like orig_read_set etc, and sometimes all_set and tmp_set, are assigned to the pointers. * Sometimes tmp_use_all_columns is used to substitute the raw bitmap directly with all_set.bitmap * Sometimes even bitmaps are directly modified, like in TABLE::update_virtual_field(): bitmap_clear_all(&tmp_set) is called. The last three bullets in the list, when used together (which is mostly always) make the program flow cumbersome and impossible to follow, notwithstanding the errors they cause, like this MDEV-17556, where tmp_set pointer was assigned to read_set, write_set and vcol_set, then its bitmap was substituted with all_set.bitmap by dbug_tmp_use_all_columns() call, and then bitmap_clear_all(&tmp_set) was applied to all this. To untangle this knot, the rule should be applied: * Never substitute bitmaps! This patch is about this. orig_*, all_set bitmaps are never substituted already. This patch changes the following function prototypes: * tmp_use_all_columns, dbug_tmp_use_all_columns to accept MY_BITMAP** and to return MY_BITMAP * instead of my_bitmap_map* * tmp_restore_column_map, dbug_tmp_restore_column_maps to accept MY_BITMAP* instead of my_bitmap_map* These functions now will substitute read_set/write_set/vcol_set directly, and won't touch underlying bitmaps.
* | | Added 'final' to some classes to improve generated codeMichael Widenius2020-08-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Final added to: - All reasonable classes inhereted from Field - All classes inhereted from Protocol - Almost all Handler classes - Some important Item classes The stripped size of mariadbd is just 4K smaller, but several object files showed notable improvements in common execution paths. - Checked field.o and item_sum.o Other things: - Added 'override' to a few class functions touched by this patch. - Removed 'virtual' from a new class functions that had/got 'override' - Changed Protocol_discard to inherit from Protocol instad of Protocol_text
* | | replace HTON_AUTOMATIC_DELETE_TABLE with return -1 from drop_table()Sergei Golubchik2020-07-041-2/+2
| | |
* | | optimization: use hton->drop_table in few simple casesSergei Golubchik2020-07-041-0/+1
| | |
* | | MDEV-11412 Ensure that table is truly dropped when using DROP TABLEMonty2020-06-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The used code is largely based on code from Tencent The problem is that in some rare cases there may be a conflict between .frm files and the files in the storage engine. In this case the DROP TABLE was not able to properly drop the table. Some MariaDB/MySQL forks has solved this by adding a FORCE option to DROP TABLE. After some discussion among MariaDB developers, we concluded that users expects that DROP TABLE should always work, even if the table would not be consistent. There should not be a need to use a separate keyword to ensure that the table is really deleted. The used solution is: - If a .frm table doesn't exists, try dropping the table from all storage engines. - If the .frm table exists but the table does not exist in the engine try dropping the table from all storage engines. - Update storage engines using many table files (.CVS, MyISAM, Aria) to succeed with the drop even if some of the files are missing. - Add HTON_AUTOMATIC_DELETE_TABLE to handlerton's where delete_table() is not needed and always succeed. This is used by ha_delete_table_force() to know which handlers to ignore when trying to drop a table without a .frm file. The disadvantage of this solution is that a DROP TABLE on a non existing table will be a bit slower as we have to ask all active storage engines if they know anything about the table. Other things: - Added a new flag MY_IGNORE_ENOENT to my_delete() to not give an error if the file doesn't exist. This simplifies some of the code. - Don't clear thd->error in ha_delete_table() if there was an active error. This is a bug fix. - handler::delete_table() will not abort if first file doesn't exists. This is bug fix to handle the case when a drop table was aborted in the middle. - Cleaned up mysql_rm_table_no_locks() to ensure that if_exists uses same code path as when it's not used. - Use non_existing_Table_error() to detect if table didn't exists. Old code used different errors tests in different position. - Table_triggers_list::drop_all_triggers() now drops trigger file if it can't be parsed instead of leaving it hanging around (bug fix) - InnoDB doesn't anymore print error about .frm file out of sync with InnoDB directory if .frm file does not exists. This change was required to be able to try to drop an InnoDB file when .frm doesn't exists. - Fixed bug in mi_delete_table() where the .MYD file would not be dropped if the .MYI file didn't exists. - Fixed memory leak in Mroonga when deleting non existing table - Fixed memory leak in Connect when deleting non existing table Bugs fixed introduced by the original version of this commit: MDEV-22826 Presence of Spider prevents tables from being force-deleted from other engines
* | | Added page_range to records_in_range() to improve range statisticsMonty2020-03-272-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prototype change: - virtual ha_rows records_in_range(uint inx, key_range *min_key, - key_range *max_key) + virtual ha_rows records_in_range(uint inx, const key_range *min_key, + const key_range *max_key, + page_range *res) The handler can ignore the page_range parameter. In the case the handler updates the parameter, the optimizer can deduce the following: - If previous range's last key is on the same block as next range's first key - If the current key range is in one block - We can also assume that the first and last block read are cached! This can be used for a better calculation of IO seeks when we estimate the cost of a range index scan. The parameter is fully implemented for MyISAM, Aria and InnoDB. A separate patch will update handler::multi_range_read_info_const() to take the benefits of this change and also remove the double records_in_range() calls that are not anymore needed.
* | | Fix various spelling errorsOtto Kekäläinen2020-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | e.g. - dont -> don't - occurence -> occurrence - succesfully -> successfully - easyly -> easily Also remove trailing space in selected files. These changes span: - server core - Connect and Innobase storage engine code - OQgraph, Sphinx and TokuDB storage engines Related to MDEV-21769.
* | | cleanup: PSI key is *always* the first argumentSergei Golubchik2020-03-101-2/+3
| | |
* | | perfschema memory related instrumentation changesSergei Golubchik2020-03-101-1/+3
| | |
* | | Merge 10.4 into 10.5Marko Mäkelä2019-12-161-1/+1
|\ \ \ | |/ /
| * | Merge branch '10.3' into 10.4Oleksandr Byelkin2019-12-091-1/+1
| |\ \ | | |/
| | * Lintian complains on spelling errorFaustin Lammler2019-12-021-1/+1
| | | | | | | | | | | | | | | The lintian check complains on spelling error: https://salsa.debian.org/mariadb-team/mariadb-10.3/-/jobs/95739
* | | Merge remote-tracking branch 'origin/10.4' into 10.5Alexander Barkov2019-10-013-4/+33
|\ \ \ | |/ /
| * | Merge remote-tracking branch 'origin/10.3' into 10.4Alexander Barkov2019-10-013-4/+33
| |\ \ | | |/
| | * Merge remote-tracking branch 'origin/10.2' into 10.3Alexander Barkov2019-10-013-4/+33
| | |\
| | | * MDEV-20647 Fix and enable SphinxSE testsRobert Bindar2019-09-303-4/+33
| | | |
* | | | Merge 10.4 into 10.5Marko Mäkelä2019-09-243-3/+37
|\ \ \ \ | |/ / /
| * | | Merge 10.3 into 10.4Marko Mäkelä2019-09-233-3/+37
| |\ \ \ | | |/ / | | | | | | | | Disable MDEV-20576 assertions until MDEV-20595 has been fixed.
| | * | Merge 10.2 into 10.3Marko Mäkelä2019-09-233-3/+37
| | |\ \ | | | |/
| | | * MDEV 19205 Sphinx unable to connect using a host nameAnel Husakovic2019-09-202-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Enable the test `sphinx.sphinx` which was disabled by MDEV 10986, comit ee0094d2fd48dac0c - Add test case to `sphinx.sphinx` to cover host as localhost instead of `127.0.0.1` - Add result file for single test
| | | * Fix Caribe 19992019-09-201-3/+4
| | | | | | | | | | | | | | | | | | | | There's an annoying bug that prevents a Sphinx table to connect to a searchd using a host name. So the example table in the documentation https://mariadb.com/kb/en/library/about-sphinxse/#basic-usage that point's to "localhost" actually doesn't work. After some investigation I found two errors. The first one is a wrong check after the getaddrinfo call. The second is a wrong usage of the returned struct.
* | | | Merge 10.4 into 10.5Marko Mäkelä2019-09-061-3/+6
|\ \ \ \ | |/ / /
| * | | Merge 10.3 into 10.4Marko Mäkelä2019-08-311-3/+6
| |\ \ \ | | |/ /
| | * | Merge 10.2 into 10.3Marko Mäkelä2019-08-291-3/+6
| | |\ \ | | | |/
| | | * Merge 10.1 into 10.2Marko Mäkelä2019-08-281-3/+6
| | | |\
| | | | * Fix -Wstringop-truncationMarko Mäkelä2019-08-221-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | For the Sphinx storage engine, this is a functional change (bug fix): we will ensure that the message buffer is always NUL-terminated.
| | | | * MDEV-16544 - crash in ha_sphinx::create()mariadb-10.1.35Vladislav Vaintroub2018-08-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Use table_arg that was passed to the function, instead of dereferencing this->table, which is a NULL pointer.
| | | * | Merge 10.1 into 10.2Marko Mäkelä2018-05-291-4/+7
| | | |\ \ | | | | |/
| | | | * Fixed compiler warningsMonty2018-05-261-45/+42
| | | | | | | | | | | | | | | | | | | | When merging this with 10.2 and later, one can just use the 10.2 or later code
* | | | | Merge 10.4 into 10.5Marko Mäkelä2019-08-132-2/+2
|\ \ \ \ \ | |/ / / /
| * | | | fix buildEugene Kosov2019-07-052-2/+2
| | | | |
* | | | | MDEV-17709 Remove handlerton::stateRobert Bindar2019-06-061-1/+0
| | | | |
* | | | | Fixed Sphinx to follow THD ha_data protocolSergey Vojtovich2019-05-211-25/+12
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use thd_get_ha_data()/thd_set_ha_data() which protect against plugin removal until it has THD ha_data. Do not reset THD ha_data in sphinx_close_connection(), cleaner approach is to let ha_close_connection() do it. Part of MDEV-19515 - Improve connect speed
* | | | Merge 10.3 into 10.4Marko Mäkelä2018-08-161-1/+1
|\ \ \ \ | |/ / /
| * | | MDEV-16544 - crash in ha_sphinx::create()Vladislav Vaintroub2018-08-051-1/+1
| | | | | | | | | | | | | | | | | | | | Use table_arg that was passed to the function, instead of dereferencing this->table, which is a NULL pointer.
* | | | MDEV-14630 Replace {STRING|INT|REAL|DECIMAL|DATE}_ITEM to CONST_ITEMAlexander Barkov2018-06-061-2/+6
|/ / /
* | | Fixed wrong usage of variable in ha_sphinx.ccMonty2018-05-271-1/+1
| | | | | | | | | | | | This only affected printing of errors
* | | Removed even more warning that was found with -WunusedMonty2018-04-302-4/+4
| | | | | | | | | | | | | | | | | | - Removed test if HA_FT_WTYPE == HA_KEYTYPE_FLOAT as this never worked (HA_KEYTYPE_FLOAT is an enum) - Define HA_FT_MAXLEN to 126 (was tested before but never defined)
* | | Merge 10.2 into 10.3Marko Mäkelä2018-04-241-6/+0
|\ \ \ | |/ /
| * | Remove unused function FixNull()Marko Mäkelä2018-04-241-6/+0
| | |
| * | Merge branch '10.1' into 10.2Vicențiu Ciorbaru2018-04-101-4/+4
| |\ \ | | |/
| | * Fixed compiler warnings in sphinxMonty2018-03-261-4/+4
| | |
* | | Fixed compiler warningsMonty2018-03-291-4/+4
| | | | | | | | | | | | Remove compiler warnings in sphinx, item_sum.cc and opt_split.cc
* | | Merge bb-10.2-ext into 10.3Marko Mäkelä2018-02-151-9/+9
|\ \ \
| * \ \ Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2018-02-121-9/+9
| |\ \ \ | | |/ /
| | * | Removed compiler warningsMonty2018-02-101-9/+9
| | | |