-
Notifications
You must be signed in to change notification settings - Fork 0
Comparing changes
Open a pull request
base repository: jpeirson/mysql
base: master
head repository: go-sql-driver/mysql
compare: master
Commits on Nov 13, 2018
-
Fix Auth Resnponse packet for cleartext password (go-sql-driver#887)
Trailing NUL char should be in `string[n] auth-response`. But NUL was after auth-response.
Configuration menu - View commit details
-
Copy full SHA for 369b5d6 - Browse repository at this point
Copy the full SHA 369b5d6View commit details
Commits on Nov 16, 2018
-
Improve buffer handling (go-sql-driver#890)
* Eliminate redundant size test in takeBuffer. * Change buffer takeXXX functions to return an error to make it explicit that they can fail. * Add missing error check in handleAuthResult. * Add buffer.store(..) method which can be used by external buffer consumers to update the raw buffer. * Fix some typos and unnecessary UTF-8 characters in comments. * Improve buffer function docs. * Add comments to explain some non-obvious behavior around buffer handling.
Configuration menu - View commit details
-
Copy full SHA for 6be42e0 - Browse repository at this point
Copy the full SHA 6be42e0View commit details
Commits on Dec 2, 2018
-
Implement support of Optional TLS (go-sql-driver#900)
Issue: go-sql-driver#899 Add `preferred` config value to the `tls` config variable on the DSN. This results in a TLS connection when the server advertises this by the flag send in the initial packet.
Configuration menu - View commit details
-
Copy full SHA for 60d456a - Browse repository at this point
Copy the full SHA 60d456aView commit details
Commits on Dec 18, 2018
-
Configuration menu - View commit details
-
Copy full SHA for c45f530 - Browse repository at this point
Copy the full SHA c45f530View commit details
Commits on Jan 27, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 1b9eda2 - Browse repository at this point
Copy the full SHA 1b9eda2View commit details
Commits on Feb 17, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 972a708 - Browse repository at this point
Copy the full SHA 972a708View commit details
Commits on Mar 8, 2019
-
README: 'Equivalent' is clearer (go-sql-driver#927)
* Equivalent is clearer * Update AUTHORS
Configuration menu - View commit details
-
Copy full SHA for 2c9d54f - Browse repository at this point
Copy the full SHA 2c9d54fView commit details
Commits on Mar 15, 2019
-
drop Go 1.8 support (go-sql-driver#936)
* drop Go 1.8 support * travis: add Go 1.12.x
Configuration menu - View commit details
-
Copy full SHA for 1fbca2a - Browse repository at this point
Copy the full SHA 1fbca2aView commit details
Commits on Mar 29, 2019
-
check connection liveness before writing query (go-sql-driver#934)
This commit contains a potential fix to the issue reported in go-sql-driver#657. As a summary: when a MySQL server kills a connection on the server-side (either because it is actively pruning connections, or because the connection has hit the server-side timeout), the Go MySQL client does not immediately become aware of the connection being dead. Because of the way TCP works, the client cannot know that the connection has received a RST packet from the server (i.e. the server-side has closed) until it actually reads from it. This causes an unfortunate bug wherein a MySQL idle connection is pulled from the connection pool, a query packet is written to it without error, and then the query fails with an "unexpected EOF" error when trying to read the response packet. Since the initial write to the socket does not fail with an error, it is generally not safe to return `driver.ErrBadConn` when the read fails, because in theory the write could have arrived to the server and could have been committed. Returning `ErrBadConn` could lead to duplicate inserts on the database and data corruption because of the way the Go SQL package performs retries. In order to significantly reduce the circumstances where this "unexpected EOF" error is returned for stale connections, this commit performs a liveness check before writing a new query. When do we check? ----------------- This check is not performed for all writes. Go 1.10 introduced a new `sql/driver` interface called `driver.SessionResetter`, which calls the `ResetSession` method on any connections _when they are returned to the connection pool_. Since performing the liveness check during `ResetSession` is not particularly useful (the connection can spend a long time in the pool before it's checked out again, and become stale), we simply mark the connection with a `reset` flag instead. This `reset` flag is then checked from `mysqlConn.writePacket` to perform the liveness checks. This ensures that the liveness check will only be performed for the first query on a connection that has been checked out of the connection pool. These are pretty much the semantics we want: a fresh connection from the pool is more likely to be stale, and it has not performed any previous writes that could cause data corruption. If a connection is being consistently used by the client (i.e. through an open transaction), we do NOT perform liveness checks. If MySQL Server kills such active connection, we want to bubble up the error to the user because any silent retrying can and will lead to data corruption. Since the `ResetSession` interface is only available in Go 1.10+, the liveness checks will only be performed starting with that Go version. How do we check? ---------------- To perform the actual liveness test on the connection, we use the new `syscall.Conn` interface which is available for all `net.Conn`s since Go 1.9. The `SyscallConn` method returns a `RawConn` that lets us read directly from the connection's file descriptor using syscalls, and skipping the default read pipeline of the Go runtime. When reading directly from the file descriptor using `syscall.Read`, we pass in a 1-length buffer, as passing a 0-length buffer will always result in a 0-length read, and the 1-length buffer will never be filled because we're not expecting any reads from MySQL before we have written any request packets in a fresh connection. All sockets created in the Go runtime are set to non-blocking (O_NONBLOCK). Consequently, we can detect a socket that has been closed on the server-side because the `read` syscall will return a 0-length read _and_ no error. We assume that any other errors returned from the `read` also mean the connection is in a bad state, except for `EAGAIN`/`EWOULDBLOCK`, which is the expected return for a healthy non-blocking socket in this circumstance. Because of the dependency on `syscall.Conn`, liveness checks can only be performed in Go 1.9+. This restriction however overlaps with the fact that we only mark connections as having been reset in Go 1.10+, as explained in the previous section.
Configuration menu - View commit details
-
Copy full SHA for bc5e6ea - Browse repository at this point
Copy the full SHA bc5e6eaView commit details
Commits on Mar 30, 2019
-
Configuration menu - View commit details
-
Copy full SHA for c0f6b44 - Browse repository at this point
Copy the full SHA c0f6b44View commit details
Commits on Apr 4, 2019
-
buffer: Use a double-buffering scheme to prevent data races (go-sql-d…
…river#943) Fixes go-sql-driver#903 Co-Authored-By: vmg <vicent@github.com>
Configuration menu - View commit details
-
Copy full SHA for df597a2 - Browse repository at this point
Copy the full SHA df597a2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 89ec2a9 - Browse repository at this point
Copy the full SHA 89ec2a9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8f4b98d - Browse repository at this point
Copy the full SHA 8f4b98dView commit details
Commits on Apr 5, 2019
-
Configuration menu - View commit details
-
Copy full SHA for d3a0b0f - Browse repository at this point
Copy the full SHA d3a0b0fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 93c3765 - Browse repository at this point
Copy the full SHA 93c3765View commit details
Commits on Apr 10, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 578c4c8 - Browse repository at this point
Copy the full SHA 578c4c8View commit details
Commits on Apr 23, 2019
-
connection: interpolate uint64 parameters (go-sql-driver#955)
PR go-sql-driver#838 introduced a fix for the driver's custom Value Converter that stopped emitting large uint64 `driver.Value`s as a string. Instead, now _all_ uint{8,16,32,64} values passed to the driver are returned as uint64, and `packets.c` now explicitly handles `driver.Value` instances that are uint64. However, the update in `packets.c` only applies when sending `driver.Value` arguments to the server. When a connection is set up using `InterpolateParams = true` and query interpolation happens inside of the driver, the `(*mysqlConn) interpolateParams` does **not** handle uint64 values (which, again, are now passed by `database/sql` because we've updated our value converter to generate them). Because of this, any `DB.Query` operations which have an uint argument (regardless of its size!!) will force the driver to return `driver.ErrSkip`, disabling client interpolation for such queries. We can fix this by updating `interpolateParams` like we previously updated `writeExecutePacket`.
Configuration menu - View commit details
-
Copy full SHA for d0a5481 - Browse repository at this point
Copy the full SHA d0a5481View commit details
Commits on May 7, 2019
-
packets: reset read deadline before conn check (go-sql-driver#964)
* packets: reset read deadline before conn check If a MySQL connection has been configured with a short `ReadTimeout`, each read from the TCP connection will be preceded by a `SetReadDeadline` call, which lingers until the next `SetReadDeadline`. This can be an issue if the connection becomes stale after staying too long in the connection pool, because when we attempt to perform a stale connection check, the Go runtime scheduler will return a timedout error from the scheduler itself, without letting us get to the kernel to perform the non-blocking read. To fix this, reset the read deadline before we perform the connection check. * packets: set a 0 deadline
Configuration menu - View commit details
-
Copy full SHA for 8056f2c - Browse repository at this point
Copy the full SHA 8056f2cView commit details
Commits on May 10, 2019
-
move tls and pubkey object creation to Config.normalize() (go-sql-dri…
…ver#958) This is still less than ideal since we cannot directly pass in tls.Config into Config and have it be used, but it is sill backwards compatable. In the future this should be revisited to be able to use a custome tls.Config passed directly in without string parsing/registering.
Configuration menu - View commit details
-
Copy full SHA for 877a977 - Browse repository at this point
Copy the full SHA 877a977View commit details
Commits on Sep 4, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 7244e50 - Browse repository at this point
Copy the full SHA 7244e50View commit details -
GCP DSN example for flexible environment (go-sql-driver#993)
* Added GCP connection string example for flexible environment. * Added one more GCP connection string example for flexible environment. * Unified GCP connection strings examples for 2nd gen and flexible env.
Configuration menu - View commit details
-
Copy full SHA for 23821f4 - Browse repository at this point
Copy the full SHA 23821f4View commit details
Commits on Sep 5, 2019
-
Configuration menu - View commit details
-
Copy full SHA for d9aa6d3 - Browse repository at this point
Copy the full SHA d9aa6d3View commit details
Commits on Sep 7, 2019
-
Configuration menu - View commit details
-
Copy full SHA for b2c03bc - Browse repository at this point
Copy the full SHA b2c03bcView commit details
Commits on Sep 17, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 6c79a37 - Browse repository at this point
Copy the full SHA 6c79a37View commit details
Commits on Oct 1, 2019
-
Remove Cloud SQL dialer (go-sql-driver#1007)
CloudSQL is only available up to Go 1.9 on Google AppEngine, which was phased out. Starting from 2019-10-01, no new apps can be deployed to GAE/Go 1.9 anymore. This dialer is thus obsolete. Fixes go-sql-driver#1002
Configuration menu - View commit details
-
Copy full SHA for 59de189 - Browse repository at this point
Copy the full SHA 59de189View commit details -
Configuration menu - View commit details
-
Copy full SHA for 14bb9c0 - Browse repository at this point
Copy the full SHA 14bb9c0View commit details
Commits on Oct 21, 2019
-
Add string type to ColumnTypeScanType(). (go-sql-driver#976)
ColumnTypeScanType() now returns string and sql.NullString.
Configuration menu - View commit details
-
Copy full SHA for 5ee934f - Browse repository at this point
Copy the full SHA 5ee934fView commit details
Commits on Oct 22, 2019
-
Revert "Add string type to ColumnTypeScanType(). (go-sql-driver#976)" (…
…go-sql-driver#1018) This reverts commit 5ee934f.
Configuration menu - View commit details
-
Copy full SHA for 6ea7374 - Browse repository at this point
Copy the full SHA 6ea7374View commit details
Commits on Nov 1, 2019
-
Fix connection leak caused by rapid context cancellation (go-sql-driv…
…er#1024) Fixes go-sql-driver#1023
Configuration menu - View commit details
-
Copy full SHA for 296987f - Browse repository at this point
Copy the full SHA 296987fView commit details
Commits on Nov 8, 2019
-
connector: don't return ErrBadConn when failing to connect (go-sql-dr…
…iver#1020) ErrBadConn should only be returned for an already established connection, not when creating a new one.
Configuration menu - View commit details
-
Copy full SHA for b57978c - Browse repository at this point
Copy the full SHA b57978cView commit details
Commits on Nov 14, 2019
-
Configuration menu - View commit details
-
Copy full SHA for b4242ba - Browse repository at this point
Copy the full SHA b4242baView commit details
Commits on Nov 21, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 15462c1 - Browse repository at this point
Copy the full SHA 15462c1View commit details
Commits on Dec 11, 2019
-
Drop Go 1.9 support (go-sql-driver#1017)
* Drop Go 1.9 support * Add test for Go 1.13.
Configuration menu - View commit details
-
Copy full SHA for 94084c9 - Browse repository at this point
Copy the full SHA 94084c9View commit details
Commits on Dec 12, 2019
-
Remove "go1.10" build tag (go-sql-driver#1016)
Some IDEs and editors refuse to acknowledge the "go1.10" build tag when autocompleting & compiling. Removing said tag increases usibility of the library for those stuck with these editors.
Configuration menu - View commit details
-
Copy full SHA for b66d043 - Browse repository at this point
Copy the full SHA b66d043View commit details
Commits on Jan 5, 2020
-
fix compile error of connCheck.go (go-sql-driver#1048)
* fix compile error of connCheck.go * remove "appengine" build tag
Configuration menu - View commit details
-
Copy full SHA for 8723940 - Browse repository at this point
Copy the full SHA 8723940View commit details
Commits on Jan 7, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 4bdaef4 - Browse repository at this point
Copy the full SHA 4bdaef4View commit details -
conncheck: allow to disable via config (go-sql-driver#1052)
* conncheck: allow to disable via config * dsn: refactor writing of params in FormatDSN
Configuration menu - View commit details
-
Copy full SHA for 6844171 - Browse repository at this point
Copy the full SHA 6844171View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2898b56 - Browse repository at this point
Copy the full SHA 2898b56View commit details -
Release v1.5.0 (go-sql-driver#1047)
* CHANGELOG: include v1.4.1 * Release v1.5.0
Configuration menu - View commit details
-
Copy full SHA for 17ef3dd - Browse repository at this point
Copy the full SHA 17ef3ddView commit details
Commits on Feb 9, 2020
-
connection: interpolate json.RawMessage as string (go-sql-driver#1058)
json encoded data is represented as bytes however it should be interpolated as a string Fixes go-sql-driver#819
Configuration menu - View commit details
-
Copy full SHA for c4f1976 - Browse repository at this point
Copy the full SHA c4f1976View commit details
Commits on Feb 13, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 5a8a207 - Browse repository at this point
Copy the full SHA 5a8a207View commit details
Commits on Feb 18, 2020
-
stmt: add json.RawMessage for converter and prepared statement (go-sq…
…l-driver#1059) Following go-sql-driver#1058, in order for the driver.Value to get as a json.RawMessage, the converter should accept it as a valid value, and handle it as bytes in case where interpolation is disabled
Configuration menu - View commit details
-
Copy full SHA for 3d8a029 - Browse repository at this point
Copy the full SHA 3d8a029View commit details
Commits on Feb 25, 2020
-
Put zero filler into the SSL handshake packet. (go-sql-driver#1066)
According to the linked documentation at http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::SSLRequest SSLRequest packet should have zero filler similar to the regular handshake request, but now the driver puts zeros only in the regular request. Luckily vanilla MySQL doesn't rely on this zero filler and doesn't verify its presence, thus the driver worked fine so far. But MySQL can change to rely on zeros at any point. The problem was discovered while testing against a customized MySQL.
Configuration menu - View commit details
-
Copy full SHA for dd9d356 - Browse repository at this point
Copy the full SHA dd9d356View commit details
Commits on Mar 11, 2020
-
travis: Add compile check for all supported platforms (go-sql-driver#…
…1070) Implements a Travis CI task that checks if the driver compiles on all platforms supported by Go. Fixes go-sql-driver#1050
Configuration menu - View commit details
-
Copy full SHA for 681ffa8 - Browse repository at this point
Copy the full SHA 681ffa8View commit details
Commits on May 8, 2020
-
Travis allow Go master to fail (go-sql-driver#1092)
* travis: allow master branch to fail * travis: matrix is an alias for jobs * travis: remove obsolete sudo key * travis: remove obsolete sudo keys in jobs matrix
Configuration menu - View commit details
-
Copy full SHA for f070e56 - Browse repository at this point
Copy the full SHA f070e56View commit details
Commits on May 9, 2020
-
mysqlStmt Implements CheckNamedValue (go-sql-driver#1090)
* Add CheckNamedValue for mysqlStmt * Update AUTHORS Co-authored-by: Zhixin Wen <zwen@nuro.ai>
Configuration menu - View commit details
-
Copy full SHA for 343c803 - Browse repository at this point
Copy the full SHA 343c803View commit details
Commits on May 12, 2020
-
Fix checking cancelled connections back into the connection pool (go-…
…sql-driver#1095) If * BeginTx is called with a non-default isolation level, * The context is canceled before SET TRANSACTION ISOLATION LEVEL completes, then the connection: * has the cancelled property set to "context cancelled", * has the closed property set to true, and, * BeginTx returns "context canceled" Because of this, the connection gets put back into the connection pool. When it is checked out again, if BeginTx is called on it again _without_ an isolation level, * then we fall into the mc.closed.IsSet() check in begin(), * so we return ErrBadConn, * so the driver kicks the broken connection out of the pool * (and transparently retries to get a new connection that isn't broken too). However, if BeginTx is called on the connection _with_ an isolation level, then we return a context canceled error from the SET TRANSACTION ISOLATION LEVEL call. That means the broken connection will stick around in the pool forever (or until it's checked out for some other operation that correctly returns ErrBadConn). The fix is to check for the connection being closed before executing SET TRANSACTION ISOLATION LEVEL.
Konstantinos Tsanaktsidis authoredMay 12, 2020 Configuration menu - View commit details
-
Copy full SHA for 6313f20 - Browse repository at this point
Copy the full SHA 6313f20View commit details
Commits on May 13, 2020
-
Update travis: use Go 1.14 for testing (go-sql-driver#1100)
* Travis-CI: reverse order of Go version Reverse order of Go versions so the recent ones are tested first. * Travis-CI: add Go 1.14 * Travis-CI: move 'tip' just below the latest Go release * Travis-CI: upgrade Go to 1.14 to run tests
Configuration menu - View commit details
-
Copy full SHA for f378f59 - Browse repository at this point
Copy the full SHA f378f59View commit details
Commits on May 17, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 096feaa - Browse repository at this point
Copy the full SHA 096feaaView commit details
Commits on May 19, 2020
-
On connect, set all variables in a single SET statement (go-sql-drive…
…r#1099) When opening a connection, instead of iterating on all variables and calling "SET <variable>=<value>" for each, we now use a single SET statement with all pairs using a comma as separator: SET <variable1>=<value1>,<variable2>=<value2>,...
Configuration menu - View commit details
-
Copy full SHA for 3f51e4e - Browse repository at this point
Copy the full SHA 3f51e4eView commit details
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.