1. 18 Dec, 2017 14 commits
    • Andrei Elkin's avatar
      MDEV-13073. rpl.perf_buildin_semisync_issue40 is corrected to expect the... · ca9ed393
      Andrei Elkin authored
      MDEV-13073. rpl.perf_buildin_semisync_issue40 is corrected to expect the Rpl_semi_sync_master_clients value of 1 (ll.307..). Explicit sleeps are converted to wait_xyz.
      ca9ed393
    • Galina Shalygina's avatar
      Test result changed · 3791d0cf
      Galina Shalygina authored
      3791d0cf
    • Galina Shalygina's avatar
      MDEV-14579: New tests for condition pushdown into materialized views/defined tables · 86308aa9
      Galina Shalygina authored
      defined with INTERSECT/EXCEPT	added
      86308aa9
    • Andrei Elkin's avatar
      MDEV-13073. This patch is a followup of the previous one to convert the... · 529120e1
      Andrei Elkin authored
      MDEV-13073. This patch is a followup of the previous one to convert the trailing underscore identifier to mariadb standard. For identifier representing class private members the underscore is replaced with a `m_` prefix. Otherwise `_` is just removed.
      529120e1
    • Andrei Elkin's avatar
      MDEV-13073. This part converts the Ali patch`s identifiers to the MariaDB... · f279d3c4
      Andrei Elkin authored
      MDEV-13073. This part converts the Ali patch`s identifiers to the MariaDB standard. Also some renaming is done as well as white spaces removal.
      f279d3c4
    • Andrei Elkin's avatar
      MDEV-13073. This patch replaces semisync's native function_enter,exit · 6a84e340
      Andrei Elkin authored
      and its custom trace faciltiy with standard DBUG_ based equivalents.
      6a84e340
    • Andrei Elkin's avatar
      MDEV-13073. This is a part with a new test (refined Ali's · c0ea3056
      Andrei Elkin authored
      one) and affected result files.
      
      Specifically to rpl_semi_sync_after_sync*, the changed results reflect
      a fact that thanks to fixes in the dump thread functionality
      there's no longer zombie thread to kill neither such thread represent
      a semisync client (so the counter drops).
      c0ea3056
    • Andrei Elkin's avatar
      MDEV-13073. This part patch weeds out RUN_HOOK from the server as semisync · 74b35b68
      Andrei Elkin authored
      is defined statically. Consequently the observer interfaces are removed
      as well.
      74b35b68
    • Andrei Elkin's avatar
      MDEV-13073 This part merges the Ali semisync related changes · e972125f
      Andrei Elkin authored
      and specifically the ack receiving functionality.
      Semisync is turned to be static instead of plugin so its functions
      are invoked at the same points as RUN_HOOKS.
      The RUN_HOOKS and the observer interface remain to be removed by later
      patch.
      
      Todo:
        React on killed status by repl_semisync_master.wait_after_sync(). Currently
        Repl_semi_sync_master::commit_trx does not check the killed status.
      
        There were few bugfixes found that are present in mysql and its unclear
        whether/how they are covered. Those include:
      
        Bug#15985893: GTID SKIPPED EVENTS ON MASTER CAUSE SEMI SYNC TIME-OUTS
        Bug#17932935 CALLING IS_SEMI_SYNC_SLAVE() IN EACH FUNCTION CALL
                       HAS BAD PERFORMANCE
        Bug#20574628: SEMI-SYNC REPLICATION PERFORMANCE DEGRADES WITH A HIGH NUMBER OF THREADS
      e972125f
    • Monty's avatar
      Optimize RUN_HOOK() call · abceaa75
      Monty authored
      RUN_HOOK() is only called if semisync is enabled
      
      As the server can't disable the hooks if something is in progress, I added
      a new variable, run_hooks_enabled, that is set the first time semi sync is
      used. This means that RUN_HOOK will have no overhead, unless semi sync
      master or slave has been enabled once.
      
      Some of the changes was just to get rid of warnings for embedded server
      abceaa75
    • Monty's avatar
      Changed from using LOCK_log to LOCK_binlog_end_pos for binary log · 13770edb
      Monty authored
      Part of MDEV-13073 AliSQL Optimize performance of semisync
      
      The idea it to use a dedicated lock detecting if there is new data in
      the master's binary log instead of the overused LOCK_log.
      
      Changes:
      - Use dedicated COND variables for the relay and binary log signaling.
        This was needed as we where the old 'update_cond' variable was used
        with different mutex's, which could cause deadlocks.
         - Relay log uses now COND_relay_log_updated and LOCK_log
         - Binary log uses now COND_bin_log_updated and LOCK_binlog_end_pos
      - Renamed signal_cnt to relay_signal_cnt (as we now have two signals)
      - Added some missing error handling in MYSQL_BIN_LOG::new_file_impl()
      - Reformatted some comments with old style
      - Renamed m_key_LOCK_binlog_end_pos to key_LOCK_binlog_end_pos
      - Changed 'signal_update()' to update_binlog_end_pos() which works for
        both relay and binary log
      13770edb
    • Monty's avatar
      Removed not used lock argument from read_log_event · ea37c129
      Monty authored
      ea37c129
    • Monty's avatar
      Moved semisync from a plugin to normal server · 2e53b96a
      Monty authored
      Part of MDEV-13073 AliSQL Optimize performance of semisync
      
      Did the following renames to match other similar variables
      key_ss_mutex_LOCK_binlog_       > key_LOCK_bing
      key_ss_cond_COND_binlog_send_  -> key_COND_binlog_send
      COND_binlog_send_              -> COND_binlog_send
      LOCK_binlog_                   -> LOCK_binlog
      
      debian/mariadb-server-10.2.install does not install semisync libs.
      2e53b96a
    • Takuro Ashie's avatar
      Fix typos in some comments · 77030649
      Takuro Ashie authored
      77030649
  2. 16 Dec, 2017 1 commit
  3. 15 Dec, 2017 4 commits
  4. 14 Dec, 2017 8 commits
    • Sachin Setiya's avatar
      mysqldump fix for invisible column · 0bc3c0fb
      Sachin Setiya authored
      Actually there are 2 issues in the case of invisible columns
      
        1st `select fields from t1` will have more fields then `select * from t1`.
      So instead of `select * from t1` we are using `select a,b,invisible from t1`
      these fields are supplied from `select fields from t1`.
      
        2nd We are using --complete-insert when we detect that this table is using
      invisible columns.
      0bc3c0fb
    • Sachin Setiya's avatar
      BuildBot bug fix for invisible columns · c90db2c8
      Sachin Setiya authored
      c90db2c8
    • Sergei Golubchik's avatar
      Add tests for system and completely invisible columns · 022b163a
      Sergei Golubchik authored
      debug only
      022b163a
    • Sachin Setiya's avatar
      MDEV-10177 Invisible Columns and Invisible Index · 84726906
      Sachin Setiya authored
      Feature Definition:-
      
      This feature adds invisible column functionality to server.
      There is 4 level of "invisibility":
      
      1. Not invisible (NOT_INVISIBLE) — Normal columns created by the user
      
      2. A little bit invisible (USER_DEFINED_INVISIBLE) — columns that the
          user has marked invisible. They aren't shown in SELECT * and they
          don't require values in INSERT table VALUE (...). Otherwise
          they behave as normal columns.
      
      3. More invisible (SYSTEM_INVISIBLE) — Can be queried explicitly,
          otherwise invisible from everything. Think ROWID sytem column.
          Because they're invisible from ALTER TABLE and from CREATE TABLE
          they cannot be created or dropped, they're created by the system.
          User cant not create a column name which is same as of
          SYSTEM_INVISIBLE.
      
      4. Very invisible (COMPLETELY_INVISIBLE) — as above, but cannot be
          queried either. They can only show up in EXPLAIN EXTENDED (might
          be possible for a very invisible indexed virtual column) but
          otherwise they don't exist for the user.If user creates a columns
          which has same name as of COMPLETELY_INVISIBLE then
          COMPLETELY_INVISIBLE column is renamed again. So it is completely
          invisible from user.
      
      Invisible Index(HA_INVISIBLE_KEY):-
         Creation of invisible columns require a new type of index which
         will be only visible to system. User cant see/alter/create/delete
         this index. If user creates a index which is same name as of
         invisible index then it will be renamed.
      
      Syntax Details:-
      
        Only USER_DEFINED_INVISIBLE column can be created by user. This
        can be created by adding INVISIBLE suffix after column definition.
      
        Create table t1( a int invisible, b int);
      
      Rules:-
        There are some rules/restrictions related to use of invisible columns
        1. All the columns in table cant be invisible.
           Create table t1(a int invisible); \\error
           Create table t1(a int invisible, b int invisble); \\error
        2. If you want invisible column to be NOT NULL then you have to supply
           Default value for the column.
           Create table t1(a int, b int not null); \\error
        3. If you create a view/create table with select * then this wont copy
           invisible fields. So newly created view/table wont have any invisible
           columns.
           Create table t2 as select * from t1;//t2 wont have t1 invisible column
           Create view v1 as select * from t1;//v1 wont have t1 invisible column
        4. Invisibility wont be forwarded to next table in any case of create
           table/view as select */(a,b,c) from table.
           Create table t2 as select a,b,c from t1; // t2 will have t1 invisible
                                 // column(b), but this wont be invisible in t2
           Create view v1 as select a,b,c from t1; // v1 will have t1 invisible
                                 // column(b), but this wont be invisible in v1
      
      Implementation Details:-
        Parsing:- INVISIBLE_SYM is added into vcol_attribute(so its like unique
            suffix), It is also added into keyword_sp_not_data_type so that table
            can have column with name invisible.
        Implementation detail is given by each modified function/created function.
         (Some function are left as they were self explanatory)
         (m= Modified, n= Newly Created)
      
        mysql_prepare_create_table(m):- Extra checks for invisible columns are
        added. Also some DEBUG_EXECUTE_IF are also added for test cases.
      
        mysql_prepare_alter_table(m):- Now this will drop all the
        COMPLETELY_INVISIBLE column and HA_INVISIBLE_KEY index. Further
        Modifications are made to stop drop/change/delete of SYSTEM_INVISIBLE
        column.
      
        build_frm_image(m):- Now this allows incorporating field_visibility
        status into frm image. To remain compatible with old frms
        field_visibility info will be only written when any of the field is
        not NOT_INVISIBLE.
      
        extra2_write_additional_field_properties(n):- This will write field
        visibility info into buffer. We first write EXTRA2_FIELD_FLAGS into
        buffer/frm , then each next char will have field_visibility for each
        field.
      
        init_from_binary_frm_image(m):- Now if we get EXTRA2_FIELD_FLAGS,
        then we will read the next n(n= number of fields) chars and set the
        field_visibility. We also increment
        thd->status_var.feature_invisible_columns. One important thing to
        note if we find out that key contains a field whose visibility is
        > USER_DEFINED_INVISIBLE then , we declare this key as invisible
        key.
      
        sql_show.cc is changed accordingly to make show table, show keys
        correct.
      
        mysql_insert(m):- If we get to know that we are doing insert in
        this way insert into t1 values(1,1); without explicitly specifying
        columns, then we check for if we have invisible fields if yes then
        we reset the whole record, Why ? Because first we want hidden columns
        to get default/null value. Second thing auto_increment has property
        no default and no null which voilates invisible key rule 2, And
        because of this it was giving error. Reseting table->record[0]
        eliminates this issue. More info put breakpoint on handler::write_row
        and see auto_increment value.
      
        fill_record(m):- we continue loop if we find invisible column because
        this is already reseted/will get its value if it is default.
      
      Test cases:- Since we can not directly add > USER_DEFINED_INVISIBLE
        column then I have debug_dbug to create it in mysql_prepare_create_table.
      
        Patch Credit:- Serg Golubchik
      84726906
    • Marko Mäkelä's avatar
      Merge bb-10.2-ext into 10.3 · 866ccc88
      Marko Mäkelä authored
      866ccc88
    • Marko Mäkelä's avatar
      Merge 10.2 into bb-10.2-ext · 1b5f0cbd
      Marko Mäkelä authored
      1b5f0cbd
    • Marko Mäkelä's avatar
      80638049
    • Marko Mäkelä's avatar
      Merge 10.1 into 10.2 · ece9c54e
      Marko Mäkelä authored
      ece9c54e
  5. 13 Dec, 2017 13 commits
    • Marko Mäkelä's avatar
      Merge 10.0 into 10.1 · 7be5b6f0
      Marko Mäkelä authored
      7be5b6f0
    • Marko Mäkelä's avatar
      Follow-up fix for MDEV-12352: Plug a memory leak · 9d76b274
      Marko Mäkelä authored
      trx_rollback_active(): When aborting the rollback, free the query graph.
      9d76b274
    • Marko Mäkelä's avatar
      Fix a typo: schedule, scheduling · e9cc486c
      Marko Mäkelä authored
      e9cc486c
    • Marko Mäkelä's avatar
      Fix the grammar of an error message · 2fe990df
      Marko Mäkelä authored
      2fe990df
    • Marko Mäkelä's avatar
      Merge 10.0 into 10.1 · 46305b00
      Marko Mäkelä authored
      46305b00
    • Marko Mäkelä's avatar
      MDEV-12323 Rollback progress log messages during crash recovery are intermixed... · b1977a39
      Marko Mäkelä authored
      MDEV-12323 Rollback progress log messages during crash recovery are intermixed with unrelated log messages
      
      trx_roll_must_shutdown(): During the rollback of recovered transactions,
      report progress and check if the rollback should be interrupted because
      of a pending shutdown.
      
      trx_roll_max_undo_no, trx_roll_progress_printed_pct: Remove, along with
      the messages that were interleaved with other messages.
      b1977a39
    • Marko Mäkelä's avatar
      08d0ea1f
    • Marko Mäkelä's avatar
      MDEV-12352 InnoDB shutdown should not be blocked by a large transaction rollback · b46fa627
      Marko Mäkelä authored
      row_undo_step(), trx_rollback_active(): Abort the rollback of a
      recovered ordinary transaction if fast shutdown has been initiated.
      
      trx_rollback_resurrected(): Convert an aborted-rollback transaction
      into a fake XA PREPARE transaction, so that fast shutdown can proceed.
      b46fa627
    • Marko Mäkelä's avatar
      MDEV-13797 InnoDB may hang if shutdown is initiated soon after startup while... · 6559ba71
      Marko Mäkelä authored
      MDEV-13797 InnoDB may hang if shutdown is initiated soon after startup while rolling back recovered incomplete transactions
      
      trx_rollback_resurrected(): If shutdown was initiated, fake all
      remaining active transactions to XA PREPARE state, so that shutdown
      can proceed. Also, make the parameter "all" an output that will be
      assigned to FALSE in this case.
      
      trx_rollback_or_clean_recovered(): Remove the shutdown check
      (it was moved to trx_rollback_resurrected()).
      
      trx_undo_free_prepared(): Relax assertions.
      6559ba71
    • Marko Mäkelä's avatar
      MDEV-14422 Assertion failure in trx_purge_run() on shutdown · 58eb4e5d
      Marko Mäkelä authored
      row_quiesce_table_start(), row_quiesce_table_complete():
      Use the more appropriate predicate srv_undo_sources for skipping
      purge control. (This change alone is insufficient; it is possible
      that this predicate will change during the call to trx_purge_stop()
      or trx_purge_run().)
      
      trx_purge_stop(), trx_purge_run(): Tolerate PURGE_STATE_EXIT.
      It is very well possible to initiate shutdown soon after the statement
      FLUSH TABLES FOR EXPORT has been submitted to execution.
      
      srv_purge_coordinator_thread(): Ensure that the wait for purge_sys->event
      in trx_purge_stop() will terminate when the coordinator thread exits.
      58eb4e5d
    • Alexander Barkov's avatar
      Removing a dead code in sql_load.cc · 701e22d5
      Alexander Barkov authored
      The loop in read_xml_field(), unlike the same loop in read_sep_field(),
      cannot end with item<>NULL, as it does not have any "break" statements.
      The entire block "if (item) {...}" was a dead code.
      701e22d5
    • Marko Mäkelä's avatar
      Try to prevent sporadic test failures · b93a87f1
      Marko Mäkelä authored
      On Windows, sometimes more files stay open:
      
      [Warning] InnoDB: innodb_open_files=13 is exceeded (15 files stay open)
      b93a87f1
    • Alexander Barkov's avatar
      MDEV-14628 Wrong autoinc value assigned by LOAD XML in the NO_AUTO_VALUE_ON_ZERO mode · a53e087e
      Alexander Barkov authored
      The fixes for these bugs:
      
      Bug#27586 Wrong autoinc value assigned by LOAD DATA in the NO_AUTO_VALUE_ON_ZERO mode
      Bug#22372 Disable spatial key, load data, enable spatial key, crashes table
      
      fixed only LOAD DATA INFILE, but did not fix LOAD XML INFILE.
      
      This patch does for LOAD XML FILE what patches for Bug#27586 and Bug#22372
      earlier did for LOAD DATA INFILE.
      
      1. Fixing the auto_increment problem:
         a. table->auto_increment_field_not_null is not set to TRUE
            anymore when a column does not have a corresponding XML tag.
         b. Adding "table->auto_increment_field_not_null= false"
            in the end of read_xml_field().
         These two changes resemble the patch for Bug#27586.
      
      2. Fixing the GEOMETRY problem:
         The result for "reset()" was not tested for errors in read_xml_field(),
         which made it possible for empty string to sneak into a "GEOMETRY NOT NULL"
         column when this column does not have a corresponding XML tag with data.
         After this patch the result of reset() is tested and and an error is
         returned in such cases.
         This change effectively resembles the patch for Bug#22372
      
      3. Spliting the code into a new virtual method Field::load_data_set_null().
      
         Rationale:
         a. To avoid duplicate code in read_sep_field() and read_xml_field():
            Changes #1 and #2 made the code handling NULL values for Field
            exactly the same in read_sep_field() and read_xml_field().
      
        b. To avoid tests for field_type(), which is not friendly to
           upcoming data type plugins.
           This change makes it possible for data type plugins
           to implement their own special way for handling NULL values in LOAD DATA
           by overriding Field_xxx::load_data_set_null(),
           like Field_geom and Field_timestamp do.
      a53e087e