32 Commits

Author SHA1 Message Date
Zhaodong Xie
a827495be1
Preparestmt use LRU Map instead default map (#7435)
* 支持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 <xiezhaodong@bytedance.com>
Co-authored-by: Jinzhu <wosmvp@gmail.com>
2025-04-25 16:22:26 +08:00
ivila
0dbfda5d7e
fix memory leaks in PrepareStatementDB (#7142)
* fix memory leaks in PrepareStatementDB

* Fix CR:
1) Fix potential Segmentation Fault in Reset function
2) Setting db.Stmts to nil map when Close to avoid further using

* Add Test:
1) TestPreparedStmtConcurrentReset
2) TestPreparedStmtConcurrentClose

* Fix test, create new connection to keep away from other tests

---------

Co-authored-by: Zehui Chen <zehui@ssc-hn.com>
2024-08-22 19:02:05 +08:00
hjwblog.com
1b48aa072d
feat: prepare_stmt support ping (#6924)
* feat: prepare_stmt support ping

* feat: prepare_stmt tx support ping
2024-03-28 16:47:39 +08:00
Jinzhu
57603882ea Only close bad conn prepared stmt 2024-03-20 19:47:20 +08:00
qqxhb
fef42941ba
feat: rm GetDBConnWithContext method (#6535)
* feat: rm contextconnpool method

* feat: nil
2023-08-19 21:33:31 +08:00
Jinzhu
15162afaf2 Support GetDBConnWithContext PreparedStmtDB 2023-08-10 13:30:57 +08:00
Lev Zakharov
7a76c042e6
refactor: remove unnecessary prepared statement allocation (#6374) 2023-06-05 16:23:17 +08:00
东方上人
740f2be453
fix: begin transaction fail, rollback panic (#6365) 2023-05-31 19:21:51 +08:00
jessetang
cef3de694d
cleanup(prepare_stmt.go): unnecessary map delete (#5849) 2022-11-13 11:12:09 +08:00
Cr
5dd2bb4827
feat(PreparedStmtDB): support reset (#5782)
* feat(PreparedStmtDB): support reset

* fix: close all stmt

* test: fix test

* fix: delete one by one
2022-10-19 14:46:59 +08:00
Cr
0b7113b618
fix: prepare deadlock (#5568)
* fix: prepare deadlock

* chore[ci skip]: code style

* chore[ci skip]: test remove unnecessary params

* fix: prepare deadlock

* fix: double check prepare

* test: more goroutines

* chore[ci skip]: improve code comments

Co-authored-by: Jinzhu <wosmvp@gmail.com>
2022-09-30 18:13:36 +08:00
Jinzhu
4e523499d1 Refactor Tx interface 2022-03-01 16:59:50 +08:00
lianghuan
996b96e812 Add TxConnPoolBeginner and Tx interface 2022-03-01 16:59:50 +08:00
heige
e3fc49a694
feat: ajust PreparedStmtDB unlock location and BuildCondition if logic (#4681) 2021-10-08 11:16:58 +08:00
Jinzhu
74752018dc Fix hang when closing a prepared statement 2021-07-14 18:35:10 +08:00
shiyu7
16579e00c6
fix: fix race issue in prepare method (#4487) 2021-07-01 06:27:12 +08:00
Chris Faulkner
15a46bc042
Fix some typos (#4294) 2021-04-19 21:03:39 +08:00
Jinzhu
a8b72546c1 Fix get database connection for prepared stmt, close #4214 2021-03-25 10:17:57 +08:00
Jinzhu
a9fe025ef5 Add GetDBConnector interface 2021-03-19 15:55:38 +08:00
Jinzhu
fe553a7c1a Fix prepared statement in transaction mode can't be shared in normal operations, close #3927 2021-01-10 16:46:06 +08:00
Jinzhu
21c3f05aa2 Use transaction's conn when preparing statement 2020-12-14 18:31:18 +08:00
Jinzhu
bdb30da0a7 Fix copy lock for prepared statement, close #3642, #3607 2020-10-21 15:47:46 +08:00
Jinzhu
dd0d74fad0 Fix transaction on closed conn when using prepared statement, close #3380 2020-09-03 19:16:55 +08:00
Jinzhu
496db1f13e Fix named argument with multiple line SQL, fix #3336 2020-08-31 15:45:56 +08:00
Jinzhu
9b0ad4730f Squashed commit of the following:
commit 759038a126122d5b3323979fdd7d867a4ab85585
Author: Jinzhu <wosmvp@gmail.com>
Date:   Mon Aug 31 12:06:31 2020 +0800

    Add PreparedStmt tests

commit 066d54db1fc93ea58c190195104a2d7086623f69
Author: 王岚 <wanglan.backend@bytedance.com>
Date:   Fri Aug 28 18:40:59 2020 +0800

    prepare_stmt add ctx
2020-08-31 12:08:33 +08:00
Jinzhu
c11c939b95 callbacks support sort with wildcard 2020-08-03 21:48:36 +08:00
Jinzhu
c7667e9299 Refactor Prepared Statement 2020-07-28 14:46:48 +08:00
Jinzhu
f93345afa8 Close cached prepared stmt when got error 2020-07-03 10:26:18 +08:00
Jinzhu
2d945a9641 Switch pgx as default driver 2020-07-03 08:54:12 +08:00
Jinzhu
3f355dc050 Refactor 2020-07-02 10:14:30 +08:00
Jinzhu
7851faa094 Allow close prepared statements, double check before prepare 2020-06-21 18:18:23 +08:00
Jinzhu
c8e7878b3e Add PrepareStmt support 2020-06-05 11:40:24 +08:00