go/src/database/sql/sql_test.go

func init() {}

const pollDuration

const fakeDBName

var chrisBirthday

func newTestDB(t testing.TB, name string) *DB {}

func newTestDBConnector(t testing.TB, fc *fakeConnector, name string) *DB {}

func TestOpenDB(t *testing.T) {}

func TestDriverPanic(t *testing.T) {}

func exec(t testing.TB, db *DB, query string, args ...any) {}

func closeDB(t testing.TB, db *DB) {}

// numPrepares assumes that db has exactly 1 idle conn and returns
// its count of calls to Prepare
func numPrepares(t *testing.T, db *DB) int {}

func (db *DB) numDeps() int {}

// Dependencies are closed via a goroutine, so this polls waiting for
// numDeps to fall to want, waiting up to nearly the test's deadline.
func (db *DB) numDepsPoll(t *testing.T, want int) int {}

func (db *DB) numFreeConns() int {}

func (db *DB) numOpenConns() int {}

// clearAllConns closes all connections in db.
func (db *DB) clearAllConns(t *testing.T) {}

func (db *DB) dumpDeps(t *testing.T) {}

func (db *DB) dumpDep(t *testing.T, depth int, dep finalCloser, seen map[finalCloser]bool) {}

func TestQuery(t *testing.T) {}

// TestQueryContext tests canceling the context while scanning the rows.
func TestQueryContext(t *testing.T) {}

func waitCondition(t testing.TB, fn func() bool) bool {}

// waitForFree checks db.numFreeConns until either it equals want or
// the maxWait time elapses.
func waitForFree(t *testing.T, db *DB, want int) {}

func waitForRowsClose(t *testing.T, rows *Rows) {}

// TestQueryContextWait ensures that rows and all internal statements are closed when
// a query context is closed during execution.
func TestQueryContextWait(t *testing.T) {}

// TestTxContextWait tests the transaction behavior when the tx context is canceled
// during execution of the query.
func TestTxContextWait(t *testing.T) {}

// TestTxContextWaitNoDiscard is the same as TestTxContextWait, but should not discard
// the final connection.
func TestTxContextWaitNoDiscard(t *testing.T) {}

func testContextWait(t *testing.T, keepConnOnRollback bool) {}

// TestUnsupportedOptions checks that the database fails when a driver that
// doesn't implement ConnBeginTx is used with non-default options and an
// un-cancellable context.
func TestUnsupportedOptions(t *testing.T) {}

func TestMultiResultSetQuery(t *testing.T) {}

func TestQueryNamedArg(t *testing.T) {}

func TestPoolExhaustOnCancel(t *testing.T) {}

func TestRowsColumns(t *testing.T) {}

func TestRowsColumnTypes(t *testing.T) {}

func TestQueryRow(t *testing.T) {}

func TestRowErr(t *testing.T) {}

func TestTxRollbackCommitErr(t *testing.T) {}

func TestStatementErrorAfterClose(t *testing.T) {}

func TestStatementQueryRow(t *testing.T) {}

type stubDriverStmt

func (s stubDriverStmt) Close() error {}

func (s stubDriverStmt) NumInput() int {}

func (s stubDriverStmt) Exec(args []driver.Value) (driver.Result, error) {}

func (s stubDriverStmt) Query(args []driver.Value) (driver.Rows, error) {}

// golang.org/issue/12798
func TestStatementClose(t *testing.T) {}

// golang.org/issue/3734
func TestStatementQueryRowConcurrent(t *testing.T) {}

// just a test of fakedb itself
func TestBogusPreboundParameters(t *testing.T) {}

func TestExec(t *testing.T) {}

func TestTxPrepare(t *testing.T) {}

func TestTxStmt(t *testing.T) {}

func TestTxStmtPreparedOnce(t *testing.T) {}

func TestTxStmtClosedRePrepares(t *testing.T) {}

func TestParentStmtOutlivesTxStmt(t *testing.T) {}

// Test that tx.Stmt called with a statement already
// associated with tx as argument re-prepares the same
// statement again.
func TestTxStmtFromTxStmtRePrepares(t *testing.T) {}

// Issue: https://golang.org/issue/2784
// This test didn't fail before because we got lucky with the fakedb driver.
// It was failing, and now not, in github.com/bradfitz/go-sql-test
func TestTxQuery(t *testing.T) {}

func TestTxQueryInvalid(t *testing.T) {}

// Tests fix for issue 4433, that retries in Begin happen when
// conn.Begin() returns ErrBadConn
func TestTxErrBadConn(t *testing.T) {}

func TestConnQuery(t *testing.T) {}

func TestConnRaw(t *testing.T) {}

func TestCursorFake(t *testing.T) {}

func TestInvalidNilValues(t *testing.T) {}

func TestConnTx(t *testing.T) {}

// TestConnIsValid verifies that a database connection that should be discarded,
// is actually discarded and does not re-enter the connection pool.
// If the IsValid method from *fakeConn is removed, this test will fail.
func TestConnIsValid(t *testing.T) {}

// Tests fix for issue 2542, that we release a lock when querying on
// a closed connection.
func TestIssue2542Deadlock(t *testing.T) {}

// From golang.org/issue/3865
func TestCloseStmtBeforeRows(t *testing.T) {}

// Tests fix for issue 2788, that we bind nil to a []byte if the
// value in the column is sql null
func TestNullByteSlice(t *testing.T) {}

func TestPointerParamsAndScans(t *testing.T) {}

func TestQueryRowClosingStmt(t *testing.T) {}

var atomicRowsCloseHook

func init() {}

func setRowsCloseHook(fn func(*Rows, *error)) {}

// Test issue 6651
func TestIssue6651(t *testing.T) {}

type nullTestRow

type nullTestSpec

func TestNullStringParam(t *testing.T) {}

func TestGenericNullStringParam(t *testing.T) {}

func TestNullInt64Param(t *testing.T) {}

func TestNullInt32Param(t *testing.T) {}

func TestNullInt16Param(t *testing.T) {}

func TestNullByteParam(t *testing.T) {}

func TestNullFloat64Param(t *testing.T) {}

func TestNullBoolParam(t *testing.T) {}

func TestNullTimeParam(t *testing.T) {}

func nullTestRun(t *testing.T, spec nullTestSpec) {}

// golang.org/issue/4859
func TestQueryRowNilScanDest(t *testing.T) {}

func TestIssue4902(t *testing.T) {}

// Issue 3857
// This used to deadlock.
func TestSimultaneousQueries(t *testing.T) {}

func TestMaxIdleConns(t *testing.T) {}

func TestMaxOpenConns(t *testing.T) {}

// Issue 9453: tests that SetMaxOpenConns can be lowered at runtime
// and affects the subsequent release of connections.
func TestMaxOpenConnsOnBusy(t *testing.T) {}

// Issue 10886: tests that all connection attempts return when more than
// DB.maxOpen connections are in flight and the first DB.maxOpen fail.
func TestPendingConnsAfterErr(t *testing.T) {}

func TestSingleOpenConn(t *testing.T) {}

func TestStats(t *testing.T) {}

func TestConnMaxLifetime(t *testing.T) {}

// golang.org/issue/5323
func TestStmtCloseDeps(t *testing.T) {}

// golang.org/issue/5046
func TestCloseConnBeforeStmts(t *testing.T) {}

// golang.org/issue/5283: don't release the Rows' connection in Close
// before calling Stmt.Close.
func TestRowsCloseOrder(t *testing.T) {}

func TestRowsImplicitClose(t *testing.T) {}

func TestRowsCloseError(t *testing.T) {}

func TestStmtCloseOrder(t *testing.T) {}

// Test cases where there's more than maxBadConnRetries bad connections in the
// pool (issue 8834)
func TestManyErrBadConn(t *testing.T) {}

// Issue 34775: Ensure that a Tx cannot commit after a rollback.
func TestTxCannotCommitAfterRollback(t *testing.T) {}

// Issue 40985 transaction statement deadlock while context cancel.
func TestTxStmtDeadlock(t *testing.T) {}

// Issue32530 encounters an issue where a connection may
// expire right after it comes out of a used connection pool
// even when a new connection is requested.
func TestConnExpiresFreshOutOfPool(t *testing.T) {}

// TestIssue20575 ensures the Rows from query does not block
// closing a transaction. Ensure Rows is closed while closing a transaction.
func TestIssue20575(t *testing.T) {}

// TestIssue20622 tests closing the transaction before rows is closed, requires
// the race detector to fail.
func TestIssue20622(t *testing.T) {}

// golang.org/issue/5718
func TestErrBadConnReconnect(t *testing.T) {}

// golang.org/issue/11264
func TestTxEndBadConn(t *testing.T) {}

type concurrentTest

type concurrentDBQueryTest

func (c *concurrentDBQueryTest) init(t testing.TB, db *DB) {}

func (c *concurrentDBQueryTest) finish(t testing.TB) {}

func (c *concurrentDBQueryTest) test(t testing.TB) error {}

type concurrentDBExecTest

func (c *concurrentDBExecTest) init(t testing.TB, db *DB) {}

func (c *concurrentDBExecTest) finish(t testing.TB) {}

func (c *concurrentDBExecTest) test(t testing.TB) error {}

type concurrentStmtQueryTest

func (c *concurrentStmtQueryTest) init(t testing.TB, db *DB) {}

func (c *concurrentStmtQueryTest) finish(t testing.TB) {}

func (c *concurrentStmtQueryTest) test(t testing.TB) error {}

type concurrentStmtExecTest

func (c *concurrentStmtExecTest) init(t testing.TB, db *DB) {}

func (c *concurrentStmtExecTest) finish(t testing.TB) {}

func (c *concurrentStmtExecTest) test(t testing.TB) error {}

type concurrentTxQueryTest

func (c *concurrentTxQueryTest) init(t testing.TB, db *DB) {}

func (c *concurrentTxQueryTest) finish(t testing.TB) {}

func (c *concurrentTxQueryTest) test(t testing.TB) error {}

type concurrentTxExecTest

func (c *concurrentTxExecTest) init(t testing.TB, db *DB) {}

func (c *concurrentTxExecTest) finish(t testing.TB) {}

func (c *concurrentTxExecTest) test(t testing.TB) error {}

type concurrentTxStmtQueryTest

func (c *concurrentTxStmtQueryTest) init(t testing.TB, db *DB) {}

func (c *concurrentTxStmtQueryTest) finish(t testing.TB) {}

func (c *concurrentTxStmtQueryTest) test(t testing.TB) error {}

type concurrentTxStmtExecTest

func (c *concurrentTxStmtExecTest) init(t testing.TB, db *DB) {}

func (c *concurrentTxStmtExecTest) finish(t testing.TB) {}

func (c *concurrentTxStmtExecTest) test(t testing.TB) error {}

type concurrentRandomTest

func (c *concurrentRandomTest) init(t testing.TB, db *DB) {}

func (c *concurrentRandomTest) finish(t testing.TB) {}

func (c *concurrentRandomTest) test(t testing.TB) error {}

func doConcurrentTest(t testing.TB, ct concurrentTest) {}

func TestIssue6081(t *testing.T) {}

// TestIssue18429 attempts to stress rolling back the transaction from a
// context cancel while simultaneously calling Tx.Rollback. Rolling back from a
// context happens concurrently so tx.rollback and tx.Commit must guard against
// double entry.
//
// In the test, a context is canceled while the query is in process so
// the internal rollback will run concurrently with the explicitly called
// Tx.Rollback.
//
// The addition of calling rows.Next also tests
// Issue 21117.
func TestIssue18429(t *testing.T) {}

// TestIssue20160 attempts to test a short context life on a stmt Query.
func TestIssue20160(t *testing.T) {}

// TestIssue18719 closes the context right before use. The sql.driverConn
// will nil out the ci on close in a lock, but if another process uses it right after
// it will panic with on the nil ref.
//
// See https://golang.org/cl/35550 .
func TestIssue18719(t *testing.T) {}

func TestIssue20647(t *testing.T) {}

func TestConcurrency(t *testing.T) {}

func TestConnectionLeak(t *testing.T) {}

func TestStatsMaxIdleClosedZero(t *testing.T) {}

func TestStatsMaxIdleClosedTen(t *testing.T) {}

// testUseConns uses count concurrent connections with 1 nanosecond apart.
// Returns the returnedAt time of the final connection.
func testUseConns(t *testing.T, count int, tm time.Time, db *DB) time.Time {}

func TestMaxIdleTime(t *testing.T) {}

type nvcDriver

func (d *nvcDriver) Open(dsn string) (driver.Conn, error) {}

type nvcConn

type decimalInt

type doNotInclude

var _

func (c *nvcConn) CheckNamedValue(nv *driver.NamedValue) error {}

func TestNamedValueChecker(t *testing.T) {}

func TestNamedValueCheckerSkip(t *testing.T) {}

func TestOpenConnector(t *testing.T) {}

type ctxOnlyDriver

func (d *ctxOnlyDriver) Open(dsn string) (driver.Conn, error) {}

var _

var _

var _

type ctxOnlyConn

func (c *ctxOnlyConn) Begin() (driver.Tx, error) {}

func (c *ctxOnlyConn) Close() error {}

// Prepare is still part of the Conn interface, so while it isn't used
// must be defined for compatibility.
func (c *ctxOnlyConn) Prepare(q string) (driver.Stmt, error) {}

func (c *ctxOnlyConn) PrepareContext(ctx context.Context, q string) (driver.Stmt, error) {}

func (c *ctxOnlyConn) QueryContext(ctx context.Context, q string, args []driver.NamedValue) (driver.Rows, error) {}

func (c *ctxOnlyConn) ExecContext(ctx context.Context, q string, args []driver.NamedValue) (driver.Result, error) {}

// TestQueryExecContextOnly ensures drivers only need to implement QueryContext
// and ExecContext methods.
func TestQueryExecContextOnly(t *testing.T) {}

type alwaysErrScanner

var errTestScanWrap

func (alwaysErrScanner) Scan(any) error {}

// Issue 38099: Ensure that Rows.Scan properly wraps underlying errors.
func TestRowsScanProperlyWrapsErrors(t *testing.T) {}

type alwaysErrValuer

var errEmpty

func (v alwaysErrValuer) Value() (driver.Value, error) {}

// Issue 64707: Ensure that Stmt.Exec and Stmt.Query properly wraps underlying errors.
func TestDriverArgsWrapsErrors(t *testing.T) {}

func TestContextCancelDuringRawBytesScan(t *testing.T) {}

// From go.dev/issue/60304
func testContextCancelDuringRawBytesScan(t *testing.T, mode string) {}

func TestContextCancelBetweenNextAndErr(t *testing.T) {}

func TestNilErrorAfterClose(t *testing.T) {}

// Issue #65201.
//
// If a RawBytes is reused across multiple queries,
// subsequent queries shouldn't overwrite driver-owned memory from previous queries.
func TestRawBytesReuse(t *testing.T) {}

type badConn

func (bc badConn) Prepare(query string) (driver.Stmt, error) {}

func (bc badConn) Close() error {}

func (bc badConn) Begin() (driver.Tx, error) {}

func (bc badConn) Exec(query string, args []driver.Value) (driver.Result, error) {}

type badDriver

func (bd badDriver) Open(name string) (driver.Conn, error) {}

// Issue 15901.
func TestBadDriver(t *testing.T) {}

type pingDriver

type pingConn

var pingError

func (pc pingConn) Ping(ctx context.Context) error {}

var _

func (pd *pingDriver) Open(name string) (driver.Conn, error) {}

func TestPing(t *testing.T) {}

// Issue 18101.
func TestTypedString(t *testing.T) {}

func BenchmarkConcurrentDBExec(b *testing.B) {}

func BenchmarkConcurrentStmtQuery(b *testing.B) {}

func BenchmarkConcurrentStmtExec(b *testing.B) {}

func BenchmarkConcurrentTxQuery(b *testing.B) {}

func BenchmarkConcurrentTxExec(b *testing.B) {}

func BenchmarkConcurrentTxStmtQuery(b *testing.B) {}

func BenchmarkConcurrentTxStmtExec(b *testing.B) {}

func BenchmarkConcurrentRandom(b *testing.B) {}

func BenchmarkManyConcurrentQueries(b *testing.B) {}

func TestGrabConnAllocs(t *testing.T) {}

func BenchmarkGrabConn(b *testing.B) {}

func TestConnRequestSet(t *testing.T) {}

func BenchmarkConnRequestSet(b *testing.B) {}

func TestIssue69837(t *testing.T) {}

type issue69728Type

func (t issue69728Type) Value() (driver.Value, error) {}

func TestIssue69728(t *testing.T) {}