summaryrefslogtreecommitdiff
path: root/sql/net_serv.cc
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'bb-10.2-ext' into 10.3Sergei Golubchik2017-08-261-1/+1
|\
| * Merge branch '10.1' into 10.2Sergei Golubchik2017-08-171-1/+1
| |\
| | * Merge branch '10.0' into 10.1Sergei Golubchik2017-08-081-1/+1
| | |\
| | | * Merge remote-tracking branch 'origin/5.5' into 10.0Vicențiu Ciorbaru2017-07-251-1/+1
| | | |\
| | | | * Merge remote-tracking branch 'mysql/5.5' into 5.5Sergei Golubchik2017-07-181-1/+1
| | | | |\
| | | | | * BUG#24807826: UINT3KORR SHOULD STOP READING FOUR INSTEAD OFKarthik Kamath2017-03-091-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | THREE BYTES ON X86 Analysis: ========= The macro uint3korr reads 4 bytes of data instead of 3 on on x86 machines. Multiple definitions were created for this macro for optimization in WIN32. The idea was to optimize reading of 3 byte ints by reading an ordinary int and masking away the unused byte. However this is an undefined behavior. It will be an issue unless users are aware of allocating an extra byte for using this macro. Fix: ==== Removing the definition which reads 4 bytes of data. The only definition of this macro would now read just 3 bytes of data thus prohibiting the usage of an extra byte. Note: ===== This is a backport of Patches #5 and #6 for Bug#17922198.
* | | | | | MDEV-13641 host errors are not reset after successful connection.Vladislav Vaintroub2017-08-251-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed thd_set_peer_addr() to propagate host error count from ip_to_hostname() to check_connection(), which tests this count to clear errors affter successful authentication.
* | | | | | Enusure that my_global.h is included firstMichael Widenius2017-08-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added sql/mariadb.h file that should be included first by files in sql directory, if sql_plugin.h is not used (sql_plugin.h adds SHOW variables that must be done before my_global.h is included) - Removed a lot of include my_global.h from include files - Removed include's of some files that my_global.h automatically includes - Removed duplicated include's of my_sys.h - Replaced include my_config.h with my_global.h
* | | | | | Compile mariabackup with its own copy of net_serv.ccSergei Golubchik2017-08-231-26/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't use the server's version, that expects a valid THD. Modify net_serv.cc not not use any THD if MYSQL_SERVER isn't defined. This reverts commit aaddac5cd7b23795ee617ee6f8b5613eec343e79.
* | | | | | MDEV-11159 Server proxy protocol supportVladislav Vaintroub2017-08-221-7/+74
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | accept proxy protocol header from client connections. The new server variable 'proxy_protocol_networks' contains list of networks from which proxy header is accepted.
* | | | | Merge branch '10.1' into 10.2Sergei Golubchik2016-12-291-2/+2
|\ \ \ \ \ | |/ / / /
| * | | | Merge branch '10.0' into 10.1Sergei Golubchik2016-09-281-2/+2
| |\ \ \ \ | | |/ / /
| | * | | Merge branch '5.5' into 10.0Sergei Golubchik2016-09-271-2/+2
| | |\ \ \ | | | |/ /
| | | * | Merge branch 'mysql/5.5' into 5.5Sergei Golubchik2016-09-111-3/+3
| | | |\ \ | | | | |/ | | | | | | | | | | 80% reverted
| | | | * BUG#23703568 - IS CLIENT LIBRARY SUPPOSED TO RETRY EINTR INDEFINITELY OR NOTThayumanavar S2016-07-251-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit#ebd24626ca38e7fa1e3da2acdcf88540be70fabe obsoleted the THREAD and THREAD_SAFE_CLIENT preprocessor symbols. This is not removed in the sql/net_serv.cc thereby the code that retries on EINTR became dead code. Remove the THREAD_SAFE_CLIENT preprocessor directive form sql/net_serv.cc. Also check errno for EINTR only if there is an error in preceding read call.
| | | | * Bug#17474166 - EXECUTING STATEMENT LIKE 'SHOW ENGINE INNODB'Praveenkumar Hulakund2013-10-091-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AND 'KILL SESSION' LEAD TO CRASH Analysis: -------- This situation occurs when the connection executes query "show engine innodb status" and this connection is killed by executing statement "kill <con>" by another connection. In function "innodb_show_status", function "stat_print" is called to print the status but return value of function is not checked. After killing connection, if write to connection fails then error is returned and same is set in Diagnostic area. Since FALSE is returned from "innodb_show_status" now, assert to check no error is set in function "set_eof_status" (called from my_eof) is failing. Fix: ---- Changed code to check return value of function "stat_print" in "innodb_show_status".
| | | | * Fix for Bug 16395495 - OLD FSF ADDRESS IN GPL HEADERMurthy Narkedimilli2013-03-191-1/+1
| | | | |
| | | | * weave merge from mysql-5.1 to mysql-5.5Georgi Kodinov2011-02-081-1/+1
| | | | |\ | | | | | | | | | | | | | | | | | | Resolved an innodb conflict thanks to vasil.
| | | | | * Updating header copyright/README in source for 2011Karen Langford2011-01-251-1/+1
| | | | | |
| | | | * | Auto-merge mysql-5.1 -> mysql-5.5 for bug#58887.Dmitry Shulga2011-01-111-11/+1
| | | | |\ \ | | | | | |/
| | | | | * Fixed Bug#58887 - server not throwing "Packet too large" errorDmitry Shulga2011-01-111-11/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | if max_allowed_packet >= 16M. This bug was introduced by patch for bug#42503. This patch restores behaviour that there was before patch for bug#42503 was applied.
| | | | * | MergeKent Boortz2010-12-291-1/+1
| | | | |\ \ | | | | | |/
| | | | | * MergeKent Boortz2010-12-291-1/+1
| | | | | |\
| | | | | | * - Added/updated copyright headersKent Boortz2010-12-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Removed files specific to compiling on OS/2 - Removed files specific to SCO Unix packaging - Removed "libmysqld/copyright", text is included in documentation - Removed LaTeX headers for NDB Doxygen documentation - Removed obsolete NDB files - Removed "mkisofs" binaries - Removed the "cvs2cl.pl" script - Changed a few GPL texts to use "program" instead of "library"
| | | | * | | Auto-merge from mysql-5.1-bugteam for bug#42503.Dmitry Shulga2010-09-161-1/+11
| | | | |\ \ \ | | | | | |/ /
| | | | | * | Fixed bug#42503 - "Lost connection" errors when usingDmitry Shulga2010-09-161-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | compression protocol. The loss of connection was caused by a malformed packet sent by the server in case when query cache was in use. When storing data in the query cache, the query cache memory allocation algorithm had a tendency to reduce the amount of memory block necessary to store a result set, up to finally storing the entire result set in a single block. With a significant result set, this memory block could turn out to be quite large - 30, 40 MB and on. When such a result set was sent to the client, the entire memory block was compressed and written to network as a single network packet. However, the length of the network packet is limited by 0xFFFFFF (16MB), since the packet format only allows 3 bytes for packet length. As a result, a malformed, overly large packet with truncated length would be sent to the client and break the client/server protocol. The solution is, when sending result sets from the query cache, to ensure that the data is chopped into network packets of size <= 16MB, so that there is no corruption of packet length. This solution, however, has a shortcoming: since the result set is still stored in the query cache as a single block, at the time of sending, we've lost boundaries of individual logical packets (one logical packet = one row of the result set) and thus can end up sending a truncated logical packet in a compressed network packet. As a result, on the client we may require more memory than max_allowed_packet to keep, both, the truncated last logical packet, and the compressed next packet. This never (or in practice never) happens without compression, since without compression it's very unlikely that a) a truncated logical packet would remain on the client when it's time to read the next packet b) a subsequent logical packet that is being read would be so large that size-of-new-packet + size-of-old-packet-tail > max_allowed_packet. To remedy this issue, we send data in 1MB sized packets, that's below the current client default of 16MB for max_allowed_packet, but large enough to ensure there is no unnecessary overhead from too many syscalls per result set.
| | | | * | | WL#5486: Remove code for unsupported platformsDavi Arnaut2010-07-151-3/+0
| | | | | | | | | | | | | | | | | | | | | Remove Netware specific code.
| | | | * | | Bug#34043: Server loops excessively in _checkchunk() when safemalloc is enabledDavi Arnaut2010-07-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Essentially, the problem is that safemalloc is excruciatingly slow as it checks all allocated blocks for overrun at each memory management primitive, yielding a almost exponential slowdown for the memory management functions (malloc, realloc, free). The overrun check basically consists of verifying some bytes of a block for certain magic keys, which catches some simple forms of overrun. Another minor problem is violation of aliasing rules and that its own internal list of blocks is prone to corruption. Another issue with safemalloc is rather the maintenance cost as the tool has a significant impact on the server code. Given the magnitude of memory debuggers available nowadays, especially those that are provided with the platform malloc implementation, maintenance of a in-house and largely obsolete memory debugger becomes a burden that is not worth the effort due to its slowness and lack of support for detecting more common forms of heap corruption. Since there are third-party tools that can provide the same functionality at a lower or comparable performance cost, the solution is to simply remove safemalloc. Third-party tools can provide the same functionality at a lower or comparable performance cost. The removal of safemalloc also allows a simplification of the malloc wrappers, removing quite a bit of kludge: redefinition of my_malloc, my_free and the removal of the unused second argument of my_free. Since free() always check whether the supplied pointer is null, redudant checks are also removed. Also, this patch adds unit testing for my_malloc and moves my_realloc implementation into the same file as the other memory allocation primitives.
| | | | * | | mergeGeorgi Kodinov2010-06-091-1/+7
| | | | |\ \ \ | | | | | |/ /
| | | | | * | MergeGeorgi Kodinov2010-06-091-1/+7
| | | | | |\ \
| | | | | | * | Bug #52512: Assertion `! is_set()' in Diagnostics_area::set_ok_status Georgi Kodinov2010-04-071-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | on LOAD DATA Two problems : 1. LOAD DATA was not checking for SQL errors and was sending an OK packet even when there were errors reported already. Fixed to check for SQL errors in addition to the error conditions already detected. 2. There was an over-ambitious assert() on the server to check if the protocol is always followed by the client. This can cause crashes on debug servers by clients not completing the protocol exchange for some reason (e.g. --send command in mysqltest). Fixed by keeping the assert only on client side, since the server always completes the protocol exchange.
| | | | * | | | Manual merge from mysql-5.1-bugteam to mysql-trunk-merge.Alexey Kopytov2010-05-271-5/+1
| | | | |\ \ \ \ | | | | | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Null-merged patch for bug 53907. Conflicts: conflict sql/sql_parse.cc
| | | | | * | | Bug#52107 Comment in sql/net_serv.cc still makes "GPL protocol" claimKristofer Pettersson2010-05-261-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removed misleading comments.
| | | | * | | | Manual merge of mysql-5.1-bugteam to mysql-trunk-merge.Alexey Kopytov2010-05-071-0/+4
| | | | |\ \ \ \ | | | | | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Text conflict in mysql-test/r/explain.result Text conflict in mysql-test/t/explain.test Text conflict in sql/net_serv.cc Text conflict in sql/sp_head.cc Text conflict in sql/sql_priv.h
| | | | | * | | Manual merge.Davi Arnaut2010-04-291-0/+4
| | | | | |\ \ \ | | | | | | |/ / | | | | | |/| / | | | | | | |/
| | | | | | * Bug#50974: Server keeps receiving big (> max_allowed_packet) packets ↵Davi Arnaut2010-04-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | indefinitely. The server could be tricked to read packets indefinitely if it received a packet larger than the maximum size of one packet. This problem is aggravated by the fact that it can be triggered before authentication. The solution is to no skip big packets for non-authenticated sessions. If a big packet is sent before a session is authen- ticated, a error is returned and the connection is closed.
| | | | * | | WL#5030: Split and remove mysql_priv.hMats Kindahl2010-03-311-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch: - Moves all definitions from the mysql_priv.h file into header files for the component where the variable is defined - Creates header files if the component lacks one - Eliminates all include directives from mysql_priv.h - Eliminates all circular include cycles - Rename time.cc to sql_time.cc - Rename mysql_priv.h to sql_priv.h
| | | | * | | A follow-up on WL#5154 and WL#5182: remove forgotten options.Alexander Nozdrin2010-03-031-3/+3
| | | | | | |
| | | | * | | WL#4949, Remove use of LOCK_alarm by instead using SO_SNDTIME0/SO_RCVTIME0Mikael Ronstrom2009-11-121-0/+2
| | | | | | |
| | | | * | | Manual merge from mysql-next-mr.Alexander Nozdrin2009-11-021-1/+0
| | | | |\ \ \
| | | | | * | | Bug#38968 Unused mutex LOCK_bytes_sent, LOCK_bytes_receivedMarc Alff2009-10-291-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport for 5.5
| | | | * | | | Introduce thd->query_cache_tls (threadKonstantin Osipov2009-10-131-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | local storage for query cache). We need more than one pointer in a thread to represent the query cache and net->query_cache_query can not be used any more (due to ABI compatibility issues and to different life time of NET and THD). This is a backport of the following patch from 6.0: ---------------------------------------------------------- revno: 2476.1157.2 committer: kostja@bodhi.(none) timestamp: Sat 2007-06-16 13:29:24 +0400
| | | | * | | | Backport to 5.4 the following changesets:Konstantin Osipov2009-10-091-1/+1
| | | | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | revno: 2476.785.24 committer: kostja@bodhi.(none) timestamp: Tue 2007-10-16 20:19:00 +0400 message: Reflect a rename of a member in the client ABI (a compatible change). ---------------------------------------------------------- revno: 2476.423.26 committer: kostja@bodhi.(none) timestamp: Tue 2007-10-16 20:12:37 +0400 message: Update the client ABI to reflect member rename (this is a backward-compatible change). ---------------------------------------------------------- revno: 2476.785.22 committer: kostja@bodhi.(none) timestamp: Tue 2007-10-16 19:37:25 +0400 message: Remove some remains of support of 3.22 protocol. This was in fact dead code, since the option to talk 3.22 protocol was removed in 4.1 and there is no other protocol negotiation mechanism besides this option.
| | | | * | | merge of 5.1-main into mysql-trunk.Guilhem Bichot2009-08-121-2/+11
| | | | |\ \ \ | | | | | |/ / | | | | | | | | | | | | | | Changes to ha_innodb.cc are not propagated to plugin, they will come back via Oracle/Innobase if needed.
| | | | | * | Manual merge.Alexey Kopytov2009-07-281-2/+11
| | | | | |\ \ | | | | | | |/
| | | | | | * Bug #45031: invalid memory reads in my_real_read using protocol Alexey Kopytov2009-07-281-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | compression Since uint3korr() may read 4 bytes depending on build flags and platform, allocate 1 extra "safety" byte in the network buffer for cases when uint3korr() in my_real_read() is called to read last 3 bytes in the buffer. It is practically hard to construct a reliable and reasonably small test case for this bug as that would require constructing input stream such that a certain sequence of bytes in a compressed packet happens to be the last 3 bytes of the network buffer.
| | | | * | | Merge MySQL 5.1.35 into MySQL 5.4Mikael Ronstrom2009-06-111-3/+3
| | | | |\ \ \ | | | | | |/ /
| | | | | * | Bug#29125 Windows Server X64: so many compiler warningsIgnacio Galarza2009-02-131-3/+3
| | | | | |\ \ | | | | | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Remove bothersome warning messages. This change focuses on the warnings that are covered by the ignore file: support-files/compiler_warnings.supp. - Strings are guaranteed to be max uint in length
| | | | | | * Bug#29125 Windows Server X64: so many compiler warningsIgnacio Galarza2009-02-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Remove bothersome warning messages. This change focuses on the warnings that are covered by the ignore file: support-files/compiler_warnings.supp. - Strings are guaranteed to be max uint in length
| | | | | | * Bug#26243 mysql command line crash after control-ciggy@amd64.(none)2008-03-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Backported the 5.1 DBUG to 5.0. - Avoid memory cleanup race on Windows client for CTRL-C