summaryrefslogtreecommitdiff
path: root/storage/myisam
Commit message (Collapse)AuthorAgeFilesLines
* WIP Merge 10.0 into 10.1Marko Mäkelä2018-01-291-2/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | Bootstrap fails as follows: Logging: /mariadb/10.1/mysql-test/mysql-test-run.pl --mem --parallel=auto --force --retry=0 --suite=innodb vardir: /mariadb/10.1/build/mysql-test/var Removing old var directory... Creating var directory '/mariadb/10.1/build/mysql-test/var'... - symlinking 'var' to '/dev/shm/var_auto_CT5B' Checking supported features... mysqld: /mariadb/10.1/sql/sql_cache.cc:2767: void Query_cache::free_cache(): Assertion `m_cache_lock_status == LOCKED_NO_WAIT || m_cache_status == DISABLE_REQUEST' failed. 180129 18:05:25 [ERROR] mysqld got signal 6 ;
| * 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 10.0 into 10.1Marko Mäkelä2018-01-031-7/+7
|\ \ \ \ | |/ / /
| * | | 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
| | | |
* | | | cleanup: ha_myisam::data_file_name and index_file_nameSergei Golubchik2017-12-251-22/+25
| | | | | | | | | | | | | | | | | | | | | | | | don't allocate them on THD::mem_root on every init(HA_STATUS_CONST) call, do it once in open() (because they don't change) on TABLE::mem_root (so they stay valid until the table is closed)
* | | | Merge branch '10.0' into 10.1Sergei Golubchik2017-10-221-1/+1
|\ \ \ \ | |/ / /
| * | | 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
* | | | MDEV-13636 ALTER TABLE ... DELAY_KEY_WRITE=1 creates table copy for MyISAM ↵Sergei Golubchik2017-09-181-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | table with DATA DIRECTORY/INDEX DIRECTORY options correct detection of changes in DATA/INDEX DIRECTORY
* | | | Merge branch '10.0' into 10.1Sergei Golubchik2017-08-082-1/+3
|\ \ \ \ | |/ / /
| * | | 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-13097 Online alter of a partitioned MyISAM table with auto_incrementSergei Golubchik2017-06-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MyISAM only allows online alter if autoincrement didn't change. MyISAM detects that by comparing new autoinc value from create_info, with the old one, stored in MYI. But in partitioned tables, create_info->auto_increment_value is for the whole table, max of autoinc values of individual MYI partitions. So *some* MYI partitions will inevitably think that alter table changes auto_increment value and will deny online alter. Fix: only compare autoinc values, if the user has used AUTO_INCREMENT in the ALTER TABLE statement.
* | | | MDEV-11335 Changing delay_key_write option for MyISAM table should not copy rowsSergei Golubchik2017-05-241-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't rebuild the table for ALTER TABLE delay_key_write changes. After that, delay_key_write value in .frm may differ from the value in .MYI. We'll do what .frm says.
* | | | Merge 10.0 into 10.1Marko Mäkelä2017-05-232-2/+2
|\ \ \ \ | |/ / /
| * | | 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)
* | | | Merge 10.0 into 10.1Marko Mäkelä2017-05-191-11/+9
|\ \ \ \ | |/ / /
| * | | 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.
* | | | 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.
* | | | Merge branch '10.0' 10.1Sergei Golubchik2017-04-281-2/+0
|\ \ \ \ | |/ / /
| * | | 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
* | | | Merge branch '10.0' into 10.1Sergei Golubchik2017-03-211-4/+4
|\ \ \ \ | |/ / /
| * | | 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
| | | |
* | | | Correct FSF addressiangilfillan2017-03-101-1/+1
| | | |
* | | | Merge 10.0 into 10.1Marko Mäkelä2017-03-098-220/+194
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, implement MDEV-11027 a little differently from 5.5 and 10.0: recv_apply_hashed_log_recs(): Change the return type back to void (DB_SUCCESS was always returned). Report progress also via systemd using sd_notifyf().
| * | | 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
* | | | Merge 10.0 into 10.1Marko Mäkelä2017-03-032-0/+70
|\ \ \ \ | |/ / /
| * | | 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 '10.0' into 10.1Sergei Golubchik2016-12-112-9/+1
|\ \ \ \ | |/ / /
| * | | 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.