An error occurred fetching the project authors.
  1. 16 Mar, 2006 1 commit
    • unknown's avatar
      fix for bug 16408 (Events: crash for an event in a procedure) · 06dd9764
      unknown authored
      (one patch)
      
      
      mysql-test/r/events_bugs.result:
        fix for bug 16408
      mysql-test/t/events_bugs.test:
        fix for bug 16408
      sql/event.h:
        fix for bug 16408
      sql/event_timed.cc:
        fix for bug 16408
      sql/sql_parse.cc:
        fix for bug 16408
      sql/sql_yacc.yy:
        fix for bug 16408
      06dd9764
  2. 13 Mar, 2006 2 commits
    • unknown's avatar
      Fixes to the replication mixed mode (patch approved by Monty): · b9f6f9bc
      unknown authored
      - detect the need for row-based binlogging not at execution stage but earlier at parsing stage; needed for example for CREATE TABLE SELECT UUID().
      - more tests of this mixed mode.
      
      
      mysql-test/r/rpl_switch_stm_row_mixed.result:
        result update
      mysql-test/t/rpl_switch_stm_row_mixed.test:
        testing more scenarios for the mixed replication mode.
        Added support for manual testing of UDFs vs the mixed mode (behind a variable in the test).
        Changing old file names to better ones.
      sql/item_create.cc:
        at parse time, when we see a UUID(), put up a flag in LEX to say this binlogs properly only with row-based binlogging.
      sql/item_func.cc:
        it's not perfect to put up the flag at this execution stage, better do it at parse stage.
      sql/item_strfunc.cc:
        it's not perfect to put up the flag at this execution stage, better do it at parse stage
      sql/set_var.cc:
        this assertion is wrong, this piece of code can happen in RBR mode too.
      sql/sql_lex.cc:
        when we reinitialize the LEX members before every query, we have to reinitialize the new flag
      sql/sql_lex.h:
        A new flag, set at parsing stage, which tells if some items seen during parsing stage require row-based replication to binlog/replicate correctly
        when this statement is later executed.
        It has to be in LEX and not directly in THD, for this to work in prepared statements.
      sql/sql_parse.cc:
        Parsing stage happened at some time in the past and set up the flag in LEX, now that we execute the statement we actually turn on row-based binlogging
        if the thread's binlog format is "mixed". We then turn it off when leaving mysql_execute_command().
        Some cleanup code was not executed if leaving mysql_execute_command() at the "error" label, fixing this. A better fix than the "goto end" would be
        to modify each "goto error" to "res=1; goto end" but it required changing many lines which I don't want to do now ("make smallest possible patch").
      sql/sql_yacc.yy:
        When at parsing stage we see a UDF we put up a flag to say that row-based binlogging is preferred.
      b9f6f9bc
    • unknown's avatar
      BUG#15407: Crash if error in subpartition definition · aa451a0e
      unknown authored
      mysql-test/r/partition.result:
        New test cases
      mysql-test/t/partition.test:
        New test cases
      sql/sql_yacc.yy:
        New error checks
      aa451a0e
  3. 10 Mar, 2006 1 commit
    • unknown's avatar
      BUG#15101 SYSDATE() disregards SET TIMESTAMP. · 8f543b5e
      unknown authored
         After the ChangeSet 1.1892.20.1 2005/08/24 (Bug #12562) SYSDATE() is not an alias
         of NOW() and is unsafe for replication.
         `SYSDATE()' backward compatible aliasing clashes with the idea #12562 
         fix. To make it safe-replicatable we have to either use RBR or to restore
         the pre-5.0 style.
         --sysdate-is-now command line flag was introduced to provide backward compatibility.
      
      
      sql/mysqld.cc:
        New option to force SYSDATE's backward compatible with 4.1 aliasing to NOW (not default)
      sql/sql_class.h:
        new slot to fill at init time and check at parse
      sql/sql_yacc.yy:
        calling NOW's branches when --sysdate-is-now
      mysql-test/r/sysdate_is_now.result:
        New BitKeeper file ``mysql-test/r/sysdate_is_now.result''
      mysql-test/t/sysdate_is_now-master.opt:
        New BitKeeper file ``mysql-test/t/sysdate_is_now-master.opt''
      mysql-test/t/sysdate_is_now.test:
        New BitKeeper file ``mysql-test/t/sysdate_is_now.test''
      8f543b5e
  4. 09 Mar, 2006 2 commits
    • unknown's avatar
      BUG#17947: Crash when REBUILD PARTITION syntax error · 1d9a1c46
      unknown authored
      mysql-test/r/partition.result:
        New test case
      mysql-test/t/partition.test:
        New test case
      sql/sql_yacc.yy:
        Ridiculuos small bug in parser
      1d9a1c46
    • unknown's avatar
      BUG#17127: Crash if wrong use of VALUES for list partition · b7b8fd25
      unknown authored
      mysql-test/r/partition.result:
        Added a number of new test cases where errors in use of
        VALUES LESS THAN and VALUES IN is happening for ALTER TABLE
      mysql-test/t/partition.test:
        Added a number of new test cases where errors in use of
        VALUES LESS THAN and VALUES IN is happening for ALTER TABLE
      sql/sql_partition.cc:
        Check for errors with VALUES *
      sql/sql_yacc.yy:
        Add state to part_type when doing ALTER TABLE for partitioning
      b7b8fd25
  5. 07 Mar, 2006 1 commit
    • unknown's avatar
      Fix for bug#15447 Partitions: NULL is treated as zero · 807c7a6a
      unknown authored
        NULL value handling
      
      
      mysql-test/r/ndb_partition_error.result:
        Fix for bug#15447 Partitions: NULL is treated as zero
          test case
      mysql-test/r/partition.result:
        Fix for bug#15447 Partitions: NULL is treated as zero
          test case
      mysql-test/t/ndb_partition_error.test:
        Fix for bug#15447 Partitions: NULL is treated as zero
          test case
      mysql-test/t/partition.test:
        Fix for bug#15447 Partitions: NULL is treated as zero
          test case
      sql/partition_element.h:
        Fix for bug#15447 Partitions: NULL is treated as zero
          added null value flag to partition_element object
      sql/partition_info.h:
        Fix for bug#15447 Partitions: NULL is treated as zero
          added null value flag to partition_info object
          added has_null partition id variable
      807c7a6a
  6. 06 Mar, 2006 1 commit
  7. 04 Mar, 2006 1 commit
    • unknown's avatar
      Fix for bug #17866 "Problem with renaming table with triggers with fully · 350475fa
      unknown authored
      qualified subject table" which was introduced during work on bug #13525
      "Rename table does not keep info of triggers".
      
      The bug was caused by the fact that during reconstruction of CREATE TRIGGER
      statement stored in .TRG file which happened during RENAME TABLE we damaged
      trigger definition in case when it contained fully qualified name of subject
      table (see comment for sql_yacc.yy for more info).
      
      
      mysql-test/r/trigger.result:
        Added test for bug #17866 "Problem with renaming table with triggers with fully
        qualified subject table".
      mysql-test/t/trigger.test:
        Added test for bug #17866 "Problem with renaming table with triggers with fully
        qualified subject table".
      sql/sql_trigger.cc:
        Table_triggers_list::change_table_name_in_triggers():
          Instead of trying to use pointer to the end of subject table identifier
          we use pointer to the beginning of FOR lexeme now, so during reconstruction
          of CREATE TRIGGER statement in this function we need to add extra space
          before part which begins with FOR to get nice trigger definition.
      sql/sql_yacc.yy:
        trigger_tail:
          In this rule we can't rely on using remember_end token after table_ident token,
          since value returned depends on whether table name is fully qualified or not.
          So instead of trying to get pointer to the end of table identifier we use
          pointer to the beginning of FOR lexeme.
      350475fa
  8. 02 Mar, 2006 1 commit
    • unknown's avatar
      Implementation of WL#2897: Complete definer support in the stored routines. · 9a1fed13
      unknown authored
      The idea is to add DEFINER-clause in CREATE PROCEDURE and CREATE FUNCTION
      statements. Almost all support of definer in stored routines had been already
      done before this patch.
      
      NOTE: this patch changes behaviour of dumping stored routines in mysqldump.
      Before this patch, mysqldump did not dump DEFINER-clause for stored routines
      and this was documented behaviour. In order to get full information about stored
      routines, one should have dumped mysql.proc table. This patch changes this
      behaviour, so that DEFINER-clause is dumped.
      
      Since DEFINER-clause is not supported in CREATE PROCEDURE | FUNCTION statements
      before this patch, the clause is covered by additional version-specific comments.
      
      
      client/mysqldump.c:
        Updated the code for dumping stored routines: cover DEFINER-clause
        into version-specific comment.
      mysql-test/r/gis.result:
        Updated result file after adding DEFINER-clause.
      mysql-test/r/information_schema.result:
        Updated result file after adding DEFINER-clause.
      mysql-test/r/mysqldump.result:
        Updated result file after adding DEFINER-clause.
      mysql-test/r/rpl_ddl.result:
        Updated result file after adding DEFINER-clause.
      mysql-test/r/rpl_sp.result:
        Updated result file after adding DEFINER-clause.
      mysql-test/r/rpl_trigger.result:
        Updated result file after adding DEFINER-clause.
      mysql-test/r/sp-security.result:
        Updated result file after adding DEFINER-clause.
      mysql-test/r/sp.result:
        Updated result file after adding DEFINER-clause.
      mysql-test/r/sql_mode.result:
        Updated result file after adding DEFINER-clause.
      mysql-test/t/sp-security.test:
        Updated result file after adding DEFINER-clause.
      sql/sp.cc:
        Added DEFINER-clause.
      sql/sp_head.cc:
        Added a new convenient variant of set_definer() operation.
      sql/sp_head.h:
        Updated result file after adding DEFINER-clause.
      sql/sql_lex.h:
        Renamed trigger_definition_begin into stmt_definition_begin to be used for
        triggers and stored routines.
      sql/sql_parse.cc:
        Check DEFINER-clause.
      sql/sql_trigger.cc:
        Renamed trigger_definition_begin into stmt_definition_begin to be used for
        triggers and stored routines.
      sql/sql_yacc.yy:
        Added DEFINER-clause.
      9a1fed13
  9. 01 Mar, 2006 3 commits
    • unknown's avatar
      for every deprecated feature say when it will be removed. · a28368f2
      unknown authored
      restore CREATE TABLE ... TYPE=engine until 5.2
      
      
      a28368f2
    • unknown's avatar
      Fix for BUG#16266: Definer is not fully qualified error during replication. · a44a924a
      unknown authored
      The idea of the fix is to extend support of non-SUID triggers for backward
      compatibility. Formerly non-SUID triggers were appeared when "new" server
      is being started against "old" database. Now, they are also created when
      "new" slave receives updates from "old" master.
      
      
      mysql-test/r/rpl_trigger.result:
        Updated the result file with the results of the test for BUG#16266.
      mysql-test/t/rpl_trigger.test:
        Added the test case for BUG#16266.
      sql/mysql_priv.h:
        Added an utility operation to be used from sql_yacc.yy.
      sql/sql_parse.cc:
        Add a utility operation to be used from sql_yacc.yy.
      sql/sql_trigger.cc:
        Extend support of non-SUID triggers.
      sql/sql_view.cc:
        Initialize LEX::definer if DEFINER-clause is missing.
      sql/sql_yacc.yy:
        Extended support of non-SUID triggers.
      mysql-test/std_data/bug16266.000001:
        A new binlog file for testing a patch for BUG#16266.
      a44a924a
    • unknown's avatar
      Fix for bug#14363 Partitions: failure if create in stored procedure · ee9930bf
      unknown authored
        store copy of partition function string
      
      
      mysql-test/r/partition.result:
        Fix for bug#14363 Partitions: failure if create in stored procedure
          test case
      mysql-test/t/partition.test:
        Fix for bug#14363 Partitions: failure if create in stored procedure
          test case
      ee9930bf
  10. 28 Feb, 2006 2 commits
    • unknown's avatar
      class event_timed -> Event_timed · 58a6d96c
      unknown authored
      fix for bug#17793 (Scheduler uses class event_timed should be Event_timed)
      
      
      sql/event.cc:
        class event_timed -> Event_timed
      sql/event.h:
        class event_timed -> Event_timed
      sql/event_executor.cc:
        class event_timed -> Event_timed
      sql/event_priv.h:
        class event_timed -> Event_timed
      sql/event_timed.cc:
        class event_timed -> Event_timed
      sql/sql_lex.h:
        class event_timed -> Event_timed
      sql/sql_show.cc:
        class event_timed -> Event_timed
      sql/sql_yacc.yy:
        class event_timed -> Event_timed
      58a6d96c
    • unknown's avatar
      fix for bug#16537 (Events: mysql.event.starts is null) · 317c6851
      unknown authored
      - now when the event is created and STARTS is omitted then STARTS is implicitly
        CURRENT_TIMESTAMP
      - This CS also fixed incorrect presentation of STARTS/ENDS in I_S.EVENTS
      (incorporated review changes)
      
      
      mysql-test/r/events.result:
        results of new test cases
      mysql-test/t/events.test:
        new test cases for bug #16537 (Events: mysql.event.starts is null)
      sql/event.cc:
        - check whether event_timed::starts_null only in case
          event_timed::expression is set, so for recurring events only
        - disable binlogging of CREATE EVENT statement. It should not be
          replicated but the result of the execution. Still the replication is
          untouched topic.
      sql/event.h:
        - add flags whether starts, ends and execute_at are null or not
      sql/event_executor.cc:
        - check whether xxx_null instead of !xxxx.year
      sql/event_timed.cc:
        - introduce xxx_null and change the usage of xxx.year to !xxx_null
      sql/sql_show.cc:
        - don't show 0000-00-00 in I_S.EVENTS when the value is NULL
      sql/sql_yacc.yy:
        - if STARTS is omitted default to current_timestamp
      317c6851
  11. 24 Feb, 2006 1 commit
    • unknown's avatar
      Fix for bug #13525 "Rename table does not keep info of triggers". · f8386dfa
      unknown authored
      Let us transfer triggers associated with table when we rename it (but only if
      we are not changing database to which table belongs, in the latter case we will
      emit error).
      
      
      mysql-test/r/trigger.result:
        Added test for bug #13525 "Rename table does not keep info of triggers".
      mysql-test/t/trigger.test:
        Added test for bug #13525 "Rename table does not keep info of triggers".
      sql/sql_rename.cc:
        rename_tables():
          Now after renaming table's .FRM file and updating handler data we call
          Table_triggers_list::change_table_name() which is reponsible for
          updating .TRG and .TRN files.
      sql/sql_table.cc:
        mysql_alter_table():
          Now in case when ALTER should rename table we call
          Table_triggers_list::change_table_name() which is responsible
          for updating .TRG and .TRN files after renaming table.
      sql/sql_trigger.cc:
        Added Table_triggers_list::change_table_name() method and
        change_table_name_in_triggers()/trignames() methods responsible for updating
        .TRG and .TRN files for table during its renaming.
        
        Two small cleanups - removed versioning for .TRG files (since it was not working
        before anyway) and emphasized that type of lock specified in tables list is
        unimportant for DROP TABLE (since this statement uses name-locking).
      sql/sql_trigger.h:
        Table_triggers_list:
          Added on_table_names_list member to store pointers and lenghts of
          "ON table_name" parts in triggers' definitions to be able easily
          change them during RENAME TABLE.
          Added change_table_name() method and change_table_name_in_trignames/triggers()
          helper methods responsible for updating .TRG and .TRN files.
      sql/sql_yacc.yy:
        trigger_tail:
          To be able properly update triggers' definitions with new table names
          when renaming tables we need to know where in CREATE TRIGGER statement
          "ON db_name.table_name" part resides.
          Small cleanup - let us emphasize that for CREATE TRIGGER statement 
          lock type which is specified in table list is unimportant since
          name-locking is used.
      f8386dfa
  12. 20 Feb, 2006 2 commits
    • unknown's avatar
      A new error message for deprecated statements. · 4ba2e008
      unknown authored
      Fixes failing sp.test
      
      
      mysql-test/r/backup.result:
        A new error message for deprecated statements.
      mysql-test/t/sp.test:
        Disable warnings in the test for Bug#13012
      sql/share/errmsg.txt:
        A new error message for deprecated statements.
      sql/sql_yacc.yy:
        Use a better worded error message.
      4ba2e008
    • unknown's avatar
      fix for bug #16411 Events: Microsecond intervals are allowed · 17fb7f96
      unknown authored
      WL#1034
      
      
      mysql-test/r/events.result:
        output fix
      sql/event.cc:
        - handle also INTERVAL_MICROSECOND, was missing.
        - use renamed ER_ code which is generic
      sql/event.h:
        add new error code
      sql/event_executor.cc:
        - use new ER_ code name
        - handle EVEX_MICROSECOND_UNSUP error code
      sql/event_timed.cc:
        forbid MICROSECOND intervals for events
      sql/share/errmsg.txt:
        rename error code, it's generic
      sql/sql_show.cc:
        use new error code name
      sql/sql_yacc.yy:
        bail out if any MICROSECOND interval is specified
      17fb7f96
  13. 19 Feb, 2006 1 commit
    • unknown's avatar
      Fixed some threading issues that Guilhem found (and its what I get for copy... · 99502158
      unknown authored
      Fixed some threading issues that Guilhem found (and its what I get for copy and pasting from elsewhere without thinking about it). Added depracted messages to BACKUP, RESTORE, and LOAD TABLE FROM MASTER (which doesn't work well). 
      
      
      client/Makefile.am:
        Added threaded libary.
      client/mysqlimport.c:
        Updated logic to use threaded libmysql correctly.
      client/mysqlslap.c:
        Modified how threads were working.
      mysql-test/r/backup.result:
        Added deprecated messages.
      sql/sql_yacc.yy:
        Added deprecated messages to RESTORE, BACKUP, and LOAD TABLE FROM MASTER
      99502158
  14. 17 Feb, 2006 1 commit
    • unknown's avatar
      WL#2645 (CHECK TABLE FOR UPGRADE) · bf840404
      unknown authored
      necessary implementation in the server
      mysql_upgrade script added
      
      
      client/mysqlcheck.c:
        --check-upgrade option added
      include/my_base.h:
        errcode added
      include/myisam.h:
        option added
      scripts/Makefile.am:
        mysql_upgrade script added
      sql/handler.cc:
        checks for old types/bugs added
      sql/handler.h:
        declarations regarding checks for upgrade
      sql/lex.h:
        sym added
      sql/share/errmsg.txt:
        error message added
      sql/slave.cc:
        now ha_repair is for public use
      sql/sql_table.cc:
        upgrade in ha_repair implemented
      sql/sql_yacc.yy:
        CHECK ... FOR UPGRADE added to syntax
      bf840404
  15. 15 Feb, 2006 1 commit
    • unknown's avatar
      Fixed BUG#16887: Cursor causes server segfault · 7f02b0a0
      unknown authored
        The problem was a code generation bug: cpop instructions were not generated
        when using ITERATE back to an outer block from a context with a declared
        cursor; this would make it push a new cursor without popping in-between,
        eventually overrunning the cursor stack with a crash as the result.
        Fixed the calculation of how many cursors to pop (in sp_pcontext.cc:
        diff_cursors()), and also corrected diff_cursors() and diff_handlers()
        to when doing a "leave"; don't include the last context we're leaving
        (we are then jumping to the appropriate pop instructions).
      
      
      mysql-test/r/sp.result:
        Updated result for new test case (BUG#16887)
      mysql-test/t/sp.test:
        New test case for BUG#16887
      sql/sp_pcontext.cc:
        Added new parameter to sp_pcontext::diff_handlers() and diff_cursors():
        They can either include (for iterate jumps) or exclude (for leave jumps)
        the outer context.
        Fixed bug in diff_cursors(); it was just plain wrong and would return
        zero in some situations when it shouldn't.
      sql/sp_pcontext.h:
        Added new parameter to sp_pcontext::diff_handlers() and diff_cursors():
        They can either include (for iterate jumps) or exclude (for leave jumps)
        the outer context.
      sql/sql_yacc.yy:
        Added parameter to diff_handlers/diff_cursors depending on if it's an
        iterate or leave jump.
        For "leave", we don't have to include the last context we're leaving since
        we will jump to the appropriate pop instructions.
      7f02b0a0
  16. 14 Feb, 2006 3 commits
    • unknown's avatar
      - final fixes for bug#16431 (Events: An event which alters itself disappears) · 8d4f74be
      unknown authored
      - fix for bug#16423 (Events: SHOW CREATE EVENT doesn't work)
      - this Changeset commits makes CREATE/UPDATE/DELETE EVENT real DDL statements
        by committing the currently open transaction before they are executed.
      - this Changeset also fixes a trailing space problem since the very early days
        of the internal cron
      - adds sophisticated checking of whether mysql.event was tampered accidentally
        or with purpose by an user.
      - adds a lot of inline function documentation - documents everything left
        uncodumented
      - INTERVAL_XXXX to XXX in I_S.EVENTS.INTERVAL_FIELD
      
      WL#1034 (Internal CRON)
      
      
      mysql-test/r/events.result:
        update result
      mysql-test/t/events.test:
        add test cases for SHOW CREATE EVENT
        add test cases where the structure of mysql.event is changed and error reporting in this case
      sql/event.cc:
        - do a lot more checking on mysql.event whether it's valid
          introduced generic function table_check_intact() which can be used also
          for checking whether a system table (mysql.*) has been tampered by user
          and report an error in this case. The checking is quite strict, thus
          maybe some mechanism can be added later that loosens this like some
          session variable, for instance, i_am_aware_that_i_can_damage_my_data
          so the table will be opened nevertheless we think that it's not valid.
        - add evex_show_create_event(THD *thd, sp_name *spn, LEX_STRING definer)
        - document a loooot. not a single function left undocumented.
      sql/event.h:
        - add evex_show_create_event(THD *thd, sp_name *spn, LEX_STRING definer)
        - change get_show_create_event() to get_create_event()
        - add TABLE_FIELD_W_TYPE used by table_check_intact()
        - add event_timed::sql_mode so it can be used by show create event. currently
          always 0, will be fixed by a patch for another bug. At least makes the code
          of show create event complete.
      sql/event_executor.cc:
        - add evex_check_system_tables() that checks on boot and event
          main thread startup that mysql.db and mysql.user tables are correct.
        - document everything!
      sql/event_priv.h:
        remove a line
      sql/event_timed.cc:
        - implement SHOW CREATE EVENT
        - document undocumented functions!
      sql/share/errmsg.txt:
        - fix an error message and add two new
      sql/sql_acl.cc:
        - add mysql.db table definition to use by table_check_intact()
        - exchange some of the positions by numbers from mysql.db to enum names (see sql_acl.h)
      sql/sql_acl.h:
        - define the structure of mysql.db table
      sql/sql_parse.cc:
        - handle SQLCOM_SHOW_CREATE_EVENT
        - end the current transaction becase CREATE/UPDATE/DELETE EVENT is a DDL
          statement
      sql/sql_show.cc:
        - remove interval_type_to_name
        - use common function event_reconstruct_interval_expression()
          that reconstructs the expression given at create/alter, to some
          extent - interval of 2:62 MINUTE_SECOND will be reconstructed as
          interval of 3:02 MINUTE_SECOND!
      sql/sql_yacc.yy:
        init the definer of event_timed also when doing SHOW CREATE EVENT
        because it's needed for checking into mysql.event
      sql/table.cc:
        - remove stale code. only mysql.event should be a 'system_table'
        - add table_check_intact() to check the consistency of a table.
          mostly usable with mysql.xxx tables.
      sql/table.h:
        - export TABLE_FIELD_W_TYPE and table_check_intact() which are used for 
          checking the structure of a table. mostly usable for mysql.xxx tables.
      8d4f74be
    • unknown's avatar
      MATCH(a,b) AGAINST (... IN NATURAL LANGUAGE MODE) · 4f4f20d4
      unknown authored
      remove explicit $<ulong_num>$ from sql_yacc.yy
      
      
      mysql-test/r/fulltext.result:
        MATCH(a,b) AGAINST (... IN NATURAL LANGUAGE MODE)
      mysql-test/t/fulltext.test:
        MATCH(a,b) AGAINST (... IN NATURAL LANGUAGE MODE)
      4f4f20d4
    • unknown's avatar
      Many files: · 7ce3b2a3
      unknown authored
        Backporting character_set_filesystem from 5.0 to 5.1.
      
      
      sql/mysqld.cc:
        Backporting character_set_filesystem from 5.0 to 5.1.
      sql/set_var.cc:
        Backporting character_set_filesystem from 5.0 to 5.1.
      sql/set_var.h:
        Backporting character_set_filesystem from 5.0 to 5.1.
      sql/sql_class.cc:
        Backporting character_set_filesystem from 5.0 to 5.1.
      sql/sql_class.h:
        Backporting character_set_filesystem from 5.0 to 5.1.
      sql/sql_yacc.yy:
        Backporting character_set_filesystem from 5.0 to 5.1.
      mysql-test/t/variables.test:
        Backporting character_set_filesystem from 5.0 to 5.1.
      mysql-test/r/variables.result:
        Backporting character_set_filesystem from 5.0 to 5.1.
      7ce3b2a3
  17. 13 Feb, 2006 1 commit
    • unknown's avatar
      renamedb.test, renamedb.result: · bc5dc9e0
      unknown authored
        new file
      Many files:
        WL#757 RENAME DATABASE
      
      
      sql/mysql_priv.h:
        WL#757 RENAME DATABASE
      sql/mysqld.cc:
        WL#757 RENAME DATABASE
      sql/sql_db.cc:
        WL#757 RENAME DATABASE
      sql/sql_lex.h:
        WL#757 RENAME DATABASE
      sql/sql_parse.cc:
        WL#757 RENAME DATABASE
      sql/sql_rename.cc:
        WL#757 RENAME DATABASE
      sql/sql_table.cc:
        WL#757 RENAME DATABASE
      sql/sql_yacc.yy:
        WL#757 RENAME DATABASE
      bc5dc9e0
  18. 12 Feb, 2006 2 commits
    • unknown's avatar
      This patch removes the remaining TYPE= code from MySQL. It cleans up a number... · 48d435b1
      unknown authored
      This patch removes the remaining TYPE= code from MySQL. It cleans up a number of tests where it was being called still (and failing). Also I cleaned up all of the extra scripts so that they now work. 
      
      
      BitKeeper/deleted/.del-raid.test~501e9e00b3c27a55:
        Delete: mysql-test/t/raid.test
      mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
        Test change
      mysql-test/r/binlog_stm_mix_innodb_myisam.result:
        New results
      mysql-test/r/ctype_ujis.result:
        New results
      mysql-test/r/innodb_concurrent.result:
        New results.
      mysql-test/r/rpl_heap.result:
        New results
      mysql-test/r/warnings.result:
        New results
      mysql-test/t/ctype_ujis.test:
        Fixed ENGINE=, test should now actually function
      mysql-test/t/innodb_concurrent.test:
        Fixed test for engine
      mysql-test/t/rpl_heap.test:
        Fixed test for engine
      mysql-test/t/system_mysql_db_fix.test:
        Fixed setup.
      mysql-test/t/warnings.test:
        Removed deprecated tests
      scripts/fill_func_tables.sh:
        Fixed script
      scripts/mysql_convert_table_format.sh:
        Fixed script
      sql/ha_innodb.cc:
        Fixed comment
      sql/sql_yacc.yy:
        Removed deprecated syntax
      tests/fork_big.pl:
        Fixed scipt
      tests/fork_big2.pl:
        Fixed script
      tests/mail_to_db.pl:
        Fixed script
      tests/mysql_client_test.c:
        Fixed test
      48d435b1
    • unknown's avatar
      This patch is to further remove the RAID code. We removed support for people... · 88aa9b13
      unknown authored
      This patch is to further remove the RAID code. We removed support for people creating tables with RAID. This patch remove most of the source for this. 
      
      
      sql/ha_myisam.cc:
        Remove RAID code
      sql/ha_partition.cc:
        Remove RAID code.
      sql/handler.h:
        Remove RAID code
      sql/lex.h:
        Remove RAID code.
      sql/mysqld.cc:
        Remove RAID code.
      sql/set_var.cc:
        Remove RAID code.
      sql/sql_show.cc:
        Remove RAID code
      sql/sql_yacc.yy:
        Remove more of the RAID code
      sql/table.cc:
        Remove RAID code.
      88aa9b13
  19. 09 Feb, 2006 1 commit
    • unknown's avatar
      Fixed BUG#16896: Stored function: unused AGGREGATE-clause in CREATE FUNCTION · 0fd78492
      unknown authored
        Check if AGGREGATE was given with a stored (non-UDF) function, and return
        error in that case.
        Also made udf_example/udf_test work again, by adding a missing *_init()
        function. (_init() functions required unless --allow_suspicious_udfs is
        given to the server, since March 2005 - it seems udf_example wasn't updated
        at the time.)
      
      
      mysql-test/r/sp-error.result:
        Updated results for BUG#16896.
      mysql-test/t/sp-error.test:
        Added test case for BUG#16896.
      sql/share/errmsg.txt:
        New error message: ER_SP_NO_AGGREGATE
      sql/sql_yacc.yy:
        Check if AGGREGATE was used when creating a stored function (i.e. not an UDF).
      sql/udf_example.cc:
        Added myfunc_int_init() function to make it work when the server is running without
        --allow_suspicious_udfs.
      0fd78492
  20. 06 Feb, 2006 1 commit
  21. 01 Feb, 2006 1 commit
    • unknown's avatar
      Fix for BUG#9412: Triggers: should have trigger privilege. · 6aaed733
      unknown authored
      Implement table-level TRIGGER privilege to control access to triggers.
      Before this path global SUPER privilege was used for this purpose, that
      was the big security problem.
      
      In details, before this patch SUPER privilege was required:
        - for the user at CREATE TRIGGER time to create a new trigger;
        - for the user at DROP TRIGGER time to drop the existing trigger;
        - for the definer at trigger activation time to execute the trigger (if the
          definer loses SUPER privilege, all its triggers become unavailable);
      
      This patch changes the behaviour in the following way:
        - TRIGGER privilege on the subject table for trigger is required:
          - for the user at CREATE TRIGGER time to create a new trigger;
          - for the user at DROP TRIGGER time to drop the existing trigger;
          - for the definer at trigger activation time to execute the trigger
            (if the definer loses TRIGGER privilege on the subject table, all its
            triggers on this table become unavailable).
        - SUPER privilege is still required:
          - for the user at CREATE TRIGGER time to explicitly set the trigger
            definer to the user other than CURRENT_USER().
      
      When the server works with database of the previous version (w/o TRIGGER
      privilege), or if the database is being upgraded from the previous versions,
      TRIGGER privilege is granted to whose users, who have CREATE privilege.
      
      
      mysql-test/r/grant.result:
        Updated the result file after adding TRIGGER privilege.
      mysql-test/r/information_schema.result:
        Updated the result file after adding TRIGGER privilege.
      mysql-test/r/lowercase_table_grant.result:
        Updated the result file after adding TRIGGER privilege.
      mysql-test/r/ps.result:
        Updated the result file after adding TRIGGER privilege.
      mysql-test/r/sp.result:
        Updated the result file after adding TRIGGER privilege.
      mysql-test/r/trigger-compat.result:
        Updated the result file after adding TRIGGER privilege.
      mysql-test/r/trigger-grant.result:
        Updated the result file after adding TRIGGER privilege.
      mysql-test/t/trigger-compat.test:
        Grant table-level TRIGGER privilege instead of global SUPER one.
      mysql-test/t/trigger-grant.test:
        1. Grant table-level TRIGGER privilege instead of global SUPER one.
        2. Updated the test case to check that SUPER is required to specify
        the user other than the current as a definer.
      scripts/mysql_create_system_tables.sh:
        Added TRIGGER privilege.
      scripts/mysql_fix_privilege_tables.sql:
        Added TRIGGER privilege.
      sql/sql_acl.cc:
        Added TRIGGER privilege.
      sql/sql_acl.h:
        Added TRIGGER privilege.
      sql/sql_show.cc:
        Added TRIGGER privilege.
      sql/sql_trigger.cc:
        Check TRIGGER privilege instead of SUPER.
      sql/sql_yacc.yy:
        Added TRIGGER privilege.
      6aaed733
  22. 30 Jan, 2006 1 commit
    • unknown's avatar
      fix for bug#16642 (Events: No INFORMATION_SCHEMA.EVENTS table) · c3542ceb
      unknown authored
      post-review change - use pointer instead of copy on the stack.
      WL#1034 (Internal CRON)
       This patch adds INFORMATION_SCHEMA.EVENTS table with the following format:
        EVENT_CATALOG  - MYSQL_TYPE_STRING  (Always NULL)
        EVENT_SCHEMA   - MYSQL_TYPE_STRING  (the database)
        EVENT_NAME     - MYSQL_TYPE_STRING  (the name)
        DEFINER        - MYSQL_TYPE_STRING  (user@host)
        EVENT_BODY     - MYSQL_TYPE_STRING  (the body from mysql.event)
        EVENT_TYPE     - MYSQL_TYPE_STRING  ("ONE TIME" | "RECURRING")
        EXECUTE_AT     - MYSQL_TYPE_TIMESTAMP (set for "ONE TIME" otherwise NULL)
        INTERVAL_VALUE - MYSQL_TYPE_LONG    (set for RECURRING otherwise NULL)
        INTERVAL_FIELD - MYSQL_TYPE_STRING  (set for RECURRING otherwise NULL)
        SQL_MODE       - MYSQL_TYPE_STRING  (for now NULL)
        STARTS         - MYSQL_TYPE_TIMESTAMP (starts from mysql.event)
        ENDS           - MYSQL_TYPE_TIMESTAMP (ends from mysql.event)
        STATUS         - MYSQL_TYPE_STRING  (ENABLED | DISABLED)
        ON_COMPLETION  - MYSQL_TYPE_STRING  (NOT PRESERVE | PRESERVE)
        CREATED        - MYSQL_TYPE_TIMESTAMP
        LAST_ALTERED   - MYSQL_TYPE_TIMESTAMP
        LAST_EXECUTED  - MYSQL_TYPE_TIMESTAMP
        EVENT_COMMENT  - MYSQL_TYPE_STRING
      
        SQL_MODE is NULL for now, because the value is still not stored in mysql.event .
      Support will be added as a fix for another bug.
      
       This patch also adds SHOW [FULL] EVENTS [FROM db] [LIKE pattern]
      1. SHOW EVENTS shows always only the events on the same user,
         because the PK of mysql.event is (definer, db, name) several 
         users may have event with the same name -> no information disclosure.
      2. SHOW FULL EVENTS - shows the events (in the current db as SHOW EVENTS)
         of all users. The user has to have PROCESS privilege, if not then
         SHOW FULL EVENTS behave like SHOW EVENTS.
      3. If [FROM db] is specified then this db is considered.
      4. Event names can be filtered with LIKE pattern.
        SHOW EVENTS returns table with the following columns, which are subset of
        the data which is returned by SELECT * FROM I_S.EVENTS
         Db
         Name
         Definer 
         Type
         Execute at
         Interval value
         Interval field 
         Starts 
         Ends
         Status
      
      
      mysql-test/lib/init_db.sql:
        change the PK - (definer, db, name)
        quicker searches when SHOW EVENTS;
        allow also different users to have events with the same name -> 
        no information disclosure
      mysql-test/r/events.result:
        result of new tests
      mysql-test/r/information_schema.result:
        result of new tests
      mysql-test/r/information_schema_db.result:
        result of new tests
      mysql-test/r/system_mysql_db.result:
        result of new tests
      mysql-test/t/events.test:
        new tests for information_schema.events
      scripts/mysql_create_system_tables.sh:
        change the PK of mysql.event to (definer, db, name)
      scripts/mysql_fix_privilege_tables.sql:
        change the PK of mysql.event to (definer, db, name)
      sql/event.cc:
        pass around the definer of the event because of the new PK
        which is (definer, db, name). It's needed for index searching.
      sql/event.h:
        - make enum evex_table_field again public so it can be used
        in sql_show.cc
        - make created and modified ulonglong, because they should be such
        - make public evex_open_event_table so it can be used in sql_show.cc
      sql/event_executor.cc:
        - cosmetics
      sql/event_priv.h:
        - moved enum evex_table_field and evex_open_event_table()
          to event.h (made them therefore public)
      sql/event_timed.cc:
        - in event_timed::init_definer() always fill this.definer with
          the concatenated value of definer_user@definer_host. Makes
          later the work easier.
        - pass around the definer wherever is needed for searching 
          (new prototype of evex_db_find_evex_aux)
      sql/mysqld.cc:
        - add counter for SHOW EVENTS
      sql/sql_lex.h:
        - register SHOW EVENTS as command
      sql/sql_parse.cc:
        - handle SCH_EVENTS (I_S.EVENTS like SCH_TRIGGERS)
        - make additional check in case of SHOW EVENTS (check for EVENT on
          the current database. if it is null check_access() gives appropriate
          message back.
      sql/sql_show.cc:
        - add INFORMATION_SCHEMA.EVENTS and SHOW EVENTS
        - I_S.EVENTS.SQL_MODE is NULL for now -> not implemented. Trudy
          asked to be added so bug #16642 can be completely closed. There
          is another bug report which will fix the lack of storage of
          SQL_MODE during event creation.
      sql/sql_yacc.yy:
        - always call event_timed::init_definer() when CREATE/ALTER/DROP
          EVENT but not when just compiling the body of the event because
          in this case this operation is not needed, it takes memory and
          CPU time and at the end the result is not used. event_timed::definer
          is used only on SQLCOM_CREATE/ALTER/DROP_EVENT execution not on
          statement compilation.
        - add SHOW [FULL] EVENTS [FROM db] [LIKE pattern]
          in case of FULL and the user has PROCESS privilege then he will see
          also others' events in the current database, otherwise the output
          is the same as of SHOW EVENTS. Because the events are per DB only
          the events from the current database are shown. pattern is applied
          against event name. FROM db is self explanatory.
      sql/table.h:
        add SCH_EVENTS as part of INFORMATION_SCHEMA
      c3542ceb
  23. 28 Jan, 2006 1 commit
    • unknown's avatar
      Fix for bug #16829 "Firing trigger with RETURN crashes the server" · a1b67ce2
      unknown authored
      We should disallow usage of RETURN statement in triggers and emit
      error at parsing time (instead of crashing when trigger is fired).
      
      
      mysql-test/r/trigger.result:
        Added test for bug #16829 "Firing trigger with RETURN crashes the server".
      mysql-test/t/trigger.test:
        Added test for bug #16829 "Firing trigger with RETURN crashes the server".
      sql/sql_yacc.yy:
        We should disallow usage of RETURN statement in triggers and emit
        error at parsing time (instead of crashing when trigger is fired).
      a1b67ce2
  24. 26 Jan, 2006 3 commits
    • unknown's avatar
      fix for bug#16434 (Events: Illegal dates don't cause errors) · 8b3b76c6
      unknown authored
      (post-review commit)
      WL#1034 (Internal CRON)
      
      
      sql/event_timed.cc:
        remove bogus check
      sql/share/errmsg.txt:
        change error messages
      sql/sql_yacc.yy:
        handle error code returned by event_timed::init_starts()
      8b3b76c6
    • unknown's avatar
      fix for bug#16419 (Events: can't use timestamp in the schedule) · 3881218d
      unknown authored
      WL #1034 (Internal CRON)
      
      
      mysql-test/r/events.result:
        update test result
      mysql-test/t/events.test:
        add tests
      sql/event_timed.cc:
        - remove stupid check of val_int()
        - fix for bug #16419 (Events: can't use timestamp in the schedule)
          => don't use val_int() but only get_date() and use the date!
      sql/share/errmsg.txt:
        - fix an error message, one more "einen"
      sql/sql_yacc.yy:
        - handle new return value of event_timed::init_execute_at()
      3881218d
    • unknown's avatar
      Fixed on BUG#16568: Continue handler with simple CASE not working correctly · af187fa2
      unknown authored
        After trying multiple inheritance (to messy and hard make it work) and
        sublassing jump_if_not (worked, but ugly), decided to on this solution
        instead:
        Inserting an abstract sp_instr_opt_meta class as parent for all instructions
        with destinations makes it possible to handle a continuation pointer for
        sp_instr_set_case_expr too.
        Note: No special test case; the fix is captured by the changed behaviour of
        bug14643_2, and bug14498_4 (formerly disabled), in sp.test.
      
      
      mysql-test/r/sp.result:
        Updated results for BUG#16568 (affects results for bug14643_2 and bug14498_4)
      mysql-test/t/sp.test:
        Enabled test bug14498_4 for BUG#16568.
      sql/sp_head.cc:
        Changed type of some parameters and variables (sp_instr_opt_meta instead of sp_instr_jump*).
        Added consistency check of m_ip member in instructions in sp_head::show_routine_code().
        Updated print() method of, and added opt_mark() and opt_move() methods to
        sp_instr_set_case_expr, to handle the new continuation destination.
      sql/sp_head.h:
        New abstract class between sp_instr and instructions with destinations, in particular
        sp_instr_set_case_expr, for continuation destination handling.
        Changed type of some parameters and variables (sp_instr_opt_meta instead of sp_instr_jump*).
        Added opt_mark(), opt_move() and set_destination() methods to
        sp_instr_set_case_expr.
      sql/sql_parse.cc:
        Fixed small bug at show_routine_code() call (tested return value the wrong way).
      sql/sql_yacc.yy:
        sp_instr_set_case_expr is now added to backpatch list (for the new cont. destination).
      af187fa2
  25. 25 Jan, 2006 1 commit
    • unknown's avatar
      Fixed BUG#15737: Stored procedure optimizer bug with LEAVE · 7ee65fcf
      unknown authored
        Second version.
        The problem was that the optimizer didn't work correctly with forwards jumps
        to "no-op" hpop and cpop instructions.
        Don't generate "no-op" instructions (hpop 0 and cpop 0), it isn't actually
        necessary.
      
      
      mysql-test/r/sp-code.result:
        Updated results for new test case (BUG#15737)
      mysql-test/t/sp-code.test:
        New test case (BUG#15737)
      sql/sp_head.cc:
        Removed backpatch methods from sp_instr_hpop/cpop, since they're not needed any more.
        Added more documentation to sp_head::optimize()
      sql/sp_head.h:
        Removed backpatch and opt_mark methods from sp_instr_hpop/cpop, since they're not needed
        any more.
        Added comments to optimizer methods in sp_instr.
      sql/sql_yacc.yy:
        Don't generate "no-op" hpop and cpop instructions for LEAVE, it's not necessary.
        Just generate them when needed.
      7ee65fcf
  26. 24 Jan, 2006 2 commits
    • unknown's avatar
      Fix for the following bugs: · 8f395ebb
      unknown authored
        - BUG#15166: Wrong update permissions required to execute triggers
        - BUG#15196: Wrong select permission required to execute triggers
      
      The idea of the fix is to check necessary privileges
      in Item_trigger_field::fix_fields(), instead of having "special variables"
      technique. To achieve this, we should pass to an Item_trigger_field instance
      a flag, which will indicate the usage/access type of this trigger variable.
      
      
      mysql-test/r/trigger-grant.result:
        Update the result file.
      mysql-test/t/trigger-grant.test:
        Add test cases for BUG#15166 and BUG#15196
      sql/item.cc:
        Item_trigger_field: check appropriate (SELECT/UPDATE) privilege in fix_fields().
      sql/item.h:
        Add a flag to specify access type for trigger field.
      sql/sql_trigger.cc:
        "Special variable" technique of checking privileges for NEW/OLD variables
        was replaced by checking table- and column-level privileges in
        Item_trigger_field::fix_fields().
      sql/sql_trigger.h:
        "Special variable" technique of checking privileges for NEW/OLD variables
        was replaced by checking table- and column-level privileges in
        Item_trigger_field::fix_fields().
      sql/sql_yacc.yy:
        Specify access type for trigger fields.
      8f395ebb
    • unknown's avatar
      fix for bug#16404 (Events: keyword is ENABLED rather than ENABLE) · 679aef1b
      unknown authored
      WL#1034 (Internal CRON)
      
      
      mysql-test/r/events.result:
        fix results file
      mysql-test/t/events.test:
        change test for the fix of bug#16404
      sql/lex.h:
        enabled/disabled were only for events, going back to enable/disable
        fix for bug#16404
      sql/sql_yacc.yy:
        ENABLED -> ENABLE
        DISABLED -> DISABLE
        fix for bug#16404 (Events: keyword is ENABLED rather than ENABLE)
      679aef1b
  27. 23 Jan, 2006 1 commit
  28. 20 Jan, 2006 1 commit
    • unknown's avatar
      fix for bug#16548 (Events: can't alter clause for preserve) · 2dc2a430
      unknown authored
      WL #1034 (Internal CRON)
      
      
      mysql-test/r/events.result:
        fix the results
      mysql-test/t/disabled.def:
        make it enabled
      mysql-test/t/events.test:
        - comment out some tests (having problems now)
        - add test for fix for bug#16548
      sql/sql_yacc.yy:
        - fix for bug#16548 (Events: can't alter clause for preserve)
        - prefix optional non-terminals with opt_
      2dc2a430