Commit b6ab8c91 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

MDEV-9077 - sys schema

Fix tests, in case either performance schema or innodb are not compiled in.
parent ba5c152e
......@@ -2,6 +2,9 @@
# Can't run test of external client with embedded server
-- source include/not_embedded.inc
# diff in the output, if perfschema is not compiled in
# (sys schema views are missing)
-- source include/have_perfschema.inc
#
# Hack:
#
......
......@@ -769,220 +769,20 @@ deallocate prepare stmt;
#
# Test 3: View referencing an Information schema table
#
create view t1 as select table_name from information_schema.views order by table_name;
create view t1 as select table_name from information_schema.views where table_schema <> 'sys' order by table_name;
prepare stmt from "select * from t1";
execute stmt;
table_name
host_summary
host_summary_by_file_io
host_summary_by_file_io_type
host_summary_by_stages
host_summary_by_statement_latency
host_summary_by_statement_type
innodb_buffer_stats_by_schema
innodb_buffer_stats_by_table
innodb_lock_waits
io_by_thread_by_latency
io_global_by_file_by_bytes
io_global_by_file_by_latency
io_global_by_wait_by_bytes
io_global_by_wait_by_latency
latest_file_io
memory_by_host_by_current_bytes
memory_by_thread_by_current_bytes
memory_by_user_by_current_bytes
memory_global_by_current_bytes
memory_global_total
metrics
processlist
ps_check_lost_instrumentation
schema_auto_increment_columns
schema_index_statistics
schema_object_overview
schema_redundant_indexes
schema_tables_with_full_table_scans
schema_table_lock_waits
schema_table_statistics
schema_table_statistics_with_buffer
schema_unused_indexes
session
session_ssl_status
statements_with_errors_or_warnings
statements_with_full_table_scans
statements_with_runtimes_in_95th_percentile
statements_with_sorting
statements_with_temp_tables
statement_analysis
t1
user
user_summary
user_summary_by_file_io
user_summary_by_file_io_type
user_summary_by_stages
user_summary_by_statement_latency
user_summary_by_statement_type
version
waits_by_host_by_latency
waits_by_user_by_latency
waits_global_by_latency
wait_classes_global_by_avg_latency
wait_classes_global_by_latency
x$host_summary
x$host_summary_by_file_io
x$host_summary_by_file_io_type
x$host_summary_by_stages
x$host_summary_by_statement_latency
x$host_summary_by_statement_type
x$innodb_buffer_stats_by_schema
x$innodb_buffer_stats_by_table
x$innodb_lock_waits
x$io_by_thread_by_latency
x$io_global_by_file_by_bytes
x$io_global_by_file_by_latency
x$io_global_by_wait_by_bytes
x$io_global_by_wait_by_latency
x$latest_file_io
x$memory_by_host_by_current_bytes
x$memory_by_thread_by_current_bytes
x$memory_by_user_by_current_bytes
x$memory_global_by_current_bytes
x$memory_global_total
x$processlist
x$ps_digest_95th_percentile_by_avg_us
x$ps_digest_avg_latency_distribution
x$ps_schema_table_statistics_io
x$schema_flattened_keys
x$schema_index_statistics
x$schema_tables_with_full_table_scans
x$schema_table_lock_waits
x$schema_table_statistics
x$schema_table_statistics_with_buffer
x$session
x$statements_with_errors_or_warnings
x$statements_with_full_table_scans
x$statements_with_runtimes_in_95th_percentile
x$statements_with_sorting
x$statements_with_temp_tables
x$statement_analysis
x$user_summary
x$user_summary_by_file_io
x$user_summary_by_file_io_type
x$user_summary_by_stages
x$user_summary_by_statement_latency
x$user_summary_by_statement_type
x$waits_by_host_by_latency
x$waits_by_user_by_latency
x$waits_global_by_latency
x$wait_classes_global_by_avg_latency
x$wait_classes_global_by_latency
call p_verify_reprepare_count(0);
SUCCESS
create temporary table t1 (a int);
execute stmt;
table_name
host_summary
host_summary_by_file_io
host_summary_by_file_io_type
host_summary_by_stages
host_summary_by_statement_latency
host_summary_by_statement_type
innodb_buffer_stats_by_schema
innodb_buffer_stats_by_table
innodb_lock_waits
io_by_thread_by_latency
io_global_by_file_by_bytes
io_global_by_file_by_latency
io_global_by_wait_by_bytes
io_global_by_wait_by_latency
latest_file_io
memory_by_host_by_current_bytes
memory_by_thread_by_current_bytes
memory_by_user_by_current_bytes
memory_global_by_current_bytes
memory_global_total
metrics
processlist
ps_check_lost_instrumentation
schema_auto_increment_columns
schema_index_statistics
schema_object_overview
schema_redundant_indexes
schema_tables_with_full_table_scans
schema_table_lock_waits
schema_table_statistics
schema_table_statistics_with_buffer
schema_unused_indexes
session
session_ssl_status
statements_with_errors_or_warnings
statements_with_full_table_scans
statements_with_runtimes_in_95th_percentile
statements_with_sorting
statements_with_temp_tables
statement_analysis
t1
user
user_summary
user_summary_by_file_io
user_summary_by_file_io_type
user_summary_by_stages
user_summary_by_statement_latency
user_summary_by_statement_type
version
waits_by_host_by_latency
waits_by_user_by_latency
waits_global_by_latency
wait_classes_global_by_avg_latency
wait_classes_global_by_latency
x$host_summary
x$host_summary_by_file_io
x$host_summary_by_file_io_type
x$host_summary_by_stages
x$host_summary_by_statement_latency
x$host_summary_by_statement_type
x$innodb_buffer_stats_by_schema
x$innodb_buffer_stats_by_table
x$innodb_lock_waits
x$io_by_thread_by_latency
x$io_global_by_file_by_bytes
x$io_global_by_file_by_latency
x$io_global_by_wait_by_bytes
x$io_global_by_wait_by_latency
x$latest_file_io
x$memory_by_host_by_current_bytes
x$memory_by_thread_by_current_bytes
x$memory_by_user_by_current_bytes
x$memory_global_by_current_bytes
x$memory_global_total
x$processlist
x$ps_digest_95th_percentile_by_avg_us
x$ps_digest_avg_latency_distribution
x$ps_schema_table_statistics_io
x$schema_flattened_keys
x$schema_index_statistics
x$schema_tables_with_full_table_scans
x$schema_table_lock_waits
x$schema_table_statistics
x$schema_table_statistics_with_buffer
x$session
x$statements_with_errors_or_warnings
x$statements_with_full_table_scans
x$statements_with_runtimes_in_95th_percentile
x$statements_with_sorting
x$statements_with_temp_tables
x$statement_analysis
x$user_summary
x$user_summary_by_file_io
x$user_summary_by_file_io_type
x$user_summary_by_stages
x$user_summary_by_statement_latency
x$user_summary_by_statement_type
x$waits_by_host_by_latency
x$waits_by_user_by_latency
x$waits_global_by_latency
x$wait_classes_global_by_avg_latency
x$wait_classes_global_by_latency
call p_verify_reprepare_count(0);
SUCCESS
......
......@@ -699,7 +699,7 @@ deallocate prepare stmt;
--echo #
--echo # Test 3: View referencing an Information schema table
--echo #
create view t1 as select table_name from information_schema.views order by table_name;
create view t1 as select table_name from information_schema.views where table_schema <> 'sys' order by table_name;
prepare stmt from "select * from t1";
execute stmt;
......
-- source include/not_embedded.inc
-- source ../include/ps_truncate_all_tables.inc
-- source include/have_innodb.inc
# Tests for sys schema
# Verify the sys.innodb_buffer_stats_by_schema view
......
-- source include/not_embedded.inc
-- source ../include/ps_truncate_all_tables.inc
-- source include/have_innodb.inc
# Tests for sys schema
# Verify the sys.innodb_buffer_stats_by_table view
......
-- source include/not_embedded.inc
-- source ../include/ps_truncate_all_tables.inc
-- source include/have_innodb.inc
# Tests for sys schema
# Verify the sys.innodb_lock_waits view
......
IF(TARGET perfschema)
SET(files
${CMAKE_CURRENT_SOURCE_DIR}/before_setup.sql
${CMAKE_CURRENT_SOURCE_DIR}/views/version.sql
......@@ -156,14 +157,20 @@ ${CMAKE_CURRENT_SOURCE_DIR}/procedures/statement_performance_analyzer.sql
${CMAKE_CURRENT_SOURCE_DIR}/procedures/table_exists.sql
${CMAKE_CURRENT_SOURCE_DIR}/after_setup.sql
)
ELSE()
SET(files
${CMAKE_CURRENT_SOURCE_DIR}/before_setup.sql
${CMAKE_CURRENT_SOURCE_DIR}/tables/sys_config.sql
${CMAKE_CURRENT_SOURCE_DIR}/tables/sys_config_data_57.sql
${CMAKE_CURRENT_SOURCE_DIR}/triggers/sys_config_insert_set_user.sql
${CMAKE_CURRENT_SOURCE_DIR}/triggers/sys_config_update_set_user.sql
${CMAKE_CURRENT_SOURCE_DIR}/after_setup.sql)
ENDIF()
SET(CMAKE_CONFIGURABLE_FILE_CONTENT)
IF(TARGET perfschema)
FOREACH(f ${files})
FOREACH(f ${files})
FILE(READ ${f} content)
SET(CMAKE_CONFIGURABLE_FILE_CONTENT "${CMAKE_CONFIGURABLE_FILE_CONTENT}${content}\n")
ENDFOREACH()
ENDIF()
ENDFOREACH()
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/configurable_file_content.in ${CMAKE_BINARY_DIR}/scripts/mysql_sys_schema.sql)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment