If a bulk MySQL insert takes 5 minutes to complete, and one of the columns in the table is a TIMESTAMP column with a default value of CURRENT TIMESTAMP, will the timestamps of the rows that were inserted be reflective of the entire 5 minutes, or will they all default to the same timestamp from beginning or the end of the query? The bulk insert exists within a transaction.
Dani 4,084
The Queen of DaniWeb Administrator Featured Poster Premium Member
Recommended Answers
Jump to PostMySQL binds
current_timestamp()
/now()
at the beginning of the statement so I believe all of your records would have the samecreated_at
value.If you wanted them to differ I think you'd need to use a cursor and separate insert statements.
All 3 Replies
Reverend Jim 4,780
Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
Dani 4,084
The Queen of DaniWeb Administrator Featured Poster Premium Member
pty 882
Posting Pro
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.