summaryrefslogtreecommitdiff
path: root/sql/net_serv.cc
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.1 into 10.2Marko Mäkelä2020-09-031-2/+3
|\
| * MDEV-22387: Do not pass null pointer to some memcpy()Marko Mäkelä2020-09-031-2/+3
| | | | | | | | | | | | | | | | | | | | Passing a null pointer to a nonnull argument is not only undefined behaviour, but it also grants the compiler the permission to optimize away further checks whether the pointer is null. GCC -O2 at least starting with version 8 may do that, potentially causing SIGSEGV. These problems were caught in a WITH_UBSAN=ON build with the Bug#7024 test in main.view.
| * imporve clang buildEugene Kosov2019-06-251-2/+2
| | | | | | | | | | | | | | | | | | cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug Maintainer mode makes all warnings errors. This patch fix warnings. Mostly about deprecated `register` keyword. Too much warnings came from Mroonga and I gave up on it.
* | MDEV-14203: rpl.rpl_extra_col_master_myisam, ↵Sujatha2020-07-231-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rpl.rpl_slave_load_tmpdir_not_exist failed in buildbot with a warning Problem: ======= rpl.rpl_slave_load_tmpdir_not_exist 'stmt' w3 [ fail ] Found warnings/errors in server log file! Test ended at 2017-09-27 20:34:55 [Warning] Master is configured to log replication events with checksum, but will not send such events to slaves that cannot process them ^ Found warnings in /mnt/buildbot/build/mariadb-10.2.10/mysql-test/var/3/log/mysqld.1.err ok Analysis: ======== When slave tries to connect to master 'get_master_version_and_clock' function is invoked to perform elaborated slave-master handshake. During this process slave server queries master server, to know if it is checksum aware and at the same time master is notified about its CRC-awareness. The master's side instant value of @@global.binlog_checksum is stored in the dump thread's uservar area as well as cached locally to become known in consensus by master and slave. Post hand-shake slave requests master for binlog dump. It sends 'COM_BINLOG_DUMP'. This command is sent to master by 'cli_advanced_command' call. If there is some temporary network failure during this request_dump call, 'end_server' is invoked to close the current connection between master and slave. Upon connection close the dump thread on the master gets terminated and it clears the 'uservar' data it got through master-slave handshake. The 'COM_BINLOG_DUMP' command is sent once again without master-slave handshake. Since the checksum data is not available with new dump thread a warning gets reported. Fix: === Upon network write error donot attempt reconnect, proceed to master-slave handshake. This ensures that master is aware of slave's capability to use checksums.
* | Merge 10.1 into 10.2Marko Mäkelä2019-05-131-1/+1
|\ \ | |/
| * Merge branch '5.5' into 10.1Vicențiu Ciorbaru2019-05-111-1/+1
| |\
| | * Update FSF AddressVicențiu Ciorbaru2019-05-111-1/+1
| | | | | | | | | | | | * Update wrong zip-code
* | | Merge branch 'github/10.1' into 10.2Sergei Golubchik2018-02-061-2/+6
|\ \ \ | |/ /
| * | Merge branch 'github/10.0' into 10.1Sergei Golubchik2018-02-021-1/+3
| |\ \
| | * | don't crash debug builds on "packets out of order"Sergei Golubchik2018-01-311-1/+3
| | | | | | | | | | | | | | | | only do it in EXTRA_DEBUG builds
* | | | 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.
* | | | | 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
| | | | | |\ \ | | | | | | |/