zoukankan      html  css  js  c++  java
  • MySQL事件的先后

    今天闲聊之时 提及MySQL事件的执行,发现一些自己之前没有注意的细节

    如果在执行事件过程中,如果insert的存储过程发生意外 会如何

    USE iot2;
    CREATE TABLE aaaa (timeline TIMESTAMP);
    CREATE TABLE aaab (timeline TIMESTAMP);
    
    
    

     

    CREATE EVENT e_test_insert ON SCHEDULE EVERY 1 SECOND DO call ck1() ;

    存储过程为

    DELIMITER $$ 
    USE `iot2`$$
    DROP PROCEDURE IF EXISTS `ck1`$$
    CREATE PROCEDURE `ck1`()
     BEGIN
       INSERT INTO iot2.aaaa VALUES (CURRENT_TIMESTAMP);
       INSERT INTO iot2.aaab VALUES (CURRENT_TIMESTAMP); 
     END $$
    DELIMITER ;

    此时 删除aaaa 发现事务不在执行 错误日志中的提示为

    2015-12-27 15:32:04 3451 [ERROR] Event Scheduler: [root@localhost][iot2.e_test_insert] Table 'iot2.aaaa' doesn't exist
    2015-12-27 15:32:04 3451 [Note] Event Scheduler: [root@localhost].[iot2.e_test_insert] event execution failed.
    2015-12-27 15:32:05 3451 [ERROR] Event Scheduler: [root@localhost][iot2.e_test_insert] Table 'iot2.aaaa' doesn't exist
    2015-12-27 15:32:05 3451 [Note] Event Scheduler: [root@localhost].[iot2.e_test_insert] event execution failed.
    2015-12-27 15:32:06 3451 [ERROR] Event Scheduler: [root@localhost][iot2.e_test_insert] Table 'iot2.aaaa' doesn't exist
    2015-12-27 15:32:06 3451 [Note] Event Scheduler: [root@localhost].[iot2.e_test_insert] event execution failed.
    2015-12-27 15:32:07 3451 [ERROR] Event Scheduler: [root@localhost][iot2.e_test_insert] Table 'iot2.aaaa' doesn't exist
    2015-12-27 15:32:07 3451 [Note] Event Scheduler: [root@localhost].[iot2.e_test_insert] event execution failed.
    2015-12-27 15:32:08 3451 [ERROR] Event Scheduler: [root@localhost][iot2.e_test_insert] Table 'iot2.aaaa' doesn't exist
    2015-12-27 15:32:08 3451 [Note] Event Scheduler: [root@localhost].[iot2.e_test_insert] event execution failed.
    2015-12-27 15:32:09 3451 [ERROR] Event Scheduler: [root@localhost][iot2.e_test_insert] Table 'iot2.aaaa' doesn't exist
    2015-12-27 15:32:09 3451 [Note] Event Scheduler: [root@localhost].[iot2.e_test_insert] event execution failed.

    可以发现 事件失败。。。

  • 相关阅读:
    ZYNQ. Interrupt(1)Private Timer
    RaspberryPi.1.开机与远程桌面
    ZYNQ. DMA基本用法
    ZYNQ. LwIP.PHY.KSZ9031RNX
    Verilog笔记.三段式状态机
    c语言.函数指针数组
    c语言学习笔记.链表.
    D3D基本框架:即D3D头文件分类
    win32窗口:关于鼠标定位位置偏移问题的原因及解决方法
    <转>C++基础知识: 引用
  • 原文地址:https://www.cnblogs.com/olinux/p/5133502.html
Copyright © 2011-2022 走看看