1. 04 Nov, 2010 1 commit
    • Mats Kindahl's avatar
      BUG#57108: mysqld crashes when I attempt to install plugin · e8cbcf15
      Mats Kindahl authored
      If a relative path is supplied to option --defaults-file or
      --defaults-extra-file, the server will crash when executing
      an INSTALL PLUGIN command. The reason is that the defaults
      file is initially read relative the current working directory
      when the server is started, but when INSTALL PLUGIN is executed,
      the server has changed working directory to the data directory.
      Since there is no check that the call to my_load_defaults()
      inside mysql_install_plugin(), the subsequence call to
      free_defaults() will crash the server.
      
      This patch fixes the problem by:
      
      - Prepending the current working directory to the file name when
        a relative path is given to the --defaults-file or --defaults-
        extra-file option the first time my_load_defaults() is called,
        which is just after the server has started in main().
      
      - Adding a check of the return value of my_load_defaults() inside
        mysql_install_plugin() and aborting command (with an error) if
        an error is returned.
      
      - It also adds a check of the return value for load_defaults in
        lib_sql.cc for the embedded server since that was missing.
      
      To test that the relative files for the options --defaults-file and
      --defaults-extra-file is handled properly, mysql-test-run.pl is also
      changed to not add a --defaults-file option if one is provided in the
      tests *.opt file.
      e8cbcf15
  2. 02 Sep, 2010 1 commit
    • Alexey Botchkov's avatar
      Bug#53251 mysql_library_init fails on second execution with embedded library · d5330f34
      Alexey Botchkov authored
                thread-specific variables weren't set when we load error message files.
      
      per-file comments:
        libmysqld/lib_sql.cc
      Bug#53251      mysql_library_init fails on second execution with embedded library
            we need to call my_thread_init() once more. Normally it's called at the my_init()
            stage but that doesn't happen on the second my_init() call.
      
        sql/derror.cc
      Bug#53251      mysql_library_init fails on second execution with embedded library
           use default errors for the embedded server.
      
        sql/mysqld.cc
      Bug#53251      mysql_library_init fails on second execution with embedded library
              unregister server errors in clean_up(). Without it the error list contains
              that on the second mysql_server_init() which is not good.
      
        sql/set_var.cc
      Bug#53251      mysql_library_init fails on second execution with embedded library
              sys_var::cleanup() call instead of the destructor
      
        sql/set_var.h
      Bug#53251      mysql_library_init fails on second execution with embedded library
              sys_var::cleanup() introduced instead of the destructor
              
        sql/sys_vars.h
      Bug#53251      mysql_library_init fails on second execution with embedded library
              Sys_var_charptr::cleanup() implemented
      d5330f34
  3. 09 Aug, 2010 1 commit
  4. 15 Jul, 2010 1 commit
  5. 08 Jul, 2010 1 commit
    • Davi Arnaut's avatar
      Bug#34043: Server loops excessively in _checkchunk() when safemalloc is enabled · 3143a4dc
      Davi Arnaut authored
      Essentially, the problem is that safemalloc is excruciatingly
      slow as it checks all allocated blocks for overrun at each
      memory management primitive, yielding a almost exponential
      slowdown for the memory management functions (malloc, realloc,
      free). The overrun check basically consists of verifying some
      bytes of a block for certain magic keys, which catches some
      simple forms of overrun. Another minor problem is violation
      of aliasing rules and that its own internal list of blocks
      is prone to corruption.
      
      Another issue with safemalloc is rather the maintenance cost
      as the tool has a significant impact on the server code.
      Given the magnitude of memory debuggers available nowadays,
      especially those that are provided with the platform malloc
      implementation, maintenance of a in-house and largely obsolete
      memory debugger becomes a burden that is not worth the effort
      due to its slowness and lack of support for detecting more
      common forms of heap corruption.
      
      Since there are third-party tools that can provide the same
      functionality at a lower or comparable performance cost, the
      solution is to simply remove safemalloc. Third-party tools
      can provide the same functionality at a lower or comparable
      performance cost. 
      
      The removal of safemalloc also allows a simplification of the
      malloc wrappers, removing quite a bit of kludge: redefinition
      of my_malloc, my_free and the removal of the unused second
      argument of my_free. Since free() always check whether the
      supplied pointer is null, redudant checks are also removed.
      
      Also, this patch adds unit testing for my_malloc and moves
      my_realloc implementation into the same file as the other
      memory allocation primitives.
      
      client/mysqldump.c:
        Pass my_free directly as its signature is compatible with the
        callback type -- which wasn't the case for free_table_ent.
      3143a4dc
  6. 10 Jun, 2010 1 commit
  7. 02 Jun, 2010 1 commit
    • Alexander Barkov's avatar
      Bug#52520 Difference in tinytext utf column metadata · 1dfcb49a
      Alexander Barkov authored
            Problems:
            - regression (compating to version 5.1) in metadata for BLOB types
            - inconsistency between length metadata in server and embedded for BLOB types
            - wrong max_length calculation in items derived from BLOB columns
           @ libmysqld/lib_sql.cc
              Calculating length metadata in embedded similary to server version,
              using new function char_to_byte_length_safe().
           @ mysql-test/r/ctype_utf16.result
              Adding tests
           @ mysql-test/r/ctype_utf32.result
              Adding tests
           @ mysql-test/r/ctype_utf8.result
              Adding tests
           @ mysql-test/r/ctype_utf8mb4.result
              Adding tests
           @ mysql-test/t/ctype_utf16.test
              Adding tests
           @ mysql-test/t/ctype_utf32.test
              Adding tests
           @ mysql-test/t/ctype_utf8.test
              Adding tests
           @ mysql-test/t/ctype_utf8mb4.test
              Adding tests
           @ sql/field.cc
              Overriding char_length() for Field_blob:
              unlike in generic Item::char_length() we don't
              divide to mbmaxlen for BLOBs.
           @ sql/field.h
              - Making Field::char_length() virtual
              - Adding prototype for Field_blob::char_length()
           @ sql/item.h
              - Adding new helper function char_to_byte_length_safe()
              - Using new function
           @ sql/protocol.cc
              Using new function char_to_byte_length_safe().
      
          modified:
            libmysqld/lib_sql.cc
            mysql-test/r/ctype_utf16.result
            mysql-test/r/ctype_utf32.result
            mysql-test/r/ctype_utf8.result
            mysql-test/r/ctype_utf8mb4.result
            mysql-test/t/ctype_utf16.test
            mysql-test/t/ctype_utf32.test
            mysql-test/t/ctype_utf8.test
            mysql-test/t/ctype_utf8mb4.test
            sql/field.cc
            sql/field.h
            sql/item.h
            sql/protocol.cc
      1dfcb49a
  8. 13 Apr, 2010 1 commit
    • Konstantin Osipov's avatar
      Backport of: · 64c937b7
      Konstantin Osipov authored
      ChangeSet@1.2703, 2007-12-07 09:35:28-05:00, cmiller@zippy.cornsilk.net +40 -0
      Bug#13174: SHA2 function
      Patch contributed from Bill Karwin, paper unnumbered CLA in Seattle
      
      Implement SHA2 functions.
      
      Chad added code to make it work with YaSSL.  Also, he removed the 
      (probable) bug of embedded server never using SSL-dependent 
      functions.  (libmysqld/Makefile.am didn't read ANY autoconf defs.)
      
      Function specification:
        SHA2( string cleartext, integer hash_length ) 
          -> string hash, or NULL
      where hash_length is one of 224, 256, 384, or 512.  If either is 
      NULL or a length is unsupported, then the result is NULL.  The 
      resulting string is always the length of the hash_length parameter
      or is NULL.
      
      Include the canonical hash examples from the NIST in the test
      results.
      ---
      Polish and address concerns of reviewers.
      
      
      .bzrignore:
        Added libmysqld/sha2.cc to the ignore list.
      client/mysql.cc:
        Add condition to remove code for embedded server.
      client/mysqltest.cc:
        Add condition to remove code for embedded server.
      include/Makefile.am:
        New header file to header list.
      include/mysql_embed.h:
        Embedded servers can use SSL-library functions too!
      include/sha2.h:
        Compatibility layer to make YaSSL behave like OpenSSL.
      include/sslopt-case.h:
        Remove SSL-communication parameters from command lines.
      include/sslopt-longopts.h:
        Remove SSL-communication parameters from command lines.
      include/sslopt-vars.h:
        Don't declare variables that are only used in SSL communication, if
        we are compiling the embedded server.
      include/violite.h:
        Don't even compile the SSL-communication function if we're in the
        embedded server.
        ---
        Remove CPP condition indentation.
      libmysqld/CMakeLists.txt:
        Add new file to source list.
      libmysqld/Makefile.am:
        Include standard DEFS in embedded compilation.  It's an undiscovered
        but that it's not there.
        
        Add new file to source list.
      libmysqld/examples/Makefile.am:
        Include autoconf DEFS.
      libmysqld/lib_sql.cc:
        Initialize SSL-related variables in embedded server.
      mysql-test/include/have_ssl_crypto_functs.inc:
        Distinguish between communication and crypto.
        Use the tristate value of "have_ssl" variable to know whether to
        test or not for SSL-provided crypto functions.
      mysql-test/r/func_digest.result:
        
        Test against the sample test vectors in the NIST Secure
        Hash Standard (http://csrc.nist.gov/cryptval/shs.htm)
      mysql-test/r/func_encrypt_nossl.result:
        Update results to the new error message text.
      mysql-test/r/have_ssl_is_yes_or_disabled_only.require:
        Distinguish between communication and crypto.
        
        Use the tristate value of "have_ssl" variable to know whether to
        test or not for SSL-provided crypto functions.
      mysql-test/suite/rpl/t/rpl_ssl.test:
        Distinguish between communication and crypto.
      mysql-test/suite/rpl/t/rpl_ssl1.test:
        Distinguish between communication and crypto.
      mysql-test/t/func_des_encrypt.test:
        Distinguish between communication and crypto.
      mysql-test/t/func_digest.test:
        Test against the sample test vectors in the NIST Secure
        Hash Standard (http://csrc.nist.gov/cryptval/shs.htm)
        
        Also, test that various parameters (legal and illegal)
        do what we expect.
        ---
        Distinguish between communication and crypto.
      mysql-test/t/func_encrypt.test:
        Distinguish between communication and crypto.
      mysql-test/t/openssl_1.test:
        Don't test SSL communication if we're in the embedded server.
        ---
        Distinguish between communication and crypto.
      mysql-test/t/ssl-big.test:
        Don't test SSL communication if we're in the embedded server.
        ---
        Distinguish between communication and crypto.
      mysql-test/t/ssl.test:
        Don't test SSL communication if we're in the embedded server.
        ---
        Distinguish between communication and crypto.
      mysql-test/t/ssl_8k_key.test:
        Don't test SSL communication if we're in the embedded server.
        ---
        Distinguish between communication and crypto.
      mysql-test/t/ssl_compress.test:
        Don't test SSL communication if we're in the embedded server.
        ---
        Distinguish between communication and crypto.
      mysql-test/t/ssl_connect.test:
        Don't test SSL communication if we're in the embedded server.
        ---
        Distinguish between communication and crypto.
      sql-common/client.c:
        SSL is useful for more functionality than just connecting.  Test
        for whether we are not embedded server also.
      sql/CMakeLists.txt:
        Add new source file to source list so that we have access to SHA2
        functions.
      sql/Makefile.am:
        Add new source file to source list so that we have access to SHA2
        functions.
      sql/item_create.cc:
        Bootstrap the SHA2 function into the server.
      sql/item_strfunc.cc:
        Add new SHA2 Item class methods.
        
        Clean up two minor problems.
        ---
        Remove extraneous debugging.
        ---
        We must check nullness of a parameter only /after/ computing its
        value.
      sql/item_strfunc.h:
        Declare new SHA2 Item class.
      sql/mysqld.cc:
        For embedded server, don't refer to SSL-communications variables
        or values.
        ---
        Remove CPP condition indentation.
      sql/sha2.cc:
        Compatibility layer to make YaSSL behave like OpenSSL.
        ---
        Add comment for generated functions.
      sql/sql_acl.cc:
        For embedded server, don't refer to SSL-communications variables
        or values.
      sql/sql_connect.cc:
        SSL is useful for more functionality than just connecting.  Test
        for whether we are not embedded server also.
      sql/sys_vars.cc:
        For embedded server, don't refer to SSL-communications variables
        or values.
      64c937b7
  9. 23 Feb, 2010 1 commit
  10. 11 Feb, 2010 1 commit
    • Alexander Barkov's avatar
      A post-fix for WL#2649 Number-to-string conversion · 2545a634
      Alexander Barkov authored
      Fixing problems discovered by "mtr --embedded" and "mtr --ps"
      
      
        @ libmysqld/lib_sql.cc
         "mtr --embedded --do-test=ps" failed.
         Applying a similar change to the one previously done in protocol.cc,
         to make embedded version work the same with client/server version.
         (a bug in the WL#2649 patch)
      
        @ 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
      
        - Changing tinyint(30) to tinyint(4)
          due to problems with "mtr --ps"
          Possibly a bug in libmysql.cc, in function fetch_long_with_conversion().
          Zerofill buffer is to short.
      
        - Commenting tests with get_lock/release_lock
          "mtr --ps" failed for some reasons in ctype_cp1251.
      2545a634
  11. 07 Jan, 2010 1 commit
  12. 22 Dec, 2009 1 commit
    • Sergei Golubchik's avatar
      WL#4738 streamline/simplify @@variable creation process · 6f262201
      Sergei Golubchik authored
      Bug#16565 mysqld --help --verbose does not order variablesBug#20413 sql_slave_skip_counter is not shown in show variables
      Bug#20415 Output of mysqld --help --verbose is incomplete
      Bug#25430 variable not found in SELECT @@global.ft_max_word_len;
      Bug#32902 plugin variables don't know their names
      Bug#34599 MySQLD Option and Variable Reference need to be consistent in formatting!
      Bug#34829 No default value for variable and setting default does not raise error
      Bug#34834 ? Is accepted as a valid sql mode
      Bug#34878 Few variables have default value according to documentation but error occurs  
      Bug#34883 ft_boolean_syntax cant be assigned from user variable to global var.
      Bug#37187 `INFORMATION_SCHEMA`.`GLOBAL_VARIABLES`: inconsistent status
      Bug#40988 log_output_basic.test succeeded though syntactically false.
      Bug#41010 enum-style command-line options are not honoured (maria.maria-recover fails)
      Bug#42103 Setting key_buffer_size to a negative value may lead to very large allocations 
      Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled
      Bug#44797 plugins w/o command-line options have no disabling option in --help
      Bug#46314 string system variables don't support expressions
      Bug#46470 sys_vars.max_binlog_cache_size_basic_32 is broken
      Bug#46586 When using the plugin interface the type "set" for options caused a crash.
      Bug#47212 Crash in DBUG_PRINT in mysqltest.cc when trying to print octal number
      Bug#48758 mysqltest crashes on sys_vars.collation_server_basic in gcov builds
      Bug#49417 some complaints about mysqld --help --verbose output
      Bug#49540 DEFAULT value of binlog_format isn't the default value
      Bug#49640 ambiguous option '--skip-skip-myisam' (double skip prefix)
      Bug#49644 init_connect and \0
      Bug#49645 init_slave and multi-byte characters
      Bug#49646 mysql --show-warnings crashes when server dies
      
      
      CMakeLists.txt:
        Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled
      client/mysql.cc:
        don't crash with --show-warnings when mysqld dies
      config/ac-macros/plugins.m4:
        Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled
      include/my_getopt.h:
        comments
      include/my_pthread.h:
        fix double #define
      mysql-test/mysql-test-run.pl:
        run sys_vars suite by default
        properly recognize envirinment variables (e.g. MTR_MAX_SAVE_CORE) set to 0
        escape gdb command line arguments
      mysql-test/suite/sys_vars/r/rpl_init_slave_func.result:
        init_slave+utf8 bug
      mysql-test/suite/sys_vars/t/rpl_init_slave_func.test:
        init_slave+utf8 bug
      mysys/my_getopt.c:
        Bug#34599 MySQLD Option and Variable Reference need to be consistent in formatting!
        Bug#46586 When using the plugin interface the type "set" for options caused a crash.
        Bug#49640 ambiguous option '--skip-skip-myisam' (double skip prefix)
      mysys/typelib.c:
        support for flagset
      sql/ha_ndbcluster.cc:
        backport from telco tree
      sql/item_func.cc:
        Bug#49644 init_connect and \0
        Bug#49645 init_slave and multi-byte characters
      sql/sql_builtin.cc.in:
        Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled
      sql/sql_plugin.cc:
        Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled
        Bug#32902 plugin variables don't know their names
        Bug#44797 plugins w/o command-line options have no disabling option in --help
      sql/sys_vars.cc:
        all server variables are defined here
      storage/myisam/ft_parser.c:
        remove unnecessary updates of param->quot
      storage/myisam/ha_myisam.cc:
        myisam_* variables belong here
      strings/my_vsnprintf.c:
        %o and %llx
      unittest/mysys/my_vsnprintf-t.c:
        %o and %llx tests
      vio/viosocket.c:
        bugfix: fix @@wait_timeout to work with socket timeouts (vs. alarm thread)
      6f262201
  13. 17 Dec, 2009 1 commit
    • Davi Arnaut's avatar
      Bug#48983: Bad strmake calls (length one too long) · c2fb2a9a
      Davi Arnaut authored
      The problem is a somewhat common misusage of the strmake function.
      The strmake(dst, src, len) function writes at most /len/ bytes to
      the string pointed to by src, not including the trailing null byte.
      Hence, if /len/ is the exact length of the destination buffer, a
      one byte buffer overflow can occur if the length of the source
      string is equal to or greater than /len/.
      
      client/mysqldump.c:
        Make room for the trailing null byte.
      libmysql/libmysql.c:
        Add comment, there is enough room in the buffer.
        Increase buffer length, two strings are concatenated.
      libmysqld/lib_sql.cc:
        Make room for the trailing null byte.
      mysys/default.c:
        Make room for the trailing null bytes.
      mysys/mf_pack.c:
        Make room for the trailing null byte.
      server-tools/instance-manager/commands.cc:
        Copy only if overflow isn't possible in both cases.
      server-tools/instance-manager/listener.cc:
        Make room for the trailing null byte.
      sql/log.cc:
        Make room for the trailing null byte.
      sql/sp_pcontext.h:
        Cosmetic fix.
      sql/sql_acl.cc:
        MAX_HOSTNAME already specifies space for the trailing null byte.
      sql/sql_parse.cc:
        Make room for the trailing null byte.
      sql/sql_table.cc:
        Make room for the trailing null byte.
      c2fb2a9a
  14. 20 Nov, 2009 1 commit
    • Mattias Jonsson's avatar
      Bug#32115: Bad use of Name_resolution_context from current LEX in partitioning · 8f98e13f
      Mattias Jonsson authored
      port from mysql-next (5.4?) to mysql-next-mr-bugfixes (5.5/5.6?)
      
      3477 Mikael Ronstrom	2009-07-29
      Bug#32115, made use of local lex object to avoid side effects of opening partitioned
      tables
      
      3478 Mikael Ronstrom	2009-07-29
      Bug#32115, added an extra test in debug builds to ensure no dangling pointers to the
      old lex object is still around
      
      3479 Mikael Ronstrom	2009-07-29
      Bug#32115, Removed an assert that was no longer needed
      
      3480 Mikael Ronstrom	2009-08-05
      Bug#32115, fixed review comments
      
      3481 Mikael Ronstrom	2009-08-07
      Bug#32115, remove now obsolete lex_start calls
      8f98e13f
  15. 10 Nov, 2009 1 commit
    • Davi Arnaut's avatar
      Backport of Bug#47304 to mysql-next-mr · 3b880c0e
      Davi Arnaut authored
      ------------------------------------------------------------
      revno: 3624
      revision-id: jon.hauglid@sun.com-20090928163426-2lg1gofzz44xzzxf
      parent: alik@sun.com-20090928050057-r0a62x9czr01q7oe
      committer: Jon Olav Hauglid <jon.hauglid@sun.com>
      branch nick: mysql-6.0-codebase-bugfixing-bug47304
      timestamp: Mon 2009-09-28 18:34:26 +0200
      message:
        Bug #47304 Test main.mdl_sync fails on embedded server
      
        The problem was that SHOW PROCESSLIST was trying to access
        a thread that was not properly running and therefore had an 
        uninitialized mutex.
      
        This patch explicitly resets thd->mysys_var after each embedded
        server command to prevent the mutex from being accessed in an
        illegal state.
      
        The patch also re-enables lock_multi.test and mdl_sync.test for 
        embedded server as they had been disabled because of this bug.
      3b880c0e
  16. 09 Nov, 2009 1 commit
    • Vladislav Vaintroub's avatar
      WL#5161 : Cross-platform build with CMake · 697a2e17
      Vladislav Vaintroub authored
      BUILD-CMAKE:
        WL#5161 : Documentation on how to build with CMake on Unix/Windows
      BUILD/Makefile.am:
        Add new file
      BUILD/autorun.sh:
        WL#5161 : use choose_configure instead of autotools configure script
        (choose configure will call cmake if cmake is available)
      BUILD/choose_configure.sh:
        WL#5161 : use choose_configure instead of autotools configure script
        (choose configure will call cmake if cmake is available)
      CMakeLists.txt:
        WL#5161 : Rewrite top-level CMakeLists.txt. 
        Remove  Windows specifics
        - compiler flags handling moved to configure.cmake
        - storage engine/plugin stuff moved into cmake/plugin.cmake
        - copy docs
      Makefile.am:
        Added new files
      client/CMakeLists.txt:
        WL#5161 : Rewrite CMakeLists.txt to be platform-independent
        Handle packagng (add INSTALL commands)
      cmake/Makefile.am:
        WL#5161 : use choose_configure instead of autotools configure script
        (choose configure will call cmake if cmake is available)
      cmake/abi_check.cmake:
        Custom targets for abi_check (for cmake)
      cmake/bison.cmake:
        - Check bison availability
        - Add RUN_BISON macro (used to create sql_yacc.cc and sql_yacc.h)
      cmake/cat.cmake:
        Add helper script to concatenate files.
      cmake/character_sets.cmake:
        Handle configuration parameters WITH_EXTRA_CHARSETS
      cmake/check_minimal_version.cmake:
        Helper script to check the minimum required version of cmake
      cmake/configure.pl:
        Add perl script to convert ./configure parameters for cmake
      cmake/create_initial_db.cmake.in:
        Add script helper to create initial database. 
        (on Windows, we pack initial db with the redistribution
        package)
      cmake/do_abi_check.cmake:
        Perform abi check
      cmake/dtrace.cmake:
        Handle dtrace in CMake Build.
        Check for dtrace availablility,
        run dtrace -G on solaris in prelink step
      cmake/dtrace_prelink.cmake:
        Run dtrace -G on Solaris in pre-link step,
        link the object it creates together with library or
        executable
      cmake/install_macros.cmake:
        Helper macros for packaging
        (install pdb on Windows, install symlinks on Unix)
      cmake/make_dist.cmake.in:
        "make dist" - 
        - pack autotools ./configure script with the source
        (renamed to configure.am)
        - pack bison output
      cmake/merge_archives_unix.cmake.in:
        script to merge static libraries on Unix
      cmake/misc.cmake:
        Build helper macros
        - MERGE_STATIC_LIBS 
        We use it when building client library and embedded
        (avoid recompilation)
        
        - Convert source file paths to absolute names.
        We use it in  to locate files of a different project,
        when the files need to be recompiled (e.g in embedded
        several storage engines are recompiled with 
        -DEMBEDDED_LIBRARY)
      cmake/mysql_version.cmake:
        Extract version info from configure.in
        Handle package names.
      cmake/plugin.cmake:
        Rewrote storage/mysql_storage_engine.cmake to handle 
        other types of plugins and do it in OS-independent manner.
      cmake/readline.cmake:
        Macros to handle WITH_READLINE/WITH_LIBEDIT parameters
      cmake/ssl.cmake:
        Add macros to handle WITH_SSL parameter.
      cmake/stack_direction.c:
        Helper to check stack direction.
      cmake/zlib.cmake:
        Add macros to handle WITH_ZLIB parameter
      cmd-line-utils/libedit/CMakeLists.txt:
        Build libedit with cmake.
      cmd-line-utils/libedit/Makefile.am:
        Add new file
      cmd-line-utils/readline/CMakeLists.txt:
        Build readline with CMake.
      cmd-line-utils/readline/Makefile.am:
        Add new file
      config.h.cmake:
        WL#5161 : Add config.h template for cmake
      configure.cmake:
        WL#5161 : Add platform tests ( for cmake)
      configure.in:
        Added new subdirectories
      dbug/CMakeLists.txt:
        WL#5161
      extra/CMakeLists.txt:
        WL#5161
      extra/yassl/CMakeLists.txt:
        WL#5161
      extra/yassl/taocrypt/CMakeLists.txt:
        WL#5161
      include/Makefile.am:
        Add new file
      include/keycache.h:
        remove configure-win.h and remove HUGE_PTR defined there.
      include/my_global.h:
        use my_config.h for Windows, not config-win.h anymore
      include/my_pthread.h:
        - Move thread_safe_increment from config-win.h to other headers
        (config-win.h is not used anymore)
        - Declare pthread_cancel on Windows (it is used in daemon_example)
      include/my_sys.h:
        Add malloc.h on Windows (we use -D_WIN32_LEAN_AND_MEAN now, and 
        with this define malloc.h is not included automatically via windows.h)
      include/mysql/plugin.h:
        Handle pure-C plugins with Microsoft compiler.
      include/thr_alarm.h:
        remove rf_SetTimer that used to be defined in config-win.h
        Replace with UINT_PTR (we do not use config-win.h anymore
        and typedef was needed in this single place only)
      libmysql/CMakeLists.txt:
        Avoid pointless recompilation of source files 
        in client library if possible. Merge static 
        libs (dbug, mysys) to create static client 
        library.
      libmysqld/CMakeLists.txt:
        Avoid pointless recompilation of source files 
        when building embedded. Instead, merge dbug and 
        mysys (and some other static libs) into embedded.
      libmysqld/examples/CMakeLists.txt:
        Embedded compilation on Unix
      libmysqld/lib_sql.cc:
        Do not define THD::clear_error() in lib_sql.cc
        for embedded. Instead, use the same inline 
        definition from sql_class.h as in none-embedded 
        case (fixes duplicate symbol errors on Windows
        and removes pointless #ifdef EMBEDDED)
      man/CMakeLists.txt:
        Install man files.
      man/Makefile.am:
        Add new file.
      mysql-test/CMakeLists.txt:
        Install mysql-test files
      mysql-test/Makefile.am:
        Add new files
      mysql-test/lib/My/ConfigFactory.pm:
        Allow testing with mtr in out-of-source builds.
      mysql-test/lib/My/Find.pm:
        the build configurations are now also available on Unix
        Xcode on Mac uses the Release, RelwithDebinfo and Debug 
        subdirectories for executables. Earlier, build configurations 
        were available only on Windows.
      mysql-test/lib/My/SafeProcess.pm:
        Allow testing with mtr in out-of-source builds.
      mysql-test/lib/My/SafeProcess/CMakeLists.txt:
        Port CMakeLists.txt to Unix
      mysql-test/lib/My/SafeProcess/safe_kill_win.cc:
        add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
      mysql-test/lib/My/SafeProcess/safe_process_win.cc:
        Add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
        define JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE if not defined 
        (can happen using MinGW compiler that comes with old SDK)
      mysql-test/mtr.out-of-source:
        Allow testing with mtr in out-of-source builds.
      mysql-test/mysql-test-run.pl:
        Allow testing with mtr in out-of-source builds.
        Use common find_plugin macro for Windows and unix.
      mysql-test/t/fulltext_plugin.test:
        This test can now run on Windows as well.
      mysys/CMakeLists.txt:
        Port CMakeLists.txt to Unix
      mysys/my_create.c:
        config-win.h is dead => NO_OPEN_3 is never defined.
      mysys/my_getsystime.c:
        config-win.h is dead => define OFFSET_TO_EPOCH where it is used.
      mysys/my_winthread.c:
        Add  win32 pthread_cancel - used by daemon_example
      mysys/mysys_priv.h:
        config-win.h is dead => include <sys/stat.h> where it is used
        fix prototype of my_win_(f)stat
      plugin/daemon_example/CMakeLists.txt:
        Compile daemon_example with CMake
      plugin/daemon_example/Makefile.am:
        Add new file
      plugin/fulltext/CMakeLists.txt:
        Compile full-text example with CMake
      plugin/fulltext/Makefile.am:
        Add new file.
      plugin/semisync/CMakeLists.txt:
        Fix semisync to use common  macro for plugins.
      regex/CMakeLists.txt:
        Use absolute filenames, when adding regex library 
        (we recompile files in embedded, and want to locate 
        sources via GET_TARGET_PROPERTY( ... SOURCES ..))
      regex/regex2.h:
        Remove pointless typedef (produces error with MinGW compiler)
      scripts/CMakeLists.txt:
        Add configure/install for scripts
      sql-bench/CMakeLists.txt:
        install sql-bench files
      sql-bench/Makefile.am:
        Add new file
      sql/CMakeLists.txt:
        Port CmakeLists.txt to Unix
      sql/nt_servc.cc:
        compile server with -DWIN32_LEAN_AND_MEAN
      sql/share/CMakeLists.txt:
        Install charsets
      sql/share/Makefile.am:
        Add new file
      sql/sql_builtin.cc.in:
        Handle pure-C plugins on Windows.
      sql/sql_class.h:
        Use the same clear_error macro in embedded and not embedded.
        Fixes pointless #ifdef and avoids duplicate symbols when linking
        on Windows.
      storage/Makefile.am:
        storage/mysql_storage_engine.cmake => cmake/plugin.cmake
      storage/archive/CMakeLists.txt:
        Add names for static and dynamic plugin libraries.
        Link archive with zlib
      storage/blackhole/CMakeLists.txt:
        Add names for static and dynamic storage 
        engine libraries
      storage/csv/CMakeLists.txt:
        Add names for static and dynamic storage engine
        libraries
      storage/example/CMakeLists.txt:
        Add names for static and dynamic storage engine 
        libraries
      storage/federated/CMakeLists.txt:
        Add names for static and dynamic storage engine 
        libraries
      storage/heap/CMakeLists.txt:
        Add names for static and dynamic storage engine 
        libraries
      storage/ibmdb2i/CMakeLists.txt:
        Better port for ibmdb2i plugin
      storage/innobase/CMakeLists.txt:
        Run system checks.
        
        Add names for static and dynamic storage engine 
        libraries.
      storage/innobase/include/page0page.ic:
        Fix compile error on OpenSolaris.
      storage/myisam/CMakeLists.txt:
        Port CmakeLists.txt to Unix
      storage/myisammrg/CMakeLists.txt:
        Add names for static and dynamic storage engine 
        libraries
      storage/mysql_storage_engine.cmake:
        storage/mysql_storage_engine.cmake => cmake/plugin.cmake
      support-files/CMakeLists.txt:
        Configure and install some files from support-files.
      support-files/Makefile.am:
        Add new file
      tests/CMakeLists.txt:
        In general case, mysqlclient library can be dependent
        on C++ runtime(if it includes yassl and is not compiled
        with gcc or MSVC)
      unittest/mysys/CMakeLists.txt:
        Add unit tests
      unittest/mysys/Makefile.am:
        Add new file
      unittest/mytap/CMakeLists.txt:
        Add library for unit tests
      unittest/mytap/Makefile.am:
        Add new file
      unittest/mytap/tap.c:
        fix function definitions to match declarations
      win/create_def_file.js:
        Fix link error with intel compiler (icl 
        defines of special label for exception handler)
      697a2e17
  17. 21 Oct, 2009 1 commit
    • Konstantin Osipov's avatar
      Backport of revno 2630.28.10, 2630.28.31, 2630.28.26, 2630.33.1, · 482bfed2
      Konstantin Osipov authored
      2630.39.1, 2630.28.29, 2630.34.3, 2630.34.2, 2630.34.1, 2630.29.29,
      2630.29.28, 2630.31.1, 2630.28.13, 2630.28.10, 2617.23.14 and
      some other minor revisions.
      
      This patch implements: 
      
      WL#4264 "Backup: Stabilize Service Interface" -- all the
      server prerequisites except si_objects.{h,cc} themselves (they can
      be just copied over, when needed).
      
      WL#4435: Support OUT-parameters in prepared statements.
      
      (and all issues in the initial patches for these two
      tasks, that were discovered in pushbuild and during testing).
      
      Bug#39519: mysql_stmt_close() should flush all data
      associated with the statement.
      
      After execution of a prepared statement, send OUT parameters of the invoked
      stored procedure, if any, to the client.
      
      When using the binary protocol, send the parameters in an additional result
      set over the wire.  When using the text protocol, assign out parameters to
      the user variables from the CALL(@var1, @var2, ...) specification.
      
      The following refactoring has been made:
        - Protocol::send_fields() was renamed to Protocol::send_result_set_metadata();
        - A new Protocol::send_result_set_row() was introduced to incapsulate
          common functionality for sending row data.
        - Signature of Protocol::prepare_for_send() was changed: this operation
          does not need a list of items, the number of items is fully sufficient.
      
      The following backward incompatible changes have been made:
        - CLIENT_MULTI_RESULTS is now enabled by default in the client;
        - CLIENT_PS_MULTI_RESUTLS is now enabled by default in the client.
      
      include/mysql.h:
        Add a new flag to MYSQL_METHODS::flush_use_result
        function pointer. This flag determines if all results
        should be flushed or only the first one:
            
        - if flush_all_results is TRUE, then cli_flush_use_result()
          will read/flush all pending results. I.e. it will read
          all packets while server status attribute indicates that
          there are more results. This is a new semantic, required
          to fix the bug.
                    
        - if flush_all_results is FALSE, the old sematic
          is preserved -- i.e. cli_flush_use_result() reads data
          until first EOF-packet.
      include/mysql.h.pp:
        Update the ABI with new calls (compatible changes).
      include/mysql_com.h:
        Add CLIENT_PS_OUT_PARAMS -- a client capability indicating that the client supportsю
      libmysql/libmysql.c:
        Add mysql_stmt_next_result() -- analogue of mysql_next_result() for binary protocol.
        Fix a minor bug in alloc_fields() -- not all members were copied over,
        and some only shallow-copied (catalog).
        Flush all results in mysql_stmt_close() (Bug#39519).
      libmysqld/lib_sql.cc:
        Rename send_fields() -> send_result_set_metadata().
        Refactoring: change prepare_for_send() so that it accepts only 
        what it really needs -- a number of elements in the list.
      mysql-test/r/ps.result:
        Update results: WL#4435.
      mysql-test/t/ps.test:
        WL#4435: A test case for an SQL-part of the problem.
      sql-common/client.c:
        Bug#39519.
        Implement new functionality in cli_flush_use_result():
        if flush_all_delete is TRUE, then it should read/flush
        all pending results.
      sql/Makefile.am:
        Add a new header sql_prepare.h to the list
        of build headers.
      sql/events.cc:
        Rename: Protocol::send_fields() -> 
        Protocol::send_result_set_metadata().
      sql/handler.cc:
        Rename: Protocol::send_fields() -> 
        Protocol::send_result_set_metadata().
      sql/mysql_priv.h:
        Move sql_prepare.cc-specific declarations to a new
        header - sql_prepare.h.
      sql/procedure.h:
        Rename: Protocol::send_fields() -> 
        Protocol::send_result_set_metadata().
      sql/protocol.cc:
        Move the logic responsible for sending of one result
        set row to the Protocol class. Define a template
        for end-of-statement action. 
        Refactoring: change prepare_for_send() so that it accepts 
        only what it really needs -- a number of elements in the list.
        Rename send_fields() to send_result_set_metadata().
      sql/protocol.h:
        Update with new declarations (WL#4435).
        Rename send_fields() -> send_result_set_metadata().
        prepare_for_send() only needs the number of columns to send,
        and doesn't use the item list - update signature to require
        only what's needed.
        Add a new protocol type -- Protocol_local.
      sql/repl_failsafe.cc:
        Rename: Protocol::send_fields() -> 
        Protocol::send_result_set_metadata().
      sql/slave.cc:
        Rename: Protocol::send_fields() -> 
        Protocol::send_result_set_metadata().
      sql/sql_acl.cc:
        Rename: Protocol::send_fields() -> 
        Protocol::send_result_set_metadata().
      sql/sql_base.cc:
        Include sql_prepare.h (for Reprepare_observer).
      sql/sql_cache.cc:
        Extend the query cache flags block to be able
        to store a numeric id for the result format,
        not just a flag binary/non-binary.
      sql/sql_class.cc:
        Update to use the rename of Protocol::send_fields()
        to Protocol::send_result_set_metadata().
        Use Protocol::send_one_result_set_row().
      sql/sql_class.h:
        Move the declaration of Reprepare_observer to the 
        new header - sql_prepare.h.
        Update to the new signature of class Protocol::send_fields().
      sql/sql_connect.cc:
        Use a protocol template method instead of
        raw NET layer API at the end of a statement.
      sql/sql_cursor.cc:
        Rename: Protocol::send_fields() -> 
        Protocol::send_result_set_metadata().
      sql/sql_error.cc:
        Rename: Protocol::send_fields() -> 
        Protocol::send_result_set_metadata().
      sql/sql_handler.cc:
        Rename: Protocol::send_fields() -> 
        Protocol::send_result_set_metadata().
        Use new method Protocol::send_one_result_set_row().
      sql/sql_help.cc:
        Rename: Protocol::send_fields() -> 
        Protocol::send_result_set_metadata().
      sql/sql_lex.cc:
        Initialize multi_statements variable.
        Add a handy constant for empty lex
        string.
      sql/sql_lex.h:
        Add a separate member for a standalone
        parsing option - multi-statements support.
      sql/sql_list.cc:
        sql_list.h is a standalone header now, 
        no need to include mysql_priv.h.
      sql/sql_list.h:
        Make sql_list.h a stand-alone header.
      sql/sql_parse.cc:
        Include sql_prepare.h for prepared
        statements- related declarations.
        Use a new Protocol template method to end
        each statement (send OK, EOF or ERROR to
        the client).
      sql/sql_prepare.cc:
        Implement Execute Direct API (WL#4264), 
        currently unused. It will be used by the service
        interface (Backup).
        Use a new header - sql_prepare.h.
        Add support for OUT parameters in the 
        binary and text protocol (prepared statements 
        only).
      sql/sql_prepare.h:
        Add a new header to contain (for now)
        all prepared statement- external
        related declarations.
      sql/sql_profile.cc:
        Rename: Protocol::send_fields() -> 
        Protocol::send_result_set_metadata().
      sql/sql_repl.cc:
        Rename: Protocol::send_fields() -> 
        Protocol::send_result_set_metadata().
      sql/sql_select.cc:
        Rename: Protocol::send_fields() -> 
        Protocol::send_result_set_metadata().
      sql/sql_show.cc:
        Rename: Protocol::send_fields() -> 
        Protocol::send_result_set_metadata().
      sql/sql_string.h:
        Add a way to convert a String to LEX_STRING.
      sql/sql_table.cc:
        Rename: Protocol::send_fields() -> 
        Protocol::send_result_set_metadata().
      sql/sql_update.cc:
        Remove an extraneous my_error(). The error
        is already reported in update_non_unique_table_error().
      sql/sql_yacc.yy:
        Support for multi-statements is an independent
        property of parsing, not derived from 
        the protocol type.
      tests/mysql_client_test.c:
        Add tests for WL#4435 (binary protocol).
      482bfed2
  18. 15 Oct, 2009 1 commit
  19. 09 Oct, 2009 1 commit
    • Jon Olav Hauglid's avatar
      Bug #44651 "have_community_features" variable should be renamed · c6b3545e
      Jon Olav Hauglid authored
                 "have_profiling"
      
      1) Renamed have_community_features server system variable to
      have_profiling.
      2) Removed eable-community-features configure option and
      ENABLE_COMMUNITY_FEATURES macro.
      3) Removed COMMUNITY_SERVER macro and replaced its usage by 
      ENABLED_PROFILING.
      
      Only --enable-profiling is now needed to enable profiling.
      It was the only existing "community feature", so there was
      no need for both configure options.
      
      Using --enable-community-features will give a warning message
      since it no longer exists.
      c6b3545e
  20. 30 Sep, 2009 2 commits
    • Guilhem Bichot's avatar
      Fix for BUG#42980 "Client doesn't set NUM_FLAG for DECIMAL and TIMESTAMP": · df434e28
      Guilhem Bichot authored
      DECIMAL and TIMESTAMP used to have NUM_FLAG, but NEWDECIMAL was forgotten.
      It's correct that TIMESTAMP does not have the flag nowadays (manual will be updated, connectors
      developers will be notified).
      
      client/mysqldump.c:
        IS_NUM_FIELD(f) removed and replaced by its definition (f>flags & NUM_FLAG).
      include/mysql.h:
        - IS_NUM_FIELD() is removed because name is too close to IS_NUM() and it is not used a lot
        - INTERNAL_NUM_FIELD() is removed:
          * it forgets to test NEWDECIMAL (when IS_NUM() was updated for NEWDECIMAL we forgot
          to update INTERNAL_NUM_FIELD()), that's why client didn't mark NEWDECIMAL with NUM_FLAG (a bug).
          * it has an obsolete test for length of the TIMESTAMP field: test became accidentally wrong when length
          of TIMESTAMP was changed to always be 19 (when the format was changed from YYYYMMDDhhmmss to
          YYYY-MM-DD hh:mm:ss), never 8 or 14 anymore. That obsolete test caused TIMESTAMP to lose NUM_FLAG,
          which was an accidental but good change (see below).
          * IS_NUM() should be used instead
        - IS_NUM(f) is changed: TIMESTAMP used to be parsable as a number without quotes (when it was formatted as
        "YYYYMMDDhhmmss"); but it is not anymore (now that it is "YYYY-MM-DD hh:mm:ss"), so it should not have NUM_FLAG
        (mysqldump needs to quote TIMESTAMP values), so IS_NUM() should return false for it.
      libmysqld/lib_sql.cc:
        use IS_NUM() instead of INTERNAL_NUM_FIELD()
      mysql-test/r/bigint.result:
        result change: NEWDECIMAL fields now have NUM_FLAG (32768)
      mysql-test/r/metadata.result:
        result change: NEWDECIMAL fields now have NUM_FLAG (32768)
      mysql-test/r/mysqldump.result:
        DECIMAL columns are not quoted anymore by mysqldump. Which is ok, the parser does not need '' for them
      mysql-test/r/ps_2myisam.result:
        result change: NEWDECIMAL fields now have NUM_FLAG (32768)
      mysql-test/r/ps_3innodb.result:
        result change: NEWDECIMAL fields now have NUM_FLAG (32768)
      mysql-test/r/ps_4heap.result:
        result change: NEWDECIMAL fields now have NUM_FLAG (32768)
      mysql-test/r/ps_5merge.result:
        result change: NEWDECIMAL fields now have NUM_FLAG (32768)
      mysql-test/suite/ndb/r/ps_7ndb.result:
        result change: NEWDECIMAL fields now have NUM_FLAG (32768)
      mysql-test/t/metadata.test:
        test for BUG#42980
      sql-common/client.c:
        use IS_NUM() instead of INTERNAL_NUM_FIELD()
      df434e28
    • Alexander Barkov's avatar
      Backporting WL#3759 Optimize identifier conversion in client-server protocol · 0a9122ec
      Alexander Barkov authored
      This patch provides performance improvements:
      - send_fields() when character_set_results = latin1
        is now about twice faster for column/table/database
        names, consisting on ASCII characters.
      
      Changes:
      
      - Protocol doesn't use "convert" temporary buffer anymore,
        and converts strings directly to "packet".
      
      - General conversion optimization: quick conversion
        of ASCII strings was added.
      
      modified files:
      
      include/m_ctype.h
      - Adding a new flag.
      - Adding a new function prototype
      
      libmysqld/lib_sql.cc
      - Adding quick conversion method for embedded library:
        conversion is now done directly to result buffer,
        without using a temporary buffer.
      
      mysys/charset.c
      - Mark all dynamic ucs2 character sets as non-ASCII
      - Mark some dymamic 7bit and 8bit charsets as non-ASCII
        (for example swe7 is not fully ASCII compatible).
      
      sql/protocol.cc
      - Adding quick method to convert a string directly
        into protocol buffer, without using a temporary buffer.
      
      sql/protocol.h
      - Adding a new method prototype
      
      sql/sql_string.cc
        Optimization for conversion between two ASCII-compatible charsets:
      - quickly convert ASCII strings,
        switch to mc_wc->wc_mb method only when a non-ASCII character is met.
      - copy four ASCII characters at once on i386
      
      strings/conf_to_src.c
      - Marking non-ASCII character sets with a flag.
      
      strings/ctype-extra.c
      - Regenerating ctype-extra.c by running "conf_to_src".
      
      strings/ctype-uca.c
      - Marking UCS2 character set as non-ASCII.
      
      strings/ctype-ucs2.c
      - Marking UCS2 character set as non-ASCII.
      
      strings/ctype.c
      - A new function to detect if a 7bit or 8bit character set
        is ascii compatible.
      0a9122ec
  21. 22 Sep, 2009 1 commit
    • MySQL Build Team's avatar
      Backport into build-200909221805-5.1.37sp1 · 16b9a2a1
      MySQL Build Team authored
      > ------------------------------------------------------------
      > revno: 3044.1.1
      > revision-id: kristofer.pettersson@sun.com-20090729200708-cb0td7n9r5md0aa0
      > parent: davi.arnaut@sun.com-20090728195938-qabe9ldm2l4k8xns
      > committer: Kristofer Pettersson <kristofer.pettersson@sun.com>
      > branch nick: mysql-5.1-bugteam
      > timestamp: Wed 2009-07-29 22:07:08 +0200
      > message:
      >   Bug#44521 Executing a stored procedure as a prepared statement can sometimes cause
      >             an assertion in a debug build.
      >   
      >   The reason is that the C API doesn't support multiple result sets for prepared
      >   statements and attempting to execute a stored routine which returns multiple result
      >   sets sometimes lead to a network error. The network error sets the diagnostic area
      >   prematurely which later leads to the assert when an attempt is made to set a second
      >   server state.
      >   
      >   This patch fixes the issue by changing the scope of the error code returned by
      >   sp_instr_stmt::execute() to include any error which happened during the execution.
      >   To assure that Diagnostic_area::is_sent really mean that the message was sent all
      >   network related functions are checked for return status.
      16b9a2a1
  22. 10 Sep, 2009 1 commit
    • Marc Alff's avatar
      WL#2110 (SIGNAL) · b129e0af
      Marc Alff authored
      WL#2265 (RESIGNAL)
      
      Manual merge of SIGNAL and RESIGNAL to mysql-trunk-signal,
      plus required dependencies.
      b129e0af
  23. 29 Jul, 2009 1 commit
    • Kristofer Pettersson's avatar
      Bug#44521 Executing a stored procedure as a prepared statement can sometimes cause · cdfbb2e9
      Kristofer Pettersson authored
                an assertion in a debug build.
      
      The reason is that the C API doesn't support multiple result sets for prepared
      statements and attempting to execute a stored routine which returns multiple result
      sets sometimes lead to a network error. The network error sets the diagnostic area
      prematurely which later leads to the assert when an attempt is made to set a second
      server state.
      
      This patch fixes the issue by changing the scope of the error code returned by
      sp_instr_stmt::execute() to include any error which happened during the execution.
      To assure that Diagnostic_area::is_sent really mean that the message was sent all
      network related functions are checked for return status.
      
      libmysqld/lib_sql.cc:
        * Changed prototype to return success/failure status on net_send_error_packet(),
          net_send_ok(), net_send_eof(), write_eof_packet().
      mysql-test/r/sp_notembedded.result:
        * Added test case for bug 44521
      mysql-test/t/sp_notembedded.test:
        * Added test case for bug 44521
      sql/protocol.cc:
        * Changed prototype to return success/failure status on net_send_error_packet(),
          net_send_ok(), net_send_eof(), write_eof_packet().
      sql/protocol.h:
        * Changed prototype to return success/failure status on net_send_error_packet(),
          net_send_ok(), net_send_eof(), write_eof_packet().
      sql/sp_head.cc:
        * Changed prototype to return success/failure status on net_send_error_packet(),
          net_send_ok(), net_send_eof(), write_eof_packet().
      cdfbb2e9
  24. 27 Jul, 2009 1 commit
  25. 04 Jun, 2009 1 commit
    • Alexey Botchkov's avatar
      Bug#43733 Select on processlist let the embedded server crash (concurrent_innodb_safelog) · e76acd67
      Alexey Botchkov authored
          the thread->mysys_var parameter should be empty for the idle
          embedded-server threads so that working threads can safely free
          this memory.
      
      per-file comments:
        libmysqld/lib_sql.cc
      Bug#43733      Select on processlist let the embedded server crash (concurrent_innodb_safelog)
          set thread->mysys_var= 0 after the query is handled
      
        mysql-test/include/concurrent.inc
      Bug#43733      Select on processlist let the embedded server crash (concurrent_innodb_safelog)
          enable these for the embedded-server mode
      
        sql/sql_show.cc
      Bug#43733      Select on processlist let the embedded server crash (concurrent_innodb_safelog)
          show thread lock status in the query result
      e76acd67
  26. 04 Dec, 2008 1 commit
    • Vladislav Vaintroub's avatar
      Bug#38522: 5 seconds delay when closing application using embedded server · ec5ce9b0
      Vladislav Vaintroub authored
                        
      The problem here is that embedded server starts handle_thread manager 
      thread  on mysql_library_init() does not stop it on mysql_library_end().
      At shutdown, my_thread_global_end() waits for thread count to become 0,
      but since we did not stop the thread it will give up after 5 seconds.
                   
      Solution is to move shutdown for handle_manager thread from kill_server()
      (mysqld specific) to clean_up() that is used by both embedded and mysqld.
                  
      This patch also contains some refactorings - to avoid duplicate code,
      start_handle_manager() and stop_handle_manager() functions are introduced.
      Unused variables are eliminated. handle_manager does not rely on global
      variable abort_loop anymore to stop (abort_loop is not set for embedded).
                  
      Note: Specifically on Windows and when using DBUG version of libmysqld, 
      the complete solution requires removing obsolete code my_thread_init() 
      from my_thread_va...
      ec5ce9b0
  27. 17 Nov, 2008 1 commit
    • 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
  28. 27 Oct, 2008 1 commit
    • Alexey Botchkov's avatar
      Bug#39289 libmysqld.a calls exit() upon error · 37a762da
      Alexey Botchkov authored
      Several functions (mostly in mysqld.cc) directly call
      exit() function in case of errors, which is not a desired
      behaviour expecially in the embedded-server library.
      
      Fixed by making these functions return error sign instead
      of exiting.
      
      per-file comments:
        include/my_getopt.h
      Bug#39289 libmysqld.a calls exit() upon error 
        added 'error' retvalue for my_getopt_register_get_addr
      
        libmysqld/lib_sql.cc
      Bug#39289 libmysqld.a calls exit() upon error 
        unireg_clear() function implemented
      
        mysys/default.c
      Bug#39289 libmysqld.a calls exit() upon error 
        error returned instead of exit() call
      
        mysys/mf_tempdir.c
      Bug#39289 libmysqld.a calls exit() upon error 
        free_tmpdir() - fixed so it's not produce crash on uninitialized
          tmpdir structure
      
        mysys/my_getopt.c
      Bug#39289 libmysqld.a calls exit() upon error 
        error returned instead of exit() call
      
        sql/mysql_priv.h
      Bug#39289 libmysqld.a calls exit() upon error 
        unireg_abort definition fixed for the embedded server
      
        sql/mysqld.cc
      Bug#39289 libmysqld.a calls exit() upon error 
        various functions fixed
        error returned instead of exit() call
      37a762da
  29. 13 Aug, 2008 1 commit
    • Mattias Jonsson's avatar
      Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that · 922ad96e
      Mattias Jonsson authored
      partition is corrupt
      
      Post push fix
      
      an DBUG_ASSERT broke the embedded server, fixed by initializing
      it in the embedded version of Protocol_text::prepare_for_resend
      
      libmysqld/lib_sql.cc:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Post push fix
        
        an DBUG_ASSERT in Protocol_text::store broke the embedded
        server, fixed by initializing it in the embedded version
        of Protocol_text::prepare_for_resend
      922ad96e
  30. 18 Jun, 2008 1 commit
    • Davi Arnaut's avatar
      Bug#37003 Tests sporadically crashes with embedded server · 65969723
      Davi Arnaut authored
      The problem was that when a embedded linked version of mysqltest
      crashed there was no way to obtain a stack trace if no core file
      is available. Another problem is that the embedded version of
      libmysql was not behaving (crash) the same as the non-embedded with
      respect to sending commands to a explicitly closed connection.
      
      The solution is to generate a mysqltest's stack trace on crash
      and to enable "reconnect" if the connection handle was explicitly
      closed so the behavior matches the non-embedded one.
      
      client/CMakeLists.txt:
        Link mysys to mysqltest.
      client/Makefile.am:
        Link mysys to mysqltest.
      client/mysqltest.c:
        Add fatal signal handling with backtracing for Unix and Windows.
      configure.in:
        Add check for weak symbols support and remove a spurious word.
      include/Makefile.am:
        Add new header with prototype for stack tracing functions.
      include/my_stacktrace.h:
        Add new header with prototype for stack tracing functions.
      libmysqld/CMakeLists.txt:
        stack tracing is now part of mysys.
      libmysqld/Makefile.am:
        stack tracing is now part of mysys.
      libmysqld/lib_sql.cc:
        Re-connect if connection was explicitly closed. This is
        done to match the behavior of the non-embeded libmysql.
      mysql-test/t/sql_low_priority_updates_func.test:
        Test expects parallelism between queries that cannot be
        guaranteed under embedded.
      mysys/CMakeLists.txt:
        Add stacktrace to mysys.
      mysys/Makefile.am:
        Add stacktrace to mysys.
      mysys/stacktrace.c:
        Move stacktrace to mysys and add weak symbol for the
        C++ name de-mangling function so that it can later be
        overridden in C++ code. Also add my_ prefix to exported
        functions.
      sql/CMakeLists.txt:
        stacktrace was moved to mysys.
      sql/Makefile.am:
        stacktrace was moved to mysys.
      sql/mysqld.cc:
        Add my_ prefix to mysys functions.
      65969723
  31. 12 May, 2008 2 commits
    • unknown's avatar
      Bug#35997 Event scheduler seems to let the server crash, if it is embedded. · 1e1fc6d4
      unknown authored
      SHOW commands fail in embedded mode because schema_table array doesn't
      correspond to enum_schema_tables.
      
      This patch implements a dummy implementation of the abstract fill_table
      function to be used when the event scheduler (or other core feature)
      isn't part of the build.
      
      
      libmysqld/lib_sql.cc:
        Fixed type conversion warning.
      sql/sql_show.cc:
        Leave entry for EVENTS to keep array consistent but set the 
        fill_table function pointer to a dummy function instead.
      1e1fc6d4
    • unknown's avatar
      Fixed: · de0b3b00
      unknown authored
       - a 64 bit compile warning in embedded
       - disabled the new (and failing tests for Bug#36522
      
      
      libmysqld/lib_sql.cc:
        Fixed: win64 warning
      mysql-test/t/disabled.def:
        Disabled the new (and failing) tests for 36522
      de0b3b00
  32. 01 May, 2008 1 commit
  33. 19 Apr, 2008 1 commit
  34. 02 Apr, 2008 1 commit
    • unknown's avatar
      mysql.spec.sh: · 510ee0cf
      unknown authored
        If excluding Federated, make sure dynamic plugin is not built
      Makefile.am:
        Only run cluster test when compiled with cluster
      lib_sql.cc:
        Work around for Visual Studio 2003, that lacks vsnprintf() but has _vsnprintf()
      
      
      Makefile.am:
        Only run cluster test when compiled with cluster
      libmysqld/lib_sql.cc:
        Work around for Visual Studio 2003, that lacks vsnprintf() but has _vsnprintf()
      support-files/mysql.spec.sh:
        If excluding Federated, make sure dynamic plugin is not built
      510ee0cf
  35. 28 Feb, 2008 1 commit
    • unknown's avatar
      Bug#34655 Compile error · ba02c492
      unknown authored
      Rename client_last_error to last_error and client_last_errno to last_errno
      to not break connectors which use the internal net structure for error handling.
      
      
      include/mysql_com.h:
        Rename client_last_error to last_error, client_last_errno to last_errno.
      include/mysql_h.ic:
        Rename client_last_error to last_error, client_last_errno to last_errno.
      libmysql/libmysql.c:
        Rename client_last_error to last_error, client_last_errno to last_errno.
      libmysql/manager.c:
        Rename client_last_error to last_error, client_last_errno to last_errno.
      libmysqld/lib_sql.cc:
        Rename client_last_error to last_error, client_last_errno to last_errno.
      libmysqld/libmysqld.c:
        Rename client_last_error to last_error, client_last_errno to last_errno.
      server-tools/instance-manager/mysql_connection.cc:
        Rename client_last_error to last_error, client_last_errno to last_errno.
      sql/log_event.cc:
        Rename client_last_error to last_error, client_last_errno to last_errno.
      sql-common/client.c:
        Rename client_last_error to last_error, client_last_errno to last_errno.
      sql/log_event_old.cc:
        Rename client_last_error to last_error, client_last_errno to last_errno.
      sql/net_serv.cc:
        Rename client_last_error to last_error, client_last_errno to last_errno.
      sql/repl_failsafe.cc:
        Rename client_last_error to last_error, client_last_errno to last_errno.
      ba02c492
  36. 27 Feb, 2008 2 commits
    • unknown's avatar
      merging · d13abd50
      unknown authored
      d13abd50
    • unknown's avatar
      Bug #25097 mysql_server_init fails silently if no errmsg.sys is present. · 86260744
      unknown authored
      There was no way to return an error from the client library
      if no MYSQL connections was established.
      So here i added variables to store that king of errors and
      made functions like mysql_error(NULL) to return these.
      
      
      client/mysql.cc:
        Bug #25097 mysql_server_init fails silently if no errmsg.sys is present.
        
        Show the error message on std_error
      include/sql_common.h:
        Bug #25097 mysql_server_init fails silently if no errmsg.sys is present.
        
        cant_connect_sqlstate constant declared
      libmysql/libmysql.c:
        Bug #25097 mysql_server_init fails silently if no errmsg.sys is present.
        
        mysql_sqlstate(NULL) returns 'unknown_sqlstate'
      libmysqld/lib_sql.cc:
        Bug #25097 mysql_server_init fails silently if no errmsg.sys is present.
        
        EMBEDDED_SERVER version of the vprint_msg_to_log() implemented
      sql-common/client.c:
        Bug #25097 mysql_server_init fails silently if no errmsg.sys is present.
        
        mysql_server_last_errno and mysql_server_last_error introduced
        to store errors not related to particular connections.
        
        mysql_error(NULL) and mysql_errno(NULL) now returns these
        mysql_server_last_error and errno respectively
      sql/log.cc:
        Bug #25097 mysql_server_init fails silently if no errmsg.sys is present.
        
        EMBEDDED_LIBRARY implementation of the vprint_msg_to_log() moved
        to lib_sql.cc
      86260744
  37. 10 Feb, 2008 1 commit
    • unknown's avatar
      Bug #33796 Memory leak for prepared statements in embedded server. · 075e0220
      unknown authored
      Field data for a query was stored to the stmt->alloc that is emptied
      with mysql_stmt_close statement only. That means a lot of memory can
      be occupied without a reason if used doesn't call mysql_stmt_close often.
      
      
      libmysql/libmysql.c:
        Bug #33796 Memory leak for prepared statements in embedded server.
        
        Clean up result->alloc even if there's no 'data' created
      libmysqld/lib_sql.cc:
        Bug #33796 Memory leak for prepared statements in embedded server.
        
        alloc 'fields' in the 'result.alloc' as the 'mem_root' is only cleaned with
        mysql_stmt_close'
      075e0220