@@ -48,6 +48,39 @@ FROM INFORMATION_SCHEMA.TABLES
4848WHERE TABLE_SCHEMA='information_schema' AND TABLE_NAME='columns';
4949SET debug = '-d,fetch_system_view_definition';
5050
51+ --echo # Dump DD tables for villagesql schema
52+ --output $MYSQL_TMP_DIR/fresh_dd_tables.sql
53+ SELECT t.name, t.type, t.engine, t.row_format, t.collation_id,
54+ t.comment, t.hidden, t.options, t.mysql_version_id
55+ FROM mysql.tables t
56+ JOIN mysql.schemata s ON t.schema_id = s.id
57+ WHERE s.name = 'villagesql'
58+ ORDER BY t.name;
59+
60+ --output $MYSQL_TMP_DIR/fresh_dd_columns.sql
61+ SELECT t.name AS table_name, c.name AS col_name, c.ordinal_position,
62+ c.type, c.is_nullable, c.is_zerofill, c.is_unsigned,
63+ c.char_length, c.numeric_precision, c.numeric_scale,
64+ c.datetime_precision, c.collation_id, c.has_no_default,
65+ c.default_value_utf8, c.default_option, c.update_option,
66+ c.is_auto_increment, c.is_virtual, c.generation_expression_utf8,
67+ c.comment, c.hidden, c.options, c.column_key, c.column_type_utf8
68+ FROM mysql.columns c
69+ JOIN mysql.tables t ON c.table_id = t.id
70+ JOIN mysql.schemata s ON t.schema_id = s.id
71+ WHERE s.name = 'villagesql'
72+ ORDER BY t.name, c.ordinal_position;
73+
74+ --output $MYSQL_TMP_DIR/fresh_dd_indexes.sql
75+ SELECT t.name AS table_name, idx.name AS idx_name, idx.type,
76+ idx.algorithm, idx.is_visible, idx.is_generated, idx.hidden,
77+ idx.ordinal_position, idx.comment, idx.options, idx.engine
78+ FROM mysql.indexes idx
79+ JOIN mysql.tables t ON idx.table_id = t.id
80+ JOIN mysql.schemata s ON t.schema_id = s.id
81+ WHERE s.name = 'villagesql'
82+ ORDER BY t.name, idx.ordinal_position;
83+
5184--echo # Cleanup test database
5285DROP DATABASE fresh_test;
5386
@@ -93,6 +126,39 @@ FROM INFORMATION_SCHEMA.TABLES
93126WHERE TABLE_SCHEMA='information_schema' AND TABLE_NAME='columns';
94127SET debug = '-d,fetch_system_view_definition';
95128
129+ --echo # Dump DD tables for villagesql schema
130+ --output $MYSQL_TMP_DIR/from_vanilla_dd_tables.sql
131+ SELECT t.name, t.type, t.engine, t.row_format, t.collation_id,
132+ t.comment, t.hidden, t.options, t.mysql_version_id
133+ FROM mysql.tables t
134+ JOIN mysql.schemata s ON t.schema_id = s.id
135+ WHERE s.name = 'villagesql'
136+ ORDER BY t.name;
137+
138+ --output $MYSQL_TMP_DIR/from_vanilla_dd_columns.sql
139+ SELECT t.name AS table_name, c.name AS col_name, c.ordinal_position,
140+ c.type, c.is_nullable, c.is_zerofill, c.is_unsigned,
141+ c.char_length, c.numeric_precision, c.numeric_scale,
142+ c.datetime_precision, c.collation_id, c.has_no_default,
143+ c.default_value_utf8, c.default_option, c.update_option,
144+ c.is_auto_increment, c.is_virtual, c.generation_expression_utf8,
145+ c.comment, c.hidden, c.options, c.column_key, c.column_type_utf8
146+ FROM mysql.columns c
147+ JOIN mysql.tables t ON c.table_id = t.id
148+ JOIN mysql.schemata s ON t.schema_id = s.id
149+ WHERE s.name = 'villagesql'
150+ ORDER BY t.name, c.ordinal_position;
151+
152+ --output $MYSQL_TMP_DIR/from_vanilla_dd_indexes.sql
153+ SELECT t.name AS table_name, idx.name AS idx_name, idx.type,
154+ idx.algorithm, idx.is_visible, idx.is_generated, idx.hidden,
155+ idx.ordinal_position, idx.comment, idx.options, idx.engine
156+ FROM mysql.indexes idx
157+ JOIN mysql.tables t ON idx.table_id = t.id
158+ JOIN mysql.schemata s ON t.schema_id = s.id
159+ WHERE s.name = 'villagesql'
160+ ORDER BY t.name, idx.ordinal_position;
161+
96162--echo # Shutdown and cleanup
97163--source include/shutdown_mysqld.inc
98164--remove_file $MYSQL_TMP_DIR/mysql_8.4.6_lctn$lctn.zip
@@ -109,7 +175,9 @@ SET debug = '-d,fetch_system_view_definition';
109175--diff_files $MYSQL_TMP_DIR/fresh_custom_columns.sql $MYSQL_TMP_DIR/from_vanilla_custom_columns.sql
110176--diff_files $MYSQL_TMP_DIR/fresh_is_extensions.sql $MYSQL_TMP_DIR/from_vanilla_is_extensions.sql
111177--diff_files $MYSQL_TMP_DIR/fresh_is_columns.sql $MYSQL_TMP_DIR/from_vanilla_is_columns.sql
112- # TODO(villagesql-beta): figure out a way to test the entire schema
178+ --diff_files $MYSQL_TMP_DIR/fresh_dd_tables.sql $MYSQL_TMP_DIR/from_vanilla_dd_tables.sql
179+ --diff_files $MYSQL_TMP_DIR/fresh_dd_columns.sql $MYSQL_TMP_DIR/from_vanilla_dd_columns.sql
180+ --diff_files $MYSQL_TMP_DIR/fresh_dd_indexes.sql $MYSQL_TMP_DIR/from_vanilla_dd_indexes.sql
113181
114182--echo # Cleanup
115183--remove_file $MYSQL_TMP_DIR/fresh_dump.sql
@@ -120,6 +188,12 @@ SET debug = '-d,fetch_system_view_definition';
120188--remove_file $MYSQL_TMP_DIR/from_vanilla_is_extensions.sql
121189--remove_file $MYSQL_TMP_DIR/fresh_is_columns.sql
122190--remove_file $MYSQL_TMP_DIR/from_vanilla_is_columns.sql
191+ --remove_file $MYSQL_TMP_DIR/fresh_dd_tables.sql
192+ --remove_file $MYSQL_TMP_DIR/from_vanilla_dd_tables.sql
193+ --remove_file $MYSQL_TMP_DIR/fresh_dd_columns.sql
194+ --remove_file $MYSQL_TMP_DIR/from_vanilla_dd_columns.sql
195+ --remove_file $MYSQL_TMP_DIR/fresh_dd_indexes.sql
196+ --remove_file $MYSQL_TMP_DIR/from_vanilla_dd_indexes.sql
123197--remove_file $MYSQLD_LOG_FROM_VANILLA
124198
125199--echo # Test passed - both upgrade paths result in equivalent state!
0 commit comments