1. 09 Mar, 2010 6 commits
    • Davi Arnaut's avatar
      Bug#40277: SHOW CREATE VIEW returns invalid SQL · f502deac
      Davi Arnaut authored
      The problem is that not all column names retrieved from a SELECT
      statement can be used as view column names due to length and format
      restrictions. The server failed to properly check the conformity
      of those automatically generated column names before storing the
      final view definition on disk.
      
      Since columns retrieved from a SELECT statement can be anything
      ranging from functions to constants values of any format and length,
      the solution is to rewrite to a pre-defined format any names that
      are not acceptable as a view column name.
      
      The name is rewritten to "Name_exp_%u" where %u translates to the
      position of the column. To avoid this conversion scheme, define
      explict names for the view columns via the column_list clause.
      Also, aliases are now only generated for top level statements.
      
      mysql-test/include/view_alias.inc:
        Add test case for Bug#40277
      mysql-test/r/compare.result:
        Bug#40277: SHOW CREATE VIEW returns invalid SQL
      mysql-test/r/group_by.result:
        Bug#40277: SHOW CREATE VIEW returns invalid SQL
      mysql-test/r/ps.result:
        Bug#40277: SHOW CREATE VIEW returns invalid SQL
      mysql-test/r/subselect.result:
        Bug#40277: SHOW CREATE VIEW returns invalid SQL
      mysql-test/r/subselect3.result:
        Bug#40277: SHOW CREATE VIEW returns invalid SQL
      mysql-test/r/type_datetime.result:
        Bug#40277: SHOW CREATE VIEW returns invalid SQL
      mysql-test/r/union.result:
        Bug#40277: SHOW CREATE VIEW returns invalid SQL
      mysql-test/r/view.result:
        Add test case result for Bug#40277
      mysql-test/r/view_alias.result:
        Add test case result for Bug#40277
      mysql-test/t/view_alias.test:
        Add test case for Bug#40277
      sql/sql_view.cc:
        Check if auto generated column names are conforming. Also, the
        make_unique_view_field_name function is not used as it uses the
        original name to construct a new one, which does not work if the
        name is invalid.
      f502deac
    • Davi Arnaut's avatar
      Bug#51650: crash with user variables and triggers · 02ac873c
      Davi Arnaut authored
      The problem was that bits of the destructive equality propagation
      optimization weren't being undone after the execution of a stored
      program. Modifications to the parse tree that are based on transient
      properties must be undone to enable the re-execution of stored
      programs.
      
      The solution is to cleanup any references to predicates generated
      by the equality propagation during the execution of a stored program.
      
      mysql-test/r/trigger.result:
        Add test case result for Bug#51650.
      mysql-test/t/trigger.test:
        Add test case for Bug#51650.
      sql/item.cc:
        Remove reference to a equality predicate.
      02ac873c
    • Georgi Kodinov's avatar
    • Georgi Kodinov's avatar
      Addendum to the test for bug 51357 : disable the (possibly binary) · d0bb5465
      Georgi Kodinov authored
      output from HANDLER ... READ .. NEXT ...
      d0bb5465
    • Luis Soares's avatar
    • Luis Soares's avatar
  2. 08 Mar, 2010 4 commits
  3. 04 Mar, 2010 1 commit
    • Georgi Kodinov's avatar
      Bug #51357: crash when using handler commands on spatial indexes · d934426f
      Georgi Kodinov authored
      Spatial indexes were not checking for out-of-record condition in
      the handler next command when the previous command didn't found
      rows.
      
      Fixed by making the rtree index to check for end of rows condition
      before re-using the key from the previous search.
      
      Fixed another crash if the tree has changed since the last search.
      Added a test case for the other error.
      d934426f
  4. 05 Mar, 2010 4 commits
    • Gleb Shchepa's avatar
      Bug #39653: find_shortest_key in sql_select.cc does not · 63a88e13
      Gleb Shchepa authored
                  consider clustered primary keys
      
      Choosing a shortest index for the covering index scan,
      the optimizer ignored the fact, that the clustered primary
      key read involves whole table data.
      
      The find_shortest_key function has been modified to
      take into account that fact that a clustered PK has a
      longest key of possible covering indices.
      
      
      mysql-test/r/innodb_mysql.result:
        Test case for bug #39653.
      mysql-test/t/innodb_mysql.test:
        Test case for bug #39653.
      sql/sql_select.cc:
        Bug #39653: find_shortest_key in sql_select.cc does not
                    consider clustered primary keys
        
        The find_shortest_key function has been modified to
        take into account that fact that a clustered PK has a
        longest key of possible covering indices.
      63a88e13
    • Tatiana A. Nurnberg's avatar
      auto-merge · fbad82de
      Tatiana A. Nurnberg authored
      fbad82de
    • Tatiana A. Nurnberg's avatar
      manual merge · 823661bd
      Tatiana A. Nurnberg authored
      823661bd
    • Ramil Kalimullin's avatar
      Fix for bug#32426: "FEDERATED query returns corrupt results · 2eb9d388
      Ramil Kalimullin authored
       for ORDER BY on a TEXT or VARCHAR field" backported to 5.1.
      2eb9d388
  5. 04 Mar, 2010 3 commits
  6. 03 Mar, 2010 1 commit
    • Luis Soares's avatar
      BUG#51226: mysqlbinlog replay: ERROR 1146 when using temp tables · d13db314
      Luis Soares authored
                 + failing statements
      
      Implicit DROP event for temporary table is not getting
      LOG_EVENT_THREAD_SPECIFIC_F flag, because, in the previous
      executed statement in the same thread, which might even be a
      failed statement, the thread_specific_used flag is set to
      FALSE (in mysql_reset_thd_for_next_command) and not set to TRUE
      before connection is shutdown. This means that implicit DROP
      event will take the FALSE value from thread_specific_used and
      will not set LOG_EVENT_THREAD_SPECIFIC_F in the event header. As
      a consequence, mysqlbinlog will not print the pseudo_thread_id
      from the DROP event, because one of the requirements for the
      printout is that this flag is set to TRUE.
      
      We fix this by setting thread_specific_used whenever we are
      binlogging a DROP in close_temporary_tables, and resetting it to
      its previous value afterward.
      d13db314
  7. 02 Mar, 2010 6 commits
  8. 01 Mar, 2010 7 commits
  9. 28 Feb, 2010 1 commit
    • Ramil Kalimullin's avatar
      Fix for bug#51304: checksum table gives different results · 9715539e
      Ramil Kalimullin authored
      for same data when using bit fields
      
      Problem: checksum for BIT fields may be computed incorrectly 
      in some cases due to its storage peculiarity.
      
      Fix: convert a BIT field to a string then calculate its checksum.
      
      
      mysql-test/r/myisam.result:
        Fix for bug#51304: checksum table gives different results 
        for same data when using bit fields
          - test result.
      mysql-test/t/myisam.test:
        Fix for bug#51304: checksum table gives different results 
        for same data when using bit fields
          - test case.
      sql/sql_table.cc:
        Fix for bug#51304: checksum table gives different results 
        for same data when using bit fields
          - convert BIT fields to strings calculating its checksums
        as some bits may be saved among NULL bits in the record buffer.
      9715539e
  10. 27 Feb, 2010 3 commits
  11. 26 Feb, 2010 4 commits