1. 21 Nov, 2008 7 commits
    • Ramil Kalimullin's avatar
      Auto-merge · 7f788ae2
      Ramil Kalimullin authored
      7f788ae2
    • Ramil Kalimullin's avatar
      Auto-merge · b08a6a61
      Ramil Kalimullin authored
      b08a6a61
    • Sergey Glukhov's avatar
      null merge · 52a97b4f
      Sergey Glukhov authored
      52a97b4f
    • Sergey Glukhov's avatar
      Bug#34760 Character set autodetection appears to fail · 20689fa1
      Sergey Glukhov authored
      the problem is the same as reported in bug#20835,
      so the fix is backport of bug#20835 patch.
      
      
      mysql-test/r/subselect.result:
        test result
      mysql-test/t/subselect.test:
        test case
      20689fa1
    • Vladislav Vaintroub's avatar
      1155f621
    • Ramil Kalimullin's avatar
      Fix for bug#36772: When using UTF8, CONVERT with GROUP BY · d16a9a68
      Ramil Kalimullin authored
      returns truncated results
      
      Problem: performig conversion from {INT, DECIMAL, REAL} to CHAR
      we incorrectly set its max length in some cases that may lead
      to truncated results returned.
      
      Fix: properly set CONVERT({INT, DECIMAL, REAL}, CHAR) result's
      max length.
      
      
      mysql-test/r/ctype_utf8.result:
        Fix for bug#36772: When using UTF8, CONVERT with GROUP BY
        returns truncated results
          - test result.
      mysql-test/t/ctype_utf8.test:
        Fix for bug#36772: When using UTF8, CONVERT with GROUP BY
        returns truncated results
          - test case.
      sql/item_timefunc.cc:
        Fix for bug#36772: When using UTF8, CONVERT with GROUP BY
        returns truncated results
          - calculating Item_char_typecast::max_length use initial
        argument's charset mbmaxlen instead of from_cs->mbmaxlen,
        as from_cs may differ in some case (see comment above).
      d16a9a68
    • Vladislav Vaintroub's avatar
      merge · efbdf260
      Vladislav Vaintroub authored
      efbdf260
  2. 20 Nov, 2008 6 commits
    • Chad MILLER's avatar
      Merge update for bug 39178 fix. · 88b62652
      Chad MILLER authored
      88b62652
    • Chad MILLER's avatar
      Update to change for bug 39178. Revert error-handling change, perhaps · d9ca5c1c
      Chad MILLER authored
      temporarily if yassl maintainer has plans for other error handling.
      d9ca5c1c
    • Ramil Kalimullin's avatar
      Fix for bug#40770: Server Crash when running with triggers including · 0ff8074f
      Ramil Kalimullin authored
      variable settings (rpl_sys)
      
      Problem: under certain conditions (e.g. user variables usage in triggers)
      accessing a user defined variable we may use a variables hash table that
      belongs to already deleted thread. It happens if
      thd= new THD;
      has the same address as just deleted thd as we use
      if (stored_thd == thd)
      to check.
      That may lead to unpredictable results, server crash etc.
      
      Fix: use thread_id instead of thd address to distinguish threads.
      
      Note: no simple and repeatable test case.
      
      
      sql/item_func.cc:
        Fix for bug#40770: Server Crash when running with triggers including
        variable settings (rpl_sys)
          - store and use thd->thread_id to distinguish threads instead of
        thread address as it may be the same as just deleted thread had, 
        i.e. we may get (old_thd == new_thd) after
        delete old_thd;
        new_thd= new THD;
          - set entry_thread_id only when we get a real entry, clear it 
        if the hash search fails.
      sql/item_func.h:
        Fix for bug#40770: Server Crash when running with triggers including
        variable settings (rpl_sys)
          - Item_func_set_user_var::entry_thread_id introduced.
      0ff8074f
    • Ramil Kalimullin's avatar
      Null-merge · f63a8a07
      Ramil Kalimullin authored
      f63a8a07
    • Ramil Kalimullin's avatar
      Fix for bug#40875: Memory leak in FEDERATED handler · 82ee1ccb
      Ramil Kalimullin authored
      Problem: memory leak occurs when we open a federated table
      that has its share in the hash.
      
      Fix: free not used memory.
      
      Note: the fix should NOT be merged to 5.1 (the code changed).
      
      
      sql/ha_federated.cc:
        Fix for bug#40875: Memory leak in FEDERATED handler
          - free memory (tmp_share.scheme) allocated in the parse_url()
        if it isn't used anymore.
      82ee1ccb
    • Staale Smedseng's avatar
      A fix for Bug#22891 "session level max_allowed_packet can be · cf365da5
      Staale Smedseng authored
      set but is ignored".
                                        
      This patch makes @@session.max_allowed_packed and
      @@session.net_buffer_length read-only as suggested in the bug
      report. The user will have to use SET GLOBAL (and reconnect)
      to alter the session values of these variables.
                                  
      The error string ER_VARIABLE_IS_READONLY is introduced.
                                  
      Tests are modified accordingly.
      
      
      sql/set_var.cc:
        The class sys_var_thd_ulong_session_readonly is introduced as
        a specialization of sys_var_thd_ulong implementing a read-only
        session variable. The class overrides check() and
        check_default() to achieve the read-only property for the
        session part of the variable.
      sql/set_var.h:
        The class sys_var_thd_ulong_session_readonly is introduced as
        a specialization of sys_var_thd_ulong implementing a read-only
        session variable. The class overrides check() and
        check_default() to achieve the read-only property for the
        session part of the variable.
      sql/share/errmsg.txt:
        New error ER_VARIABLE_IS_READONLY.
      cf365da5
  3. 19 Nov, 2008 5 commits
    • Vladislav Vaintroub's avatar
      Bug#39494 : key_buffer_size > 4GB does not work on 64 bit Windows · 50cc209e
      Vladislav Vaintroub authored
      Cache size  is truncated via 32bit ulong  in  ha_init_key_cache() and 
      ha_resize_key_cache() 
      
      This change fixes the cast to size_t instead of ulong. This cast is safe,
      because key_buffer_size parameter is limited to SIZE_T_MAX
      50cc209e
    • Alexey Botchkov's avatar
      Bug#38293 Libmysqld crash in mysql_library_init if language file missing · 29107ccc
      Alexey Botchkov authored
         additional fix - the 'debug' keyword removed
      29107ccc
    • Alexey Botchkov's avatar
      merging · cafec00d
      Alexey Botchkov authored
      cafec00d
    • Alexey Botchkov's avatar
      Bug#38293 Libmysqld crash in mysql_library_init if language file missing · 33774bdd
      Alexey Botchkov authored
          That's a Win-specific error.
          When we create libmysqld.dll we have many libraries like mysys, dbug,
          strings, etc linked into that dll, so the application built upon
          this library shouldn't link these libraries to itself, rather use
          those inside the dll.
      
          Fixed by redirecting calls into the libmysqld.dll
      
      per-file comments:
        dbug/dbug.c
      Bug#38293 Libmysqld crash in mysql_library_init if language file missing
          fake _db_something definitions added
      
        include/my_dbug.h
      Bug#38293 Libmysqld crash in mysql_library_init if language file missing
        fake _db_something declarations added
      
        libmysqld/examples/CMakeLists.txt
      Bug#38293 Libmysqld crash in mysql_library_init if language file missing
          superfluous libraries removed from linking
      
        libmysqld/libmysqld.def
      Bug#38293 Libmysqld crash in mysql_library_init if language file missing
          set of mysys functions added to the export section
      33774bdd
    • Alexey Botchkov's avatar
      merging · b2101137
      Alexey Botchkov authored
      b2101137
  4. 18 Nov, 2008 7 commits
  5. 17 Nov, 2008 5 commits
    • Alexey Botchkov's avatar
      Bug#34517 SHOW GLOBAL STATUS does not work properly in embedded server. · 8313561a
      Alexey Botchkov authored
            GLOBAL STATUS is calculated by studying the list of threads. In the
              embedded server threads were not linked to the internal list, so the
              calculation always returns 0. Fixed by 'linking' the embedded-server
              threads to the same list
      
      per-file comments:
        libmysqld/lib_sql.cc
      Bug#34517 SHOW GLOBAL STATUS does not work properly in embedded server.
          Add newly created 'threads' to the internal thread list.
          Remove them from the list as they're freed.
      
        mysql-test/r/information_schema.result
      Bug#34517 SHOW GLOBAL STATUS does not work properly in embedded server.
          test result
      
        mysql-test/t/information_schema.test
      Bug#34517 SHOW GLOBAL STATUS does not work properly in embedded server.
          test case added
      8313561a
    • Alexey Botchkov's avatar
      merging · 57e3bd3e
      Alexey Botchkov authored
      57e3bd3e
    • Alexey Botchkov's avatar
      Bug#31616 div_precision_increment description looks wrong · 4b03b2c5
      Alexey Botchkov authored
      Item_func_div didn't calculate the precision of the result properly.
        The result of 5/0.0001 is 5000 so we have to add decimals of the divisor
        to the planned precision.
      
      per-file comments:
        mysql-test/r/type_newdecimal.result
      Bug#31616 div_precision_increment description looks wrong
          test result fixed
      
        mysql-test/t/type_newdecimal.test
      Bug#31616 div_precision_increment description looks wrong
          test case
      
        sql/item_func.cc
      Bug#31616 div_precision_increment description looks wrong
          precision must be increased with args[1]->decimals parameter
      4b03b2c5
    • Kristofer Pettersson's avatar
      Automerge · b24886f8
      Kristofer Pettersson authored
      b24886f8
    • Kristofer Pettersson's avatar
      Bug#40778 thd_security_context has bad architecture; allocates on unprotected memroot · 0fba20ce
      Kristofer Pettersson authored
                        
      The function thd_security_context allocates memory on an unprotected MEM_ROOT if the
      message length becomes longer than requested and the initial buffer memory needs to
      be reallocated.
                        
      This patch fixes the design error by copying parts of the reallocated buffer 
      to the destination buffer. This works because the destination buffer isn't
      owned by the String object and thus isn't freed when a new buffer is allocated.
      Any new memory allocated by the String object is reclaimed when the object
      is destroyed at the end of the function call.
      0fba20ce
  6. 14 Nov, 2008 8 commits
    • Mattias Jonsson's avatar
      merge · c7891ea3
      Mattias Jonsson authored
      c7891ea3
    • Mattias Jonsson's avatar
      Bug#40595: Non-matching rows not released with READ-COMMITTED on tables · e68be532
      Mattias Jonsson authored
      with partitions
      
      Pre push fix, optimized replace_regex, to cut 2 seconds
      from test time.
      e68be532
    • Gleb Shchepa's avatar
      manual merge 5.0-bugteam --> 5.1-bugteam (bug 40021) · accbf3b2
      Gleb Shchepa authored
      sql_view.cc: required_view_parameters has been decreased by 2 
      (not by 1) because its value was incorrect: 16 instead of 15
      (minor performance issue).
      
      
      sql/sql_view.cc:
        sql_view.cc: required_view_parameters has been decreased by 2 
        (not by 1) because its value was incorrect: 16 instead of 15
        (minor performance issue).
      accbf3b2
    • Gleb Shchepa's avatar
      Bug #40021: Renaming view fails, archived .frm for view is · 8c9e7a64
      Gleb Shchepa authored
                  missing after downgrade
      
      Obsolete arc/ directory and view .frm file backup support
      has been removed by the patch for bug 17823. However, that
      bugfix caused a problem with "live downgrades" of the
      server: if we rename some view 4 times under 5.1.29/5.0.72
      and then try to rename it under 5.1.28/5.0.70 on the same
      database, the server fails with a error:
      
        query 'RENAME TABLE ... TO ...' failed: 6: Error on
        delete of '....frm-0001' (Errcode: 2)
      
      Also .frm file of that view may be lost (renamed to .frm~).
      
      The server failed because it tried to rename latest 3
      backup .frm files renaming the view: the server used an
      integer value of the "revision" field of .frm file to
      extract those file names. After the fix for bug 17823 those
      files were not created/maintained any more, however the
      "revision" field was incremented as usual. So, the server
      failed renaming non existent files.
      
      This fix solves the problem by removing the support for
      "revision" .frm file field:
      1. New server silently ignores existent "revision" fields
         in old .frm files and never write it down;
      2. Old server assumes, that missing "revision" field in new
         .frm files means default value of 0.
      3. Accordingly to the fix for bug 17823 the new server
         drops arc/ directory on alter/rename view, so after
         "live downgrade" old server begins maintenance of the
         arc/ directory from scratch without conflicts with .frm
         files.
      
      
      sql/parse_file.cc:
        Bug #40021: Renaming view fails, archived .frm for view is
                    missing after downgrade
        
        1. static write_parameter(): the old_version parameter
           and the section for FILE_OPTIONS_REV have been re moved.
        2. write_parameter(): the max_versions parameter has been
           removed;
        3. sql_create_definition_file(): removal of dead code;
        4. rename_in_schema_file(): revision and num_view_backups
           parameters and dead code have been removed;
        5. File_parser::parse(): FILE_OPTIONS_REV section has been
           removed.
      sql/parse_file.h:
        Bug #40021: Renaming view fails, archived .frm for view is
                    missing after downgrade
        
        1. The FILE_OPTIONS_REV constant has been removed.
        2. sql_create_definition_file and rename_in_schema_file
           functions: obsolete versions, revision and
           num_view_backups parameters have been removed.
      sql/sql_db.cc:
        Bug #40021: Renaming view fails, archived .frm for view is
                    missing after downgrade
        
        Commentary update.
      sql/sql_trigger.cc:
        Bug #40021: Renaming view fails, archived .frm for view is
                    missing after downgrade
        
        sql_create_definition_file() calls have been updates to
        new parameter lists.
      sql/sql_view.cc:
        Bug #40021: Renaming view fails, archived .frm for view is
                    missing after downgrade
        
        1. The mysql_create_view function code is used for both
           CREATE VIEW and ALTER queries, but query cache is
           necessary for ALTER command only. Check for a non first
           view revision has been replaced with a direct check for
           ALTER query.
        2. The num_view_backups global constant has been removed.
        3. view_parameters: the "revision" .frm field support has
           been removed.
        4. sql_create_definition_file and rename_in_schema_file
           function calls have been updates to new parameter lists.
      sql/table.h:
        Bug #40021: Renaming view fails, archived .frm for view is
                    missing after downgrade
        
        TABLE_LIST: the revision field has been removed.
      8c9e7a64
    • Ramil Kalimullin's avatar
      Auto-merge · 114c160d
      Ramil Kalimullin authored
      114c160d
    • Tatiana A. Nurnberg's avatar
      auto-merge · f6feb912
      Tatiana A. Nurnberg authored
      f6feb912
    • Ramil Kalimullin's avatar
      Test case for bug #34774: key prefix on text field in federated · 914edc42
      Ramil Kalimullin authored
      tables can cause server to crash!
      
      The bug will be fixed by patch for #34779: "crash in checksum table
      on federated tables with blobs containing nulls"
      
      Only a test case commited.
      
      
      mysql-test/r/federated.result:
        Test case for bug #34774: key prefix on text field in federated 
        tables can cause server to crash!
          - test result.
      mysql-test/t/federated.test:
        Test case for bug #34774: key prefix on text field in federated 
        tables can cause server to crash!
          - test case.
      914edc42
    • Ramil Kalimullin's avatar
      Fix for bug#37527: mysqlcheck fails to report entire database · 6558e18b
      Ramil Kalimullin authored
      when InnoDB frm file corruption
      
      Problem: mysqlcheck runs 'SHOW FULL TABLE' queries to get table lists.
      The query may fail for some reasons (e.g. null .frm file) then
      mysqlcheck doesn't process the database tables.
      
      Fix: try to run 'SHOW TABLES' if 'SHOW FULL TABLES' failed.
      
      
      client/mysqlcheck.c:
        Fix for bug#37527: mysqlcheck fails to report entire database 
        when InnoDB frm file corruption
          - run "SHOW TABLES" query if "SHOW /*!50002 FULL*/ TABLES" failed;
          - print error info if both failed.
      mysql-test/r/mysqlcheck.result:
        Fix for bug#37527: mysqlcheck fails to report entire database 
        when InnoDB frm file corruption
          - test result.
      mysql-test/t/mysqlcheck.test:
        Fix for bug#37527: mysqlcheck fails to report entire database 
        when InnoDB frm file corruption
          - test case.
      6558e18b
  7. 13 Nov, 2008 2 commits