1. 08 Apr, 2008 1 commit
    • unknown's avatar
      Tentative implementation of · a63dde5a
      unknown authored
      WL#4165 Prepared statements: validation 
      WL#4166 Prepared statements: automatic re-prepare
      Fixes
      Bug#27430 Crash in subquery code when in PS and table DDL changed after PREPARE
      Bug#27690 Re-execution of prepared statement after table was replaced with a view crashes
      Bug#27420 A combination of PS and view operations cause error + assertion on shutdown
      
      The basic idea of the patch is to keep track of table metadata between
      prepared statement prepare and execute. If some table used in the statement
      has changed, the prepared statement is re-prepared before execution.
      
      See WL#4165 and WL#4166 contents and comments in the code for details
      of the implementation.
      
      
      include/my_global.h:
        Remove 'register' keyword to avoid warnings when swapping large structures
        that don't fit into a register. Any modern compiler is capable of placing
        a variable in a register when that would benefit performance.
      mysql-test/r/ps_1general.result:
        Update test results: since now we re-prepare automatically,
        more correct results are produced in prepare-ddl-execute scenario.
      mysql-test/r/query_cache_merge.result:
        Ensure that the table definition cache is large enough for
        the test to pass in --ps-protocol
      mysql-test/r/trigger.result:
        Update test results to reflect automatic statement reprepare.
      mysql-test/t/disabled.def:
        Enable ps_ddl.test, which now passes.
      mysql-test/t/ps_1general.test:
        Since now we re-execute prepared statements after DDL successfully,
        change the test to produce repeatable results. Remove expectancy of
        an error in one place where now we automatically reprepare the prepared
        statement.
      mysql-test/t/query_cache_merge.test:
        Ensure the table definition cache is large enough for the test to pass
        in --ps-protocol
      mysql-test/t/trigger.test:
        Sinc
      sql/item.cc:
        Implement Item_param "copy" functionality, used at re-prepare of
        a prepared statement.
        We copy the type of the original parameter, and move the assigned value,
        if any. Sic, the value is "moved", since it can be quite big --
        e.g. in case we deal with a LONG DATA parameter.
        It's essential to move the value from the old parameter since
        at the time of re-prepare the client packet with the necessary information
        may be not available.
      sql/item.h:
        Declare a new method used for reprepare.
      sql/my_decimal.h:
        Implement "swap()" functionality of class my_decimal to be
        able to easily swap two decimal values.
      sql/mysql_priv.h:
        Declare enum_metadata_type.
      sql/mysqld.cc:
        Implement a status variable for the number of reprepared statements.
      sql/sql_base.cc:
        Implement metadata version validation.
      sql/share/errmsg.txt:
        Add two new error messages: ER_NEED_REPREPARE and ER_PS_REBIND.
        The first error (theoretically) never reaches the user.
        It is issued by the metadata validation framework when a metadata version
        has changed between prepare and execute. Later on it's intercepted
        and the statement is automatically re-prepared. Only if the error
        has occurred repeatedly MAX_REPREPARE_ATTEMTS (3) times do we
        return it to the user.
        
        The second error is issued when after re-prepare we discover
        that the metadata we sent over to the client using the binary
        protocol differs drammatically from the new result set metadata 
        that the reprepared statement produces (e.g. number of result
        set columns is different).
      sql/sql_class.cc:
        Implement metadata version validation framework.
      sql/sql_class.h:
        Declarations for metadata version validation framework.
      sql/sql_parse.cc:
        Mark commands for which we must invalidate and reprepare a prepared
        statement when metadata has changed.
      sql/sql_prepare.cc:
        Implement WL#4165 and WL#4166 (limited support of metadata validation
        and re-prepare).
      sql/table.h:
        Implement metadata validation.
      tests/mysql_client_test.c:
        Add a test case for WL#4166
      a63dde5a
  2. 07 Apr, 2008 5 commits
    • unknown's avatar
      Fix a compilation warning (unused variable). · 797bfd6e
      unknown authored
      797bfd6e
    • unknown's avatar
      A fix for Bug#32724 "innodb_mysql.test fails randomly". · 17ec1c3c
      unknown authored
      Enable back the disabled test case.
      
      
      mysql-test/t/disabled.def:
        Enable the test case innodb_mysql.
      sql/sql_parse.cc:
        Fix the random failure of innodb_mysql test. The failure is not
        random any more after a patch for Bug 12713 added asserts around
        handler commit.
      17ec1c3c
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime · ed0fd2f6
      unknown authored
      into  mockturtle.local:/home/dlenev/src/mysql-5.1-symlink
      
      
      ed0fd2f6
    • unknown's avatar
      d017acee
    • unknown's avatar
      Fix for bug #35733 "main.symlink.test fails". · d5990c28
      unknown authored
      The problem was that symlink.test failed due to debug assertions or
      due to errors emitted for wrong statements (in non-debug builds)
      if 6.0 version of server was run with --thread-handling=pool-of-threads
      option.
      
      The above problems were caused by that on the one hand code mi_create()
      which handles case when error is returned relies on my_errno being set
      to appropriate non-0 value, but on the other it has not done this
      in case when error was emitted due to discovery that share for table
      which we are going to create is already present in the list of open
      shares. Running server with pool-of-threads option just exposed this
      bug since in this scheduler mode my_errno is reset to 0 when connection
      (THD) is reattached to the "real" thread.
      
      This fix ensures that code in mi_create() properly sets my_errno in
      the case described above.
      
      Since original reason that caused this bug to be exposed in 6.0 tree
      might also under very special conditions lead to incorrect behavior
      of earlier versions of server (i.e. to errors emitted for wrong
      statements) this patch is also being pushed into 5.1 tree.
      
      No test case is present as this code is already covered by a test
      case + pushbuild options combination in 6.0.
      
      
      storage/myisam/mi_create.c:
        Code in mi_create() which handles case when error is returned relies
        on my_errno being set to appropriate non-0 value. Adjusted code which
        emits error when we discover that share for table which we are going
        to create is already present in the list of open shares to do this.
      d5990c28
  3. 01 Apr, 2008 3 commits
  4. 31 Mar, 2008 2 commits
  5. 28 Mar, 2008 3 commits
    • unknown's avatar
      Fix for Bug#32748: Inconsistent handling of assignments to · bae7b267
      unknown authored
      general_log_file/slow_query_log_file.
      
      The problem was that log file path was rejected if directory
      path was empty. The fix is to reject log file path only if it
      is entirely empty.
      
      
      mysql-test/r/log_state.result:
        Update result file.
      mysql-test/t/log_state.test:
        A test case for Bug#32748: Inconsistent handling of assignments to
        general_log_file/slow_query_log_file.
      sql/set_var.cc:
        Accept file path if dirname is empty.
        Reject file path if it is empty.
      bae7b267
    • unknown's avatar
      A patch for Bug#34820: log_output can be set to illegal value. · fba9e7c8
      unknown authored
      We have "set" variables, which can accept empty values
      (like sql_mode), and which can not (like log_output). The problem
      was that the code does not distinguish them and allow empty
      values for every set variable.
      
      The fix is to introduce an attribute of a set variable telling
      whether it can accept empty values.
      
      
      mysql-test/r/variables.result:
        Update result file.
      mysql-test/t/variables.test:
        A test case for Bug#34820: log_output can be set to illegal value.
      sql/set_var.cc:
        Don't allow empty values if it is prohibitted.
      sql/set_var.h:
        Add a flag (m_allow_empty_value) telling if an empty value is
        acceptable for this variable.
      fba9e7c8
    • unknown's avatar
      Merge quad.opbmk:/mnt/raid/alik/MySQL/devel/5.1 · 1abfb6e0
      unknown authored
      into  quad.opbmk:/mnt/raid/alik/MySQL/devel/5.1-rt-merged
      
      
      mysql-test/r/grant.result:
        Auto merged
      mysql-test/t/grant.test:
        Auto merged
      sql/sql_acl.cc:
        Auto merged
      1abfb6e0
  6. 27 Mar, 2008 25 commits
    • unknown's avatar
      Merge mysql.com:/misc/mysql/mysql-5.0-opt · 0cf83bbf
      unknown authored
      into  mysql.com:/misc/mysql/mysql-5.1-opt
      
      
      CMakeLists.txt:
        Auto merged
      configure.in:
        Auto merged
      include/config-win.h:
        Auto merged
      include/my_global.h:
        Auto merged
      0cf83bbf
    • unknown's avatar
      Merge mysql.com:/misc/mysql/mysql-5.0 · ed1d366a
      unknown authored
      into  mysql.com:/misc/mysql/mysql-5.0-opt
      
      
      CMakeLists.txt:
        Auto merged
      configure.in:
        Auto merged
      include/config-win.h:
        Auto merged
      include/my_global.h:
        Auto merged
      ed1d366a
    • unknown's avatar
      Merge mysql.com:/misc/mysql/mysql-5.1 · ea4c84ea
      unknown authored
      into  mysql.com:/misc/mysql/mysql-5.1-opt
      
      
      CMakeLists.txt:
        Auto merged
      configure.in:
        Auto merged
      include/config-win.h:
        Auto merged
      include/my_global.h:
        Auto merged
      sql/sql_acl.cc:
        Auto merged
      sql/sql_db.cc:
        Auto merged
      storage/innobase/handler/ha_innodb.cc:
        Auto merged
      ea4c84ea
    • unknown's avatar
      Merge host.loc:/home/uchum/work/5.0-opt · 1561ee5c
      unknown authored
      into  host.loc:/home/uchum/work/5.1-opt
      
      
      configure.in:
        Auto merged
      sql/item.cc:
        Auto merged
      1561ee5c
    • unknown's avatar
      Merge host.loc:/home/uchum/work/mysql-5.0 · 8e473edd
      unknown authored
      into  host.loc:/home/uchum/work/5.0-opt
      
      
      configure.in:
        Auto merged
      sql/item.cc:
        Auto merged
      8e473edd
    • unknown's avatar
      Merge trift2.:/MySQL/M50/push-5.0 · 099c8889
      unknown authored
      into  trift2.:/MySQL/M51/push-5.1
      
      
      099c8889
    • unknown's avatar
      Merge jbruehe@bk-internal.mysql.com:/home/bk/mysql-5.1-build · 0c2b6330
      unknown authored
      into  trift2.:/MySQL/M51/push-5.1
      
      
      0c2b6330
    • unknown's avatar
      Merge jbruehe@bk-internal.mysql.com:/home/bk/mysql-5.0-build · 0db1f520
      unknown authored
      into  trift2.:/MySQL/M50/push-5.0
      
      
      0db1f520
    • unknown's avatar
      Merge trift2.:/MySQL/M51/ndb-decl-5.1 · a0cf1fa1
      unknown authored
      into  trift2.:/MySQL/M51/push-5.1
      
      
      a0cf1fa1
    • unknown's avatar
      Merge host.loc:/home/uchum/work/5.0-opt · abe22f2e
      unknown authored
      into  host.loc:/home/uchum/work/5.1-opt
      
      
      sql/sql_delete.cc:
        Auto merged
      sql/sql_prepare.cc:
        Auto merged
      sql/sql_update.cc:
        Auto merged
      configure.in:
        SCCS merged
      abe22f2e
    • unknown's avatar
      Merge pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.0-build · 648dae60
      unknown authored
      into  pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.1-build
      
      
      BitKeeper/deleted/.del-configure.js:
        Auto merged
      648dae60
    • unknown's avatar
      BUG#25340 · 5a6b357e
      unknown authored
      5a6b357e
    • unknown's avatar
      Merge host.loc:/home/uchum/work/4.1-opt · 1207c866
      unknown authored
      into  host.loc:/home/uchum/work/5.0-opt
      
      
      configure.in:
        Merge with 4.1-opt.
      1207c866
    • unknown's avatar
      Merge host.loc:/home/uchum/work/mysql-5.1 · a451de2f
      unknown authored
      into  host.loc:/home/uchum/work/5.1-opt
      
      
      client/mysqltest.c:
        Auto merged
      mysql-test/r/information_schema.result:
        Auto merged
      mysql-test/t/information_schema.test:
        Auto merged
      sql/item.cc:
        Auto merged
      sql/log.cc:
        Auto merged
      sql/mysql_priv.h:
        Auto merged
      sql/sql_acl.cc:
        Auto merged
      sql/sql_base.cc:
        Auto merged
      sql/sql_delete.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_update.cc:
        Auto merged
      a451de2f
    • unknown's avatar
      Merge trift2.:/MySQL/M50/push-5.0 · 09d7b08a
      unknown authored
      into  trift2.:/MySQL/M51/push-5.1
      
      
      configure.in:
        Auto merged
      09d7b08a
    • unknown's avatar
      Merge host.loc:/home/uchum/work/mysql-5.0 · 11cfd2ed
      unknown authored
      into  host.loc:/home/uchum/work/5.0-opt
      
      
      sql/sql_delete.cc:
        Auto merged
      sql/sql_prepare.cc:
        Auto merged
      sql/sql_update.cc:
        Auto merged
      11cfd2ed
    • unknown's avatar
      Merge trift2.:/MySQL/M51/mysql-5.1 · 797a2d68
      unknown authored
      into  trift2.:/MySQL/M51/push-5.1
      
      
      configure.in:
        Auto merged
      mysql-test/r/federated.result:
        Auto merged
      mysql-test/t/federated.test:
        Auto merged
      797a2d68
    • unknown's avatar
      Merge trift2.:/MySQL/M50/mysql-5.0 · 9878e861
      unknown authored
      into  trift2.:/MySQL/M50/push-5.0
      
      
      configure.in:
        Auto merged
      9878e861
    • unknown's avatar
      Merge quad.opbmk:/mnt/raid/alik/MySQL/devel/5.1 · f4c65a01
      unknown authored
      into  quad.opbmk:/mnt/raid/alik/MySQL/devel/5.1-rt-merged
      
      
      mysql-test/t/disabled.def:
        Auto merged
      f4c65a01
    • unknown's avatar
      Disable cast.test due to Bug#35594. · cd14c3c9
      unknown authored
      cd14c3c9
    • unknown's avatar
      Merge rhel5-ia64-a.mysql.com:/data0/tsmith/build/50 · db9df4c7
      unknown authored
      into  rhel5-ia64-a.mysql.com:/data0/tsmith/build/51
      
      
      db9df4c7
    • unknown's avatar
      Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.0 · 42a06b46
      unknown authored
      into  rhel5-ia64-a.mysql.com:/data0/tsmith/build/50
      
      
      42a06b46
    • unknown's avatar
      Merge rhel5-ia64-a.mysql.com:/data0/tsmith/51 · f676e122
      unknown authored
      into  rhel5-ia64-a.mysql.com:/data0/tsmith/build/51
      
      
      f676e122
    • unknown's avatar
      Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.1 · 45ebe995
      unknown authored
      into  rhel5-ia64-a.mysql.com:/data0/tsmith/build/51
      
      
      sql/mysqld.cc:
        Auto merged
      sql/sql_acl.cc:
        Auto merged
      sql/sql_class.cc:
        Auto merged
      mysql-test/r/drop.result:
        SCCS merged
      mysql-test/t/drop.test:
        SCCS merged
      45ebe995
    • unknown's avatar
      Apply innodb-5.1-ss2360 snapshot · 9aaab69a
      unknown authored
      Fixes:
      - Bug #34920: auto_increment resets to 1 on foreign key creation
        We need to use/inherit the passed in autoinc counter for ALTER TABLE
        statements too.
      
      
      mysql-test/r/innodb.result:
        Apply innodb-5.1-ss2360 snapshot
        
        Revision r2345:
        branches/5.1: Fix Bug# 34920. We need to use/inherit the passed in autoinc
        counter for ALTER TABLE statements too.
      mysql-test/t/innodb.test:
        Apply innodb-5.1-ss2360 snapshot
        
        Revision r2345:
        branches/5.1: Fix Bug# 34920. We need to use/inherit the passed in autoinc
        counter for ALTER TABLE statements too.
      storage/innobase/dict/dict0dict.c:
        Apply innodb-5.1-ss2360 snapshot
        
        Revision r2353:
        branches/5.1: Change the InnoDB autoinc type to ulint64. For this added a
        new typedef to univ.i (ib_ulonglong). Added checks for overflow and removed
        the assertion where it crashed previously, since the type has now changed
        to unsigned, it doesn't make sense to check for < 0. Added new tests, to
        check for overflow, for the different INT types supported for both
        signed and unsigned.
      storage/innobase/handler/ha_innodb.cc:
        Apply innodb-5.1-ss2360 snapshot
        
        Revision r2353:
        branches/5.1: Change the InnoDB autoinc type to ulint64. For this added a
        new typedef to univ.i (ib_ulonglong). Added checks for overflow and removed
        the assertion where it crashed previously, since the type has now changed
        to unsigned, it doesn't make sense to check for < 0. Added new tests, to
        check for overflow, for the different INT types supported for both
        signed and unsigned.
        
        
        Revision r2345:
        branches/5.1: Fix Bug# 34920. We need to use/inherit the passed in autoinc
        counter for ALTER TABLE statements too.
      storage/innobase/handler/ha_innodb.h:
        Apply innodb-5.1-ss2360 snapshot
        
        Revision r2353:
        branches/5.1: Change the InnoDB autoinc type to ulint64. For this added a
        new typedef to univ.i (ib_ulonglong). Added checks for overflow and removed
        the assertion where it crashed previously, since the type has now changed
        to unsigned, it doesn't make sense to check for < 0. Added new tests, to
        check for overflow, for the different INT types supported for both
        signed and unsigned.
      storage/innobase/include/dict0dict.h:
        Apply innodb-5.1-ss2360 snapshot
        
        Revision r2353:
        branches/5.1: Change the InnoDB autoinc type to ulint64. For this added a
        new typedef to univ.i (ib_ulonglong). Added checks for overflow and removed
        the assertion where it crashed previously, since the type has now changed
        to unsigned, it doesn't make sense to check for < 0. Added new tests, to
        check for overflow, for the different INT types supported for both
        signed and unsigned.
      storage/innobase/include/dict0mem.h:
        Apply innodb-5.1-ss2360 snapshot
        
        Revision r2353:
        branches/5.1: Change the InnoDB autoinc type to ulint64. For this added a
        new typedef to univ.i (ib_ulonglong). Added checks for overflow and removed
        the assertion where it crashed previously, since the type has now changed
        to unsigned, it doesn't make sense to check for < 0. Added new tests, to
        check for overflow, for the different INT types supported for both
        signed and unsigned.
      storage/innobase/include/row0sel.h:
        Apply innodb-5.1-ss2360 snapshot
        
        Revision r2353:
        branches/5.1: Change the InnoDB autoinc type to ulint64. For this added a
        new typedef to univ.i (ib_ulonglong). Added checks for overflow and removed
        the assertion where it crashed previously, since the type has now changed
        to unsigned, it doesn't make sense to check for < 0. Added new tests, to
        check for overflow, for the different INT types supported for both
        signed and unsigned.
      storage/innobase/include/univ.i:
        Apply innodb-5.1-ss2360 snapshot
        
        Revision r2353:
        branches/5.1: Change the InnoDB autoinc type to ulint64. For this added a
        new typedef to univ.i (ib_ulonglong). Added checks for overflow and removed
        the assertion where it crashed previously, since the type has now changed
        to unsigned, it doesn't make sense to check for < 0. Added new tests, to
        check for overflow, for the different INT types supported for both
        signed and unsigned.
      storage/innobase/row/row0sel.c:
        Apply innodb-5.1-ss2360 snapshot
        
        Revision r2353:
        branches/5.1: Change the InnoDB autoinc type to ulint64. For this added a
        new typedef to univ.i (ib_ulonglong). Added checks for overflow and removed
        the assertion where it crashed previously, since the type has now changed
        to unsigned, it doesn't make sense to check for < 0. Added new tests, to
        check for overflow, for the different INT types supported for both
        signed and unsigned.
      9aaab69a
  7. 26 Mar, 2008 1 commit
    • unknown's avatar
      view.result: · b90296c7
      unknown authored
        Post-merge fix (bug #35193).
      
      
      mysql-test/r/view.result:
        Post-merge fix (bug #35193).
      b90296c7