session.Insert(&[]interface{}) session.Commit() panic: reflect: call of reflect.Value.Field on interface Value #2259
Open
opened 2023-05-10 13:39:16 +00:00 by Abei1uo
·
0 comments
No Branch/Tag Specified
master
lunny/upgrade_go_sqlite3
lunny/fix_postgres_question_mark
lunny/add_test
lunny/more_test
lunny/dm_ci
lunny/slight_improvement_2
lunny/fix_859
lunny/fix_oracle_time
lunny/belongs_to2
lunny/oracle_ora
lunny/test_oracle2
lunny/db2_support
lunny/load
lunny/exec_driver_valuer
lunny/exec_support_conversion
lunny/redis_cache_test
lunny/clickhouse
Nanyan/master
lunny/upgrade_cockroach_test_env
lunny/test_postgres_index
lunny/improve_read_preformance
lunny/return_error
add_on_update
lunny/green_plum
lunny/json_with_texts
liuchenrang/master
in-han/master
yuanfan/bugfix
cantasci/added_mssql_pagination_feature
chenghuama/master
v1.3.2
v1.3.1
v1.3.0
v1.2.5
v1.2.4
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.1.2
v1.1.1
v1.1.0
v1.0.7
v1.0.6
v1.0.5
v1.0.4
v1.0.3
v1.0.2
v1.0.1
v1.0.0
v0.8.2
v0.8.1
v0.8.0
v0.7.9
v0.7.8
v0.7.7
v0.7.6
v0.7.5
v0.7.4
v0.7.2
v0.7.3
v0.6.1
v0.7.1
v0.6.0
v0.7.0
v0.6.6
v0.6.5
v0.6.4
v0.6.3
v0.6.2
v0.5.8
v0.5.7
v0.5.6
v0.5.4
v0.5.3
v0.5.2
v0.5.1
v0.5.0
v0.4.5
v0.4.4
v0.4.3
v0.4.2
v0.4.1
v0.3.2
v0.3.1
v0.2.3
v0.2.2
v0.2.1
v0.2
Labels
Clear labels
Apply labels
blocked
db
oracle
db
sqlserver
duplicate
feature
cache
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 Label
blocked
db
oracle
db
sqlserver
duplicate
feature
cache
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
Milestone
Set milestone
Clear milestone
No items
No Milestone
Assignees
Assign users
Clear assignees
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.
No due date set.
Dependencies
No dependencies set.
Reference: xorm/xorm#2259
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
ver: go1.19.8 xorm.io/xorm v1.3.2 github.com/go-sql-driver/mysql v1.7.1
当表结构体使用Column属性 created和updated, 执行session.Insert(&[]interface{})后,在session.Commit()时发生panic
SQL日志显示事务已提交
报错位置 [
94fcec7f65/session_insert.go (L162)
][(
94fcec7f65/schemas/column.go (L93)
)]报错测试用例代码如下:
附报错堆栈:
可行的解决办法
在 [(
94fcec7f65/schemas/column.go (L93)
)]函数func (col *Column) ValueOfV(dataStruct *reflect.Value) (*reflect.Value, error) 中添加interface的判断