diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2021-03-11 12:17:28 +0100 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2021-03-11 12:17:28 +0100 |
commit | b6ab8c91c71c953fe865a976f5c62f247eb25c92 (patch) | |
tree | feb486a7a3efdb08f4585aac9d762aef7680bccc | |
parent | ba5c152e2520d343413613b4415904f38660f008 (diff) | |
download | mariadb-git-bb-10.6-sysschema.tar.gz |
MDEV-9077 - sys schemabb-10.6-sysschema
Fix tests, in case either performance schema or innodb are not compiled in.
-rw-r--r-- | mysql-test/include/mysql_upgrade_preparation.inc | 3 | ||||
-rw-r--r-- | mysql-test/main/ps_ddl.result | 202 | ||||
-rw-r--r-- | mysql-test/main/ps_ddl.test | 2 | ||||
-rw-r--r-- | mysql-test/suite/sysschema/t/v_innodb_buffer_stats_by_schema.test | 2 | ||||
-rw-r--r-- | mysql-test/suite/sysschema/t/v_innodb_buffer_stats_by_table.test | 2 | ||||
-rw-r--r-- | mysql-test/suite/sysschema/t/v_innodb_lock_waits.test | 1 | ||||
-rw-r--r-- | scripts/sys_schema/CMakeLists.txt | 21 |
7 files changed, 24 insertions, 209 deletions
diff --git a/mysql-test/include/mysql_upgrade_preparation.inc b/mysql-test/include/mysql_upgrade_preparation.inc index 03019ae29ff..6cdaf6dd3d4 100644 --- a/mysql-test/include/mysql_upgrade_preparation.inc +++ b/mysql-test/include/mysql_upgrade_preparation.inc @@ -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: # diff --git a/mysql-test/main/ps_ddl.result b/mysql-test/main/ps_ddl.result index 210a6998ab1..86a294b732d 100644 --- a/mysql-test/main/ps_ddl.result +++ b/mysql-test/main/ps_ddl.result @@ -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 diff --git a/mysql-test/main/ps_ddl.test b/mysql-test/main/ps_ddl.test index dafb5b5dea3..694ee61fd0c 100644 --- a/mysql-test/main/ps_ddl.test +++ b/mysql-test/main/ps_ddl.test @@ -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; diff --git a/mysql-test/suite/sysschema/t/v_innodb_buffer_stats_by_schema.test b/mysql-test/suite/sysschema/t/v_innodb_buffer_stats_by_schema.test index ca717ac445b..f44b87d43ca 100644 --- a/mysql-test/suite/sysschema/t/v_innodb_buffer_stats_by_schema.test +++ b/mysql-test/suite/sysschema/t/v_innodb_buffer_stats_by_schema.test @@ -1,5 +1,7 @@ -- 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 diff --git a/mysql-test/suite/sysschema/t/v_innodb_buffer_stats_by_table.test b/mysql-test/suite/sysschema/t/v_innodb_buffer_stats_by_table.test index 2464f201bde..d65c28ff96d 100644 --- a/mysql-test/suite/sysschema/t/v_innodb_buffer_stats_by_table.test +++ b/mysql-test/suite/sysschema/t/v_innodb_buffer_stats_by_table.test @@ -1,5 +1,7 @@ -- 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 diff --git a/mysql-test/suite/sysschema/t/v_innodb_lock_waits.test b/mysql-test/suite/sysschema/t/v_innodb_lock_waits.test index ab6db172634..d742f599595 100644 --- a/mysql-test/suite/sysschema/t/v_innodb_lock_waits.test +++ b/mysql-test/suite/sysschema/t/v_innodb_lock_waits.test @@ -1,5 +1,6 @@ -- 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 diff --git a/scripts/sys_schema/CMakeLists.txt b/scripts/sys_schema/CMakeLists.txt index 22650503991..f2f206a1a93 100644 --- a/scripts/sys_schema/CMakeLists.txt +++ b/scripts/sys_schema/CMakeLists.txt @@ -1,3 +1,4 @@ +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}) - FILE(READ ${f} content) - SET(CMAKE_CONFIGURABLE_FILE_CONTENT "${CMAKE_CONFIGURABLE_FILE_CONTENT}${content}\n") - ENDFOREACH() -ENDIF() +FOREACH(f ${files}) + FILE(READ ${f} content) + SET(CMAKE_CONFIGURABLE_FILE_CONTENT "${CMAKE_CONFIGURABLE_FILE_CONTENT}${content}\n") +ENDFOREACH() CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/configurable_file_content.in ${CMAKE_BINARY_DIR}/scripts/mysql_sys_schema.sql) |