1. 13 Apr, 2011 2 commits
    • Anitha Gopi's avatar
    • Dmitry Lenev's avatar
      Bug#11938039 "RE-EXECUTION OF FRM-ONLY ALTER TABLE WITH RENAME · cfdb3469
      Dmitry Lenev authored
      CLAUSE FAILS OR ABORTS SERVER".
       
      Attempt to re-execute prepared ALTER TABLE statement which 
      involves .FRM-only changes and also have RENAME clause led
      to unwarranted 'Table doesn't exist' error in production
      builds and assertion failure for debug builds.
       
      This problem stemmed from the fact that for such ALTER TABLE
      mysql_alter_table() code changed table list element for table 
      to be altered when it tried to re-open table under new name. 
      Since this change was not reverted back before next 
      re-execution, it made this statement re-execution unsafe.
       
      This fix addresses this problem by avoiding changing table list
      element from the main table list in such a situation. Instead 
      temporary TABLE_LIST object is used.
      
      mysql-test/r/alter_table.result:
        Added test case for bug#11938039 "RE-EXECUTION OF FRM-ONLY
        ALTER TABLE WITH RENAME CLAUSE FAILS OR ABORTS SERVER".
      mysql-test/t/alter_table.test:
        Added test case for bug#11938039 "RE-EXECUTION OF FRM-ONLY
        ALTER TABLE WITH RENAME CLAUSE FAILS OR ABORTS SERVER".
      sql/sql_table.cc:
        Changed mysql_alter_table() not to modify table list element
        for the table being altered while re-opening table after
        .FRM-only changes. Doing this made .FRM-only ALTER TABLE 
        which also had RENAME clause unsafe for re-execution.
      cfdb3469
  2. 12 Apr, 2011 8 commits
  3. 11 Apr, 2011 9 commits
  4. 08 Apr, 2011 7 commits
    • Alexander Barkov's avatar
      Bug#11926811 / Bug#60625 Illegal mix of collations · 6d4d2158
      Alexander Barkov authored
      Problem: comparison of a DATETIME sp variable and NOW()
      led to Illegal mix of collations error when 
      character_set_connection=utf8.
      Introduced by "WL#2649 Number-to-string conversions".
      
      Error happened in Arg_comparator::set_compare_func(),
      because the first argument was errouneously converted to utf8,
      while the second argument was not.
      
      Fix: separate agg_arg_charsets_for_comparison() into two functions:
      
      - agg_arg_charsets_for_comparison() - for pure comparison,
        when we don't need to return any string result and therefore
        don't need to convert arguments to @@character_set_connection:
          SELECT a = b;
      
      - agg_arg_charsets_for_string_results_with_comparison() - when
        we need to return a string result, but we also need to do
        comparison internally: SELECT REPLACE(a,b,c)
        If all arguments are numbers:
          SELECT REPLACE(123,2,3) -> 133
        we convert arguments to @@character_set_connection.
      
      
        @ mysql-test/include/ctype_numconv.inc
        @ mysql-test/r/ctype_binary.result
        @ mysql-test/r/ctype_cp1251.result
        @ mysql-test/r/ctype_latin1.result
        @ mysql-test/r/ctype_ucs.result
        @ mysql-test/r/ctype_utf8.result
        Adding tests
      
        @ sql/item.cc
        @ sql/item.h
        @ sql/item_func.cc
        @ sql/item_func.h
        @ sql/item_strfunc.cc
      
        Introducing and using new function
         agg_item_charsets_for_string_result_with_comparison() and
        its Item_func wrapper agg_arg_charsets_for_string_result_with_comparison().
      6d4d2158
    • Alexander Nozdrin's avatar
      A patch for Bug#12325375: THE SERVER ON WINXP DOES NOT ALLOW CONNECTIONS · 9303909a
      Alexander Nozdrin authored
      IF NO DNS-SERVER AVAILABLE.
      
      The thing is that on Windows XP getnameinfo() returns WSANO_DATA
      when hostname-lookup is not available. The problem was that
      this error code was treated as serious error and the client
      connection got rejected.
      
      The fix is to treat all errors from getnameinfo() as not ciritical,
      but add IP-address to the host cache only for EAI_NONAME (or WSANO_DATA).
      9303909a
    • Gleb Shchepa's avatar
      manual merge 5.1-->5.5 (bug 11829681) · 5ffab995
      Gleb Shchepa authored
      5ffab995
    • Gleb Shchepa's avatar
      Bug #11829681 - 60295: ERROR 1356 ON VIEW THAT EXECUTES FINE AS A QUERY · c64d72f3
      Gleb Shchepa authored
      Select from a view with the underlying HAVING clause failed with a
      message: "1356: View '...' references invalid table(s) or column(s)
      or function(s) or definer/invoker of view lack rights to use them"
      
      The bug is a regression of the fix for bug 11750328 - 40825 (similar
      case, but the HAVING cause references an aliased field).
      In the old fix for bug 40825 the Item_field::name_length value has
      been used in place of the real length of Item_field::name. However,
      in some cases Item_field::name_length is not in sync with the
      actual name length (TODO: combine name and name_length into a
      solid String field).
      
      The Item_ref::print() method has been modified to calculate actual
      name length every time.
      
      
      mysql-test/r/view.result:
        Test case for bug #11829681
      mysql-test/t/view.test:
        Test case for bug #11829681
      sql/item.cc:
        Bug #11829681 - 60295: ERROR 1356 ON VIEW THAT EXECUTES FINE AS A QUERY
        
        The Item_ref::print() method has been modified to calculate actual
        name length every time.
      sql/item.h:
        Minor commentary.
      c64d72f3
    • Nirbhay Choubey's avatar
      Adjusting test result for bug#11765157. · da19291f
      Nirbhay Choubey authored
      da19291f
    • Nirbhay Choubey's avatar
      c9e94027
    • Nirbhay Choubey's avatar
      Bug#11765157 - 58090: mysqlslap drops schema specified in · d31a394e
      Nirbhay Choubey authored
                     create_schema if auto-generate-sql also set.
      
      mysqlslap uses a schema to run its tests on and later
      drops it if auto-generate-sql is used. This can be a
      problem, if the schema is an already existing one.
      
      If create-schema is used with auto-generate-sql option,
      mysqlslap while performing the cleanup, drops the specified
      database.
      
      Fixed by introducing an option --no-drop, which, if used,
      will prevent the dropping of schema at the end of the test.
      
      
      client/client_priv.h:
        Bug#11765157 - 58090: mysqlslap drops schema specified in
                       create_schema if auto-generate-sql also set.
        
        Added an option.
      client/mysqlslap.c:
        Bug#11765157 - 58090: mysqlslap drops schema specified in
                       create_schema if auto-generate-sql also set.
        
        Introduced an option 'no-drop' to forbid the removal of schema
        even if 'create' or 'auto-generate-sql' options are used.
      mysql-test/r/mysqlslap.result:
        Added a testcase for Bug#11765157.
      mysql-test/t/mysqlslap.test:
        Added a testcase for Bug#11765157.
      d31a394e
  5. 07 Apr, 2011 8 commits
  6. 06 Apr, 2011 1 commit
  7. 05 Apr, 2011 4 commits
  8. 04 Apr, 2011 1 commit
    • Georgi Kodinov's avatar
      Bug #11758687: 50924: object names not resolved correctly · ad1dc78b
      Georgi Kodinov authored
         on lctn2 systems
      
      There was a local variable in get_all_tables() to store the 
      "original" value of the database name as it can get lowercased
      depending on the lower_case_table_name value.
      get_all_tables() iterates over database names and for each 
      database iterates over the tables in it.
      The "original" db name was assigned in the table names loop.
      Thus the first table is ok, but the second and subsequent tables
      get the lowercased name from processing the first table.
      Fixed by moving the assignment of the original database name
      from the inner (table name) to the outer (database name) loop.
      Test suite added.
      ad1dc78b