1. 19 Jun, 2007 1 commit
  2. 18 Jun, 2007 1 commit
    • unknown's avatar
      Bug#28211 RENAME DATABASE and query cache don't play nicely together · b9dc6ad7
      unknown authored
      When all table blocks were removed from the query cache the client session
      hung in a tight loop waiting on an impossible condition while consuming a lot
      of CPU.
      
      This patch also corrects an error which caused valid tables to sometimes be
      removed from the query cache.
      
      
      mysql-test/r/query_cache.result:
        Added test case to make sure server doesn't hang in a tight loop if last
        table block is removed from the cache.
      mysql-test/t/query_cache.test:
        Added test case to make sure server doesn't hang in a tight loop if last
        table block is removed from the cache.
      sql/sql_cache.cc:
        - Refactored loop over table blocks. The invalidate_table() function effects
          the elements over which we iterate. The previous stop condition was broken
          due to a compiler optimization error probably caused by the goto-statement
          pointing out of the loop. The effect being that tables_blocks was never
          checked for null values and thus the loop never terminated.
        - The new implementation uses two while loops instead of a goto-statement.
          The tables_blocks is a circular list which becomes null if the last table
          block is removed from the list.
      b9dc6ad7
  3. 15 Jun, 2007 3 commits
    • unknown's avatar
      Manual merge · b72380fc
      unknown authored
      b72380fc
    • unknown's avatar
      Merge weblab.(none):/home/marcsql/TREE/mysql-5.1-base · a4372367
      unknown authored
      into  weblab.(none):/home/marcsql/TREE/mysql-5.1-rt-merge
      
      
      mysql-test/r/trigger.result:
        Auto merged
      mysql-test/t/trigger.test:
        Auto merged
      sql/field.cc:
        Auto merged
      sql/field.h:
        Auto merged
      sql/handler.cc:
        Auto merged
      sql/item.h:
        Auto merged
      sql/log.cc:
        Auto merged
      sql/mysql_priv.h:
        Auto merged
      sql/sql_class.h:
        Auto merged
      sql/sql_insert.cc:
        Auto merged
      sql/sql_parse.cc:
        Auto merged
      sql/sql_partition.cc:
        Auto merged
      sql/sql_prepare.cc:
        Auto merged
      sql/sql_select.cc:
        Auto merged
      sql/sql_table.cc:
        Auto merged
      sql/sql_yacc.yy:
        Auto merged
      a4372367
    • unknown's avatar
      Another attempt to fix the valgrind warning in SHOW PROCESSLIST · 7ad57021
      unknown authored
      (event_bugs.test)
      
      
      sql/event_data_objects.cc:
        SHOW PROCESSLIST tries to read thd->query without a mutex.
        If we do not reset it, it points to free()d contents of stack variable
        sp_sql.
      7ad57021
  4. 14 Jun, 2007 23 commits
    • unknown's avatar
      build warning · a4714bae
      unknown authored
      a4714bae
    • unknown's avatar
      Merge malff@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime · 33c44f3b
      unknown authored
      into  weblab.(none):/home/marcsql/TREE/mysql-5.1-27857
      
      
      33c44f3b
    • unknown's avatar
      Part of patch for BUG#11986: make sp_head::m_body_begin pointer · e57122a7
      unknown authored
      private and provide a setter for it. The setter will be used to
      construct UTF-query in the following patches.
      
      
      sql/sp_head.cc:
        Make sp_head::m_body_begin pointer private.
      sql/sp_head.h:
        Make sp_head::m_body_begin pointer private.
      sql/sql_yacc.yy:
        Make sp_head::m_body_begin pointer private.
      e57122a7
    • unknown's avatar
      Merge mysql.com:/d2/hf/mrg/mysql-5.0-opt · f6a7490c
      unknown authored
      into  mysql.com:/d2/hf/mrg/mysql-5.1-opt
      
      
      f6a7490c
    • unknown's avatar
      Merge mysql.com:/d2/hf/mrg/mysql-4.1-opt · bcd6183f
      unknown authored
      into  mysql.com:/d2/hf/mrg/mysql-5.0-opt
      
      
      bcd6183f
    • unknown's avatar
      Merge malff@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime · d098bfff
      unknown authored
      into  weblab.(none):/home/marcsql/TREE/mysql-5.1-27857
      
      
      d098bfff
    • unknown's avatar
      fix the binlog-stm_ps.test for the embedded-server · 854353dd
      unknown authored
      
      mysql-test/t/binlog_stm_ps.test:
        embedded server doesn't have binlogs
      854353dd
    • unknown's avatar
      Merge mysql.com:/d2/hf/mrg/mysql-5.0-opt · d1614ae9
      unknown authored
      into  mysql.com:/d2/hf/mrg/mysql-5.1-opt
      
      
      d1614ae9
    • unknown's avatar
      This the 4-th patch in scope of CS patch (BUG#11986). · 83de46bc
      unknown authored
      The patch contains the following changes:
        - Introduce auxilary functions to convenient work with character sets:
          - resolve_charset();
          - resolve_collation();
          - get_default_db_collation();
        - Introduce lex_string_set();
        - Refactor Table_trigger_list::process_triggers() &
          sp_head::execute_trigger() to be consistent with other code;
        - Move reusable code from add_table_for_trigger() into
          build_trn_path(), check_trn_exists() and load_table_name_for_trigger()
          to be used in the following patch.
        - Rename triggers_file_ext and trigname_file_ext into TRN_EXT and
          TRG_EXT respectively.
      
      
      include/my_sys.h:
        Introduced auxilary functions (to be used in the following patch).
      mysys/charset.c:
        Introduced auxilary functions (to be used in the following patch).
      sql/handler.cc:
        Rename triggers_file_ext -> TRG_EXT;
        Rename trigname_file_ext -> TRN_EXT.
      sql/mysql_priv.h:
        1. Fix typo;
        2. Introduce auxilary functions (set_lex_string() will  be used
           in the following patch);
        3. Rename triggers_file_ext -> TRG_EXT;
           Rename trigname_file_ext -> TRN_EXT.
      sql/sp_head.cc:
        Make sp_head::execute_trigger() consistent with
        sp_head::execute_function() and sp_head::execute_procedure().
      sql/sp_head.h:
        Make sp_head::execute_trigger() consistent with
        sp_head::execute_function() and sp_head::execute_procedure().
      sql/sql_db.cc:
        1. Introduce auxilary function.
        2. Polishing.
      sql/sql_trigger.cc:
        1. Move common code from add_table_for_trigger() into
           - build_trn_path();
           - check_trn_exists();
           - load_table_name_for_trigger();
        2. Polishing.
      sql/sql_trigger.h:
        1. Move common code from add_table_for_trigger() into
           - build_trn_path();
           - check_trn_exists();
           - load_table_name_for_trigger();
        2. Polishing.
      83de46bc
    • unknown's avatar
      This is the 3-rd part of patch for BUG#11986: · c7aeb8f3
      unknown authored
      remove redundant "body" from Event_parse_data (use sp_head::m_body).
      
      
      sql/event_data_objects.cc:
        Use sp_head::m_body to store SQL-statement.
        Polishing.
      sql/event_data_objects.h:
        Use sp_head::m_body to store SQL-statement.
        Polishing.
      sql/event_db_repository.cc:
        Use sp_head::m_body to store SQL-statement.
      sql/sql_yacc.yy:
        Use sp_head::m_body to store SQL-statement.
      c7aeb8f3
    • unknown's avatar
      The second cleanup patch in scope of BUG#11986. · efaaeeca
      unknown authored
      1. Introduce parse_sql() as a high-level replacement for MYSQLparse().
      parse_sql() is responsible to switch and restore "parser context"
      (THD::m_lip for now).
      
      2. Fix typo in sp.cc: THD::spcont should be reset *before* calling
      the parser.
      
      
      sql/event_data_objects.cc:
        Use parse_sql() instead of MYSQLparse().
      sql/mysql_priv.h:
        Introduce parse_sql() instead of auto-generated MYSQLparse.
      sql/sp.cc:
        1. Use parse_sql() instead of MYSQLparse().
        2. THD::spcont should be reset before calling the parser.
      sql/sql_class.cc:
        Reset THD::m_lip.
      sql/sql_parse.cc:
        1. Introduce parse_sql() instead of auto-generated MYSQLparse().
        2. Backup, switch and restore THD::m_lip inside parse_sql().
        3. Use parse_sql() instead of MYSQLparse().
      sql/sql_partition.cc:
        Use parse_sql() instead of MYSQLparse().
      sql/sql_prepare.cc:
        Use parse_sql() instead of MYSQLparse().
      sql/sql_trigger.cc:
        Use parse_sql() instead of MYSQLparse().
      sql/sql_view.cc:
        Use parse_sql() instead of MYSQLparse().
      efaaeeca
    • unknown's avatar
      Merge magare.gmz:/home/kgeorge/mysql/work/valgrind-errs-5.0-opt · db17ac9f
      unknown authored
      into  magare.gmz:/home/kgeorge/mysql/work/valgrind-errs-5.1-opt
      
      
      tests/mysql_client_test.c:
        manual merge 5.0-opt -> 5.1-opt
      db17ac9f
    • unknown's avatar
      Merge bk-internal:/home/bk/mysql-5.0-opt · 1acda0ce
      unknown authored
      into  magare.gmz:/home/kgeorge/mysql/work/valgrind-errs-merge-5.0-opt
      
      
      1acda0ce
    • unknown's avatar
      f0000401
    • unknown's avatar
      Merge mysql.com:/d2/hf/mrg/mysql-5.0-opt · dbc4abca
      unknown authored
      into  mysql.com:/d2/hf/mrg/mysql-5.1-opt
      
      
      client/mysqltest.c:
        Auto merged
      sql/field.cc:
        Auto merged
      sql/field.h:
        Auto merged
      sql/item.cc:
        Auto merged
      sql/item.h:
        Auto merged
      sql/item_cmpfunc.cc:
        Auto merged
      sql/mysqld.cc:
        Auto merged
      sql/sql_parse.cc:
        Auto merged
      sql/sql_prepare.cc:
        Auto merged
      sql/sql_select.cc:
        Auto merged
      sql/sql_table.cc:
        Auto merged
      sql/sql_yacc.yy:
        Auto merged
      mysql-test/include/mix1.inc:
        merging
      mysql-test/r/innodb_mysql.result:
        merging
      dbc4abca
    • unknown's avatar
      Merge bk@192.168.21.1:mysql-5.1 · 0662a9b7
      unknown authored
      into  mysql.com:/d2/hf/mrg/mysql-5.1-opt
      
      
      client/mysqltest.c:
        Auto merged
      sql/field.cc:
        Auto merged
      sql/field.h:
        Auto merged
      sql/item.cc:
        Auto merged
      sql/item.h:
        Auto merged
      sql/item_cmpfunc.cc:
        Auto merged
      sql/mysql_priv.h:
        Auto merged
      sql/mysqld.cc:
        Auto merged
      sql/set_var.cc:
        Auto merged
      sql/sql_parse.cc:
        Auto merged
      sql/sql_prepare.cc:
        Auto merged
      sql/sql_show.cc:
        Auto merged
      sql/sql_table.cc:
        Auto merged
      sql/sql_yacc.yy:
        Auto merged
      mysql-test/include/mix1.inc:
        merging
      mysql-test/r/innodb_mysql.result:
        merging
      sql/sql_select.cc:
        merging
      0662a9b7
    • unknown's avatar
      Merge bk@192.168.21.1:mysql-5.0 · 6f168d12
      unknown authored
      into  mysql.com:/d2/hf/mrg/mysql-5.0-opt
      
      
      client/mysqltest.c:
        Auto merged
      sql/field.cc:
        Auto merged
      sql/field.h:
        Auto merged
      sql/item.cc:
        Auto merged
      sql/item.h:
        Auto merged
      sql/item_cmpfunc.cc:
        Auto merged
      sql/mysqld.cc:
        Auto merged
      sql/sql_parse.cc:
        Auto merged
      sql/sql_prepare.cc:
        Auto merged
      sql/sql_table.cc:
        Auto merged
      sql/sql_yacc.yy:
        Auto merged
      mysql-test/r/innodb_mysql.result:
        merging
      mysql-test/t/innodb_mysql.test:
        merging
      sql/sql_select.cc:
        merging
      6f168d12
    • unknown's avatar
      Merge bk@192.168.21.1:mysql-4.1 · 95d439d3
      unknown authored
      into  mysql.com:/d2/hf/mrg/mysql-4.1-opt
      
      
      95d439d3
    • unknown's avatar
      Merge mysql.com:/d2/hf/mrg/mysql-5.0-opt · 167751b3
      unknown authored
      into  mysql.com:/d2/hf/mrg/mysql-5.1-opt
      
      
      mysql-test/r/type_decimal.result:
        Auto merged
      sql/item_func.cc:
        Auto merged
      167751b3
    • unknown's avatar
      Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.1-opt · dcd779cb
      unknown authored
      into  magare.gmz:/home/kgeorge/mysql/autopush/B28991-5.1-opt
      
      
      dcd779cb
    • unknown's avatar
      Bug #28991: rpl_events failure in pushbuild · 37559e3d
      unknown authored
      In tests waiting on a timeout is not deterministic enough
      to make sure that an event actually finished executing.
      Fixed the test by waiting in a loop and checking the effect
      that the event is supposed to produce.
      
      
      mysql-test/include/rpl_events.inc:
        Bug #28991: wait until event has taken effect
      37559e3d
    • unknown's avatar
      Add a missing wait_condition call. · e615aaff
      unknown authored
      
      mysql-test/t/events_restart_phase3.test:
        Add a missing wait.
      e615aaff
    • unknown's avatar
      Bug#27857 (Log tables supplies the wrong value for generating AUTO_INCREMENT · 8b8b2888
      unknown authored
      numbers)
      
      Before this patch, the code in the class Log_to_csv_event_handler, which is
      used by the global LOGGER object to write to the tables mysql.slow_log and
      mysql_general_log, was supporting only records of the format defined for
      these tables in the database creation scripts.
      
      Also before this patch, the server would allow, with certain limitations,
      to perform ALTER TABLE on the LOG TABLES.
      
      As implemented, the behavior of the server, with regards to LOG TABLES,
      is inconsistent:
      - either ALTER TABLES on LOG TABLES should be prohibited,
      and the code writing to these tables can make assumptions on the record
      format,
      - or ALTER TABLE on LOG TABLES is permitted, in which case the code
      writing a record to these tables should be more flexible and honor
      new fields.
      
      In particular, adding an AUTO_INCREMENT column to the logs,
      does not work as expected (per the bug report).
      
      Given that the ALTER TABLE on log tables statement has been explicitly
      implemented to check that the log should be off to perform the operation,
      and that current test cases already cover this, the user expectation is
      already set that this is a "feature" and should be supported.
      
      With this patch, the server will:
      - populate AUTO INCREMENT columns if present,
      - populate any additional column with it's default value
      when writing a record to the LOG TABLES.
      
      Tests are provided, that detail the precise sequence of statements
      a SUPER user might want to perform to add more columns to the log tables.
      
      
      mysql-test/r/log_tables.result:
        Test case for bug#27857
      mysql-test/t/log_tables.test:
        Test case for bug#27857
      sql/log.cc:
        Set extra fields in log tables with default values.
      8b8b2888
  5. 13 Jun, 2007 3 commits
  6. 12 Jun, 2007 9 commits
    • unknown's avatar
      Bug#25411 (trigger code truncated), PART II · f09496c8
      unknown authored
      Bug 28127 (Some valid identifiers names are not parsed correctly)
      Bug 26302 (MySQL server cuts off trailing "*/" from comments in SP/func)
      
      This patch is the second part of a major cleanup, required to fix
      Bug 25411 (trigger code truncated).
      
      The root cause of the issue stems from the function skip_rear_comments,
      which was a work around to remove "extra" "*/" characters from the query
      text, when parsing a query and reusing the text fragments to represent a
      view, trigger, function or stored procedure.
      The reason for this work around is that "special comments",
      like /*!50002 XXX */, were not parsed properly, so that a query like:
        AAA /*!50002 BBB */ CCC
      would be seen by the parser as "AAA BBB */ CCC" when the current version
      is greater or equal to 5.0.2
      
      The root cause of this stems from how special comments are parsed.
      Special comments are really out-of-bound text that appear inside a query,
      that affects how the parser behave.
      In nature, /*!50002 XXX */ in MySQL is similar to the C concept
      of preprocessing :
        #if VERSION >= 50002
        XXX
        #endif
      
      Depending on the current VERSION of the server, either the special comment
      should be expanded or it should be ignored, but in all cases the "text" of
      the query should be re-written to strip the "/*!50002" and "*/" markers,
      which does not belong to the SQL language itself.
      
      Prior to this fix, these markers would leak into :
      - the storage format for VIEW,
      - the storage format for FUNCTION,
      - the storage format for FUNCTION parameters, in mysql.proc (param_list),
      - the storage format for PROCEDURE,
      - the storage format for PROCEDURE parameters, in mysql.proc (param_list),
      - the storage format for TRIGGER,
      - the binary log used for replication.
      
      In all cases, not only this cause format corruption, but also provide a vector
      for dormant security issues, by allowing to tunnel code that will be activated
      after an upgrade.
      
      The proper solution is to deal with special comments strictly during parsing,
      when accepting a query from the outside world.
      Once a query is parsed and an object is created with a persistant
      representation, this object should not arbitrarily mutate after an upgrade.
      In short, special comments are a useful but limited feature for MYSQLdump,
      when used at an *interface* level to facilitate import/export,
      but bloating the server *internal* storage format is *not* the proper way
      to deal with configuration management of the user logic.
      
      With this fix:
      - the Lex_input_stream class now acts as a comment pre-processor,
      and either expands or ignore special comments on the fly.
      - MYSQLlex and sql_yacc.yy have been cleaned up to strictly use the
      public interface of Lex_input_stream. In particular, how the input stream
      accepts or rejects a character is private to Lex_input_stream, and the
      internal buffer pointers of that class are strictly private, and should not
      be tempered with during parsing.
      
      This caused many changes mostly in sql_lex.cc.
      
      During the code cleanup in case MY_LEX_NUMBER_IDENT,
      Bug 28127 (Some valid identifiers names are not parsed correctly)
      was found and fixed.
      
      By parsing special comments properly, and removing the function
      'skip_rear_comments' [sic],
      Bug 26302 (MySQL server cuts off trailing "*/" from comments in SP/func)
      has been fixed as well.
      
      
      sql/event_data_objects.cc:
        Cleanup of the code that extracts the query text
      sql/sp.cc:
        Cleanup of the code that extracts the query text
      sql/sp_head.cc:
        Cleanup of the code that extracts the query text
      sql/sql_trigger.cc:
        Cleanup of the code that extracts the query text
      sql/sql_view.cc:
        Cleanup of the code that extracts the query text
      mysql-test/r/comments.result:
        Bug#25411 (trigger code truncated)
      mysql-test/r/sp.result:
        Bug#25411 (trigger code truncated)
        Bug 26302 (MySQL server cuts off trailing "*/" from comments in SP/func)
      mysql-test/r/trigger.result:
        Bug#25411 (trigger code truncated)
      mysql-test/r/varbinary.result:
        Bug 28127 (Some valid identifiers names are not parsed correctly)
      mysql-test/t/comments.test:
        Bug#25411 (trigger code truncated)
      mysql-test/t/sp.test:
        Bug#25411 (trigger code truncated)
        Bug 26302 (MySQL server cuts off trailing "*/" from comments in SP/func)
      mysql-test/t/trigger.test:
        Bug#25411 (trigger code truncated)
      mysql-test/t/varbinary.test:
        Bug 28127 (Some valid identifiers names are not parsed correctly)
      sql/sql_lex.cc:
        Implemented comment pre-processing in Lex_input_stream,
        major cleanup of the lex/yacc code to not use Lex_input_stream private members.
      sql/sql_lex.h:
        Implemented comment pre-processing in Lex_input_stream,
        major cleanup of the lex/yacc code to not use Lex_input_stream private members.
      sql/sql_yacc.yy:
        post merge fix : view_check_options must be parsed before signaling the end of the query
      f09496c8
    • unknown's avatar
      Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.1-opt · ab84fb1d
      unknown authored
      into  magare.gmz:/home/kgeorge/mysql/autopush/B27816-5.1-opt
      
      
      sql/sql_table.cc:
        Auto merged
      ab84fb1d
    • unknown's avatar
      Merge bk-internal:/home/bk/mysql-5.1-opt · 04447645
      unknown authored
      into  magare.gmz:/home/kgeorge/mysql/work/merge-5.1-opt
      
      
      04447645
    • unknown's avatar
      5.0-opt -> 5.1-opt merge · 95ef943b
      unknown authored
      95ef943b
    • unknown's avatar
      Merge bk-internal:/home/bk/mysql-5.0-opt · e53dfc6d
      unknown authored
      into  magare.gmz:/home/kgeorge/mysql/work/merge-5.1-opt
      
      
      mysql-test/r/insert_update.result:
        Auto merged
      mysql-test/r/trigger.result:
        Auto merged
      mysql-test/t/insert_update.test:
        Auto merged
      mysql-test/t/trigger.test:
        Auto merged
      sql/item_strfunc.cc:
        Auto merged
      sql/mysqld.cc:
        Auto merged
      sql/sql_class.h:
        Auto merged
      sql/sql_prepare.cc:
        Auto merged
      sql/sql_show.cc:
        Auto merged
      sql/item_func.cc:
        merge of 5.0-opt -> 5.1-opt
      sql/sql_insert.cc:
        merge of 5.0-opt -> 5.1-opt
      sql/structs.h:
        merge of 5.0-opt -> 5.1-opt
      tests/mysql_client_test.c:
        merge of 5.0-opt -> 5.1-opt
      e53dfc6d
    • unknown's avatar
      Merge bk@192.168.21.1:mysql-5.1-opt · acc7614a
      unknown authored
      into  mysql.com:/home/hf/work/28757/my51-28757
      
      
      acc7614a
    • unknown's avatar
      Bug #28757 Test program / embedded server crash in test "unsafe_binlog_innodb" · 0a67a6e5
      unknown authored
      the reported test failure is fixed by the patch to 28333,
      but there's a bit more to fix in the test itself - to
      drop tables created in this test at the test's beginning.
      
      
      mysql-test/include/unsafe_binlog.inc:
        remove tables created later in this test
        number error codes changed with the appropriate ER_something
      mysql-test/r/unsafe_binlog_innodb.result:
        test result fixed
      0a67a6e5
    • unknown's avatar
      Bug#27634: group_by test fails · a8bb10ac
      unknown authored
      On many architectures, e.g. 68000, x86, the double registers have higher precision 
      than the IEEE standard prescribes. When compiled with flags -O and higher, some double's 
      go into registers and therefore have higher precision. In one test case the cost 
      information of the best and second-best key were close enough to be influenced by this 
      effect, causing a failed test in distribution builds.
      
      Fixed by removing some rows from the table in question so that cost information is not
      influenced by decimals beyond standard definition of double.
      
      
      mysql-test/r/group_by.result:
        Bug#27634: Altered test reslut. The only difference in the results is in the 'rows' column.
      mysql-test/t/group_by.test:
        Bug#27634: Altered test case to avoid the corner case where excess precision causes 
        non-minimum costs to appear minimal.
      a8bb10ac
    • unknown's avatar
      removed compilation warning · 119412f8
      unknown authored
      119412f8