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,7 +301,11 @@ fn data_pointers_to_primitives(data_pointers []&u8, types []int, field_types []F
}
.type_datetime, .type_timestamp {
string_time := unsafe { cstring_to_vstring(&char(data)) }
primitive = time.parse(string_time)!
if string_time == '' {
primitive = orm.Null{}
} else {
primitive = time.parse(string_time)!
}
}
else {}
}