• unknown's avatar
    WL#1034 update · 48405ec7
    unknown authored
    - fix EVENT_ACL problem that GRANT ALL on some_db.* to someone@somewhere did not get to mysql.db
    - fix crash when the following is executed :
      CREATE EVENT P() CREATE EVENT E ON SCHEDULER 1 SECOND DO ROLLBACK;
      (creation works as well as calling P() which creates the event).
    
    
    mysql-test/lib/init_db.sql:
      - fix init_db.sql so add Event_priv to the database privs, many tests failed because of that
        ommision
      - remove the quotes from the column names
    mysql-test/t/events.test:
      - fix the small test, don't create own db
    scripts/mysql_fix_privilege_tables.sql:
      - fix that
    sql/event.cc:
      - be defensive and don't crash if outside has already has opened some table
    sql/event_executor.cc:
      - show in SHOW PROCESSLIST - "event_scheduler" as name of the user of the main thread
      - use "localhost" as the host where event_scheduler comes from
      - comment out some debug info, fix other debug info
    sql/event_timed.cc:
      - enable EVENT creation inside SP. sphead from lex->sphead goes to et->sphead. it's there only
        if we compile the event. OTOH when doing 
        CREATE PROCEDURE PROC() CREATE EVENT SOME_EV ON SCHEDULE EVERY 1 SECOND DO ROLLBACK;
        I have only to get the body of the event which is anonymous SP. Before it being "compiled"
        but then freed without being used because a bit later it is compiled one more time before
        being put in the events cache. So it was good that the memory structures weren't reused but
        scrapped out. Now lex->sphead is not needed during event creation but only where the event's
        body starts and where it ends so to be able at later stage to compile this anonymous SP (the
        body of the event).
    sql/sp_head.cc:
      - copy over a fix to a crash
    sql/sql_acl.h:
      - fix privileges.
        There was _NO_ documentation about that. Another CHUNK had to be created to so EVENT_ACL gets shifted to
        it's place in the db table. So how this is calculated? EVENT_ACL is 1 << 26. Remember 26, see which poistion
        in the db table is EVENT_ACL, it's 17, counted from 0. 26 - 17 = 9, then shift it with 9.
        CHUNKS are created because in some cases some privileges are in chunks and they are shifted at once. There are
        few chunks of such privileges which has to be shifted to get to exactly the structure of mysql.db table.
    sql/sql_parse.cc:
      - ok, we don't care anymore about lex->sphead because our sphead is lex->et->sphead
    sql/sql_yacc.yy:
      - bail out if new event_timed returns 0x0
      - enable creation of an event inside a SP
        CREATE PROCEDURE P() CREATE EVENT E ON SCHEDULE EVERY 1 SECOND DO SELECT 1;
    48405ec7
events.test 787 Bytes