diff options
author | Sergei Golubchik <serg@mariadb.org> | 2018-06-30 16:39:20 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2018-06-30 16:39:20 +0200 |
commit | 36e59752e7fc70bc5179a3d730b5ce3ee58e4e30 (patch) | |
tree | 0d3e30ce973b2e1f044931c0eb1846d7192becda /unittest | |
parent | 7c0779da7c37f6ef6eff2f79dda6f1b0c57e3869 (diff) | |
parent | 1dd3c8f8ba49ec06e550d7376d27ff05ce024bec (diff) | |
download | mariadb-git-36e59752e7fc70bc5179a3d730b5ce3ee58e4e30.tar.gz |
Merge branch '10.2' into 10.3
Diffstat (limited to 'unittest')
-rw-r--r-- | unittest/sql/mf_iocache-t.cc | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/unittest/sql/mf_iocache-t.cc b/unittest/sql/mf_iocache-t.cc index dbb16e51c70..07f0b0e7a7e 100644 --- a/unittest/sql/mf_iocache-t.cc +++ b/unittest/sql/mf_iocache-t.cc @@ -254,10 +254,43 @@ void mdev10259() } +void mdev14014() +{ + int res; + uchar buf_o[200]; + uchar buf_i[200]; + memset(buf_i, 0, sizeof( buf_i)); + memset(buf_o, FILL, sizeof(buf_o)); + + diag("MDEV-14014 Dump thread reads past last 'officially' written byte"); + + init_io_cache_encryption(); + + res= open_cached_file(&info, 0, 0, CACHE_SIZE, 0); + ok(res == 0, "open_cached_file" INFO_TAIL); + + res= my_b_write(&info, buf_o, sizeof(buf_o)); + ok(res == 0, "buffer is written" INFO_TAIL); + + res= my_b_flush_io_cache(&info, 1); + ok(res == 0, "flush" INFO_TAIL); + + res= reinit_io_cache(&info, READ_CACHE, 0, 0, 0); + ok(res == 0, "reinit READ_CACHE" INFO_TAIL); + + info.end_of_file= 100; + res= my_b_read(&info, buf_i, sizeof(buf_i)); + ok(res == 1 && buf_i[100] == 0 && buf_i[200-1] == 0, + "short read leaves buf_i[100..200-1] == 0"); + + close_cached_file(&info); +} + + int main(int argc __attribute__((unused)),char *argv[]) { MY_INIT(argv[0]); - plan(46); + plan(51); /* temp files with and without encryption */ encrypt_tmp_files= 1; @@ -273,6 +306,8 @@ int main(int argc __attribute__((unused)),char *argv[]) mdev10259(); encrypt_tmp_files= 0; + mdev14014(); + my_end(0); return exit_status(); } |