1. 20 Feb, 2008 4 commits
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime · 25ac83c0
      unknown authored
      into  mysql.com:/Users/davi/mysql/mysql-5.1-runtime
      
      
      mysql-test/r/view.result:
        Auto merged
      mysql-test/t/view.test:
        Auto merged
      sql/sql_view.cc:
        Auto merged
      25ac83c0
    • unknown's avatar
      Merge mysql.com:/Users/davi/mysql/bugs/34587-5.1 · 43717ba1
      unknown authored
      into  mysql.com:/Users/davi/mysql/mysql-5.1-runtime
      
      
      sql/sql_view.cc:
        Auto merged
      43717ba1
    • unknown's avatar
      Bug#34587 Creating a view inside a stored procedure leads to a server crash · 7114fbb9
      unknown authored
      The problem is that when a stored procedure is being parsed for
      the first execution, the body is copied to a temporary buffer
      which is disregarded sometime after the statement is parsed.
      And during this parsing phase, the rule for CREATE VIEW was
      holding a reference to the string being parsed for use during
      the execution of the CREATE VIEW statement, leading to invalid
      memory access later.
      
      The solution is to allocate and copy the SELECT of a CREATE
      VIEW statement using the thread memory root, which is set to
      the permanent arena of the stored procedure. 
      
      
      mysql-test/r/view.result:
        Add test case result for Bug#34587
      mysql-test/t/view.test:
        Add test case for Bug#34587
      sql/sql_lex.h:
        Remove start and end position variables. The SELECT of a
        CREATE VIEW is now allocated at parse time.
      sql/sql_view.cc:
        Remove assertion that is not true when the statement is
        being re-executed. Use string that was trimmed of leading
        and trailing whitespace at parse time.
      sql/sql_yacc.yy:
        Allocate the SELECT of a CREATE VIEW using the current thread
        memory root and remove any leading and trailing whitespace.
      7114fbb9
    • unknown's avatar
      Fix for Bug#34337: Server crash when Altering a view using · 985e9523
      unknown authored
      a table name.
      
      The problem was that fill_defined_view_parts() did not return
      an error if a table is going to be altered. That happened if
      the table was already in the table cache. In that case,
      open_table() returned non-NULL value (valid TABLE-instance from
      the cache).
      
      The fix is to ensure that an error is thrown even if the table
      is in the cache.
      
      
      mysql-test/r/view.result:
        Fix result file.
      mysql-test/t/view.test:
        Add a test case for Bug#34337: Server crash when Altering a view
        using a table name.
      sql/sql_view.cc:
        Report an error if we're going to work with a table.
      985e9523
  2. 19 Feb, 2008 8 commits
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime · 0b6bc7ef
      unknown authored
      into  dipika.(none):/opt/local/work/mysql-5.1-runtime
      
      
      0b6bc7ef
    • unknown's avatar
      Fix a compilation failure of the community tree. · 533d4354
      unknown authored
      533d4354
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime · 86301df6
      unknown authored
      into  mysql.com:/Users/davi/mysql/mysql-5.1-runtime
      
      
      sql/sql_update.cc:
        Auto merged
      86301df6
    • unknown's avatar
      Merge mysql.com:/Users/davi/mysql/bugs/23771-5.1 · 90313b02
      unknown authored
      into  mysql.com:/Users/davi/mysql/mysql-5.1-runtime
      
      
      90313b02
    • unknown's avatar
    • unknown's avatar
      Rename send_ok to my_ok. Similarly to my_error, it only records the status, · 14021c96
      unknown authored
      does not send it to the client.
      
      
      14021c96
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime · ead02981
      unknown authored
      into  dipika.(none):/opt/local/work/mysql-5.1-2pc-opt-merge-push
      
      
      mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
        Auto merged
      mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
        Auto merged
      sql/ha_ndbcluster_binlog.cc:
        Auto merged
      sql/log.cc:
        Auto merged
      sql/log_event.cc:
        Auto merged
      sql/sp.cc:
        Auto merged
      sql/sql_class.cc:
        Auto merged
      sql/sql_class.h:
        Auto merged
      sql/sql_parse.cc:
        Auto merged
      sql/sql_table.cc:
        Auto merged
      mysql-test/suite/rpl_ndb/t/disabled.def:
        Manual merge.
      ead02981
    • unknown's avatar
      A fix and a test case for Bug#12713 "Error in a stored function called from · 526798db
      unknown authored
      a SELECT doesn't cause ROLLBACK of statem".
      
      The idea of the fix is to ensure that we always commit the current
      statement at the end of dispatch_command(). In order to not issue
      redundant disc syncs, an optimization of the two-phase commit
      protocol is implemented to bypass the two phase commit if
      the transaction is read-only.
      
      
      mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
        Update test results.
      mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
        Update test results.
      mysql-test/suite/rpl_ndb/t/disabled.def:
        Disable the tests, for which this changeset reveals a bug:
        the injector thread does not always add 'statement commit' to the
        rows injected in circular replication set up.
        To be investigated separately.
      sql/ha_ndbcluster_binlog.cc:
        Add close_thread_tables() to run_query: this ensures
        that all tables are closed and there is no pending statement transaction.
      sql/handler.cc:
        Implement optimisation of read-only transactions.
        If a transaction consists only of DML statements that do not change
        data, we do not perform a two-phase commit for it 
        (run one phase commit only).
      sql/handler.h:
        Implement optimisation of read-only transactions.
        If a transaction consists only of DML statements that do not change
        data, we do not perform a two-phase commit for it 
        (run one phase commit only).
      sql/log.cc:
        Mark the binlog transaction read-write whenever it's started.
        We never read from binlog, so it's safe and least intrusive to add
        this mark up here.
      sql/log_event.cc:
        Update to the new layout of thd->transaction.
      sql/rpl_injector.cc:
        Always commit statement transaction before committing the global one.
      sql/sp.cc:
        Ad comments.
      sql/sp_head.cc:
        Add comments.
      sql/sql_base.cc:
        Commit transaction at the end of the statement. Always.
      sql/sql_class.cc:
        Update thd_ha_data to return the right pointer in the new layout.
        
        Fix select_dumpvar::send_data to properly return operation status.
        A test case from commit.inc would lead to an assertion failure in the 
        diagnostics area (double assignment). Not test otherwise by the test suite.
      sql/sql_class.h:
        Implement a new layout of storage engine transaction info in which 
        it is easy to access all members related to the handlerton only
        based on ht->slot.
      sql/sql_cursor.cc:
        Update to the new layout of thd->transaction.
      sql/sql_delete.cc:
        Remove wrong and now redundant calls to ha_autocommit_or_rollback.
        The transaction is committed in one place, at the end of the statement.
        Remove calls to mysql_unlock_tables, since some engines count locks
        and commit statement transaction in unlock_tables(), which essentially
        equates mysql_unlock_tables to ha_autocommit_or_rollback.
        Previously it was necessary to unlock tables soon because we wanted
        to avoid sending of 'ok' packet to the client under locked tables.
        This is no longer necessary, since OK packet is also sent from one place
        at the end of transaction.
      sql/sql_do.cc:
        Add DO always clears the error, we must rollback the current
        statement before this happens. Otherwise the statement will be committed,
        and not rolled back in the end.
      sql/sql_insert.cc:
        Remove wrong and now redundant calls to ha_autocommit_or_rollback.
        The transaction is committed in one place, at the end of the statement.
        Remove calls to mysql_unlock_tables, since some engines count locks
        and commit statement transaction in unlock_tables(), which essentially
        equates mysql_unlock_tables to ha_autocommit_or_rollback.
        Previously it was necessary to unlock tables soon because we wanted
        to avoid sending of 'ok' packet to the client under locked tables.
        This is no longer necessary, since OK packet is also sent from one place
        at the end of transaction.
      sql/sql_load.cc:
        Remove wrong and now redundant calls to ha_autocommit_or_rollback.
        The transaction is committed in one place, at the end of the statement.
        Remove calls to mysql_unlock_tables, since some engines count locks
        and commit statement transaction in unlock_tables(), which essentially
        equates mysql_unlock_tables to ha_autocommit_or_rollback.
        Previously it was necessary to unlock tables soon because we wanted
        to avoid sending of 'ok' packet to the client under locked tables.
        This is no longer necessary, since OK packet is also sent from one place
        at the end of transaction.
      sql/sql_parse.cc:
        Implement optimisation of read-only transactions: bypass 2-phase
        commit for them.
        Always commit statement transaction before commiting the global one.
        Fix an unrelated crash in check_table_access, when called from 
        information_schema.
      sql/sql_partition.cc:
        Partitions commit at the end of a DDL operation.
        Make sure that send_ok() is done only if the commit has succeeded.
      sql/sql_table.cc:
        Use ha_autocommit_or_rollback and end_active_trans everywhere.
        Add end_trans to mysql_admin_table, so that it leaves no pending
        transaction.
      sql/sql_udf.cc:
        Remvove a redundant call to close_thread_tables()
      sql/sql_update.cc:
        Remove wrong and now redundant calls to ha_autocommit_or_rollback.
        The transaction is committed in one place, at the end of the statement.
        Remove calls to mysql_unlock_tables, since some engines count locks
        and commit statement transaction in unlock_tables(), which essentially
        equates mysql_unlock_tables to ha_autocommit_or_rollback.
        Previously it was necessary to unlock tables soon because we wanted
        to avoid sending of 'ok' packet to the client under locked tables.
        This is no longer necessary, since OK packet is also sent from one place
        at the end of transaction.
      mysql-test/include/commit.inc:
        New BitKeeper file ``mysql-test/include/commit.inc''
      mysql-test/r/commit_1innodb.result:
        New BitKeeper file ``mysql-test/r/commit_1innodb.result''
      mysql-test/t/commit_1innodb.test:
        New BitKeeper file ``mysql-test/t/commit_1innodb.test''
      526798db
  3. 18 Feb, 2008 2 commits
  4. 15 Feb, 2008 2 commits
  5. 14 Feb, 2008 3 commits
    • unknown's avatar
      A patch for Bug#18834: ALTER TABLE ADD INDEX on table with · 5704c7fe
      unknown authored
      two timestamp fields.
        
      The actual problem here was that CREATE TABLE allowed zero
      date as a default value for a TIMESTAMP column in NO_ZERO_DATE mode.
        
      The thing is that for TIMESTAMP date type specific rule is applied:
        column_name TIMESTAMP == column_name TIMESTAMP DEFAULT 0
      whever for any other date data type
        column_name TYPE == column_name TYPE DEFAULT NULL
        
      The fix is to raise an error when we're in NO_ZERO_DATE mode and
      there is TIMESTAMP column w/o default value.
      
      
      mysql-test/r/create.result:
        Update result file.
      mysql-test/t/create.test:
        Test case for Bug#18834: ALTER TABLE ADD INDEX on table with
        two timestamp fields.
      sql/sql_table.cc:
        Report an error if NO_ZERO_MODE is set and we have zero date
        as a default.
      5704c7fe
    • unknown's avatar
      Fixing test rpl_events to not give false failures. · 58a79add
      unknown authored
      
      mysql-test/suite/rpl/r/rpl_events.result:
        Result change.
      mysql-test/suite/rpl/t/rpl_events.test:
        Replacing table with varying contents with a fresh table to avoid
        test problems. The contents of the event is unimportant for this
        part of the test.
      58a79add
    • unknown's avatar
      Fixes to try to handle valgrind warnings identical to those in · 29169c6b
      unknown authored
      BUG#24387, which is closed since long.
      
      
      sql/mysqld.cc:
        Moving my_thread_end() to before pthread_cond_broadcast() since
        it might cause other threads to start using resources that are
        about to be released, or tries to proceed assuming that the
        resources have already been released.
      29169c6b
  6. 13 Feb, 2008 4 commits
    • unknown's avatar
      Removing non-deterministic tests from events_scheduling test. · 0f19e844
      unknown authored
      
      mysql-test/r/events_scheduling.result:
        Result change.
      mysql-test/t/events_scheduling.test:
        Removing a test that only confirms that event scheduling is
        inexact, hence causing sporadic failures on loaded machines.
      0f19e844
    • unknown's avatar
      The test rpl_row_charset and it dependent rpl_ndb_charset is · 4a7d3293
      unknown authored
      irrelevant to execute since the charset information does not
      affect replication for row-based replication. The row-based
      versions of the tests were removed, and the statement-based
      version of the test was made executable by all three modes.
      
      This involves removing any lines that causes the test to be
      dependent on the contents of the binary log, and instead we
      just check that the replication works as it should.
      
      
      BitKeeper/deleted/.del-rpl_ndb_charset.test:
        Delete: mysql-test/suite/rpl_ndb/t/rpl_ndb_charset.test
      BitKeeper/deleted/.del-rpl_ndb_charset.result:
        Delete: mysql-test/suite/rpl_ndb/r/rpl_ndb_charset.result
      BitKeeper/deleted/.del-rpl_row_charset.test:
        Delete: mysql-test/extra/rpl_tests/rpl_row_charset.test
      BitKeeper/deleted/.del-rpl_row_charset.test~739be9df1baaee3e:
        Delete: mysql-test/suite/rpl/t/rpl_row_charset.test
      BitKeeper/deleted/.del-rpl_row_charset_innodb.test:
        Delete: mysql-test/suite/rpl/t/rpl_row_charset_innodb.test
      BitKeeper/deleted/.del-rpl_row_charset_innodb-master.opt:
        Delete: mysql-test/suite/rpl/t/rpl_row_charset_innodb-master.opt
      BitKeeper/deleted/.del-rpl_row_charset_innodb-slave.opt:
        Delete: mysql-test/suite/rpl/t/rpl_row_charset_innodb-slave.opt
      BitKeeper/deleted/.del-rpl_row_charset_innodb.result:
        Delete: mysql-test/suite/rpl/r/rpl_row_charset_innodb.result
      BitKeeper/deleted/.del-rpl_row_charset.result:
        Delete: mysql-test/suite/rpl/r/rpl_row_charset.result
      mysql-test/extra/rpl_tests/rpl_charset.test:
        Test is not dependent on binlog format any more.
        Using --echo instead of "select" to print text.
        Removing lines causing the test to be dependent on binlog contents.
      mysql-test/suite/rpl/r/rpl_charset.result:
        Result change.
      mysql-test/suite/rpl/t/rpl_charset.test:
        Using renamed version of test file.
      4a7d3293
    • unknown's avatar
      Additional patch for Bug#31222: com_% global status counters · e40e60fe
      unknown authored
      behave randomly with mysql_change_user.
      
      The test case had to be moved into not_embedded_server.test file,
      because SHOW GLOBAL STATUS does not work properly in embedded
      server (see bug 34517).
      
      
      BitKeeper/deleted/.del-change_user-master.opt:
        Delete: mysql-test/t/change_user-master.opt
      mysql-test/r/change_user.result:
        Move test case for Bug#31222 to not_embedded_server.test.
      mysql-test/r/not_embedded_server.result:
        Move test case for Bug#31222 to not_embedded_server.test.
      mysql-test/t/change_user.test:
        Move test case for Bug#31222 to not_embedded_server.test.
      mysql-test/t/not_embedded_server.test:
        Move test case for Bug#31222 to not_embedded_server.test.
      e40e60fe
    • unknown's avatar
      Additional patch for Bug#32538. Fix result files of windows test cases. · f8c40728
      unknown authored
      
      mysql-test/r/named_pipe.result:
        Fix result file (windows-specific test).
      mysql-test/r/shm.result:
        Fix result file (windows-specific test).
      f8c40728
  7. 12 Feb, 2008 5 commits
    • unknown's avatar
      Fix for Bug#32538: View definition picks up character set, · c1d0dd94
      unknown authored
      but not collation.
      
      The problem here was that text literals in a view were always
      dumped with character set introducer. That lead to loosing
      collation information.
      
      The fix is to dump character set introducer only if it was
      in the original query. That is now possible because there 
      is no problem any more of loss of character set of string
      literals in views -- after WL#4052 the view is dumped 
      in the original character set.
      
      
      mysql-test/r/case.result:
        Update result file.
      mysql-test/r/compress.result:
        Update result file.
      mysql-test/r/ctype_collate.result:
        Update result file.
      mysql-test/r/date_formats.result:
        Update result file.
      mysql-test/r/ddl_i18n_koi8r.result:
        Update result file.
      mysql-test/r/ddl_i18n_utf8.result:
        Update result file.
      mysql-test/r/fulltext.result:
        Update result file.
      mysql-test/r/func_crypt.result:
        Update result file.
      mysql-test/r/func_encrypt.result:
        Update result file.
      mysql-test/r/func_if.result:
        Update result file.
      mysql-test/r/func_in.result:
        Update result file.
      mysql-test/r/func_like.result:
        Update result file.
      mysql-test/r/func_regexp.result:
        Update result file.
      mysql-test/r/func_set.result:
        Update result file.
      mysql-test/r/func_str.result:
        Update result file.
      mysql-test/r/func_time.result:
        Update result file.
      mysql-test/r/gis.result:
        Update result file.
      mysql-test/r/group_min_max.result:
        Update result file.
      mysql-test/r/mysqldump.result:
        Update result file.
      mysql-test/r/negation_elimination.result:
        Update result file.
      mysql-test/r/null.result:
        Update result file.
      mysql-test/r/select.result:
        Update result file.
      mysql-test/r/show_check.result:
        Update result file.
      mysql-test/r/sp-code.result:
        Update result file.
      mysql-test/r/ssl.result:
        Update result file.
      mysql-test/r/ssl_compress.result:
        Update result file.
      mysql-test/r/subselect.result:
        Update result file.
      mysql-test/r/temp_table.result:
        Update result file.
      mysql-test/r/type_blob.result:
        Update result file.
      mysql-test/r/view.result:
        Update result file.
      mysql-test/suite/binlog/r/binlog_stm_blackhole.result:
        Update result file.
      mysql-test/suite/rpl/r/rpl_get_lock.result:
        Update result file.
      mysql-test/suite/rpl/r/rpl_master_pos_wait.result:
        Update result file.
      mysql-test/t/view.test:
        Add a test case for Bug#32538.
      sql/item.cc:
        Do not dump character set introducer if it was not specified
        explicitly in the original query.
      sql/item.h:
        Add 'cs_specified' property to Item_string.
      sql/sql_yacc.yy:
        Set Item_string::cs_specified property to TRUE
        when character set introducer is explicitly specified.
      c1d0dd94
    • unknown's avatar
      Additional fix for Bug#31222. · 84f227df
      unknown authored
      
      mysql-test/t/change_user-master.opt:
        Force mysqld restarting to reset global statistics (status info).
      84f227df
    • unknown's avatar
      Fix for Bug#31222: com_% global status counters · 215625b1
      unknown authored
      behave randomly with mysql_change_user.
        
      The problem was that global status variables were not updated
      in THD::check_user(), so thread statistics were lost after
      COM_CHANGE_USER.
        
      The fix is to update global status variables with the thread ones
      before preparing the thread for new user.
      
      
      mysql-test/r/change_user.result:
        Update result file.
      mysql-test/t/change_user.test:
        Add a test case for Bug#31222: com_% global status counters
        behave randomly with mysql_change_user.
      sql/sql_class.cc:
        Update global status variables when we're handling
        COM_CHANGE_USER for a thread.
      215625b1
    • unknown's avatar
      Various fixes to fix memory leaks after merging replication · abe4c14a
      unknown authored
      tree with main.
      
      
      sql/sql_binlog.cc:
        Adding code to free memory after execution of BINLOG statement.
        It caused a memory leak in the case that the execution failed
        for any reason.
      sql/sql_class.cc:
        Since rli_fake is checked for NULL at various occations to mean
        that no rli_fake is assigned, NULL is assigned to rli_fake after
        deleting the instance.
      abe4c14a
    • unknown's avatar
      Bug#23771 AFTER UPDATE trigger not invoked when there are no changes of the data · 8d51c6ad
      unknown authored
      The problem is that AFTER UPDATE triggers will fire only if the
      new data is different from the old data on the row. The trigger
      should fire regardless of whether there are changes to the data.
      
      The solution is to fire the trigger on UPDATE even if there are
      no changes to the value (because the value is the same).
      
      
      mysql-test/r/trigger.result:
        Add test case result for Bug#23771
      mysql-test/t/trigger.test:
        Add test case for Bug#23771
      sql/sql_update.cc:
        Move the invocation of the after update trigger so that
        the trigger will fire even if the records are the same.
      8d51c6ad
  8. 11 Feb, 2008 9 commits
  9. 09 Feb, 2008 3 commits