Commit graph

180027 commits

Author SHA1 Message Date
Marko Mäkelä
d8ada08152 MDEV-14477 InnoDB update_time is wrongly updated after partial rollback or internal COMMIT
The non-persistent UPDATE_TIME for InnoDB tables was not being
updated consistently at transaction commit.

If a transaction is partly rolled back so that in the end it will
not modify a table that it intended to modify, the update_time will
be updated nevertheless. This will also happen when InnoDB fails
to write an undo log record for the intended modification.

If a transaction is committed internally in InnoDB, instead of
being committed from the SQL interface, then the trx_t::mod_tables
will not be applied to the update_time of the tables.

trx_t::mod_tables: Replace the std::set<dict_table_t*>
with std::map<dict_table_t*,undo_no_t>, so that the very first
modification within the transaction is identified.

trx_undo_report_row_operation(): Update mod_tables for every operation
after the undo log record was successfully written.

trx_rollback_to_savepoint_low(): After partial rollback, erase from
trx_t::mod_tables any tables for which all changes were rolled back.

trx_commit_in_memory(): Tighten some assertions and simplify conditions.
Invoke trx_update_mod_tables_timestamp() if persistent tables were
affected.

trx_commit_for_mysql(): Remove the call to
trx_update_mod_tables_timestamp(), as it is now invoked at the
lower level, in trx_commit_in_memory().

trx_rollback_finish(): Clear mod_tables before invoking trx_commit(),
because the trx_commit_in_memory() would otherwise wrongly process
mod_tables after a full ROLLBACK.
2017-11-23 09:54:24 +02:00
Marko Mäkelä
fda4fabe9c Correct a comment 2017-11-23 09:54:24 +02:00
Michael Widenius
8a24be6e74 Less dependencies in include files 2017-11-23 09:49:45 +02:00
Michael Widenius
166056f744 Remove not used mem_root argument from build_clone(), get_copy() and get_item_copy()
TODO:
- Make get_thd_memroot() inline
  - To do this, we need to reduce dependence of include files, especially
    so that sql_class.h is not depending in item.h
2017-11-23 09:49:45 +02:00
Marko Mäkelä
e2dd4e3206 MDEV-4697 UPDATE_TIME field for InnoDB
Import and adjust the MySQL 5.7 tests
innodb.update_time innodb.update_time_wl6658 into MariaDB.

The functionality is present since MariaDB 10.2.2 merged
InnoDB from MySQL 5.7.9. It was implemented in MySQL 5.7.2.
2017-11-23 08:56:06 +02:00
Marko Mäkelä
187a5bbf28 Adjust the tests for MariaDB, and optimize them 2017-11-23 08:55:51 +02:00
Marko Mäkelä
f8bc799a89 Import WL#6658 update_time tests from MySQL 5.7 2017-11-23 08:55:51 +02:00
Sergei Golubchik
0055e1a57f Merge branch 'connect/10.2' into 10.2 2017-11-22 17:38:30 +01:00
Ian Gilfillan
622466644d mysql_uprade --help and man page fixes 2017-11-22 22:30:32 +08:00
Aleksey Midenkov
37dd3cf424 MDEV-13550 Copy ctor instread of memcpy() in partition_info::get_clone() (#436)
List<>::last is wrong after memcpy(). Doing it on constructed objects is bad practice.
2017-11-22 12:52:16 +01:00
Sergei Golubchik
3422ceb10c remove dead code 2017-11-22 12:52:16 +01:00
David Carlier
f86413ecc1 Fix the build on OpenBSD (#488)
* rocksdb fails without timer_delete() - only use it when it exists
2017-11-22 12:52:12 +01:00
Sergey Vojtovich
e44107c4d9 Tencent contributions added 2017-11-22 14:39:21 +04:00
Alexander Barkov
a18f6009e3 A cleanup for MDEV-12846 sql_mode=ORACLE: using Oracle-style placeholders in direct query execution makes the server crash
Fixing a test failure in "mtr --ps compat/oracle.ps" caused by "SELECT ?"
returning different errors:
- CR_PARAMS_NOT_BOUND in prepared execution
- ER_PARSE_ERROR in direct execution
Disabling PS protocol for this test chunk.
2017-11-22 11:42:31 +04:00
Vladislav Vaintroub
12840f97cd Fix typo, and disable own dtrace proibes on Solaris, really. 2017-11-21 16:20:08 -05:00
wlad
83eb14ff65 Fix compile error. 2017-11-21 21:30:45 +01:00
wlad
b6d72ed44d MDEV-14283 : Fix Solaris 10 build.
- introduce system check for posix_memalign (not available on Solaris 10)
- Disable dtrace probes, to fix weird link errors in mariabackup
2017-11-21 21:14:06 +01:00
Sergei Golubchik
14c2a9a52e don't git submodule update from rocksdb/CMakeLists.txt (#492)
we now have cmake/submodules.cmake that updates all submodules
2017-11-21 20:03:57 +01:00
Sergei Golubchik
8c422bf48d MDEV-14256 MariaDB 10.2.10 can't SST with xtrabackup-v2
another followup for 4c2c057d40.

there are six possible cases:
--port can be set or not.
--address can be set, not set, or set but without a port number

The correct behavior is:
1 both --port and --address have a port number
  - use it if it's the same, otherwise an error
2 only --port has the number (--address isn't set)
  - use the value from --port
3 only --port has the number (--address is set, but has no port)
  - use the value from --port
4 --port is unset, --address has the port number
  - use the value from --address
5 --port is unset, --address has no port number
  - use the value from --address, that is, port is empty string
6 --port is unset, --address is unset
  - port is unset (an error somewhere later)

case 5 wasn't handled correctly
2017-11-21 20:03:57 +01:00
Sergei Golubchik
a963cb95db MDEV-14268 Executable C source code files? 2017-11-21 20:03:57 +01:00
Sergei Golubchik
5dd505b709 MDEV-14428 main.cte_nonrecursive failed in --embedded
move the privilege related test to main.cte_grant
2017-11-21 20:03:57 +01:00
Sergei Golubchik
7f1900705b Merge branch '10.1' into 10.2 2017-11-21 19:47:46 +01:00
Vladislav Vaintroub
7c4f859384 MDEV-14283 : Fix compilation of mariabackup for gcc3.x 2017-11-21 17:19:32 +00:00
Marko Mäkelä
366bb162fe Merge 10.2 into bb-10.2-ext 2017-11-21 18:59:30 +02:00
Marko Mäkelä
375caf99c4 Adjust an imported test 2017-11-21 18:53:00 +02:00
Marko Mäkelä
9405fdeb9e MDEV-13201 Assertion srv_undo_sources || ... failed on shutdown during DDL operation
dict_stats_exec_sql(): Refuse the operation if shutdown has been
initiated.

The real fix would be to update the persistent statistics as part
of the data dictionary transactions. To do this, we should move the
storage of InnoDB persistent statistics to the InnoDB data files,
and maybe also remove the InnoDB data dictionary.
2017-11-21 17:56:31 +02:00
Alexander Barkov
563f1d894b MDEV-14454 Binary protocol returns wrong collation ID for SP OUT parameters
Item_param::set_value() did not set Item::collation and
Item_param::str_value_ptr.str_charset properly. So both
metadata and data for OUT parameters were sent in a wrong
way to the client.

This patch removes the old implementation of Item_param::set_value()
and rewrites it using Type_handler::Item_param_set_from_value(),
so now setting IN and OUT parameters share the a lot of code.

1. Item_param::set_str() now:
  - accepts two additional parameters fromcs, tocs
  - sets str_value_ptr, to make sure it's always in sync with str_value,
    even without Item_param::convert_str_value()
  - does collation.set(tocs, DERIVATION_COERCIBLE),
    to make sure that DTCollation is valid even without
    Item_param::convert_str_value()

2. Item_param::set_value(), which is used to set OUT parameters,
   now reuses Type_handler::Item_param_set_from_value().

3. Cleanup: moving Item_param::str_value_ptr to private,
   as it's not needed outside.

4. Cleanup: adding a new virtual method
   Settable_routine_parameter::get_item_param()
   and using it a few new DBUG_ASSERTs, where
   Item_param cannot appear.

After this change:
1. Assigning of IN parameters works as before:
a. Item_param::set_str() is called and sets the value as a binary string
b. The original value is sent to the query used for binary/general logging
c. Item_param::convert_str_value() converts the value from the client
   character set to the connection character set

2. Assigning of OUT parameters works in the new way:
a. Item_param::set_str() and sets the value
   using the source Item's collation, so both Item::collation
   and Item_param::str_value_ptr.str_charset are properly set.
b. Protocol_binary::send_out_parameters() sends the
   value to the client correctly:
   - Protocol::send_result_set_metadata() uses Item::collation.collation
     (which is now properly set), to detect if conversion is needed,
     and sends a correct collation ID.
   - Protocol::send_result_set_row() calls Type_handler::Item_send_str(),
     which uses Item_param::str_value_ptr.str_charset
     (which is now properly set) to actually perform the conversion.
2017-11-21 16:02:26 +04:00
Otto Kekäläinen
feec04f29d Travis-CI: clean up cruft and add more in-line commments
This will make these files easier to maintain in the future.
2017-11-21 13:07:26 +02:00
Otto Kekäläinen
325c9ce9b3 Travis-CI: slim down the deb build so it passes in the 50 minute time limit
The Debian packaging build was failing on Travis-CI due to timeouts.
These changes make it faster by skipping less relevant parts of the build,
like the test suite, RocksDB, TokuDB and Mroonga.

Also fix the usage of the 'make -j' flag to not have any spaces as
recommended in an example in the Debian policy.
2017-11-21 13:07:26 +02:00
Otto Kekäläinen
b9e029d706 Travis-CI: make deb job visible on the parallel jobs list 2017-11-21 13:07:26 +02:00
Marko Mäkelä
18cdc254b7 MDEV-13626 Merge InnoDB test cases from MySQL 5.7 (part 3) 2017-11-20 16:06:17 +02:00
Marko Mäkelä
f233c9778e Adjust the MySQL 5.7 tests for MariaDB 10.2 2017-11-20 16:05:41 +02:00
Marko Mäkelä
55a94ef1cf Import WL#7277 bulk insert creation tests from MySQL 5.7 2017-11-20 13:28:34 +02:00
Marko Mäkelä
ce64a65f27 MDEV-14310 Possible corruption by table-rebuilding or index-creating ALTER TABLE…ALGORITHM=INPLACE
Also, MDEV-14317 When ALTER TABLE is aborted, do not write garbage pages to data files

As pointed out by Shaohua Wang, the merge of MDEV-13328 from
MariaDB 10.1 (based on MySQL 5.6) to 10.2 (based on 5.7)
was performed incorrectly.

Let us always pass a non-NULL FlushObserver* when writing
to data files is desired.

FlushObserver::is_partial_flush(): Check if this is a bulk-load
(partial flush of the tablespace).

FlushObserver::is_interrupted(): Check for interrupt status.

buf_LRU_flush_or_remove_pages(): Instead of trx_t*, take
FlushObserver* as a parameter.

buf_flush_or_remove_pages(): Remove the parameters flush, trx.
If observer!=NULL, write out the data pages. Use the new predicate
observer->is_partial() to distinguish a partial tablespace flush
(after bulk-loading) from a full tablespace flush (export).
Return a bool (whether all pages were removed from the flush_list).

buf_flush_dirty_pages(): Remove the parameter trx.
2017-11-20 13:26:56 +02:00
Alexander Barkov
4a8039b04e Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext 2017-11-20 11:12:08 +04:00
Sergei Golubchik
b54aeeb080 never add new error messages to old GA releases!
this fixes aae4932775
2017-11-19 14:43:17 +01:00
bigs
c029eae02d Spelling fix 2017-11-19 09:49:08 +08:00
Alexander Barkov
a20c1217a5 MDEV-14435 Different UNSIGNED flag of out user variable for YEAR parameter for direct vs prepared CALL 2017-11-18 18:29:50 +04:00
Vladislav Vaintroub
e0a00c5a2f MDEV-14412 Support TCP keepalive options
Based on pull request by Oleg Obleukhov
https://github.com/MariaDB/server/pull/400
2017-11-17 21:40:20 +00:00
Alexander Barkov
4c2c5ec94e MDEV-14434 Wrong result for CHARSET(CONCAT(?,const)) 2017-11-18 00:19:46 +04:00
Vladislav Vaintroub
faee08c10c MDEV-14114 Intoduce variable for binlog io cache size. 2017-11-17 19:28:39 +00:00
David Carlier
685db2c112 Fix the build on OpenBSD (#488)
* cast pthread_t for printf
* don't use RTLD_NOLOAD
* tokudb fails without F_NOCACHE and O_DIRECT - ditto
2017-11-17 13:55:14 +08:00
Sergei Golubchik
4666f01534 mroonga after-merge test fixes
"sed -r" fails on labrador. Don't use sed, use perl.
2017-11-17 13:55:14 +08:00
Michael Widenius
5b3da95bf3 Simplify fn_rext
- Change interface according to real usage
- Fix comment
- Rename to fn_frm_ext
2017-11-17 07:30:05 +02:00
Michael Widenius
326bfb071c MDEV-14378 - Allow on to drop orphaned #sql- tables
DROP TABLE now also works on empty or short .frm files
2017-11-17 07:30:05 +02:00
Michael Widenius
cf5e193d06 Remove mark_check_constraint_columns from delete
- We don't check constraints when doing delete
2017-11-17 07:30:05 +02:00
Michael Widenius
87933d5261 Handle failures from malloc
Most "new" failures fixed in the following files:
- sql_select.cc
- item.cc
- item_func.cc
- opt_subselect.cc

Other things:
- Allocate udf_handler strings in mem_root
  - Required changes in sql_string.h
- Add mem_root as argument to some new [] calls
- Mark udf_handler strings as thread specific
- Removed some comment blocks with code
2017-11-17 07:30:05 +02:00
Vladislav Vaintroub
0d1e805aeb Fix rocksdb tests on Windows 2017-11-16 22:11:08 +00:00
Vladislav Vaintroub
689168be12 MDEV-13852 - redefine WinWriteableFile such as IsSyncThreadSafe()
is set to true, as it should.

Copy and modify original io_win.h header file to a different location
(as we cannot patch anything in submodule). Make sure modified header is
used.
2017-11-16 18:57:18 +00:00
Alexey Botchkov
842dce378a MDEV-14402 JSON_VALUE doesn't escape quote.
Result unescaping added.
2017-11-16 19:59:27 +04:00