-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
let limit and offset use bind parameter #6806
Conversation
Hi @jasonchuan thank you for your pr, can you please fix those failed tests? |
ok I'll fix those later! |
…e added a wrong one called pgx.QueryExecModeSimpleProtocol , causing the SQL with limit problem need 1 parameter ,but given two.
@jinzhu got the job done , please approve the postgress commit (go-gorm/postgres#239) first. because the stmt.Vars is polluted by gorm.io/driver/postgres@v1.5.4/migrator.go:598 ,we must get the vars ok for bindvar method of postgress driver first. |
Hi @jasonchuan, thanks for PR. But can I ask one more thing? Is the change |
Ref: go-gorm/gorm/pull/6806 Signed-off-by: liutianqi <zixizixi@vip.qq.com>
What did this pull request do?
two changes for solving the limt and offset problem which is possible to cause continuously increasing of prepared_stmt_count of mysql , max_prepared_stmt_count value range is 0 - 1048576 and default 16382.
User Case Description
the caller used while true ugly code to call our api , our api has bugs for no checking if the limit and offset is below the total row number . limit and offset was going far away from the row count . a number of sql would be prepared in mysql ,much more than max_prepared_stmt_count .
FATAL: MySQL error: 1461 "Can't create more than max_prepared_stmt_count statements (current value: 1048576 )"