1. 19 May, 2018 10 commits
    • Daniel Black's avatar
      MDEV-15635 mysys: THR_LOCK_open reduce usage · 0322ced7
      Daniel Black authored
      Change the following to statistic counters:
      * my_file_opened
      * my_file_total_opened
      * my_stream_opened
      * my_tmp_file_created
      
      There is one non-statistics use of my_file_opened/my_stream_opened
      in my_end which prints a warning if we shutdown and its still open.
      It seems excessive to hold locks to prevent this warning.
      
      A file descriptor is already a unique element per process - in Windows,
      protection occurs at fd allocation using THR_LOCK_open in my_win_{,f}open
      and in other OSes, a unique fd to file map exists at the OS level.
      So accesses to my_file_info[fd] don't need to be protected by the
      THR_LOCK_open.
      
      my_close/my_fclose where restructured to clear out the my_file_info
      before the close/my_win_close/my_win_fclose. After these calls another
      thread could gain the same file descriptor. So for Windows this
      the file_info elements available to the my_win_{,f}_open are released
      during the invalidate_fd call within my_win_close. No locking is needed
      as the my_win_{,f}open is searching for a invalidate entry which is
      determined by a single value change.
      
      my_fclose also changed for non-Windows to retry closing if EINTR was
      returned, same as my_close.
      
      Closes #657
      0322ced7
    • Daniel Black's avatar
      MDEV-8743: use mkostemp when available with O_CLOEXEC · 6ed6a045
      Daniel Black authored
      Closes #639
      6ed6a045
    • Sergei Golubchik's avatar
      cleanup: report_error() in sql_plugin.cc · d9747268
      Sergei Golubchik authored
      it's redundant. remove it, use my_error() directly.
      d9747268
    • Sergei Golubchik's avatar
      cleanup: create_temp_file() · ff1ec6e9
      Sergei Golubchik authored
      simplify. move common code inside, specify common flags inside,
      rewrite dead code (`if (mode & O_TEMPORARY)` on Linux, where
      `O_TEMPORARY` is always 0) to actually do something.
      ff1ec6e9
    • Daniel Black's avatar
      MDEV-15583 create_temp_file: remove tempnam implementation · 3537267d
      Daniel Black authored
      In the spirit of the man page "Never use this function."
      lets purge off this implementation. mkstemp is a widely
      available alternative.
      
      Closes #661.
      3537267d
    • Jia Zhouyang's avatar
      MDEV-15550 Add error handling for fopen · f428a123
      Jia Zhouyang authored
      Print error message and return when fopen fails.
      
      Closes #634
      f428a123
    • Alexander Kuleshov's avatar
      MDEV-15513 use EVP_MD_CTX_{new,free} instead of EVP_MD_CTX_{create, destroy} · d218b5c3
      Alexander Kuleshov authored
      for consistency with EVP_CIPHER_CTX_new() and EVP_CIPHER_CTX_free().
      
      As the EVP_DIGESTINIT(3) man page says:
      
      EVP_MD_CTX_create() and EVP_MD_CTX_destroy() were renamed to
      EVP_MD_CTX_new() and EVP_MD_CTX_free() in OpenSSL 1.1.
      
      Closes #621
      d218b5c3
    • Elena Stepanova's avatar
      Follow-up for be6ae0bb - fix test results · e4e0aea6
      Elena Stepanova authored
      Duplicate warnings have been removed
      e4e0aea6
    • Varun Gupta's avatar
      MDEV-14623: Output of show function code does not show FETCH GROUP NEXT ROW for custom aggregates · 36779e62
      Varun Gupta authored
      The print() function was missing from the FETCH GROUP NEXT ROW instrunction class, so there was no
      output for this particular instruction when we use the query SHOW FUNCTION CODE function_name
      36779e62
    • Varun Gupta's avatar
      MDEV-14520: Custom aggregate functions work incorrectly with WITH ROLLUP clause · 89b1c271
      Varun Gupta authored
      Queries involving rollup need all aggregate function to have copy_or_same function where we create a copy
      of item_sum items for each sum level.
      Implemented copy_or_same function for the custom aggregate function class (Item_sum_sp)
      89b1c271
  2. 18 May, 2018 8 commits
  3. 17 May, 2018 16 commits
  4. 16 May, 2018 6 commits
    • Monty's avatar
      MDEV-14669 Assertion `file->trn == trn' failed in ha_maria::start_stmt · c2352c45
      Monty authored
      Can't repeat issue so I just added the test case
      c2352c45
    • Alexander Barkov's avatar
      Token precedence cleanup in *.yy · 48d70388
      Alexander Barkov authored
      We'll be fixing soon shift-reduce conflicts introduced in the new
      10.3 syntax (see MDEV-15818 for details) by defining precedence for
      a number of tokens (e.g. TIMESTAMP, TRANSACTION_SYM, TEXT_STRING)
      and adding "%prec" directives.
      
      Before doing this, it's better to have the existing precedences set properly,
      for easier readability and maintainability.
      
      Details:
      - Changing precedence of NOT to its proper position (between AND and IS).
        It was wrong. It worked fine only because the relevant grammar reside
        in different separate rules (expr and predicate).
      
      - Moving NOT2_SYM and BINARY to the same line with NEG and ~
        It worked fine because operators !, BINARY, ~ do not conflict
        to each other.
      
      - Fixing associativity of NOT_SYM, NOT2_SYM, BINARY, COLLATE_SYM
        from "right" to "left". They are not dyadic (operate on a single expression
        only). So "%left" or "%right" is needed only to set precedence,
        while associativity does not matter.
        Note, it would be better to use "%precedence" for these tokens
        instead of "%left" though, but we use an old version of Bison on windows,
        which may not support %precedence yet.
      
      This patch does not change behavior. The generated sql_yacc.cc and
      sql_yacc_ora.cc are exactly the same before and after this change.
      48d70388
    • Marko Mäkelä's avatar
      MDEV-13779 InnoDB fails to shut down purge workers, causing hang · a4e78007
      Marko Mäkelä authored
      srv_purge_coordinator_thread(): Wait for all purge worker threads
      to actually exit. An analysis of a core dump of a hung 10.3 server
      revealed that one srv_worker_thread did not exit, even though the
      purge coordinator had exited. This caused kill_server_thread and
      mysqld_main to wait indefinitely. The main InnoDB shutdown was
      never called, because unireg_end() was never called.
      a4e78007
    • Alexander Barkov's avatar
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-13626 Merge InnoDB test cases from MySQL 5.7 · ebc24950
      Thirunarayanan Balathandayuthapani authored
      Imported the following test case from mysql to MariaDB
      
      1) innodb.alter_kill
      2) innodb.alter_foreign_crash
      3) innodb.alter_rename_files
      4) innodb.analyze_table
      5) Appended the case in innodb-online-alter-gis
      ebc24950
    • Shaohua Wang's avatar
      BUG#22385442 - INNODB: DIFFICULT TO FIND FREE BLOCKS IN THE BUFFER POOL · a54b581d
      Shaohua Wang authored
      Problem:
      We keep pinning pages in dict_stats_analyze_index_below_cur(),
      but doesn't release these pages. When we have a relative small
      buffer pool size, and big innodb_stats_persistent_sample_pages,
      there will be no free pages for use.
      
      Solution:
      Use a separate mtr in dict_stats_analyze_index_below_cur(),
      and commit mtr before return.
      Reviewed-by: default avatarJimmy Yang <jimmy.yang@oracle.com>
      RB: 11362
      a54b581d