I'm having this issue using the MySQL (Pomelo) provider (latest version but tried older ones as well). I'm using 10.1.48-MariaDB-0+deb9u2 as a database, and created a test table with only 3 fields:
Testtabel
- ID (INT - autogenerated)
- created_date_time (DATETIME)
- created_timestamp (TIMESTAMP)
and just execute the following code:
Testtabel.Add(new Testtabel(){
CreatedDateTime = DateTime.Now,
CreatedTimestamp = DateTime.Now
});
SaveChanges();
Sadly, the result is not what I would expect, as the created_timestamp field is empty:
I've tested adding the data using the same MySqlConnector library that Pomelo is using and everything seems to be working fine:
using var connection = new MySqlConnection("Server=xxxx;User ID=xxxx;Password=xxxx;Database=xxxx");
connection.Open();
using (var cmd = new MySqlCommand())
{
cmd.Connection = connection;
cmd.CommandText = "INSERT INTO testtabel_sync (created_date_time, created_timestamp) VALUES (@dt, @ts)";
cmd.Parameters.AddWithValue("dt", DateTime.Now);
cmd.Parameters.AddWithValue("ts", DateTime.Now);
await cmd.ExecuteNonQueryAsync();
}
using var command = new MySqlCommand("SELECT * FROM testtabel_sync;", connection);
using var reader = command.ExecuteReader();
reader.Dump();
With the result (last line):
Could anyone try if they have the same problem? Is there something wrong with how I'm expecting this to work?

