summaryrefslogtreecommitdiff
path: root/unittest
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.3 into 10.4Marko Mäkelä2019-04-021-1/+1
|\
| * Merge branch '10.2' into 10.3Sergei Golubchik2019-03-291-1/+1
| |\
| | * Merge branch '10.1' into 10.2Sergei Golubchik2019-03-291-1/+1
| | |\
| | | * cmake: re-enable -Werror in the maintainer modeSergei Golubchik2019-03-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | now we can afford it. Fix -Werror errors. Note: * old gcc is bad at detecting uninit variables, disable it. * time_t is int or long, cast it for printf's
* | | | Merge 10.3 into 10.4Marko Mäkelä2019-03-201-1/+7
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The MDEV-17262 commit 26432e49d37a37d09b862bb49a021e44bdf4789c was skipped. In Galera 4, the implementation would seem to require changes to the streaming replication. In the tests archive.rnd_pos main.profiling, disable_ps_protocol for SHOW STATUS and SHOW PROFILE commands until MDEV-18974 has been fixed.
| * | | Merge branch '10.2' into 10.3Sergei Golubchik2019-03-171-1/+7
| |\ \ \ | | |/ /
| | * | Merge branch '10.1' into 10.2Sergei Golubchik2019-03-151-1/+7
| | |\ \ | | | |/
| | | * fix gcc 8 compiler warningsSergei Golubchik2019-03-141-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were two newly enabled warnings: 1. cast for a function pointers. Affected sql_analyse.h, mi_write.c and ma_write.cc, mf_iocache-t.cc, mysqlbinlog.cc, encryption.cc, etc 2. memcpy/memset of nontrivial structures. Fixed as: * the warning disabled for InnoDB * TABLE, TABLE_SHARE, and TABLE_LIST got a new method reset() which does the bzero(), which is safe for these classes, but any other bzero() will still cause a warning * Table_scope_and_contents_source_st uses `TABLE_LIST *` (trivial) instead of `SQL_I_List<TABLE_LIST>` (not trivial) so it's safe to bzero now. * added casts in debug_sync.cc and sql_select.cc (for JOIN) * move assignment method for MDL_request instead of memcpy() * PARTIAL_INDEX_INTERSECT_INFO::init() instead of bzero() * remove constructor from READ_RECORD() to make it trivial * replace some memcpy() with c++ copy assignments
* | | | Merge branch '10.3' into 10.4Oleksandr Byelkin2019-02-212-3/+71
|\ \ \ \ | |/ / /
| * | | dirty mergeOleksandr Byelkin2019-02-072-3/+71
| |\ \ \ | | |/ /
| | * | Merge 10.1 into 10.2Marko Mäkelä2019-02-031-2/+2
| | |\ \ | | | |/ | | | | | | | | | | | | | | | | Temporarily disable a test for commit 2175bfce3e9da8332f10ab0e0286dc93915533a2 because fixing it in 10.2 requires updating libmariadb.
| | | * Merge 10.1 into 10.1Marko Mäkelä2019-02-021-2/+2
| | | |\ | | | | | | | | | | | | | | | This is joint work with Oleksandr Byelkin.
| | | | * Merge branch '5.5' into 10.0Oleksandr Byelkin2019-01-281-2/+2
| | | | |\
| | | | | * MDEV-18269 - fix off-by-one bug in unittestNatanael Copa2019-01-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the off-by-one overflow which was introduced with commit b0fd06a6f2721 (MDEV-15670 - unit.my_atomic failed in buildbot with Signal 11 thrown) Closes #1098.
| | * | | | Merge 10.1 into 10.2Marko Mäkelä2019-02-021-1/+69
| | |\ \ \ \ | | | |/ / /
| | | * | | MDEV-10963 Fragmented BINLOG queryAndrei Elkin2019-01-241-1/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem was originally stated in http://bugs.mysql.com/bug.php?id=82212 The size of an base64-encoded Rows_log_event exceeds its vanilla byte representation in 4/3 times. When a binlogged event size is about 1GB mysqlbinlog generates a BINLOG query that can't be send out due to its size. It is fixed with fragmenting the BINLOG argument C-string into (approximate) halves when the base64 encoded event is over 1GB size. The mysqlbinlog in such case puts out SET @binlog_fragment_0='base64-encoded-fragment_0'; SET @binlog_fragment_1='base64-encoded-fragment_1'; BINLOG @binlog_fragment_0, @binlog_fragment_1; to represent a big BINLOG. For prompt memory release BINLOG handler is made to reset the BINLOG argument user variables in the middle of processing, as if @binlog_fragment_{0,1} = NULL is assigned. Notice the 2 fragments are enough, though the client and server still may need to tweak their @@max_allowed_packet to satisfy to the fragment size (which they would have to do anyway with greater number of fragments, should that be desired). On the lower level the following changes are made: Log_event::print_base64() remains to call encoder and store the encoded data into a cache but now *without* doing any formatting. The latter is left for time when the cache is copied to an output file (e.g mysqlbinlog output). No formatting behavior is also reflected by the change in the meaning of the last argument which specifies whether to cache the encoded data. Rows_log_event::print_helper() is made to invoke a specialized fragmented cache-to-file copying function which is copy_cache_to_file_wrapped() that takes care of fragmenting also optionally wraps encoded strings (fragments) into SQL stanzas. my_b_copy_to_file() is refactored to into my_b_copy_all_to_file(). The former function is generalized to accepts more a limit argument to constraint the copying and does not reinitialize anymore the cache into reading mode. The limit does not do any effect on the fully read cache.
* | | | | | stricter json unit testsSergei Golubchik2019-02-041-56/+77
| | | | | |
* | | | | | MDEV-5313 Improving audit API.Alexey Botchkov2019-01-181-2/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | json_locate_key() implemented. get rid of 'key_len' argument in functions.
* | | | | | MDEV-5313 Improving audit api.Alexey Botchkov2019-01-171-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | json_t unittest added.
* | | | | | MDEV-5313 Improving audit api.Alexey Botchkov2019-01-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | JSON api implementations and tests pushed. sql_acl.cc fixed with the new function names.
* | | | | | Merge 10.3 into 10.4Marko Mäkelä2019-01-064-46/+11
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge branch '10.2' into 10.3Sergei Golubchik2019-01-034-46/+11
| |\ \ \ \ \ | | |/ / / /
| | * | | | Merge branch '10.1' into 10.2mariadb-10.2.21Sergei Golubchik2018-12-304-46/+11
| | |\ \ \ \ | | | |/ / /
| | | * | | Merge branch '10.0' into 10.1Sergei Golubchik2018-12-294-46/+11
| | | |\ \ \ | | | | |/ /
| | | | * | Merge branch '5.5' into 10.0Sergei Golubchik2018-12-204-46/+11
| | | | |\ \ | | | | | |/
| | | | | * MDEV-15670 - unit.my_atomic failed in buildbot with Signal 11 thrownSergey Vojtovich2018-12-184-46/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Workaround glibc bug: https://sourceware.org/bugzilla/show_bug.cgi?id=20116 by making unittest threads joinable. It makes code better anyway.
| | | | * | Merge branch '5.5' into 10.0Sergei Golubchik2018-06-211-1/+1
| | | | |\ \ | | | | | |/
| | | | | * Revert "MDEV-16075: Workaround to run MTR test suite for make test"Sergei Golubchik2018-06-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit d39629f01ebdd5b89186e6c8a4a8d3dd528bd26a. Because running mtr for many hours with no output whatsoever is not really what we should do. And in 5.5 `make test` just works anyway, nothing to fix here.
| | | | * | Merge branch '5.5' into 10.0Vicențiu Ciorbaru2018-06-101-2/+1
| | | | |\ \ | | | | | |/
| | | | | * MDEV-16075: Workaround to run MTR test suite for make testTeodor Mircea Ionita2018-06-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Assign all tests added via MY_ADD_TEST to a bogus default_ignore target, so that they are not ran by default when doing bare make test. Add default test named MTR that calls mysql-test-run suite, which is now the single test run by make test. In consequence, modified unit/suite.pm to exclude the MTR test and run the real ctests flagged for default_ignore target, thus no circular loop.
* | | | | | Simple cleanups (no logic changes)Monty2018-12-091-1/+1
|/ / / / /
* | | | | Merge 10.2 into 10.3Marko Mäkelä2018-11-061-1/+87
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | main.derived_cond_pushdown: Move all 10.3 tests to the end, trim trailing white space, and add an "End of 10.3 tests" marker. Add --sorted_result to tests where the ordering is not deterministic. main.win_percentile: Add --sorted_result to tests where the ordering is no longer deterministic.
| * | | | Merge 10.1 into 10.2Marko Mäkelä2018-11-061-1/+87
| |\ \ \ \ | | |/ / /
| | * | | MDEV-17133 follow-up patch to fix mf_iocache-t unittestAndrei Elkin2018-11-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | which did not always correctly simulated io-cache::end_of_file. The error was caused by implicit cast to unsigned of an intemediate term in a formula.
| | * | | MDEV-17133 dump thread reads from a past positionAndrei Elkin2018-10-211-1/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to logs analysis the Dump thread attempted to read again data which was already sent. The reason of regressed read turns out in an _my_b_cache_read() early exit branch which missed to distinguish between total zero size read (e.g ineffective read when Count argument is zero) from a case when the requested amount of data is fully read out by sole accessing the cache's file. In the latter case such then *effective* reading was not reflected in the cache's state to screw the cache's state. Fixed with a check introduced of whether the file reading was effective prior to early exit. When this is the case conduct standard cache state change to account the actual read size. Notice the bug can show up also as an error to read binlog event e.g through BINLOG_GTID_POS() (of MDEV-16886).
| | * | | compiler warnings (clang 4.0.1 on i386)Sergei Golubchik2018-09-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | extra/mariabackup/fil_cur.cc:361:42: warning: format specifies type 'unsigned long' but the argument has type 'ib_int64_t' (aka 'long long') [-Wformat] extra/mariabackup/fil_cur.cc:376:9: warning: format specifies type 'unsigned long' but the argument has type 'ib_int64_t' (aka 'long long') [-Wformat] sql/handler.cc:6196:45: warning: format specifies type 'unsigned long' but the argument has type 'wsrep_trx_id_t' (aka 'unsigned long long') [-Wformat] sql/log.cc:1681:16: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat] sql/log.cc:1687:16: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat] sql/wsrep_sst.cc:1388:86: warning: format specifies type 'long' but the argument has type 'wsrep_seqno_t' (aka 'long long') [-Wformat] sql/wsrep_sst.cc:232:86: warning: format specifies type 'long' but the argument has type 'wsrep_seqno_t' (aka 'long long') [-Wformat] storage/connect/filamdbf.cpp:450:47: warning: format specifies type 'short' but the argument has type 'int' [-Wformat] storage/connect/filamdbf.cpp:970:47: warning: format specifies type 'short' but the argument has type 'int' [-Wformat] storage/connect/inihandl.cpp:197:16: warning: address of array 'key->name' will always evaluate to 'true' [-Wpointer-bool-conversion] storage/innobase/btr/btr0scrub.cc:151:17: warning: format specifies type 'long' but the argument has type 'int' [-Wformat] storage/innobase/buf/buf0buf.cc:5085:8: warning: nonnull parameter 'bpage' will evaluate to 'true' on first encounter [-Wpointer-bool-conversion] storage/innobase/fil/fil0crypt.cc:2454:5: warning: format specifies type 'long' but the argument has type 'int' [-Wformat] storage/innobase/handler/ha_innodb.cc:18685:7: warning: format specifies type 'unsigned long' but the argument has type 'wsrep_trx_id_t' (aka 'unsigned long long') [-Wformat] storage/innobase/row/row0mysql.cc:3319:5: warning: format specifies type 'long' but the argument has type 'int' [-Wformat] storage/innobase/row/row0mysql.cc:3327:5: warning: format specifies type 'long' but the argument has type 'int' [-Wformat] storage/maria/ma_norec.c:35:10: warning: implicit conversion from 'int' to 'my_bool' (aka 'char') changes value from 131 to -125 [-Wconstant-conversion] storage/maria/ma_norec.c:42:10: warning: implicit conversion from 'int' to 'my_bool' (aka 'char') changes value from 131 to -125 [-Wconstant-conversion] storage/maria/ma_test2.c:1009:12: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat] storage/maria/ma_test2.c:1010:12: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat] storage/mroonga/ha_mroonga.cpp:9189:44: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand] storage/mroonga/vendor/groonga/lib/expr.c:4987:22: warning: comparison of constant -1 with expression of type 'grn_operator' is always false [-Wtautological-constant-out-of-range-compare] storage/xtradb/btr/btr0scrub.cc:151:17: warning: format specifies type 'long' but the argument has type 'int' [-Wformat] storage/xtradb/buf/buf0buf.cc:5047:8: warning: nonnull parameter 'bpage' will evaluate to 'true' on first encounter [-Wpointer-bool-conversion] storage/xtradb/fil/fil0crypt.cc:2454:5: warning: format specifies type 'long' but the argument has type 'int' [-Wformat] storage/xtradb/row/row0mysql.cc:3324:5: warning: format specifies type 'long' but the argument has type 'int' [-Wformat] storage/xtradb/row/row0mysql.cc:3332:5: warning: format specifies type 'long' but the argument has type 'int' [-Wformat] unittest/sql/mf_iocache-t.cc:120:35: warning: format specifies type 'unsigned long' but the argument has type 'int' [-Wformat] unittest/sql/mf_iocache-t.cc:96:35: note: expanded from macro 'INFO_TAIL'
| | * | | MDEV-14014 Multi-Slave Replication Fail: bogus data in log eventAndrei Elkin2018-06-281-1/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MDEV-7257 made a dump thread to read from binlog concurrently with writers as long as the read bytes are below a water-mark (MYSQL_BIN_LOG::binlog_end_pos). However it appeared to be possible a dump thread reader reach out for bytes past the water mark through a feature of IO_CACHE that fills in the internal buffer and while doing so it could read what the reader is not supposed to see (the bytes above MYSQL_BIN_LOG::binlog_end_pos). The issue is fixed with constraining the IO_CACHE buffer fill to respect the watermark. An added unit test proves reading from file is bound to an external parameter passed to {IO_CACHE::end_of_file} cache member.
* | | | | Merge branch '10.2' into 10.3Sergei Golubchik2018-06-301-1/+36
|\ \ \ \ \ | |/ / / /
| * | | | MDEV-14014 Multi-Slave Replication Fail: bogus data in log eventAndrei Elkin2018-06-281-1/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MDEV-7257 made a dump thread to read from binlog concurrently with writers as long as the read bytes are below a water-mark (MYSQL_BIN_LOG::binlog_end_pos). However it appeared to be possible a dump thread reader reach out for bytes past the water mark through a feature of IO_CACHE that fills in the internal buffer and while doing so it could read what the reader is not supposed to see (the bytes above MYSQL_BIN_LOG::binlog_end_pos). The issue is fixed with constraining the IO_CACHE buffer fill to respect the watermark. An added unit test proves reading from file is bound to an external parameter passed to {IO_CACHE::end_of_file} cache member.
* | | | | MDEV-16478: mysql_real_connect() from libmariadbd.so always crashOleksandr Byelkin2018-06-252-0/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Returned accidentally removed undefinition of MYSQL_SERVER in net_serv.cc inside embedded server (embedded server uses real_net_read/write only as a client) Prevented attempt to clean up embedded server if it was not initialized
* | | | | After-merge fixesMarko Mäkelä2018-05-301-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix type mismatches in the unit test mdev10259(). btr_search_info_get_ref_count(): Do not return early if !table->space. We can simply access table->space_id even after the tablespace has been discarded. btr_get_search_latch(): Relax a debug assertion to allow !index->table->space.
* | | | | Merge 10.2 into 10.3Marko Mäkelä2018-05-291-1/+71
|\ \ \ \ \ | |/ / / /
| * | | | Fix conversion warnings/errors.Vladislav Vaintroub2018-05-241-1/+1
| | | | |
| * | | | Merge remote-tracking branch 'origin/10.1' into 10.2Monty2018-05-241-1/+71
| |\ \ \ \ | | |/ / /
| | * | | MDEV-10259 mysqld crash with certain statement length and...sachin2018-05-221-1/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | order with Galera and encrypt-tmp-files=1 Problem:- If trans_cache (IO_CACHE) uses encrypted tmp file then on next DML server will crash. Case:- Lets take a case , we have a table t1 , We try to do 2 inserts in t1 1. A really long insert so that trans_cache has to use temp_file 2. Just a small insert Analysis:- Actually server crashes from inside of galera library. /lib64/libc.so.6(abort+0x175)[0x7fb5ba779dc5] /usr/lib64/galera/libgalera_smm.so(_ZN6galera3FSMINS_9TrxHandle5State... mysys/stacktrace.c:247(my_print_stacktrace)[0x7fb5a714940e] sql/signal_handler.cc:160(handle_fatal_signal)[0x7fb5a715c1bd] sql/wsrep_hton.cc:257(wsrep_rollback)[0x7fb5bcce923a] sql/wsrep_hton.cc:268(wsrep_rollback)[0x7fb5bcce9368] sql/handler.cc:1658(ha_rollback_trans(THD*, bool))[0x7fb5bcd4f41a] sql/handler.cc:1483(ha_commit_trans(THD*, bool))[0x7fb5bcd4f804] but actual issue is not in galera but in mariadb, because for 2nd insert we should never call rollback. We are calling rollback because log_and_order fails it fails because write_cache fails , It fails because after reinit_io_cache(trans_cache) , my_b_bytes_in_cache says 0 so we look into tmp_file for data , which is obviously wrong since temp was used for previous insert and it no longer exist. wsrep_write_cache_inc() reads the IO_CACHE in a loop, filling it with my_b_fill() until it returns "0 bytes read". Later MYSQL_BIN_LOG::write_cache() does the same. wsrep_write_cache_inc() assumes that reading a zero bytes past EOF leaves the old data in the cache Solution:- There is two issue in my_b_encr_read 1st we should never equal read_end to info->buffer. I mean this does not make sense read_end should always point to end of buffer. 2nd For most of the case(apart from async IO_CACHE) info->pos_in_file should be equal to info->buffer position wrt to temp file , since in this case we are not changing info->buffer it should remain unchanged.
* | | | | Merge bb-10.2-ext into 10.3Marko Mäkelä2018-02-151-0/+3
|\ \ \ \ \ | |/ / / /
| * | | | Merge branch 'github/10.1' into 10.2Sergei Golubchik2018-02-061-0/+3
| |\ \ \ \ | | |/ / /
| | * | | Merge branch 'github/10.0' into 10.1Sergei Golubchik2018-02-021-0/+3
| | |\ \ \ | | | |/ /
| | | * | Merge remote-tracking branch '5.5' into 10.0Vicențiu Ciorbaru2018-01-241-0/+3
| | | |\ \ | | | | |/
| | | | * Free memory in unit tests. Makes ASAN happier.Sergei Golubchik2018-01-221-0/+3
| | | | |