From: Dmitry Shulga Date: January 11 2011 3:36pm Subject: bzr push into mysql-5.1 branch (Dmitry.Shulga:3541 to 3542) Bug#58887 List-Archive: http://lists.mysql.com/commits/128442 X-Bug: 58887 Message-Id: <201101111536.p0BDdHoO030121@acsinet15.oracle.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4276460992695787673==" --===============4276460992695787673== MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline 3542 Dmitry Shulga 2011-01-11 Fixed Bug#58887 - server not throwing "Packet too large" error 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. @ sql/net_serv.cc Restored original right condition. modified: sql/net_serv.cc 3541 Davi Arnaut 2011-01-11 Bug#42054: SELECT CURDATE() is returning bad value The problem from a user point of view was that on Solaris the time related functions (e.g. NOW(), SYSDATE(), etc) would always return a fixed time. This bug was happening due to a logic in the time retrieving wrapper function which would only call the time() function every half second. This interval between calls would be calculated using the gethrtime() and the logic relied on the fact that time returned by it is monotonic. Unfortunately, due to bugs in the gethrtime() implementation, there are some cases where the time returned by it can drift (See Solaris bug id 6600939), potentially causing the interval calculation logic to fail. The solution is to retrieve the correct time whenever a drift in the time returned by gethrtime() is detected. That is, do not use the cached time whenever the values (previous and current) returned by gethrtime() are not monotonically increasing. @ mysys/my_getsystime.c Do not used the cached time if gethrtime is not monotonic. modified: mysys/my_getsystime.c === modified file 'sql/net_serv.cc' --- a/sql/net_serv.cc 2010-12-28 23:47:05 +0000 +++ b/sql/net_serv.cc 2011-01-11 15:18:25 +0000 @@ -170,17 +170,7 @@ my_bool net_realloc(NET *net, size_t len DBUG_ENTER("net_realloc"); DBUG_PRINT("enter",("length: %lu", (ulong) length)); - /* - When compression is off, net->where_b is always 0. - With compression turned on, net->where_b may indicate - that we still have a piece of the previous logical - packet in the buffer, unprocessed. Take it into account - when checking that max_allowed_packet is not exceeded. - This ensures that the client treats max_allowed_packet - limit identically, regardless of compression being on - or off. - */ - if (length >= (net->max_packet_size + net->where_b)) + if (length >= net->max_packet_size) { DBUG_PRINT("error", ("Packet too large. Max size: %lu", net->max_packet_size)); --===============4276460992695787673== MIME-Version: 1.0 Content-Type: text/bzr-bundle; charset="us-ascii"; name="bzr/dmitry.shulga@stripped" Content-Transfer-Encoding: 7bit Content-Disposition: inline # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: dmitry.shulga@stripped\ # d376jh0jefmsdslw # target_branch: file:///Users/shulga/projects/mysql/mysql-5.1-\ # bug58887/ # testament_sha1: df1140347d60c7274bd290e457d5ad9d6a81430b # timestamp: 2011-01-11 21:36:49 +0600 # base_revision_id: davi.arnaut@stripped\ # zuh1t2o1i2dofgcr # # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWf53iDMAAbZfgEAwWGP/91cC XAC////wUAQt4dLa7UoAANNQhkE9U09JsKabSbTTRMnogwhkI0om1HqaPTUbJlGmhoaAAAADSaBp NBpNEMahpp6mCGJgmTEMAAAAAAAAAAAkkEABGTTQEehNTT1GkekMmT1JUA2TyhdUp+e38MkIE8Tp ggqwyqX0rYus8JOFGGIkjl8F0Y+47FLJR7W3t3j0AvhbabX8UyPhbZCU7lLjBIsHK4xLYrp9nd1O WzHnx1J2LkUJxPR0oX4Eai3dxFWuEKIZrLXnYv42S4tTLsVX7RCsRTILCDoX5XyC1NouZA0uWkqZ AyReMuPiJPCfdiongJ5AmYg2YmQT12IsZu9kylQNOylvMat5nMglQMgZBGR2M7rKIHtgj9WKKmPa GtYQhz5nlUJkGuRxhQUGJSQJEqZPN0CuTt8m4x7pjGGDBab7J7VoovsdwRxqup8J9OqsUiplect2 6WGGUq13jvoc61WuWsHW1zPtTpLjc/Eiq5/1wXJTKExBUpwFHS8hT8MaxPOu9WeyQHAVpSoSQFxI KJ8eUX3KyFSEi2uBTuGGkqQWaqiLylVbFwuOQR6g4F6opHVSzOWqCtqKAe5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