1. 27 Jan, 2017 4 commits
  2. 26 Jan, 2017 5 commits
  3. 25 Jan, 2017 9 commits
  4. 24 Jan, 2017 11 commits
    • Igor Babaev's avatar
      Fixed bug mdev-11820. · 423b7da3
      Igor Babaev authored
      The fields st_select_lex::cond_pushed_into_where and
      st_select_lex::cond_pushed_into_having should be re-initialized
      for the unit specifying a derived table at every re-execution
      of the query that uses this derived table, because the result
      of condition pushdown may be different for different executions.
      423b7da3
    • Alexey Botchkov's avatar
      MDEV-11557 Port MySQL-5.7 JSON tests to MariaDB. · 35760c00
      Alexey Botchkov authored
              more fixes.
      35760c00
    • Alexey Botchkov's avatar
      MDEV-11042 Implement GeoJSON functions. · 1782102d
      Alexey Botchkov authored
              Typenames made into proper character case.
      1782102d
    • Varun Gupta's avatar
      MDEV-11108: adjusted test results · 6cdbf202
      Varun Gupta authored
      6cdbf202
    • Alexey Botchkov's avatar
      MDEV-11557 port MySQL-5.7 JSON tests to MariaDB. · 50831b0f
      Alexey Botchkov authored
              json_no_table.test ported.
      50831b0f
    • Jan Lindström's avatar
      e5398aca
    • Alexander Barkov's avatar
    • Alexander Barkov's avatar
      MDEV-11780 Crash with PREPARE + SP out parameter + literal · ae91690d
      Alexander Barkov authored
      Before "MDEV-10709 Expressions as parameters to Dynamic SQL" only
      user variables were syntactically allowed as EXECUTE parameters.
      User variables were OK as both IN and OUT parameters.
      When Item_param was bound to an actual parameter (a user variable),
      it automatically meant that the bound Item was settable.
      The DBUG_ASSERT() in Protocol_text::send_out_parameters() guarded that
      the actual parameter is really settable.
      
      After MDEV-10709, any kind of expressions are allowed as EXECUTE IN parameters.
      But the patch for MDEV-10709 forgot to check that only descendants of
      Settable_routine_parameter should be allowed as OUT parameters.
      So an attempt to pass a non-settable parameter as an OUT parameter
      made server crash on the above mentioned DBUG_ASSERT.
      
      This patch changes Item_param::get_settable_routine_parameter(),
      which previously always returned "this". Now, when Item_param is bound
      to some Item, it caches if the bound Item is settable.
      Item_param::get_settable_routine_parameter() now returns "this" only
      if the bound actual parameter is settable, and returns NULL otherwise.
      ae91690d
    • Jan Lindström's avatar
      Fix compiler error on native AIO. · 83680449
      Jan Lindström authored
      83680449
    • Jan Lindström's avatar
      MDEV-11879: Duplicate option innochecksum -l (--log, --leaf) · 51b248cf
      Jan Lindström authored
      Move --leaf under -e to avoid duplicate option and retain
      -l for --log (to maintain compatibility with MySQL 5.7).
      51b248cf
    • Jan Lindström's avatar
      MDEV-11254: innodb-use-trim has no effect in 10.2 · 6495806e
      Jan Lindström authored
      Problem was that implementation merged from 10.1 was incompatible
      with InnoDB 5.7.
      
      buf0buf.cc: Add functions to return should we punch hole and
      how big.
      
      buf0flu.cc: Add written page to IORequest
      
      fil0fil.cc: Remove unneeded status call and add test is
      sparse files and punch hole supported by file system when
      tablespace is created. Add call to get file system
      block size. Used file node is added to IORequest. Added
      functions to check is punch hole supported and setting
      punch hole.
      
      ha_innodb.cc: Remove unneeded status variables (trim512-32768)
      and trim_op_saved. Deprecate innodb_use_trim and
      set it ON by default. Add function to set innodb-use-trim
      dynamically.
      
      dberr.h: Add error code DB_IO_NO_PUNCH_HOLE
      if punch hole operation fails.
      
      fil0fil.h: Add punch_hole variable to fil_space_t and
      block size to fil_node_t.
      
      os0api.h: Header to helper functions on buf0buf.cc and
      fil0fil.cc for os0file.h
      
      os0file.h: Remove unneeded m_block_size from IORequest
      and add bpage to IORequest to know actual size of
      the block and m_fil_node to know tablespace file
      system block size and does it support punch hole.
      
      os0file.cc: Add function punch_hole() to IORequest
      to do punch_hole operation,
      get the file system block size and determine
      does file system support sparse files (for punch hole).
      
      page0size.h: remove implicit copy disable and
      use this implicit copy to implement copy_from()
      function.
      
      buf0dblwr.cc, buf0flu.cc, buf0rea.cc, fil0fil.cc, fil0fil.h,
      os0file.h, os0file.cc, log0log.cc, log0recv.cc:
      Remove unneeded write_size parameter from fil_io
      calls.
      
      srv0mon.h, srv0srv.h, srv0mon.cc: Remove unneeded
      trim512-trim32678 status variables. Removed
      these from monitor tests.
      6495806e
  5. 23 Jan, 2017 3 commits
    • Alexey Botchkov's avatar
      MDEV-11042 Implement GeoJSON functions. · 0d107a85
      Alexey Botchkov authored
              ST_AsGeoJSON and ST_GeomFromGeoJSON functions implemented.
      0d107a85
    • Varun Gupta's avatar
      MDEV-11108: Assertion `uniq_tuple_length_arg <= table->file->max_key_length()'... · 1f3ad6a4
      Varun Gupta authored
      MDEV-11108: Assertion `uniq_tuple_length_arg <= table->file->max_key_length()' failed in SJ_TMP_TABLE::create_sj_weedout_tmp_table
      
      Removed the assert from the if clause to the else clause.
      1f3ad6a4
    • Alexander Barkov's avatar
      MDEV-11134 Assertion `fixed' failed in Item::const_charset_converter(THD*,... · 45e40892
      Alexander Barkov authored
      MDEV-11134 Assertion `fixed' failed in Item::const_charset_converter(THD*, CHARSET_INFO*, bool, const char*)
      
      Problem: Item_param::basic_const_item() returned true when fixed==false.
      This unexpected combination made Item::const_charset_converter() crash
      on asserts.
      
      Fix:
      - Changing all Item_param::set_xxx() to set "fixed" to true.
        This fixes the problem.
      - Additionally, changing all Item_param::set_xxx() to set
        Item_param::item_type, to avoid duplicate code, and for consistency,
        to make the code symmetric between different constant types.
        Before this patch only set_null() set item_type.
      - Moving Item_param::state and Item_param::item_type from public to private,
        to make sure easier that these members are in sync with "fixed" and to
        each other.
      - Adding a new argument "unsigned_arg" to Item::set_decimal(),
        and reusing it in two places instead of duplicate code.
      - Adding a new method Item_param::fix_temporal() and reusing it in two places.
      - Adding methods has_no_value(), has_long_data_value(), has_int_value(),
        instead of direct access to Item_param::state.
      45e40892
  6. 22 Jan, 2017 3 commits
  7. 20 Jan, 2017 1 commit
    • Monty's avatar
      [MDEV-10570] Add Flashback support · d75d8631
      Monty authored
      ==== Description ====
      
      Flashback can rollback the instances/databases/tables to an old snapshot.
      It's implement on Server-Level by full image format binary logs (--binlog-row-image=FULL), so it supports all engines.
      Currently, it’s a feature inside mysqlbinlog tool (with --flashback arguments).
      
      Because the flashback binlog events will store in the memory, you should check if there is enough memory in your machine.
      
      ==== New Arguments to mysqlbinlog ====
      
      --flashback (-B)
      It will let mysqlbinlog to work on FLASHBACK mode.
      
      ==== New Arguments to mysqld ====
      
      --flashback
      
      Setup the server to use flashback. This enables binary log in row mode
      and will enable extra logging for DDL's needed by flashback feature
      
      ==== Example ====
      
      I have a table "t" in database "test", we can compare the output with "--flashback" and without.
      
      #client/mysqlbinlog /data/mysqldata_10.0/binlog/mysql-bin.000001 -vv -d test -T t --start-datetime="2013-03-27 14:54:00" > /tmp/1.sql
      #client/mysqlbinlog /data/mysqldata_10.0/binlog/mysql-bin.000001 -vv -d test -T t --start-datetime="2013-03-27 14:54:00" -B > /tmp/2.sql
      
      Then, importing the output flashback file (/tmp/2.log), it can flashback your database/table to the special time (--start-datetime).
      And if you know the exact postion, "--start-postion" is also works, mysqlbinlog will output the flashback logs that can flashback to "--start-postion" position.
      
      ==== Implement ====
      
      1. As we know, if binlog_format is ROW (binlog-row-image=FULL in 10.1 and later), all columns value are store in the row event, so we can get the data before mis-operation.
      
      2. Just do following things:
      
        2.1 Change Event Type, INSERT->DELETE, DELETE->INSERT.
        For example:
          INSERT INTO t VALUES (...)  ---> DELETE FROM t WHERE ...
          DELETE FROM t ... ---> INSERT INTO t VALUES (...)
      
        2.2 For Update_Event, swapping the SET part and WHERE part.
        For example:
          UPDATE t SET cols1 = vals1 WHERE cols2 = vals2
          --->
          UPDATE t SET cols2 = vals2 WHERE cols1 = vals1
      
        2.3 For Multi-Rows Event, reverse the rows sequence, from the last row to the first row.
        For example:
          DELETE FROM t WHERE id=1; DELETE FROM t WHERE id=2; ...; DELETE FROM t WHERE id=n;
          --->
          DELETE FROM t WHERE id=n; ...; DELETE FROM t WHERE id=2; DELETE FROM t WHERE id=1;
      
        2.4 Output those events from the last one to the first one which mis-operation happened.
        For example:
      d75d8631
  8. 19 Jan, 2017 3 commits
    • Elena Stepanova's avatar
      Follow-up for the 10.1 -> 10.2 merge · b9631b46
      Elena Stepanova authored
      Fix 32-bit rdiffs to get rid of failed hunks
      b9631b46
    • Marko Mäkelä's avatar
      Merge 10.1 to 10.2. · b05bf8ff
      Marko Mäkelä authored
      Most notably, this includes MDEV-11623, which includes a fix and
      an upgrade procedure for the InnoDB file format incompatibility
      that is present in MariaDB Server 10.1.0 through 10.1.20.
      
      In other words, this merge should address
      MDEV-11202 InnoDB 10.1 -> 10.2 migration does not work
      b05bf8ff
    • Igor Babaev's avatar
      Fixed bug mdev-11818. · 833aa97c
      Igor Babaev authored
      When a query containing a WITH clause is printed by EXPLAIN
      EXTENDED command there should not be any data expansion in
      the query specifications of the WITH elements of this WITH
      clause.
      833aa97c
  9. 18 Jan, 2017 1 commit
    • Marko Mäkelä's avatar
      MDEV-11202 InnoDB 10.1 -> 10.2 migration does not work · a1315a65
      Marko Mäkelä authored
      This is the final preparation for the merge of MDEV-11623
      from MariaDB Server 10.1 (correcting the assignment of
      FSP_SPACE_FLAGS in MariaDB Server 10.1).
      
      We must avoid reading FSP_SPACE_FLAGS directly from page 0,
      because the flags that affect the uncompressed page size
      cannot be trusted if we are upgrading from MariaDB 10.1.
      
      We will pass fil_space_t* instead of a numeric tablespace ID
      in many low-level functions, so that fil_space_t::flags
      will be available. This will also reduce the amount o
      tablespace ID lookups and the pressure on fil_system->mutex.
      
      fil_space_is_being_truncated(), fil_space_is_redo_skipped(),
      PageCallback::set_page_size(), fsp_header_get_page_size(): Remove.
      
      fil_node_open_file(), fil_space_get_crypt_data(): Use space->flags.
      
      fsp_free_extent(), fseg_get_first_extent(), fsp_get_space_header(),
      xdes_get_descriptor_with_space_hdr(), xdes_get_descriptor(),
      xdes_lst_get_descriptor(), fsp_space_modify_check(),
      fsp_init_file_page(), fsp_alloc_free_extent(), fsp_page_create(),
      fsp_alloc_free_page(), fsp_free_page(), fsp_alloc_seg_inode_page(),
      fsp_alloc_seg_inode(), fsp_free_seg_inode(), fseg_fill_free_list(),
      fseg_mark_page_used(), fseg_free_page_low(), fseg_free_extent():
      Take fil_space_t* as a parameter, instead of taking a numeric ID.
      a1315a65