We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 527b0ab commit 3d484fcCopy full SHA for 3d484fc
connection.go
@@ -685,7 +685,16 @@ func (mc *mysqlConn) startWatcher() {
685
}()
686
}
687
688
-// Reset resets the MySQL connection.
+// Reset resets the server-side session state using COM_RESET_CONNECTION.
689
+// It clears most per-session state (e.g., user variables, prepared statements)
690
+// without re-authenticating.
691
+// Usage hint: call via database/sql.Conn.Raw using a method assertion:
692
+// conn.Raw(func(c any) error {
693
+// if r, ok := c.(interface{ Reset(context.Context) error }); ok {
694
+// return r.Reset(ctx)
695
+// }
696
+// return nil
697
+// })
698
func (mc *mysqlConn) Reset(ctx context.Context) (err error) {
699
return mc.sendSimpleCommandOK(ctx, comResetConnection)
700
0 commit comments