403Webshell
Server IP : 88.99.149.37  /  Your IP : 216.73.216.141
Web Server : nginx/1.31.2
System : Linux server-88-99-149-37 6.12.0-124.56.5.el10_1.x86_64 #1 SMP PREEMPT_DYNAMIC Fri May 15 06:12:08 EDT 2026 x86_64
User : muralimurth ( 1015)
PHP Version : 8.4.23
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/local/mysql/mysql-test/suite/sysschema/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/local/mysql/mysql-test/suite/sysschema/t/v_schema_tables_with_full_table_scans.test
-- source include/not_embedded.inc
-- source include/have_innodb.inc
-- source ../include/ps_truncate_all_tables.inc
# Tests for sys schema
# Verify the sys.schema_tables_with_full_table_scans view

# Ensure structure changes don't slip in
DESC sys.schema_tables_with_full_table_scans;

# Make sure view select does not error, but ignore results
--disable_result_log
SELECT * FROM sys.schema_tables_with_full_table_scans;
--enable_result_log

# Ensure structure changes don't slip in
DESC sys.x$schema_tables_with_full_table_scans;

# Make sure view select does not error, but ignore results
--disable_result_log
SELECT * FROM sys.x$schema_tables_with_full_table_scans;
--enable_result_log

# Create a dummy table, force some full table scans, verify the results
CREATE TABLE test.t (i BIGINT AUTO_INCREMENT PRIMARY KEY, j BIGINT) ENGINE = innodb;

INSERT INTO test.t (j) VALUES (1), (2), (3);

INSERT INTO test.t (j) (SELECT j*2 FROM test.t);

INSERT INTO test.t (j) (SELECT j*2 FROM test.t);

INSERT INTO test.t (j) (SELECT j*2 FROM test.t);

INSERT INTO test.t (j) (SELECT j*2 FROM test.t);

INSERT INTO test.t (j) (SELECT j*2 FROM test.t);

INSERT INTO test.t (j) (SELECT j*2 FROM test.t);

INSERT INTO test.t (j) (SELECT j*2 FROM test.t);

INSERT INTO test.t (j) (SELECT j*2 FROM test.t);

# The table should now have 768 rows

# Now truncate the P_S tables, to get fresh results
CALL sys.ps_truncate_all_tables(false);

# Following returns 28 rows, but should full scan as j has no index
# Using RAND() to force no query caching, so ignore results, they are not important
--disable_ps2_protocol
--disable_result_log
SELECT i, j, RAND() FROM test.t WHERE j = 12;
--enable_result_log
--enable_ps2_protocol

# Ensure the base performance schema data is aggregated first
--let $wait_condition= SELECT COUNT_STAR = 768 FROM performance_schema.table_io_waits_summary_by_index_usage WHERE object_schema = 'test' AND object_name = 't' AND index_name IS NULL
--source include/wait_condition.inc

# Now verify the table shows up in the views with the right row count (should be 768)
SELECT object_schema, object_name, rows_full_scanned FROM sys.schema_tables_with_full_table_scans;

SELECT object_schema, object_name, rows_full_scanned FROM sys.x$schema_tables_with_full_table_scans;

# Scan again
--disable_ps2_protocol
--disable_result_log
SELECT i, j, RAND() FROM test.t WHERE j = 12;
--enable_result_log
--enable_ps2_protocol

# Again ensure the base performance schema data is aggregated first
--let $wait_condition= SELECT COUNT_STAR = 1536 FROM performance_schema.table_io_waits_summary_by_index_usage WHERE object_schema = 'test' AND object_name = 't' AND index_name IS NULL
--source include/wait_condition.inc

# Now verify that double the amount of rows in the table should be shown as scanned (should be 1536)
SELECT object_schema, object_name, rows_full_scanned FROM sys.schema_tables_with_full_table_scans;

SELECT object_schema, object_name, rows_full_scanned FROM sys.x$schema_tables_with_full_table_scans;

# Do a point lookup
SELECT * FROM test.t WHERE i = 10;

# The number of rows scanned should not have changed (should still be 1536)
SELECT object_schema, object_name, rows_full_scanned FROM sys.schema_tables_with_full_table_scans;

SELECT object_schema, object_name, rows_full_scanned FROM sys.x$schema_tables_with_full_table_scans;

# Cleanup
DROP TABLE test.t;

Youez - 2016 - github.com/yon3zu
LinuXploit