• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

go-sql-driver / mysql
88%
master: 88%

Build:
Build:
LAST BUILD BRANCH: refs/tags/v1.11.0
DEFAULT BRANCH: master
Repo Added 10 May 2017 10:21AM UTC
Files 34
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH fix/readcolumns-bounded-alloc
branch: fix/readcolumns-bounded-alloc
CHANGE BRANCH
x
Reset
  • fix/readcolumns-bounded-alloc
  • 1.10
  • 1.8
  • 1.9
  • ErrShortWrite
  • InterpolateParams
  • add-charset
  • atomic
  • auth-impl
  • auth_refactoring
  • auth_tests
  • authentication
  • backport-bench-1.9
  • binary-littleendian
  • bump-mysql-for-testing
  • changelog
  • ci/actions-workflow-lockfile
  • ci/limit-test-workflow-permissions
  • clientDeprecateEOF
  • close-on-connection-errors
  • cloudsql
  • codex/before-connect-effective-config
  • codex/dependabot-gomod-security-only
  • codex/fix-staticcheck-go-version
  • columntype
  • compress-min-512
  • compression
  • conncheck-alloc
  • conncheck-peek-diagnostics
  • conncheck_platforms
  • connncheck_optional
  • contributing
  • copilot/consolidate-dependabot-prs
  • copilot/support-rows-column-scanner
  • copilot/update-go-version-1-24-to-1-26
  • copyright
  • dependabot/github_actions/actions/checkout-6
  • dependabot/github_actions/actions/setup-go-6
  • dependabot/github_actions/all-dependencies-002c4593e6
  • dependabot/github_actions/all-dependencies-15271ccc20
  • dependabot/github_actions/all-dependencies-347be5f885
  • dependabot/github_actions/all-dependencies-4e0fabf454
  • dependabot/github_actions/all-dependencies-640176b5ab
  • dependabot/github_actions/all-dependencies-6ee10bdfb7
  • dependabot/github_actions/all-dependencies-781e586a15
  • dependabot/github_actions/all-dependencies-79dea28a82
  • dependabot/github_actions/all-dependencies-85b34e667a
  • dependabot/github_actions/all-dependencies-8aadb2d7d5
  • dependabot/github_actions/all-dependencies-920a780463
  • dependabot/github_actions/all-dependencies-a303a317f0
  • dependabot/github_actions/all-dependencies-a79d1f1873
  • dependabot/github_actions/all-dependencies-cf2e53152d
  • dependabot/github_actions/all-dependencies-e021b9f00e
  • dependabot/github_actions/all-dependencies-f442528237
  • dependabot/github_actions/dominikh/staticcheck-action-1.4.1
  • dependabot/github_actions/github/codeql-action-4
  • dependabot/go_modules/all-dependencies-74f59b08a4
  • dependabot/go_modules/filippo.io/edwards25519-1.2.0
  • doc-time-truncate
  • docs-verifying-server
  • docs/fix-an-an-typo
  • docs/godoc-usage
  • docs/tinyint1-scan-compatibility
  • dolthub/master
  • dsn_defaults
  • empty_auth
  • empty_sha256
  • exec-error-result
  • fil-register-set
  • fix-1575-unsigned-bigint
  • fix-1666
  • fix-bench-massiverows
  • fix-dsn-param-order
  • fix-flaky-test
  • fix-getSystemVar-buffer-reuse
  • fix-gomod
  • fix-handleokpacket-truncated-panic
  • fix-interpolate
  • fix-json-rawmessage-nil-interpolate
  • fix-race-condition-of-test-concurrent
  • fix-staticcheck
  • fix-test
  • fix-test2
  • fix-unknown-collation-check
  • fix-unused-benchmarkExecContext
  • fix/ParseDSN-colon-in-username
  • fix/column-collation-uint16-20261003
  • fix/malformed-server-packets
  • fix/newconfig-default-net
  • fix/result-empty-slice-panic
  • fix/stmt-exec-cached-metadata
  • fix/unsigned-decimal-precision
  • fix/windows-benchmark-exec
  • fix_bigint_unsigned_scan_type
  • fix_comment_typo
  • fix_formatdsn_connectionattributes
  • flaky_tests
  • fmt
  • formatdsn_err
  • go-mod
  • go1.19-is-released
  • go1.21-and-mysql8.1-are-released
  • go1.24-is-released
  • go110
  • handle_error_packets
  • internal
  • interpolate-slash-star-slash
  • introduce-run-tests-parallel
  • mariadb-test-update
  • mark-as-helper
  • master
  • max-allowed-packet-parsing
  • max_allowed_packet
  • metadataSkip
  • methane-patch-1
  • migrate-set-output
  • migrate-to-node16-actions
  • misc_fixes
  • modernize
  • modernize-2025-11-06
  • oidc-token-auth
  • openid-connect-auth
  • opt-read
  • opt-read-19
  • parsec-auth
  • patch-1
  • perf-row-decode
  • pinact
  • pr-1825-auth-review
  • prepare-for-v1.7.0
  • private-query-tracer
  • purego
  • read_opt
  • read_optimization
  • readme_collation
  • refactor-dsn-test
  • refactor-longdata
  • refs/tags/v1.10.0
  • refs/tags/v1.10.1
  • refs/tags/v1.10.2
  • refs/tags/v1.11.0
  • refs/tags/v1.6.0
  • refs/tags/v1.7.0
  • refs/tags/v1.7.1
  • refs/tags/v1.8.0
  • refs/tags/v1.8.1
  • refs/tags/v1.9.0
  • refs/tags/v1.9.1
  • refs/tags/v1.9.2
  • refs/tags/v1.9.3
  • regression801
  • release-1101
  • release-v1.10.1
  • release-v190
  • release-v191
  • release-v193
  • release/v1.11.0
  • remove-codeql
  • return-original-error-from-transaction
  • reuse-metadata
  • revert-976-master
  • sha256_password
  • start-v1.11
  • staticcheck
  • strict
  • test-against-more-mariadb-versions
  • tinyint1-is-bool
  • tls-mysql5-docs
  • tls-security
  • tlsconfig
  • travis
  • travis-allow-failure
  • travis-crossbuild
  • travis-mysql8
  • travis-update
  • tx-19
  • update-internals-links
  • v1.4
  • v1.4.0
  • v1.4.1
  • v1.5.0
  • zlib-klauspost
  • zstd

21 Nov 2026 10:38AM UTC coverage: 87.849% (+0.02%) from 87.831%
44900970428

Pull #1866

github

aibeshkov
Do not size readColumns from the announced column count

readColumns allocated the whole []mysqlField from the column count in the
result set header before reading a single column packet, so memory depended on
a number the server merely announces rather than on what it sends.

Reserve at most 4096 entries up front (a table holds at most 4096 columns, so
ordinary result sets are still sized exactly) and grow beyond that as column
packets are read. Behaviour is unchanged; only result sets wider than 4096
columns now grow incrementally.

Tests: a short read after a very large announced count must fail without a large
allocation (fails without the change), and a result set wider than the
preallocated capacity still decodes completely.

Signed-off-by: Andrei Beshkov <andrey.beshkov@gmail.com>
Pull Request #1866: Do not size readColumns from the announced column count

8 of 8 new or added lines in 1 file covered. (100.0%)

4280 of 4872 relevant lines covered (87.85%)

1196325.77 hits per line

Relevant lines Covered
Build:
Build:
4872 RELEVANT LINES 4280 COVERED LINES
1196325.77 HITS PER LINE
Source Files on fix/readcolumns-bounded-alloc
  • Tree
  • List 34
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
44900970428 fix/readcolumns-bounded-alloc Do not size readColumns from the announced column count readColumns allocated the whole []mysqlField from the column count in the result set header before reading a single column packet, so memory depended on a number the server merely announces ... Pull #1866 21 Nov 2026 11:52AM UTC aibeshkov github
87.85
See All Builds (1752)
  • Repo on GitHub
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc