summaryrefslogtreecommitdiff
path: root/storage/myisam
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch '5.5' into 10.0Vicențiu Ciorbaru2018-01-241-2/+6
|\
| * Merge branch 'mysql/5.5' into 5.5Sergei Golubchik2018-01-181-2/+6
| |\
| | * Bug #26880757: MYISAM_USE_MMAP=1 ON WINDOWS FREQUENTLY DOESArun Kuruvila2017-10-261-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NOT UPDATE FILE ON DISK Description:- When the server variable, "myisam_use_mmap" is enabled, MyISAM tables on windows are not updating the file on disk even when the server variable "flush" is set to 1. This is inturn making the table corrupted when encountering a power failure. Analysis:- When the server variable "myisam_use_mmap" is set, files of MyISAM tables will be memory mapped using the OS APIs mmap()/munmap()/msync() on Unix and CreateFileMapping() /UnmapViewOfFile()/FlushViewOfFile() on Windows. msync() and FlushViewOfFile() is responsible for flushing the changes made to the in-core copy of a file that was mapped into memory using mmap()/CreateFileMapping() back to the file system. FLUSH is determined by the OS unless explicitly called using msync()/FlushViewOfFile(). When the server variables "myisam_use_mmap" and "flush" are enabled, MyISAM is only flushing the files from file system cache to disc using "mysql_file_sync()" and not the memory mapped file from memory to FS cache using "my_msync()". ["my_msync()" inturn calls msync() on Unix and FlushViewOfFile() on Windows. Fix:- As part of the fix, if server variable "myisam_use_mmap" is enabled along with "flush", "my_msync()" is invoked to flush the data in memory to file system cache and followed by "mysql_file_sync()" which will flush the data from file system cache to disk.
| | * BUG#25451091:CREATE TABLE DATA DIRECTORY / INDEX DIRECTORYNisha Gopalakrishnan2017-05-122-14/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SYMLINK CHECK RACE CONDITIONS ANALYSIS: ========= A potential defect exists in the handling of CREATE TABLE .. DATA DIRECTORY/ INDEX DIRECTORY which gives way to the user to gain access to another user table or a system table. FIX: ==== The lstat and fstat output of the target files are now stored which help in determining the identity of the target files thus preventing the unauthorized access to other files.
| | * Bug #25447551: HANDLE_FATAL_SIGNAL (SIG=11) INKailasnath Nagarkar2017-03-151-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FT_BOOLEAN_CHECK_SYNTAX_STRING ISSUE: my_isalnum macro used for checking if character is alphanumeric dereferences uninitialized pointer in default character set structure resulting in server exiting abnormally. FIX: Used standard isalnum function instead of macro my_isalnum.
| | * Bug#24388746: PRIVILEGE ESCALATION AND RACE CONDITION USING CREATE TABLEJon Olav Hauglid2016-08-193-23/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During REPAIR TABLE of a MyISAM table, a temporary data file (.TMD) is created. When repair finishes, this file is renamed to the original .MYD file. The problem was that during this rename, we copied the stats from the old file to the new file with chmod/chown. If a user managed to replace the temporary file before chmod/chown was executed, it was possible to get an arbitrary file with the privileges of the mysql user. This patch fixes the problem by not copying stats from the old file to the new file. This is not needed as the new file was created with the correct stats. This fix only changes server behavior - external utilities such as myisamchk still does chmod/chown. No test case provided since the problem involves synchronization with file system operations.
* | | Merge 5.5 into 10.0Marko Mäkelä2018-01-031-7/+7
|\ \ \ | |/ /
| * | Silence some -Wimplicit-fallthrough by proper spellingMarko Mäkelä2018-01-031-7/+7
| | |
* | | Merge branch '5.5' into 10.0Sergei Golubchik2017-10-181-1/+1
|\ \ \ | |/ /
| * | MDEV-13459 Warnings, when compiling with gcc-7.xSergei Golubchik2017-10-171-1/+2
| | | | | | | | | | | | mostly caused by -Wimplicit-fallthrough
* | | Merge remote-tracking branch 'origin/5.5' into 10.0Vicențiu Ciorbaru2017-07-252-1/+3
|\ \ \ | |/ /
| * | ma_check/mi_check: maria_repair_parallel initialization for !quickDaniel Black2017-07-181-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | end_io_call uses uninitialized values from the new_data_cache As such we the buffer 0 and check this before calling end_io_cache on it. Thanks Sergey Vojtovich for the review and for this solution. Found by Coverity (ref 972481).
| * | Add storage_engine/parts overlay for MyISAMElena Stepanova2017-07-181-0/+0
| | |
* | | MDEV-6262 analyze the coverity report on mariadbSergei Golubchik2017-05-192-2/+2
| | | | | | | | | | | | | | | uploaded 10.0, analyzed everything with the Impact=High (and a couple of Medium)
* | | Silence bogus GCC 7 warnings -Wimplicit-fallthroughMarko Mäkelä2017-05-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Do not silence uncertain cases, or fix any bugs. The only functional change should be that ha_federated::extra() is not calling DBUG_PRINT to report an unhandled case for HA_EXTRA_PREPARE_FOR_DROP.
* | | MDEV-12761 Error return from external_lock make the server crashSergei Golubchik2017-05-151-11/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bunch of bugs when external_lock() fails on unlock: * mi_lock_database() used mi_mark_crashed() under share->intern_lock, but mi_mark_crashed() itself locks this mutex. * handler::close() required table to be unlocked, but failed external_lock didn't count as unlock * mysql_unlock_tables() ignored all unlock errors, but they still set the error status in stmt_da.
* | | Merge branch '5.5' into 10.0Sergei Golubchik2017-04-211-2/+0
|\ \ \ | |/ /
| * | MDEV-12230 include/my_sys.h:600:43: error: unknown type name ↵Sergei Golubchik2017-04-201-2/+2
| | | | | | | | | | | | | | | | | | ‘PSI_file_key’" when -DWITHOUT_SERVER=1 cherry-pick 2c2bd8c155 (MDEV-12261 build failure without P_S) from 10.0
* | | MDEV-12261 build failure without P_SSergei Golubchik2017-03-151-4/+4
| | | | | | | | | | | | | | | restore mysql_file_delete_with_symlink() but let it use new my_handler_delete_with_symlink() mysys helper.
* | | Remove unused variables.Marko Mäkelä2017-03-091-1/+0
| | |
* | | Merge 5.5 into 10.0Marko Mäkelä2017-03-081-102/+102
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | Also, implement MDEV-11027 a little differently from 5.5: recv_sys_t::report(ib_time_t): Determine whether progress should be reported. recv_apply_hashed_log_recs(): Rename the parameter to last_batch.
| * | Fix some GCC 6.3.0 warnings in MyISAM and Maria.Marko Mäkelä2017-03-081-100/+100
| | | | | | | | | | | | | | | | | | The C++ standard does not allow references to be NULL. Assign the return value of THD::alloc() to a pointer, not to a reference.
* | | Post MDEV-11902 Fix test failures in maria and myisam storage enginesVicențiu Ciorbaru2017-03-031-0/+5
| | | | | | | | | | | | | | | | | | my_readline can fail due to missing file. Make my_readline report this condition separately so that we can catch it and report an appropriate error message to the user.
* | | Merge branch '5.5' into 10.0Vicențiu Ciorbaru2017-03-038-116/+85
|\ \ \ | |/ /
| * | bugfix: remove my_delete_with_symlink()Sergei Golubchik2017-02-271-25/+28
| | | | | | | | | | | | | | | | | | it was race condition prone. instead use either a pair of my_delete() calls with already resolved paths, or a safe high-level function my_handler_delete_with_symlink(), like MyISAM and Aria already do.
| * | race-condition safe implementation of mi_delete_table/maria_delete_tableSergei Golubchik2017-02-271-31/+3
| | |
| * | cleanup: remove now-unused argumentSergei Golubchik2017-02-274-15/+13
| | |
| * | MDEV-11902 mi_open race conditionSergei Golubchik2017-02-272-32/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TOCTOU bug. The path is checked to be valid, symlinks are resolved. Then the resolved path is opened. Between the check and the open, there's a window when one can replace some path component with a symlink, bypassing validity checks. Fix: after we resolved all symlinks in the path, don't allow open() to resolve symlinks, there should be none. Compared to the old MyISAM/Aria code: * fastpath. Opening of not-symlinked files is just one open(), no fn_format() and lstat() anymore. * opening of symlinked tables doesn't do fn_format() and lstat() either. it also doesn't to realpath() (which was lstat-ing every path component), instead if opens every path component with O_PATH. * share->data_file_name stores realpath(path) not readlink(path). So, SHOW CREATE TABLE needs to do lstat/readlink() now (see ::info()), and certain error messages (cannot open file "XXX") show the real file path with all symlinks resolved.
| * | cleanup: remove 16-year-old "TODO"Sergei Golubchik2017-02-274-13/+8
| | |
| * | cleanup: mysys_test_invalid_symlinkSergei Golubchik2017-02-273-12/+4
| | | | | | | | | | | | | | | Remove maria_test_invalid_symlink() and myisam_test_invalid_symlink(), introduce mysys_test_invalid_symlink(). Other engines might need it too
* | | MDEV-11757 KEY_BLOCK_SIZE strangeness when UNCOMPRESSing COMPRESSed InnoDB ↵Sergei Golubchik2017-02-282-0/+70
| | | | | | | | | | | | | | | | | | | | | tables in ALTER TABLE ... DROP KEY, ADD KEY, don't forget to compare old and new keys' block sizes. If they differ - the key definition has changed.
* | | Merge branch '5.5' into 10.0Sergei Golubchik2016-12-091-6/+1
|\ \ \ | |/ /
| * | MDEV-11241 Certain combining marks cause MariaDB to crash when doing ↵Sergei Golubchik2016-12-031-6/+1
| | | | | | | | | | | | | | | | | | | | | Full-Text searches Don't assume that a word of n bytes can match a word of at most n * charset->mbmaxlen bytes, always go for the worst.
* | | Remove labs() warning from maria and myisam storage enginesVicențiu Ciorbaru2016-12-011-3/+0
| | |
* | | Merge branch '5.5' into 10.0Sergei Golubchik2016-08-101-1/+2
|\ \ \ | |/ /
| * | MDEV-10506 Protocol::end_statement(): Assertion `0' failed upon ALTER TABLESergei Golubchik2016-08-071-1/+2
| | | | | | | | | | | | thd->clear_error() destroyed already existing error status
* | | Merge branch '5.5' into bb-10.0Sergei Golubchik2016-06-211-190/+184
|\ \ \ | |/ /
| * | Fix typo bug that cause myisam repair to failmariadb-5.5.50Vicențiu Ciorbaru2016-06-161-2/+2
| | | | | | | | | | | | | | | We need to return TRUE if got_error == 1, not error, which is initialized to FALSE.
| * | Fix compilation failure when compiling with std=c90Vicențiu Ciorbaru2016-06-161-4/+3
| | | | | | | | | | | | Change variable declaration to be before any other statements.
| * | MDEV-10162: Update repair testcaseVicențiu Ciorbaru2016-06-141-9/+4
| | |
| * | Fixed compilation failure using clangVicențiu Ciorbaru2016-06-141-147/+164
| | | | | | | | | | | | | | | | | | | | | | | | | | | Both aria and myisam storage engines feature a logic path in thr_find_all_keys that leads to undefined behaviour by bypassing the initialization code of variables after my_thread_init(). By refactoring the nested logic into a separate function, this problem is resolved.
| * | [Code cleanup] Refactor duplicate code within myisam and maria sort.ccVicențiu Ciorbaru2016-06-141-37/+27
| | |
* | | Follow-up for commit 38b89a61c3ace83b32c079489922a0cae5106b56Elena Stepanova2016-05-281-36/+0
| | | | | | | | | | | | | | | Altering a comment or a default field's value needs "NO_LOCK", not EXCLUSIVE - storage_engine test result updated
* | | Merge branch '5.5' into 10.0Sergei Golubchik2016-04-261-2/+3
|\ \ \ | |/ /
| * | Merge branch 'mysql/5.5' into 5.5Sergei Golubchik2016-04-201-2/+3
| |\ \ | | |/
| | * (no commit message)Arun Kuruvila2016-02-231-3/+6
| | |
| | * Bug #22214852: MYSQL 5.5 AND 5.6: MAIN.KEY AND OTHERSreeharsha Ramanavarapu2015-11-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FAILURE WITH VALGRIND FOR RELEASE BUILD Issue: ------ Initialization of variable with UNINIT_VAR is flagged by valgrind 3.11. SOLUTION: --------- Initialize the variable to 0. This is a backport of Bug# 14580121.
| * | Merge branch 'mysql/5.5' into 5.5Sergei Golubchik2015-12-091-3/+3
| |\ \ | | |/
| | * Bug #22023218: MYSQL 5.5: MAIN.FULLTEXT HAS VALGRIND ISSUES.Sreeharsha Ramanavarapu2015-11-031-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue ----- This problem occurs when varchar columns are used in a internal temporary table. The type of the field is set incorrectly to the generic FIELD_NORMAL type. This in turn results in an inaccurate calculation of the record length. Valgrind issues will occur since initialization has not happend for some bytes. Fix ---- While creating the temporary table, the type of the field needs to be to set FIELD_VARCHAR. This will allow myisam to calculate the record length accurately. This fix is a backport of BUG#13350136.
* | | Fix spelling: occurred, execute, which etcOtto Kekäläinen2016-03-043-3/+3
| | |