summaryrefslogtreecommitdiff
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.0 into 10.1Marko Mäkelä2017-05-191-0/+6
|\
| * MDEV-12420 max_recursive_iterations did not prevent a stack-overflow and ↵Sergei Golubchik2017-05-151-3/+6
| | | | | | | | | | | | | | | | | | | | segfault post-review fixes * move pcre-specific variable out of mysys * don't use current_thd * move a commonly used macro to my_sys.h * remove new sysvar
| * WIP: global readonly variable pcre_frame_sizeDaniel Black2017-05-151-0/+3
| |
* | Merge branch '10.0' 10.1Sergei Golubchik2017-04-282-4/+3
|\ \ | |/
| * Merge branch '5.5' into 10.0Sergei Golubchik2017-04-212-4/+3
| |\
| | * MDEV-12230 include/my_sys.h:600:43: error: unknown type name ↵Sergei Golubchik2017-04-202-2/+48
| | | | | | | | | | | | | | | | | | ‘PSI_file_key’" when -DWITHOUT_SERVER=1 cherry-pick 2c2bd8c155 (MDEV-12261 build failure without P_S) from 10.0
| | * Merge remote-tracking branch 'mysql/5.5' into 5.5mariadb-5.5.55Sergei Golubchik2017-04-111-3/+3
| | |\
| | | * BUG#25575605: SETTING --SSL-MODE=REQUIRED SENDS CREDENTIALS BEFORE VERIFYING ↵Ramil Kalimullin2017-03-142-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SSL CONNECTION Changed MYSQL_OPT_SSL_MODE to be the same as in 5.6 (ABI compatibility). (cherry picked from commit 47bb4eb5df1629b5d5e30aebfa9d7a6d74388a5d)
| | | * BUG#25575605: SETTING --SSL-MODE=REQUIRED SENDS CREDENTIALS BEFORE VERIFYING ↵Ramil Kalimullin2017-03-105-9/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SSL CONNECTION MYSQL_OPT_SSL_MODE option introduced. It is set in case of --ssl-mode=REQUIRED and permits only SSL connection. (cherry picked from commit 3b2d28578c526f347f5cfe763681eff365731f99)
| | | * Updated copyright year in user visible textBalasubramanian Kandasamy2017-01-061-2/+2
| | | |
| | | * BUG#24437124: POSSIBLE BUFFER OVERFLOW ON CREATE TABLEKarthik Kamath2016-11-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ANALYSIS: ========= 'CREATE TABLE' query with a large value for 'CONNECTION' string reports an incorrect error. The length of connection string is stored in .frm in two bytes (max value= 65535). When the string length exceeds the max value, the length is truncated to fit the two bytes limit. Further processing leads to reading only a part of the string as the length stored is incorrect. The remaining part of the string is treated as engine type and hence results in an error. FIX: ==== We are now restricting the connection string length to 1024. An appropriate error is reported if the length crosses this limit. NOTE: ===== The 'PASSWORD' table option is documented as unused and processed within a dead code. Hence it will not cause similar issue with large strings.
| | | * Bug#24388746: PRIVILEGE ESCALATION AND RACE CONDITION USING CREATE TABLEJon Olav Hauglid2016-08-192-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | | * Bug #23296299 : HANDLE_FATAL_SIGNAL (SIG=11) INKailasnath Nagarkar2016-07-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MY_TOSORT_UTF32 This patch is specific for mysql-5.5 ISSUE: When a charater that is larger than possible to handle is passed to function my_tosort_utf32(), it results in segmentation fault. In the scenario mentioned in the bug AES_ENCRYPT function is used which returns large value. This value is further passed to my_tosort_utf32 function. This causes to cross array bound for array uni_plane, resulting in segment violation. SOLUTION: This issue has got addressed in 5.6 onward releases through worklog 2673. The fix is similar backport of that. Check for maximum character before accessing the array uni_plane. In addition to function my_tosort_utf32, the same potential problem is also present in functions my_tolower_utf16, my_toupper_utf16, my_tosort_utf16, my_tolower_utf32, my_toupper_utf32, my_tosort_unicode, my_tolower_utf8mb4 and my_toupper_utf8mb4. Fixed these functions as well.
* | | | MDEV-11663 Create services for functionality used by pluginsVladislav Vaintroub2017-04-2712-88/+381
| | | | | | | | | | | | | | | | | | | | | | | | Added service for - encryption (AES) - error reporting, e.g my_printf_error()
* | | | bugfix: federated/replication did not increment bytes_received status variableSergei Golubchik2017-04-271-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | because mysql->net.thd was reset to NULL in mysql_real_connect() and thd_increment_bytes_received() didn't do anything. Fix: * set mysql->net.thd to current_thd instread. * remove the test for non-null THD from a very often used function thd_increment_bytes_received().
* | | | Merge branch '10.0' into 10.1Sergei Golubchik2017-03-212-2/+45
|\ \ \ \ | |/ / /
| * | | compiler warningSergei Golubchik2017-03-161-2/+2
| | | |
| * | | MDEV-12261 build failure without P_SSergei Golubchik2017-03-152-2/+45
| | | | | | | | | | | | | | | | | | | | restore mysql_file_delete_with_symlink() but let it use new my_handler_delete_with_symlink() mysys helper.
* | | | Correct FSF addressiangilfillan2017-03-1013-13/+13
| | | |
* | | | MDEV-11752 Unsafe strmov - function definition in include/m_string.hSergei Golubchik2017-03-101-0/+2
| | | | | | | | | | | | | | | | | | | | assert that strmov() cannot be used on overlapping strings. (because strpcpy cannot)
* | | | small plugin API related fixesSergei Golubchik2017-03-102-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | * define MYSQL_DYNAMIC_PLUGIN only for server plugins * don't typedef my_bool in mysql.h if plugin.h has already done it * fix the include guard in plugin.h
* | | | cleanup: sort various lists of servicesSergei Golubchik2017-03-107-1110/+1109
| | | |
* | | | thd_rnd serviceSergei Golubchik2017-03-108-0/+94
| | | |
* | | | Auth Plugin API: add THD to MYSQL_SERVER_AUTH_INFOSergei Golubchik2017-03-102-1/+7
| | | | | | | | | | | | | | | | so that auth plugins could use various thd services
* | | | base64 serviceSergei Golubchik2017-03-109-62/+164
| | | |
* | | | remove old API for SHA2Sergei Golubchik2017-03-101-72/+0
| | | |
* | | | my_sha2 serviceSergei Golubchik2017-03-109-4/+386
| | | |
* | | | cleanup: generalize my_sha1.ccSergei Golubchik2017-03-101-25/+0
| | | | | | | | | | | | | | | | | | | | move most of the code into my_sha.ic, making it independent from the actual SHAx variant.
* | | | make sql_udf.cc to shorten dlerror() messagesSergei Golubchik2017-03-101-0/+2
| | | | | | | | | | | | | | | | just as sql_plugin.cc does
* | | | Merge 10.0 into 10.1Marko Mäkelä2017-03-093-44/+9
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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().
| * | | Revert "Add extra HA_ERR message that Percona introduced within TokuDB ↵Vicențiu Ciorbaru2017-03-062-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | 5.6.35-80" This reverts commit fa59ac5055686403ce8b61936069b04d4392b9d1.
| * | | Add extra HA_ERR message that Percona introduced within TokuDB 5.6.35-80Vicențiu Ciorbaru2017-03-052-2/+4
| | | |
| * | | Merge branch '5.5' into 10.0Vicențiu Ciorbaru2017-03-033-45/+9
| |\ \ \ | | |/ /
| | * | bugfix: remove my_delete_with_symlink()Sergei Golubchik2017-02-272-42/+0
| | | | | | | | | | | | | | | | | | | | | | | | 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-0/+3
| | | |
| | * | MDEV-11902 mi_open race conditionSergei Golubchik2017-02-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: mysys_test_invalid_symlinkSergei Golubchik2017-02-271-0/+2
| | | | | | | | | | | | | | | | | | | | Remove maria_test_invalid_symlink() and myisam_test_invalid_symlink(), introduce mysys_test_invalid_symlink(). Other engines might need it too
| | * | Fix for memory leak in applications, like QT,that callsMonty2017-01-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | my_thread_global_init() + my_thrad_global_end() repeatadily. This caused THR_KEY_mysys to be allocated multiple times. Deletion of THR_KEY_mysys was originally in my_thread_global_end() but was moved to my_end() as DBUG uses THR_KEY_mysys and DBUG is released after my_thread_global_end() is called. Releasing DBUG before my_thread_global_end() and move THR_KEY_mysys back into my_thread_global_end() could be a solution, but as safe_mutex and other things called by my_thread_global_end is using DBUG it may not be completely safe. To solve this, I used the simple solution to add a marker that THR_KEY_mysys is created and not re-create it in my_thread_global_init if it already exists.
* | | | Merge 10.0 into 10.1Marko Mäkelä2017-03-031-4/+3
|\ \ \ \ | |/ / /
| * | | Windows : Fix server compile errors when compile with /Zc:strictStrings optionVladislav Vaintroub2017-02-281-4/+3
| | | |
* | | | Merge branch '10.0' into 10.1Vicențiu Ciorbaru2017-01-161-0/+4
|\ \ \ \ | |/ / /
| * | | Merge remote-tracking branch 'origin/5.5' into 10.0vicentiu2017-01-061-0/+4
| |\ \ \ | | |/ /
| | * | move check_user/set_user from mysqld.cc to mysysSergei Golubchik2016-12-221-0/+4
| | | |
* | | | Merge branch '10.0' into 10.1Sergei Golubchik2016-12-111-0/+3
|\ \ \ \ | |/ / /
| * | | MDEV-11343 LOAD DATA INFILE fails to load data with an escape character ↵Alexander Barkov2016-11-291-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | followed by a multi-byte character Partially backporting MDEV-9874 from 10.2 to 10.0 READ_INFO::read_field() raised the ER_INVALID_CHARACTER_STRING error when reading an escape character followed by a multi-byte character. Raising wellformedness errors in READ_INFO::read_field() was wrong, because the main goal of READ_INFO::read_field() is to *unescape* the data which was presumably escaped using mysql_real_escape_string(), using the same character set with the one specified in "LOAD DATA INFILE ... CHARACTER SET ..." (or assumed by default). During LOAD DATA, multi-byte characters are not always scanned as a single entity! In case of escaped data, parts of a multi-byte character can be scanned on different loop iterations. So the old code erroneously tested welformedness in the middle of a multi-byte character. Moreover, the data after unescaping can go into a BLOB field, not a text field. Wellformedness tests are meaningless in this case. Ater this patch, wellformedness is only checked later, during Field::store(str,length,cs) time. The loop that scans bytes only makes sure to revert the changes made by mysql_real_escape_string(). Note, in some cases users can supply data which did not really go through mysql_real_escape_string() and was escaped by some other means, or was not escaped at all. The file reported in this MDEV contains the string "\ä", which is an example of such improperly escaped data, as - either there should be two backslashes: "\\ä" - or there should be no backslashes at all: "ä" mysql_real_escape_string() could not generate "\ä".
* | | | MDEV-10759 Fix Aria to support 2-byte collation IDsMonty2016-12-022-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Used same fix as for MyISAM: High level collation byte stored in unused bit_end position. - Moved language from header to base_info - Removed unused bit_end part in HA_KEY_SEG
* | | | Merge branch '10.0-galera' into 10.1Sergei Golubchik2016-11-022-18/+0
|\ \ \ \
| * \ \ \ Merge tag 'mariadb-10.0.28' into 10.0-galeraNirbhay Choubey2016-10-284-22/+3
| |\ \ \ \ | | |/ / /
| | * | | MDEV-10951 Field_newdate::cmp access violationVladislav Vaintroub2016-10-252-18/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The crash is caused by macro uint3korr() accessing memory (1 byte) past the end of allocated page. The macro is written such it reads 4 bytes instead of 3 and discards the value of the last byte. However, it is not always guaranteed that all uint3korr accesses will be valid (i.e that the caller allocates an extra byte after the value). In particular, the tree in Item_func_group_concat does not account for any extra bytes that it would need for comparison of keys in some cases (Field_newdate::cmp, Field_medium::cmp) The fix change uint3korr so it does not access extra bytes.
| * | | | Merge branch '10.0' into 10.0-galeraNirbhay Choubey2016-08-243-3/+3
| |\ \ \ \