8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

正文为中文,英文原文默认隐藏。点击任意中文段落即可展开 / 收起对应英文原文。

打开官方英文原文 ↗

译文由机器翻译生成,仅供理解参考;有疑问请以官方英文原文为准。

中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 71%

27.4.4 事件元数据27.4.4 Event Metadata

要获取事件的元数据:To obtain metadata about events:

事件调度器时间表示Event Scheduler Time Representation

MySQL 中的每个会话都有一个会话时区 (STZ)。这是会话的 time_zone 值,该值在会话开始时从服务器的全局 time_zone 值初始化,但在会话期间可以更改。Each session in MySQL has a session time zone (STZ). This is the session time_zone value that is initialized from the server's global time_zone value when the session begins but may be changed during the session.

当执行 CREATE EVENT 或 ALTER EVENT 语句时的当前会话时区用于解释事件定义中指定的时间。这将成为事件时区 (ETZ);即用于事件调度并在事件执行期间生效的时区。The session time zone that is current when a CREATE EVENT or ALTER EVENT statement executes is used to interpret times specified in the event definition. This becomes the event time zone (ETZ); that is, the time zone that is used for event scheduling and is in effect within the event as it executes.

在数据字典中表示事件信息时,execute_at、starts 和 ends 时间会转换为 UTC 并与事件时区一起存储。这使得事件执行能够按定义进行,而不受服务器时区或夏令时影响的后续更改影响。last_executed 时间也以 UTC 存储。For representation of event information in the data dictionary, the execute_at, starts, and ends times are converted to UTC and stored along with the event time zone. This enables event execution to proceed as defined regardless of any subsequent changes to the server time zone or daylight saving time effects. The last_executed time is also stored in UTC.

事件时间可以通过从信息模式 EVENTS 表中选择或通过 SHOW EVENTS 获取,但它们会以 ETZ 或 STZ 值报告。下表总结了事件时间的表示方法。Event times can be obtained by selecting from the Information Schema EVENTS table or from SHOW EVENTS, but they are reported as ETZ or STZ values. The following table summarizes representation of event times.

价值Value EVENTS 表EVENTS Table SHOW EVENTSSHOW EVENTS
执行时间Execute at ETZ ETZ
开始Starts ETZ ETZ
结束Ends ETZ ETZ
上次执行Last executed ETZ 不适用n/a
创建时间Created STZ 不适用n/a
最后修改Last altered STZ 不适用n/a