The loadTableInfo function supports passing the context. #2297
No reviewers
Labels
No Label
backport/done
backport/v1
blocked
db
oracle
db
sqlserver
duplicate
feature
cache
frontport/done
frontport/main
invalid
kind
breaking
kind
bug
kind
build
kind
dependencies
kind
docs
kind
driver
kind
enhancement
kind
feature
kind
performance
kind
proposal
kind
question
kind
refactor
kind
testing
need
feedback
need
test
proposal:accepted
RaspBerry Pi
regression
skip-changelog
upstream
wip
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: xorm/xorm#2297
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "LinkinStars/xorm:feat_load_table_info_context"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
loadTableInfo
add context parameterMain change
Situation
After #2200, I built custom dialect to control the SQL. I find that everything else is fine, except when the
SYNC
method executes with an exception.The reason is that the
loadTableInfo
method calls theGetIndexes
andGetColumns
methods with the dialect during execution. The context passed to these two methods are allengine.defaultContext
not the current session's context. So, I think theloadTableInfo
method should add the context parameter to ensure that the correct context is used during execution.Review Note
GetColumns
andGetIndexes
methods are only used here, if the context here is incorrect, then the context parameter is invalid.loadTableInfo
method is only used inSYNC
andDBMetas
methods,SYNC
should pass the session's context, whileDBMetas
has no problem passingengine.defaultContext
.All in all, I think this change should not affect other function.