You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(gdb): use driver dispatch for bool literal and shared-lock clause
Replace two anti-patterns from earlier commits in this PR with the
canonical driver-dispatch pattern already used by OrderRandomFunction:
- gdb_model_soft_time.go: delete boolFalseLiteral() method that branched
on driver name via switch m.db.GetConfig().Type. Call
m.db.GetBoolLiteral(false) directly at the two WHERE-builder sites.
- pgsql/gaussdb DoFilter: delete the gstr.Replace that rewrote
"LOCK IN SHARE MODE" to "FOR SHARE" on every query. Instead, make
Model.LockShared() call m.db.GetLockSharedClause() so each driver
emits its own dialect directly — no string munging, no risk of
corrupting SQL string literals that happen to contain the phrase.
New DB interface methods:
- GetBoolLiteral(v bool) string
- GetLockSharedClause() string
Core provides MySQL-legacy defaults ("0"/"1" and "LOCK IN SHARE MODE"),
so mysql/mariadb/mssql/oracle/dm/sqlite/oceanbase/tidb inherit without
change. pgsql/gaussdb/clickhouse override bool literal to "true"/"false";
pgsql/gaussdb override lock clause to "FOR SHARE".
No behavior change vs. the prior commits — all 560 pgsql tests still pass.
0 commit comments