Skip to content

fix: int type variable defaultMaxSize overflows in 32-bit environment#7439

Merged
jinzhu merged 1 commit intogo-gorm:masterfrom
iTanken:fix-int-overflows
Apr 27, 2025
Merged

fix: int type variable defaultMaxSize overflows in 32-bit environment#7439
jinzhu merged 1 commit intogo-gorm:masterfrom
iTanken:fix-int-overflows

Conversation

@iTanken
Copy link
Copy Markdown
Contributor

@iTanken iTanken commented Apr 27, 2025

Refs: #7435

  • Do only one thing
  • Non breaking API changes
  • Tested

What did this pull request do?

Fix int type variable defaultMaxSize overflows in 32-bit environment.

GOARCH=386 go test -timeout 20m -v ./...
  shell: /usr/bin/bash -e {0}
# gorm.io/gorm/internal/stmt_store
Error: 
../../../go/pkg/mod/gorm.io/[email protected]/internal/stmt_store/stmt_store.go:99:10: 
cannot use defaultMaxSize (untyped int constant 9223372036854775807) as int value in assignment (overflows)

User Case Description

iTanken referenced this pull request Apr 27, 2025
* 支持lru淘汰preparestmt cache

* 支持lru淘汰preparestmt cache

* 支持lru淘汰preparestmt cache

* 只使用lru

* 只使用lru

* 只使用lru

* 只使用lru

* 只使用lru

* 只使用lru

* 只使用lru

* 只使用lru

* 只使用lru

* change const export

* Add stmt_store

* refact prepare stmt store

* Rename lru store

* change const export

* ADD UT

* format code and add session level prepare stmt config

* code format according to golinter ci

* ADD UT

---------

Co-authored-by: xiezhaodong <[email protected]>
Co-authored-by: Jinzhu <[email protected]>
@jinzhu jinzhu merged commit 8c4e8e2 into go-gorm:master Apr 27, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants