1. 21 Apr, 2022 1 commit
    • Haidong Ji's avatar
      MDEV-28227 Error message Chinese translation · d7189fbc
      Haidong Ji authored
      - Simplified Chinese translation added
      - Character encoding is gdk
      -- gdk covers more characters
      -- gdk includes both Simplified and Traditional
      -- best option I think, may need to work along with other locale
      settings
      - Other cleanup
      -- Within each error, messages are sorted according to language code
      -- More consistent formatting (8 spaces proceeding each translation)
      -- jps removed as duplicate of jpn translation
      
      This should be a good starting point. More refinement is appreciated,
      and needed down the road.
      
      English "containt" (sic) spelling fixes on ER_FK_NO_INDEX_{CHILD,PARENT}
      resulting in mtr test case adjustments.
      
      Edited/reviewed by Daniel Black
      d7189fbc
  2. 20 Apr, 2022 1 commit
  3. 19 Apr, 2022 1 commit
  4. 18 Apr, 2022 1 commit
  5. 16 Apr, 2022 1 commit
  6. 11 Apr, 2022 1 commit
    • Rucha Deodhar's avatar
      MDEV-22266: Diagnostics_area::sql_errno() const: Assertion · 3327bb60
      Rucha Deodhar authored
      `m_status == DA_ERROR' failed on SELECT after setting tmp_disk_table_size.
      
      Analysis: Mismatch in number of warnings between "194 warnings" vs
      "64 rows in set" is because of max_error_count variable which has default
      value of 64.
      About the corrupted tables, the error that occurs because of insufficient
      tmp_disk_table_size variable is not reported correctly and we continue to
      execute the statement. But because the previous error (about table being
      full)is not reported correctly, this error moves up the stack and is
      wrongly reported as parsing error later on while parsing frm file of one
      of the information schema table. This parsing error gives corrupted table
      error.
      As for the innodb error, it occurs even when tmp_disk_table_size is not
      insufficient is default but the internal error handler takes care of it
      and the error doesn't show. But when tmp_disk_table_size is insufficient,
      the fatal error which wasn't reported correctly moves up the stack so
      internal error handler is not called. So it shows errors.
      Fix: Report the error correctly.
      3327bb60
  7. 07 Apr, 2022 4 commits
  8. 06 Apr, 2022 6 commits
    • Marko Mäkelä's avatar
      MDEV-25975 merge fixup · cbdf62ae
      Marko Mäkelä authored
      cbdf62ae
    • Marko Mäkelä's avatar
      MDEV-25975: Merge 10.3 into 10.4 · d172df99
      Marko Mäkelä authored
      d172df99
    • Marko Mäkelä's avatar
      MDEV-23328 fixup: sign mismatch in format strings · f089f8d9
      Marko Mäkelä authored
      kill_one_thread(): Fix integer sign mismatch in some format strings.
      Some of this was introduced
      in commit 5c230b21
      f089f8d9
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.4 · d6d66c6e
      Marko Mäkelä authored
      d6d66c6e
    • Marko Mäkelä's avatar
      MDEV-25975 innodb_disallow_writes causes shutdown to hang · e9735a81
      Marko Mäkelä authored
      We will remove the parameter innodb_disallow_writes because it is badly
      designed and implemented. The parameter was never allowed at startup.
      It was only internally used by Galera snapshot transfer.
      If a user executed
      SET GLOBAL innodb_disallow_writes=ON;
      the server could hang even on subsequent read operations.
      
      During Galera snapshot transfer, we will block writes
      to implement an rsync friendly snapshot, as follows:
      
      sst_flush_tables() will acquire a global lock by executing
      FLUSH TABLES WITH READ LOCK, which will block any writes
      at the high level.
      
      sst_disable_innodb_writes(), invoked via ha_disable_internal_writes(true),
      will suspend or disable InnoDB background tasks or threads that could
      initiate writes. As part of this, log_make_checkpoint() will be invoked
      to ensure that anything in the InnoDB buf_pool.flush_list will be written
      to the data files. This has the nice side effect that the Galera joiner
      will avoid crash recovery.
      
      The changes to sql/wsrep.cc and to the tests are based on a prototype
      that was developed by Jan Lindström.
      
      Reviewed by: Jan Lindström
      e9735a81
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · 7c584d82
      Marko Mäkelä authored
      7c584d82
  9. 05 Apr, 2022 4 commits
  10. 04 Apr, 2022 5 commits
    • Monty's avatar
      Fixed that mysql_upgrade doesn't give errors about mariadb.sys · c4ebb2bd
      Monty authored
      The reason for this fix was that when I tried to run mysql_upgrade
      at home to update an old 10.5 installation, mysql_upgrade failed
      with warnings about mariadb.sys user not existing.
      
      If the server was started with --skip-grants, there would be no warnings
      from mysql_upgrade, but in some cases running mysql_upgrade again could
      produce new warnings.
      
      The reason for the warnings was that any access of the mysql.user view
      will produce a warning if the mariadb.sys user does not exists.
      
      Fixed with the following changes:
      - Disable warnings about mariadb.sys user not existing
      - Don't overwrite old mariadb.sys entries in tables_priv and global_priv
      - Ensure that tables_priv has an entry for mariadb.sys if the user exists.
        This fixes an issue that tables_priv would not be updated if there
        was a failure directly after global_priv was updated.
      c4ebb2bd
    • Monty's avatar
      Fixed double free issue in events · 09c7f78c
      Monty authored
      Server crashed during shutdown with:
      "corrupted double-linked list"
      when running mysql_upgrade multiple times against the server.
      
      Reason was that db_repostitory could be freed twice.
      09c7f78c
    • Julius Goryavsky's avatar
      MDEV-28204: The tr utility does not work as expected on rsync SST · daed558b
      Julius Goryavsky authored
      This commit contains a fix to use modern syntax for selecting
      character classes in the tr utility options.
      
      Also one of the tests for SST via rsync (galera_sst_rysnc2) is made
      more reliable (to avoid rare failures during automatic testing).
      daed558b
    • Alexander Barkov's avatar
      Adding a "const" qualifier to arguments of create_func(), create_native() etc · 0ffaf19c
      Alexander Barkov authored
      The "const" qualifier was obviously forgotten.
      
      This change will also simpily fixing of MDEV-27744.
      0ffaf19c
    • Alexander Barkov's avatar
      MDEV-28224 error: cannot initialize return object of type 'bool' with an rvalue of type 'nullptr_t' · d271fbd3
      Alexander Barkov authored
      Fixing a typo in the fix for MDEV-19804, wrong return value in a bool function:
       < return NULL;
       > return true;
      
      The problem was found because it did not compile on some platforms.
      
      Strangley, it did not have visible problems on other platforms,
      which did not fail to compile, although "return NULL" should compile to
      "return false" rather than "return true".
      d271fbd3
  11. 03 Apr, 2022 1 commit
    • Daniel Black's avatar
      MDEV-26136: Correct AIX/macOS cast warning (my_time.h) · 75b9014f
      Daniel Black authored
      tv_usec is a (suseconds_t) so we cast to it. Prevents the AIX(gcc-10) warning:
      
      include/my_time.h: In function 'void my_timeval_trunc(timeval*, uint)':
      include/my_time.h:249:65: warning: conversion from 'long int' to 'suseconds_t' {aka 'int'} may change value [-Wconversion]
        249 |   tv->tv_usec-= my_time_fraction_remainder(tv->tv_usec, decimals);
            |
      
      macOS is: conversion from 'long int' to '__darwin_suseconds_t' {aka 'int'} may change value
      
      On Windows suseconds_t isn't defined so we use the existing
      long return type of my_time_fraction_remainder.
      
      Reviewed by Marko Mäkelä
      
      Closes: #2079
      75b9014f
  12. 02 Apr, 2022 1 commit
    • Dmitry Shulga's avatar
      MDEV-28220: Assert failure in sp_head::~sp_head on parsing a syntax incorrect... · 8c169f5e
      Dmitry Shulga authored
      MDEV-28220: Assert failure in sp_head::~sp_head on parsing a syntax incorrect statement CREATE SEQUENCE ... RESTART inside CREATE PROCEDURE/CREATE FUNCTION
      
      This bug report is about the same issue as MDEV-28129 and MDEV-21173.
      The issue is that the macros YYABORT is called instead of MYSQL_YYABORT
      on parse error. In result the method LEX::cleanup_lex_after_parse_error
      is not called to clean up data structures created on parsing of
      the statement.
      8c169f5e
  13. 01 Apr, 2022 2 commits
  14. 31 Mar, 2022 2 commits
  15. 30 Mar, 2022 9 commits
    • Vlad Lesin's avatar
      MDEV-27343 Useless warning "InnoDB: Allocated tablespace ID <id> for... · c1ab0e6f
      Vlad Lesin authored
      MDEV-27343 Useless warning "InnoDB: Allocated tablespace ID <id> for <tablename>, old maximum was 0" during backup stage
      
      mariabackup does not load dictionary during backup, but it loads
      tablespaces, that is why fil_system.max_assigned_id is not set with
      dict_check_tablespaces_and_store_max_id(). There is no sense to issue the
      warning during backup.
      c1ab0e6f
    • Marko Mäkelä's avatar
      Cleanup: Remove some unused functions · 35425cfc
      Marko Mäkelä authored
      35425cfc
    • Rucha Deodhar's avatar
      MDEV-13005: Fixing bugs in SEQUENCE, part 3, 5/5 · 2eaaa887
      Rucha Deodhar authored
      Task 6:
      We can find the .frm type of file. If it is sequence then is_sequence
      passed to dd_frm_type() will be true. Since there is already a check
      to give error message if we trigger is on temporary table or view, an
      additional condition is added to check if .frm is sequence
      (is_sequence==true) and error message is changed to show
      "Trigger's '%-.192s' is view, temporary table or sequence" instead of
      "Trigger's '%-.192s' is view or temporary table".
      2eaaa887
    • Rucha Deodhar's avatar
      MDEV-13005: Fixing bugs in SEQUENCE, part 3, 4/5 · a8e7e7c0
      Rucha Deodhar authored
      Task 4 and 5:
      Already fixed when I started working on bug. Task 4 correctly gives syntax
      error ('(' and ')' are not part of create sequence syntax). Task 5 also
      gives correct error because s1 is table not sequence. Fails with
      ER_NOT_SEQUENCE2
      a8e7e7c0
    • Rucha Deodhar's avatar
      MDEV-13005: Fixing bugs in SEQUENCE, part 3, 3/5 · c6eeacd1
      Rucha Deodhar authored
      Task 3:
      Added an additional condition for SEQUENCE option to check if cache < 0.
      c6eeacd1
    • Rucha Deodhar's avatar
      MDEV-13005: Fixing bugs in SEQUENCE, part 3, 2/5 · 0b9842a3
      Rucha Deodhar authored
      Task 2:
      changed the error message and made it more reusable.
      0b9842a3
    • Rucha Deodhar's avatar
      MDEV-13005: Fixing bugs in SEQUENCE, part 3, 1/5 · bb4dd70e
      Rucha Deodhar authored
      Task 1:
      If table is added to list using option TL_OPTION_SEQUENCE (done when we
      have sequence functions) then then we are dealing with sequence instead
      of table. So global table list will have sequence set to true. This is
      used to check and give correct error message about unknown sequence
      instead of table doesn't exist.
      bb4dd70e
    • Dmitry Shulga's avatar
      MDEV-19631: Assertion `0' failed in st_select_lex_unit::optimize or different... · bdba1d46
      Dmitry Shulga authored
      MDEV-19631: Assertion `0' failed in st_select_lex_unit::optimize or different plan upon 2nd execution of PS with EXPLAIN
      
      Second execution of a prepared statement for a query containing a constant
      subquery with union that can be optimized away, could result in server abnormal
      termination for debug build or incorrect result set output for release build.
      
      For example, the following test case crashes a server built with debug on second
      run of the statement EXECUTE stmt
        CREATE TABLE t1 (a INT);
        PREPARE stmt FROM 'EXPLAIN SELECT * FROM t1 HAVING 6 IN ( SELECT 6 UNION SELECT 5 )';
        EXECUTE stmt;
        EXECUTE stmt;
      
      The reason for incorrect result set output or abnormal server termination
      is careless working with the data member fake_select_lex->options inside
      the function mysql_explain_union(). Once the flag SELECT_DESCRIBE is set in
      the data member fake_select_lex->option before calling the methods
        SELECT_LEX_UNIT::prepare/SELECT_LEX_UNIT::execute
      the original value of the option is no longer restored.
      As a consequence, next time the prepared statement is re-executed we have
      the fake_select_lex with the flag SELECT_DESCRIBE set in the data member
      fake_select_lex->option, that is incorrect. In result, the method
        Item_subselect::assigned()
      is not invoked during evaluation of a constant condition (constant subquery
      with union) that being performed on OPTIMIZE phase of query handling.
      
      This leads to the fact that records in the temporary table are not deleted
      before calling
        table->file->ha_enable_indexes(HA_KEY_SWITCH_ALL)
      in the method st_select_lex_unit::optimize().
      In result table->file->ha_enable_indexes(HA_KEY_SWITCH_ALL) returns error
      and DBUG_ASSERT(0) is fired.
      
      Stack trace to the line where the error generated on re-enabling indexes
      for next subselect iteration is below:
      st_select_lex_unit::optimize (at sql_union.cc:954)
        handler::ha_enable_indexes (at handler.cc:4338)
          ha_heap::enable_indexes (at ha_heap.cc:519)
            heap_enable_indexes (at hp_clear.c:164)
      
      The code snippet to clarify raising the error is also listed:
      int heap_enable_indexes(HP_INFO *info)
      {
        int error= 0;
        HP_SHARE *share= info->s;
      
        if (share->data_length || share->index_length)
          error= HA_ERR_CRASHED; <<== set error the value HA_ERR_CRASHED
                                      since share->data_length != 0
      
      To fix this issue the original value of unit->fake_select_lex->options
      has to be saved before setting the flag SELECT_DESCRIBE and restored
      on return from invocation of SELECT_LEX_UNIT::prepare/SELECT_LEX_UNIT::execute
      bdba1d46
    • Daniele Sciascia's avatar
      Galera test failure on galera_bf_abort_ps_bind · d59b16dd
      Daniele Sciascia authored
      Fix a possible crash on my_free() due to the use of strdup() versus
      my_strdup(), and a memory leak.
      Reviewed-by: default avatarJan Lindström <jan.lindstrom@mariadb.com>
      d59b16dd