Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit 3d0d924

Browse files
committed
Expand the schema_tables_with_full_table_scans test to scan multiple times, and do point lookups, for verification of numbers
1 parent 6e0d952 commit 3d0d924

File tree

2 files changed

+62
-1
lines changed

2 files changed

+62
-1
lines changed

mysql-test/suite/sysschema/r/v_schema_tables_with_full_table_scans.result

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,49 @@ v_schema_tables_with_full_table_scans t 768
6060
SELECT object_schema, object_name, rows_full_scanned FROM sys.x$schema_tables_with_full_table_scans;
6161
object_schema object_name rows_full_scanned
6262
v_schema_tables_with_full_table_scans t 768
63+
SELECT * FROM v_schema_tables_with_full_table_scans.t WHERE j = 12;
64+
i j
65+
12 12
66+
19 12
67+
22 12
68+
34 12
69+
37 12
70+
43 12
71+
65 12
72+
68 12
73+
74 12
74+
86 12
75+
128 12
76+
131 12
77+
137 12
78+
149 12
79+
173 12
80+
255 12
81+
258 12
82+
264 12
83+
276 12
84+
300 12
85+
348 12
86+
510 12
87+
513 12
88+
519 12
89+
531 12
90+
555 12
91+
603 12
92+
699 12
93+
SELECT object_schema, object_name, rows_full_scanned FROM sys.schema_tables_with_full_table_scans;
94+
object_schema object_name rows_full_scanned
95+
v_schema_tables_with_full_table_scans t 1536
96+
SELECT object_schema, object_name, rows_full_scanned FROM sys.x$schema_tables_with_full_table_scans;
97+
object_schema object_name rows_full_scanned
98+
v_schema_tables_with_full_table_scans t 1536
99+
SELECT * FROM v_schema_tables_with_full_table_scans.t WHERE i = 10;
100+
i j
101+
10 4
102+
SELECT object_schema, object_name, rows_full_scanned FROM sys.schema_tables_with_full_table_scans;
103+
object_schema object_name rows_full_scanned
104+
v_schema_tables_with_full_table_scans t 1536
105+
SELECT object_schema, object_name, rows_full_scanned FROM sys.x$schema_tables_with_full_table_scans;
106+
object_schema object_name rows_full_scanned
107+
v_schema_tables_with_full_table_scans t 1536
63108
DROP DATABASE v_schema_tables_with_full_table_scans;

mysql-test/suite/sysschema/t/v_schema_tables_with_full_table_scans.test

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,23 @@ CALL sys.ps_truncate_all_tables(false);
3636
# Following returns 28 rows, but should full scan as j has no index
3737
SELECT * FROM v_schema_tables_with_full_table_scans.t WHERE j = 12;
3838

39-
# Now verify the table shows up in the views with the right row count
39+
# Now verify the table shows up in the views with the right row count (should be 768)
40+
SELECT object_schema, object_name, rows_full_scanned FROM sys.schema_tables_with_full_table_scans;
41+
42+
SELECT object_schema, object_name, rows_full_scanned FROM sys.x$schema_tables_with_full_table_scans;
43+
44+
# Scan again
45+
SELECT * FROM v_schema_tables_with_full_table_scans.t WHERE j = 12;
46+
47+
# Now verify that double the amount of rows in the table should be shown as scanned (should be 1536)
48+
SELECT object_schema, object_name, rows_full_scanned FROM sys.schema_tables_with_full_table_scans;
49+
50+
SELECT object_schema, object_name, rows_full_scanned FROM sys.x$schema_tables_with_full_table_scans;
51+
52+
# Do a point lookup
53+
SELECT * FROM v_schema_tables_with_full_table_scans.t WHERE i = 10;
54+
55+
# The number of rows scanned should not have changed (should still be 1536)
4056
SELECT object_schema, object_name, rows_full_scanned FROM sys.schema_tables_with_full_table_scans;
4157

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

0 commit comments

Comments
 (0)