1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge 10.0 into 10.1

Significantly reduce the amount of InnoDB, XtraDB and Mariabackup
code changes by defining pfs_os_file_t as something that is
transparently compatible with os_file_t.
This commit is contained in:
Marko Mäkelä
2017-05-19 13:59:43 +03:00
255 changed files with 7227 additions and 4903 deletions

View File

@@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -27,6 +27,8 @@
#include "stub_print_error.h"
#include "stub_pfs_defaults.h"
void unload_performance_schema();
/* test helpers, to simulate the setup */
void setup_thread(PSI_thread *t, bool enabled)
@@ -126,7 +128,7 @@ void test_bootstrap()
psi_2= boot->get_interface(PSI_VERSION_2);
ok(psi_2 == NULL, "version 2");
shutdown_performance_schema();
unload_performance_schema();
}
/*
@@ -183,6 +185,27 @@ PSI * load_perfschema()
return (PSI*) psi;
}
void unload_performance_schema()
{
cleanup_table_share();
cleanup_instruments();
cleanup_sync_class();
cleanup_thread_class();
cleanup_table_share();
cleanup_file_class();
cleanup_stage_class();
cleanup_statement_class();
cleanup_socket_class();
cleanup_events_waits_history_long();
cleanup_events_stages_history_long();
cleanup_events_statements_history_long();
cleanup_table_share_hash();
cleanup_file_hash();
cleanup_digest();
shutdown_performance_schema();
}
void test_bad_registration()
{
PSI *psi;
@@ -581,8 +604,7 @@ void test_bad_registration()
psi->register_socket("X", bad_socket_3, 1);
ok(dummy_socket_key == 2, "assigned key");
shutdown_performance_schema();
unload_performance_schema();
}
void test_init_disabled()
@@ -1016,7 +1038,7 @@ void test_init_disabled()
socket_A1= psi->init_socket(99, NULL, NULL, 0);
ok(socket_A1 == NULL, "broken socket key not instrumented");
shutdown_performance_schema();
unload_performance_schema();
}
void test_locker_disabled()
@@ -1316,14 +1338,14 @@ void test_locker_disabled()
/* Pretend the socket does not have a thread owner */
/* ---------------------------------------------- */
psi->delete_current_thread();
socket_class_A->m_enabled= true;
socket_A1= psi->init_socket(socket_key_A, NULL, NULL, 0);
ok(socket_A1 != NULL, "instrumented");
/* Socket thread owner has not been set */
socket_locker= psi->start_socket_wait(&socket_state, socket_A1, PSI_SOCKET_SEND, 12, "foo.cc", 12);
ok(socket_locker == NULL, "no locker (no thread owner)");
ok(socket_locker != NULL, "locker (owner not used)");
psi->end_socket_wait(socket_locker, 10);
/* Pretend the running thread is not instrumented */
/* ---------------------------------------------- */
@@ -1351,7 +1373,7 @@ void test_locker_disabled()
socket_locker= psi->start_socket_wait(&socket_state, socket_A1, PSI_SOCKET_SEND, 12, "foo.cc", 12);
ok(socket_locker == NULL, "no locker");
shutdown_performance_schema();
unload_performance_schema();
}
void test_file_instrumentation_leak()
@@ -1438,7 +1460,7 @@ void test_file_instrumentation_leak()
file_locker= psi->get_thread_file_descriptor_locker(&file_state, (File) 12, PSI_FILE_WRITE);
ok(file_locker == NULL, "no locker, no leak");
shutdown_performance_schema();
unload_performance_schema();
}
void test_enabled()
@@ -1474,7 +1496,7 @@ void test_enabled()
{ & cond_key_B, "C-B", 0}
};
shutdown_performance_schema();
unload_performance_schema();
#endif
}
@@ -1644,5 +1666,5 @@ int main(int argc, char **argv)
MY_INIT(argv[0]);
do_all_tests();
my_end(0);
return exit_status();
return (exit_status());
}