db.mysql: fix handling of nullable timestamp (fix #24120) (#24125)

This commit is contained in:
Felipe Pena 2025-04-03 11:18:29 -03:00 committed by GitHub
parent 6326080143
commit 9b6ccb3eef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -301,8 +301,12 @@ fn data_pointers_to_primitives(data_pointers []&u8, types []int, field_types []F
} }
.type_datetime, .type_timestamp { .type_datetime, .type_timestamp {
string_time := unsafe { cstring_to_vstring(&char(data)) } string_time := unsafe { cstring_to_vstring(&char(data)) }
if string_time == '' {
primitive = orm.Null{}
} else {
primitive = time.parse(string_time)! primitive = time.parse(string_time)!
} }
}
else {} else {}
} }
} }