summaryrefslogtreecommitdiff
path: root/unittest
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '5.5' into 10.1Oleksandr Byelkin2020-04-302-1/+140
|\
| * BUG#30301356 - SOME EVENTS ARE DELAYED AFTER DROPPING EVENTSergei Golubchik2020-04-302-1/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | queues.c cleanup and refactoring. Restore old version of _downhead() (from before cd483c55209) that works well in an average case. Use it for queue_fix(). Move existing specialized version of _downhead() to queue_replace() where it'll be handling the case it was specifically optimized for (moving the element to the end of the queue). And correct it to fix the heap not only down, but also up (this fixes BUG#30301356). Add unit tests. Collateral cosmetic fixes.
* | Merge branch '5.5' into 10.1Vicențiu Ciorbaru2019-05-1131-31/+31
|\ \ | |/
| * Update FSF AddressVicențiu Ciorbaru2019-05-1129-29/+29
| | | | | | | | * Update wrong zip-code
* | Merge branch '5.5' into 10.1Vicențiu Ciorbaru2019-05-111-1/+1
|\ \ | |/
| * Update FSF addressMichal Schorm2019-05-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit is based on the work of Michal Schorm, rebased on the earliest MariaDB version. Th command line used to generate this diff was: find ./ -type f \ -exec sed -i -e 's/Foundation, Inc., 59 Temple Place, Suite 330, Boston, /Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, /g' {} \; \ -exec sed -i -e 's/Foundation, Inc. 59 Temple Place.* Suite 330, Boston, /Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, /g' {} \; \ -exec sed -i -e 's/MA.*.....-1307.*USA/MA 02110-1335 USA/g' {} \; \ -exec sed -i -e 's/Foundation, Inc., 59 Temple/Foundation, Inc., 51 Franklin/g' {} \; \ -exec sed -i -e 's/Place, Suite 330, Boston, MA.*02111-1307.*USA/Street, Fifth Floor, Boston, MA 02110-1335 USA/g' {} \; \ -exec sed -i -e 's/MA.*.....-1307/MA 02110-1335/g' {} \;
* | 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
* | 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 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.
* | | 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.
* | | 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.
* | | 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.
* | | 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 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
| | |
* | | Merge 10.0 into 10.1Marko Mäkelä2017-05-231-0/+3
|\ \ \ | |/ /
| * | MDEV-6262 analyze the coverity report on mariadbSergei Golubchik2017-05-191-0/+3
| | | | | | | | | | | | | | | uploaded 10.0, analyzed everything with the Impact=High (and a couple of Medium)
* | | Correct FSF addressiangilfillan2017-03-103-3/+3
| | |
* | | base64 serviceSergei Golubchik2017-03-101-1/+0
| | |
* | | Merge branch '10.0' into 10.1Oleksandr Byelkin2016-03-241-1/+43
|\ \ \ | |/ /
| * | MDEV-9773: Memory corruption in mariadb_dyncol_unpackOleksandr Byelkin2016-03-241-1/+43
| | | | | | | | | | | | Fixed calculating pointer to memory allocated for names in numeric format in unpacking procedure.
* | | Merge branch '10.0' into 10.1Sergei Golubchik2016-02-233-3/+78
|\ \ \ | |/ /
| * | Merge branch '5.5' into 10.0Sergei Golubchik2016-02-153-3/+77
| |\ \ | | |/
| | * compilation errors on sparc sun studio 10Sergei Golubchik2016-02-152-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. unused static inline functions are only removed at -xO4, otherwise test binaries will depend on various mysys symbols that they don't use. Link test with libmysys. 2. Sphinx - don't instantiate (explicitly) templates before they're defined. Or, rather, don't instantiate them explicitly at all. 3. GIS - don't use anonymous unions and structs.
| | * MDEV-4664 mysql_upgrade crashes if root's password contains an ↵Sergei Golubchik2016-02-061-5/+5
| | | | | | | | | | | | | | | | | | | | | apostrophe/single quotation mark fix dynstr_append_os_quoted() to escape single quotes correctly for a POSIX shell
| | * unit test for dynstr_append_os_quoted()Sergei Golubchik2016-02-062-1/+75
| | | | | | | | | | | | and a trivial cleanup to avoid manually-specified lengths
| | * my_decimal didn't compile properly with debugMonty2016-01-291-1/+1
| | |
* | | Merge branch '10.0' into 10.1Sergei Golubchik2015-12-212-3/+76
|\ \ \ | |/ /
| * | Merge branch '5.5' into 10.0Sergei Golubchik2015-12-133-2/+104
| |\ \ | | |/
| | * MDEV-8407 Numeric errors, server crash with COLUMN_JSON() on DECIMAL with ↵Oleksandr Byelkin2015-12-101-2/+32
| | | | | | | | | | | | | | | | | | precision > 40 In fact it was error in decimal library (incorrect processing of buffer overflow) invisible from other server parts because of buffer allocation and precision tests.
| | * unit tests for my_getoptSergei Golubchik2015-12-092-0/+72
| | |
* | | MDEV-9044 Binlog corruption in GaleraSergei Golubchik2015-12-181-5/+47
| | | | | | | | | | | | unit test for the IO_CACHE bug
* | | make encrypt-binlog and encrypt-tmp-files to fail if no encryptionSergei Golubchik2015-09-091-2/+6
| | | | | | | | | | | | | | | | | | --encrypt-binlog and --encrypt-tmp-files used to mean "encrypt XXX if encryption is available, otherwise don't encrypt", now they mean "encrypt or fail with an error".
* | | MDEV-6066: Merge new defaults from 5.6 and 5.7Sergei Golubchik2015-09-041-2/+5
| | | | | | | | | | | | cosmetic fixes. test fixes.
* | | MDEV-6066: Merge new defaults from 5.6 and 5.7 (autoset)Oleksandr Byelkin2015-09-042-0/+354
| | | | | | | | | | | | --autoset- command line prefix added
* | | New encryption API. Piece-wise encryption.Sergei Golubchik2015-09-042-71/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of encrypt(src, dst, key, iv) that encrypts all data in one go, now we have encrypt_init(key,iv), encrypt_update(src,dst), and encrypt_finish(dst). This also causes collateral changes in the internal my_crypt.cc encryption functions and in the encryption service. There are wrappers to provide the old all-at-once encryption functionality. But binlog events are often written piecewise, they'll need the new api.
* | | my_crypt unittestSergei Golubchik2015-09-042-1/+123
| | |
* | | MDEV-8419 utf32: compare broken bytes as "greater than any non-broken character"Alexander Barkov2015-07-071-0/+54
| | |