CURRENT_TIMESTAMP 等待锁定后应用 - 值是多少?

CURRENT_TIMESTAMP applied after waiting for lock - what is the value?

InnoDB insert/update 语句必须等待事务完成的场景下,NOW() and/or CURRENT_TIMESTAMP 的值是多少?

它是从数据准备好 inserted/updated 但开始等待锁释放时的值,还是从实际应用更改时的值?我在文档中找不到任何对此进行解释的内容。

正如您在 mysql 文档中看到的,主要区别在于 now() (和 current_timestamp )和 SYSDATE() 的使用。

NOW() returns a constant time that indicates the time at which the statement began to execute. (Within a stored function or trigger, NOW() returns the time at which the function or triggering statement began to execute.) This differs from the behavior for SYSDATE(), which returns the exact time at which it executes.

你可以在这里找到一些参考资料

https://dev.mysql.com/doc/refman/5.7/en/timestamp-initialization.html https://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html#function_sysdate https://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html#function_now