summaryrefslogtreecommitdiff
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* Add encryption key id to the API as a distinct conceptSergei Golubchik2015-04-097-44/+58
| | | | which is separate from the encryption key version
* remove now-empty my_aes.{h,cc}Sergei Golubchik2015-04-092-71/+33
| | | | move remaning defines to my_crypt, add MY_ namespace prefix
* renames to follow single consistent naming styleSergei Golubchik2015-04-099-113/+120
| | | | with namespace prefixes
* remove wrappers in encryption_keys.ccSergei Golubchik2015-04-096-90/+26
| | | | invoke plugin methods directly
* encryption plugin controls the encryptionSergei Golubchik2015-04-099-122/+150
| | | | | | | | | * no --encryption-algorithm option anymore * encrypt/decrypt methods in the encryption plugin * ecnrypt/decrypt methods in the encryption_km service * file_km plugin has --file-key-management-encryption-algorithm * debug_km always uses aes_cbc * example_km changes between aes_cbc and aes_ecb for different key versions
* rename "encryption key management plugin" to "encryption plugin"Sergei Golubchik2015-04-094-9/+9
| | | | because it's going to do more than just key management
* optimize encryption apiSergei Golubchik2015-04-088-40/+35
| | | | | only one encryption key lookup in most cases instead of three (has_key, get_key_size, get_key).
* copy-paste bug in service_sha1.hSergei Golubchik2015-04-081-4/+4
|
* small cleanupSergei Golubchik2015-04-082-1/+3
| | | | | | | | | | | * my_aes.h doesn't compile without my_global.h * typo in a comment * redundant condition * if encryption plugin fails, there's no encryption_key_manager at plugin deinit time * encryption plugin tests must run when plugin.so is present, not when a plugin is active (otherwise the test will be skipped when plugin fails to initialize).
* remove Aria-only handler flagSergei Golubchik2015-04-081-2/+1
|
* remove get_iv() from the key management plugin APISergei Golubchik2015-04-087-23/+0
| | | | now IVs are always handled internally
* remove old my_aes_encrypt/decryptSergei Golubchik2015-04-081-49/+0
| | | | and simplify Item_func_aes_encrypt/decrypt
* yassl supportSergei Golubchik2015-04-051-9/+9
|
* unify my_{en|de}crypt_{cbc|ecb|ctr}. no yassl support yet.Sergei Golubchik2015-04-051-11/+42
|
* encryption cleanup: small changesSergei Golubchik2015-04-054-39/+4
| | | | | | | | | | * comments * move my_bytes_to_key() and my_aes_hex2uint() into file_key_management_plugin * rename HA_INSERT_ORDER -> HA_PRESERVE_INSERT_ORDER * remove unused variables and declarations * fix casts * don't link innodb with pcre * remove redundant entries from aria's TARGET_LINK_LIBRARIES
* encryption cleanup: delete obsolete filesSergei Golubchik2015-04-051-60/+0
| | | | they should've been deleted long ago, but weren't
* MDEV-6572 "USE dbname" with a bad sequence erroneously connects to a wrong ↵Alexander Barkov2015-03-161-0/+4
| | | | database
* MDEV-7728 - Improve xid cache scalability by using lock-free hashSergey Vojtovich2015-03-161-1/+6
| | | | | | | | XID cache is now based on lock-free hash. Also fixed lf_hash_destroy() to call alloc destructor. Note that previous implementation had race condition when thread was accessing XA owned by different thread. This new implementation doesn't fix it either.
* MDEV-6650 - LINT_INIT emits code in non-debug buildsSergey Vojtovich2015-03-161-13/+0
| | | | | Replaced all references to LINT_INIT with UNINIT_VAR and LINT_INIT_STRUCT. Removed LINT_INIT macro.
* Moving the conversion code from String::well_formed_copy()Alexander Barkov2015-03-161-0/+38
| | | | to my_convert_fix() - a new function in /strings.
* MDEV-6566 Different INSERT behaviour on bad bytes with and without character ↵Alexander Barkov2015-03-131-12/+59
| | | | set conversion
* MDEV-6819 st_mysql_show_var::value should be void* not char*Sergei Golubchik2015-03-076-12/+12
|
* Merge branch '10.0' into 10.1Sergei Golubchik2015-03-074-8/+11
|\
| * Merge remote-tracking branch 'origin/10.0' into 10.0Sergei Golubchik2015-02-221-1/+4
| |\
| | * fix a case where automatic procedure grant was changing user's passwordSergei Golubchik2015-02-171-1/+4
| | | | | | | | | | | | phase out make_password_from_salt() to be removed in 10.1
| * | Merge branch '5.5' into 10.0Sergei Golubchik2015-02-183-3/+11
| |\ \ | | |/ | |/|
| | * MDEV-7419 Function cli_safe_read not exportedmariadb-5.5.42Sergei Golubchik2015-02-132-0/+8
| | | | | | | | | | | | | | | | | | Start the client API for low-level protocol access: * unsigned long mysql_net_read_packet(MYSQL *mysql); * unsigned long mysql_net_field_length(unsigned char **packet);
| | * Merge remote-tracking branch 'mysql/5.5' into bb-5.5-merge @ mysql-5.5.42Sergei Golubchik2015-02-111-3/+3
| | |\
| | | * Updated the copyright year in the welcome message for MySQLmysql-5.5.42Bala2015-01-061-2/+2
| | | |
| | | * Bug #18808072 MYSQLBINLOG USES LOCALTIME() TO PRINT EVENTS, CAUSES KERNEL ↵Venkatesh Duggirala2014-10-081-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MUTEX CONTENTION Problem: For every event read, mysqlbinlog calls localtime() which in turn calls stat(/etc/localtime) which is causing kernel mutex contention. Analysis and Fix: localtime() calls stat(/etc/localtime) for every instance of the call where as localtime_r() the reentrant version was optimized to store the read only tz internal structure. Hence it will not call stat(/etc/localtime). It will call only once at the beginning. The mysql server is calling localtime_r() and mysqlbinlog tool is one place where we are still using localtime(). Once the process (mysqlbinlog) is started if timezone is changed it will be not picked up the the process and it will continue with the same values as the beginning of the process. This behavior is in-lined with mysql server. Also adding localtime_r() and gmtime_r() support for windows.
| | | * Bug#17283409 4-WAY DEADLOCK: ZOMBIES, PURGING BINLOGS,Venkatesh Duggirala2014-05-081-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SHOW PROCESSLIST, SHOW BINLOGS Problem: A deadlock was occurring when 4 threads were involved in acquiring locks in the following way Thread 1: Dump thread ( Slave is reconnecting, so on Master, a new dump thread is trying kill zombie dump threads. It acquired thread's LOCK_thd_data and it is about to acquire mysys_var->current_mutex ( which LOCK_log) Thread 2: Application thread is executing show binlogs and acquired LOCK_log and it is about to acquire LOCK_index. Thread 3: Application thread is executing Purge binary logs and acquired LOCK_index and it is about to acquire LOCK_thread_count. Thread 4: Application thread is executing show processlist and acquired LOCK_thread_count and it is about to acquire zombie dump thread's LOCK_thd_data. Deadlock Cycle: Thread 1 -> Thread 2 -> Thread 3-> Thread 4 ->Thread 1 The same above deadlock was observed even when thread 4 is executing 'SELECT * FROM information_schema.processlist' command and acquired LOCK_thread_count and it is about to acquire zombie dump thread's LOCK_thd_data. Analysis: There are four locks involved in the deadlock. LOCK_log, LOCK_thread_count, LOCK_index and LOCK_thd_data. LOCK_log, LOCK_thread_count, LOCK_index are global mutexes where as LOCK_thd_data is local to a thread. We can divide these four locks in two groups. Group 1 consists of LOCK_log and LOCK_index and the order should be LOCK_log followed by LOCK_index. Group 2 consists of other two mutexes LOCK_thread_count, LOCK_thd_data and the order should be LOCK_thread_count followed by LOCK_thd_data. Unfortunately, there is no specific predefined lock order defined to follow in the MySQL system when it comes to locks across these two groups. In the above problematic example, there is no problem in the way we are acquiring the locks if you see each thread individually. But If you combine all 4 threads, they end up in a deadlock. Fix: Since everything seems to be fine in the way threads are taking locks, In this patch We are changing the duration of the locks in Thread 4 to break the deadlock. i.e., before the patch, Thread 4 ('show processlist' command) mysqld_list_processes() function acquires LOCK_thread_count for the complete duration of the function and it also acquires/releases each thread's LOCK_thd_data. LOCK_thread_count is used to protect addition and deletion of threads in global threads list. While show process list is looping through all the existing threads, it will be a problem if a thread is exited but there is no problem if a new thread is added to the system. Hence a new mutex is introduced "LOCK_thd_remove" which will protect deletion of a thread from global threads list. All threads which are getting exited should acquire LOCK_thd_remove followed by LOCK_thread_count. (It should take LOCK_thread_count also because other places of the code still thinks that exit thread is protected with LOCK_thread_count. In this fix, we are changing only 'show process list' query logic ) (Eg: unlink_thd logic will be protected with LOCK_thd_remove). Logic of mysqld_list_processes(or file_schema_processlist) will now be protected with 'LOCK_thd_remove' instead of 'LOCK_thread_count'. Now the new locking order after this patch is: LOCK_thd_remove -> LOCK_thd_data -> LOCK_log -> LOCK_index -> LOCK_thread_count
| | | * BUG#18080920: CRASH; MY_REALLOC_STR DEREFERENCES NEGATIVE VALUE Nisha Gopalakrishnan2014-04-241-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | INTO CLIENT_ERRORS ARRAY Analysis: -------- The client may crash while executing a statement due to the missing mapping of the server error to it's equivalent client error. When trying to reallocate memory for the packet buffer, if the system is out of memory or the packet buffer is large, the server errors 'ER_OUT_OF_RESOURCES' or 'ER_PACKET_TOO_LARGE' is returned respectively. The client error number calculated is negative and when trying to dereference the array of client error messages with the calculated error number, the client crashes. Fix: ---- Map the server error returned to it's equivalent client error prior to dereferencing the array of client error messages. Note: Test case is not added since it is difficult to simulate the error condition.
| | | * Updated/added copyright header. Added line "use is subject to license terms" Murthy Narkedimilli2014-02-171-0/+1
| | | | | | | | | | | | | | | | to copyright header.
| | | * Fixing the bug 18184414: WRONG COPYRIGHT TO FILE INCLUDE/MYSQL_VERSION.H.INMurthy Narkedimilli2014-02-061-3/+4
| | | |
| | | * Bug #17760379 COLLATIONS WITH CONTRACTIONS BUFFER-OVERFLOW THEMSELVES IN THE ↵Venkata Sidagam2014-01-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FOOT Description: A typo in create_tailoring() causes the "contraction_flags" to be written into cs->contractions in the wrong place. This causes two problems: (1) Anyone relying on `contraction_flags` to decide "could this character be part of a contraction" is 100% broken. (2) Anyone relying on `contractions` to determine the weight of a contraction is mostly broken Analysis: When we are preparing the contraction in create_tailoring(), we are corrupting the cs->contractions memory location which is supposed to store the weights(8k) + contraction information(256 bytes). We started storing the contraction information after the 4k location. This is because of logic flaw in the code. Fix: When we create the contractions, we need to calculate the contraction with (char*) (cs->contractions + 0x40*0x40) from ((char*) cs->contractions) + 0x40*0x40. This makes the "cs->contractions" to move to 8k bytes and stores the contraction information from there. Similarly when we are calculating it for like range queries we need to calculate it from the 8k bytes onwards, this can be done by changing the logic to (const char*) (cs->contractions + 0x40*0x40). And for ucs2 charsets we need to modify the my_cs_can_be_contraction_head() and my_cs_can_be_contraction_tail() to point to 8k+ locations.
| | | * updating the current copyright year which reflects in the MySQL welcome message.Murthy Narkedimilli2014-01-091-2/+2
| | | |
| | | * Updated/added copyright headersMurthy Narkedimilli2014-01-065-5/+5
| | | |
| | | * Bug#17702677 WRONG INSTRUMENTATION INTERFACE FOR MYSQL_COND_TIMEDWAITChristopher Powers2013-11-071-2/+2
| | | | | | | | | | | | Fix Windows build break
| | | * Bug#17702677 WRONG INSTRUMENTATION INTERFACE FOR MYSQL_COND_TIMEDWAITMarc Alff2013-11-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pthread_cond_timedwait(3P) api uses a const struct timespec for parameter 3. The instrumentation api for the same, mysql_cond_timedwait, which expands to inline_mysql_cond_timedwait, should also take a const parameter for the timespec. This fix add the missing const to inline_mysql_cond_timedwait.
| | | * Bug#17513737 INTRODUCE CHECK TABLE...QUICKAnil Toshniwal2013-10-172-46/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --Implemented CHECK TABLE...QUICK. Introduce CHECK TABLE...QUICK that would skip the btr_validate_index() and btr_search_validate() call, and count the no. of records in each index. Approved by Marko and Kevin. (rb#3567).
| | | * WL#7076: Backporting wl6715 to support both formats in 5.5, 5.6, 5.7Ashish Agarwal2013-07-022-1/+9
| | | | | | | | | | | | Backporting wl6715 to mysql-5.5
| | | * Bug#16729109: FIX COMPILATION WARNINGS WITH GCC 4.8Tor Didriksen2013-06-141-2/+2
| | | | | | | | | | | | | | | | | | | | Backport to 5.5 (external Bug#69407 Build warnings with mysql)
| | | * Bug#16194302: SUPPORT FOR FLOATING-POINT SYSTEM VARIABLESAshish Agarwal2013-05-192-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | USING THE PLUGIN INTERFACE. ISSUE: No support for floating-point plugin system variables. SOLUTION: Allowing plugins to define and expose floating-point system variables of type double. MYSQL_SYSVAR_DOUBLE and MYSQL_THDVAR_DOUBLE are added. ISSUE: Fractional part of the def, min, max values of system variables are ignored. SOLUTION: Adding functions that are used to store the raw representation of a double in the raw bits of unsigned longlong in a way that the binary representation remains the same.
| | | * Fix for Bug 16395495 - OLD FSF ADDRESS IN GPL HEADERMurthy Narkedimilli2013-03-1914-14/+14
| | | |
| | | * Updated/added copyright headersMurthy Narkedimilli2013-02-2615-15/+21
| | | |\
| | | | * Updated/added copyright headers.Murthy Narkedimilli2013-02-2536-38/+36
| | | | |
| | | * | BUG#14303860 - EXECUTING A SELECT QUERY WITH TOO Neeraj Bisht2013-01-141-0/+2
| | | |\ \ | | | | |/ | | | | | | | | | | MANY WILDCARDS CAUSES A SEGFAULT Back port from 5.6 and trunk
| | | | * BUG#14303860 - EXECUTING A SELECT QUERY WITH TOO Neeraj Bisht2013-01-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | MANY WILDCARDS CAUSES A SEGFAULT Back port from 5.6 and trunk
| | | * | BUG#11753923-SQL THREAD CRASHES ON DISK FULLVenkatesh Duggirala2013-01-021-0/+2
| | | |\ \ | | | | |/ | | | | | Merging fix from mysql-5.1
| | | | * BUG#11753923-SQL THREAD CRASHES ON DISK FULLVenkatesh Duggirala2013-01-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem:If Disk becomes full while writing into the binlog, then the server instance hangs till someone frees the space. After user frees up the disk space, mysql server crashes with an assert (m_status != DA_EMPTY) Analysis: wait_for_free_space is being called in an infinite loop i.e., server instance will hang until someone frees up the space. So there is no need to set status bit in diagnostic area. Fix: Replace my_error/my_printf_error with sql_print_warning() which prints the warning in error log.