mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-06 17:18:35 +08:00
fix: upsert error for timestamptz (#44548)
issue: https://github.com/milvus-io/milvus/issues/44527 Signed-off-by: xtx <xtianx@smail.nju.edu.cn>
This commit is contained in:
parent
ea307ea3c9
commit
4d5afec9a8
@ -324,7 +324,8 @@ func (m *CompactionTriggerManager) ManualTrigger(ctx context.Context, collection
|
||||
}
|
||||
|
||||
func (m *CompactionTriggerManager) triggerViewForCompaction(ctx context.Context, eventType CompactionTriggerType,
|
||||
view CompactionView) ([]CompactionView, string) {
|
||||
view CompactionView,
|
||||
) ([]CompactionView, string) {
|
||||
if eventType == TriggerTypeLevelZeroViewIDLE {
|
||||
view, reason := view.ForceTrigger()
|
||||
return []CompactionView{view}, reason
|
||||
|
||||
@ -256,7 +256,7 @@ func (it *insertTask) PreExecute(ctx context.Context) error {
|
||||
|
||||
// trans timestamptz data
|
||||
_, colTimezone := getColTimezone(colInfo)
|
||||
err = timestamptzIsoStr2Utc(it.insertMsg.GetFieldsData(), colTimezone, "")
|
||||
err = timestamptzIsoStr2Utc(it.insertMsg.GetFieldsData(), colTimezone)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -996,6 +996,17 @@ func (it *upsertTask) PreExecute(ctx context.Context) error {
|
||||
}
|
||||
}
|
||||
|
||||
// trans timestamptz data
|
||||
_, colTimezone := getColTimezone(colInfo)
|
||||
err = timestamptzIsoStr2Utc(it.insertFieldData, colTimezone)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = timestamptzIsoStr2Utc(it.req.GetFieldsData(), colTimezone)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
it.upsertMsg = &msgstream.UpsertMsg{
|
||||
InsertMsg: &msgstream.InsertMsg{
|
||||
InsertRequest: &msgpb.InsertRequest{
|
||||
|
||||
@ -2765,7 +2765,7 @@ func getDbTimezone(dbInfo *databaseInfo) (bool, string) {
|
||||
return getDefaultTimezoneVal(dbInfo.properties...)
|
||||
}
|
||||
|
||||
func timestamptzIsoStr2Utc(columns []*schemapb.FieldData, colTimezone string, dbTimezone string) error {
|
||||
func timestamptzIsoStr2Utc(columns []*schemapb.FieldData, colTimezone string) error {
|
||||
naiveLayouts := []string{
|
||||
"2006-01-02T15:04:05.999999999",
|
||||
"2006-01-02T15:04:05",
|
||||
@ -2799,8 +2799,6 @@ func timestamptzIsoStr2Utc(columns []*schemapb.FieldData, colTimezone string, db
|
||||
defaultTZ := "UTC"
|
||||
if colTimezone != "" {
|
||||
defaultTZ = colTimezone
|
||||
} else if dbTimezone != "" {
|
||||
defaultTZ = dbTimezone
|
||||
}
|
||||
|
||||
location, err := time.LoadLocation(defaultTZ)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user