IsMySQLSessionReusableCommandType reports whether a MySQL command packet type (the wire Header.Type string, e.g. "COM_PING") is a connection-alive command whose response is input-independent and therefore safe to treat as session-scoped regardless of the on-disk "mocks" tag. It is the single source
(cmdType string)
| 387 | // Deliberately narrow — COM_QUERY/COM_INIT_DB/COM_CHANGE_USER/ |
| 388 | // COM_SET_OPTION depend on input and must stay per-test. |
| 389 | func IsMySQLSessionReusableCommandType(cmdType string) bool { |
| 390 | switch cmdType { |
| 391 | case "COM_PING", "COM_STATISTICS", "COM_DEBUG", "COM_RESET_CONNECTION": |
| 392 | return true |
| 393 | } |
| 394 | return false |
| 395 | } |
no outgoing calls
no test coverage detected