From: vasil.dimov Date: March 18 2011 12:57pm Subject: bzr push into mysql-trunk-innodb branch (vasil.dimov:3544 to 3545) List-Archive: http://lists.mysql.com/commits/133299 Message-Id: <20110318125701.E17F62E122@mail.v5d.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3545 Vasil Dimov 2011-03-18 Adjust stats column type when fetching from persistent stats When charset of the table is set to UTF8 then VARCHAR(N) columns do not come to InnoDB as DATA_VARCHAR, but as DATA_VARMYSQL. Also extend the testcase to cover this code path. This is a followup to vasil.dimov@stripped Reported by: Michael modified: mysql-test/suite/innodb/include/innodb_stats.inc mysql-test/suite/innodb/r/innodb_stats.result storage/innobase/dict/dict0stats.c 3544 Vasil Dimov 2011-03-16 [merge] Merge mysql-trunk -> mysql-trunk-innodb removed: mysql-test/include/have_case_insensitive_fs.inc mysql-test/r/case_insensitive_fs.require mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile-slave.opt added: mysql-test/collections/disabled-weekly.list mysql-test/r/func_encrypt_ucs2.result mysql-test/r/ssl_cipher.result mysql-test/std_data/bug47205.frm mysql-test/suite/binlog/r/binlog_incident_ignore.result mysql-test/suite/binlog/t/binlog_incident_ignore-master.opt mysql-test/suite/binlog/t/binlog_incident_ignore.test mysql-test/suite/perfschema/r/relaylog.result mysql-test/suite/perfschema/t/relaylog.test mysql-test/suite/rpl/r/rpl_skip_incident.result mysql-test/suite/rpl/t/rpl_skip_incident-master.opt mysql-test/suite/rpl/t/rpl_skip_incident-slave.opt mysql-test/suite/rpl/t/rpl_skip_incident.test mysql-test/suite/sys_vars/r/max_long_data_size_basic.result mysql-test/suite/sys_vars/t/max_long_data_size_basic.test mysql-test/t/func_encrypt_ucs2.test mysql-test/t/ssl_cipher-master.opt mysql-test/t/ssl_cipher.test renamed: regex/tests => regex/tests_include.h modified: VERSION client/mysql.cc client/mysqlcheck.c client/mysqltest.cc client/sql_string.cc client/sql_string.h cmake/make_dist.cmake.in extra/yassl/src/yassl_int.cpp include/ft_global.h include/m_ctype.h include/my_global.h include/my_handler.h include/my_sys.h include/my_tree.h include/mysql/plugin_audit.h.pp include/mysql/plugin_auth.h.pp include/mysql/plugin_ftparser.h include/mysql/plugin_ftparser.h.pp libmysqld/lib_sql.cc mysql-test/collections/default.daily mysql-test/collections/default.push mysql-test/collections/default.weekly mysql-test/extra/binlog_tests/binlog.test mysql-test/extra/binlog_tests/database.test mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test mysql-test/extra/rpl_tests/rpl_conflicts.test mysql-test/extra/rpl_tests/rpl_extra_col_master.test mysql-test/extra/rpl_tests/rpl_extra_col_slave.test mysql-test/extra/rpl_tests/rpl_loaddata.test mysql-test/extra/rpl_tests/rpl_row_basic.test mysql-test/extra/rpl_tests/rpl_row_empty_imgs.test mysql-test/extra/rpl_tests/rpl_row_tabledefs.test mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test mysql-test/extra/rpl_tests/rpl_stop_middle_group.test mysql-test/include/mtr_warnings.sql mysql-test/include/wait_for_status_var.inc mysql-test/lib/My/Find.pm mysql-test/lib/mtr_cases.pm mysql-test/lib/mtr_report.pm mysql-test/mysql-test-run.pl mysql-test/r/archive_plugin.result mysql-test/r/blackhole_plugin.result mysql-test/r/ctype_latin1.result mysql-test/r/ctype_sjis.result mysql-test/r/ctype_ucs.result mysql-test/r/ctype_utf8.result mysql-test/r/flush.result mysql-test/r/flush_read_lock.result mysql-test/r/func_analyse.result mysql-test/r/func_set.result mysql-test/r/grant.result mysql-test/r/information_schema.result mysql-test/r/information_schema_parameters.result mysql-test/r/information_schema_routines.result mysql-test/r/innodb_mysql_sync.result mysql-test/r/mysqlcheck.result mysql-test/r/mysqld--help-notwin.result mysql-test/r/mysqld--help-win.result mysql-test/r/mysqltest.result mysql-test/r/partition.result mysql-test/r/partition_error.result mysql-test/r/sp.result mysql-test/r/system_mysql_db.result mysql-test/r/trigger.result mysql-test/r/variables.result mysql-test/suite/binlog/r/binlog_base64_flag.result mysql-test/suite/binlog/r/binlog_database.result mysql-test/suite/binlog/r/binlog_row_binlog.result mysql-test/suite/binlog/r/binlog_stm_binlog.result mysql-test/suite/binlog/t/binlog_base64_flag.test mysql-test/suite/engines/iuds/t/disabled.def mysql-test/suite/funcs_1/r/innodb_storedproc_06.result mysql-test/suite/funcs_1/r/is_columns_is.result mysql-test/suite/funcs_1/r/is_columns_mysql.result mysql-test/suite/funcs_1/r/is_routines.result mysql-test/suite/funcs_1/r/memory_storedproc_06.result mysql-test/suite/funcs_1/r/myisam_storedproc_06.result mysql-test/suite/funcs_1/storedproc/storedproc_06.inc mysql-test/suite/rpl/r/rpl_binlog_corruption.result mysql-test/suite/rpl/r/rpl_bug33931.result mysql-test/suite/rpl/r/rpl_checksum.result mysql-test/suite/rpl/r/rpl_checksum_cache.result mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result mysql-test/suite/rpl/r/rpl_corruption.result mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result mysql-test/suite/rpl/r/rpl_heartbeat_basic.result mysql-test/suite/rpl/r/rpl_idempotency.result mysql-test/suite/rpl/r/rpl_ignore_table.result mysql-test/suite/rpl/r/rpl_incident.result mysql-test/suite/rpl/r/rpl_init_slave_errors.result mysql-test/suite/rpl/r/rpl_known_bugs_detection.result mysql-test/suite/rpl/r/rpl_loaddata.result mysql-test/suite/rpl/r/rpl_loaddata_fatal.result mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result mysql-test/suite/rpl/r/rpl_rotate_logs.result mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result mysql-test/suite/rpl/r/rpl_row_colSize.result mysql-test/suite/rpl/r/rpl_row_conflicts.result mysql-test/suite/rpl/r/rpl_row_idempotency.result mysql-test/suite/rpl/r/rpl_row_img_eng_full.result mysql-test/suite/rpl/r/rpl_row_img_sanity.result mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result mysql-test/suite/rpl/r/rpl_show_errors.result mysql-test/suite/rpl/r/rpl_skip_error.result mysql-test/suite/rpl/r/rpl_slave_grp_exec.result mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result mysql-test/suite/rpl/r/rpl_slave_start.result mysql-test/suite/rpl/r/rpl_slow_query_log.result mysql-test/suite/rpl/r/rpl_stm_EE_err2.result mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result mysql-test/suite/rpl/r/rpl_stm_conflicts.result mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result mysql-test/suite/rpl/r/rpl_stop_slave.result mysql-test/suite/rpl/r/rpl_temporary_errors.result mysql-test/suite/rpl/r/rpl_typeconv.result mysql-test/suite/rpl/t/rpl_binlog_corruption.test mysql-test/suite/rpl/t/rpl_bug33931.test mysql-test/suite/rpl/t/rpl_checksum.test mysql-test/suite/rpl/t/rpl_checksum_cache.test mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test mysql-test/suite/rpl/t/rpl_corruption.test mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test mysql-test/suite/rpl/t/rpl_heartbeat_basic.test mysql-test/suite/rpl/t/rpl_idempotency.test mysql-test/suite/rpl/t/rpl_ignore_table.test mysql-test/suite/rpl/t/rpl_incident.test mysql-test/suite/rpl/t/rpl_init_slave_errors.test mysql-test/suite/rpl/t/rpl_known_bugs_detection.test mysql-test/suite/rpl/t/rpl_loaddata_fatal.test mysql-test/suite/rpl/t/rpl_rotate_logs.test mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test mysql-test/suite/rpl/t/rpl_row_colSize.test mysql-test/suite/rpl/t/rpl_row_idempotency.test mysql-test/suite/rpl/t/rpl_row_img_sanity.test mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test mysql-test/suite/rpl/t/rpl_show_errors.test mysql-test/suite/rpl/t/rpl_skip_error.test mysql-test/suite/rpl/t/rpl_slave_grp_exec.test mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test mysql-test/suite/rpl/t/rpl_slave_start.test mysql-test/suite/rpl/t/rpl_slow_query_log.test mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test mysql-test/suite/rpl/t/rpl_stop_slave.test mysql-test/suite/rpl/t/rpl_temporary_errors.test mysql-test/suite/rpl/t/rpl_typeconv.test mysql-test/t/archive_plugin.test mysql-test/t/blackhole_plugin.test mysql-test/t/ctype_latin1.test mysql-test/t/ctype_sjis.test mysql-test/t/ctype_ucs.test mysql-test/t/ctype_utf8.test mysql-test/t/disabled.def mysql-test/t/file_contents.test mysql-test/t/flush.test mysql-test/t/flush_read_lock.test mysql-test/t/func_analyse.test mysql-test/t/func_set.test mysql-test/t/grant.test mysql-test/t/grant_lowercase_fs.test mysql-test/t/information_schema.test mysql-test/t/innodb_mysql_sync.test mysql-test/t/mysqlbinlog_raw_mode.test mysql-test/t/mysqlcheck.test mysql-test/t/mysqltest.test mysql-test/t/partition.test mysql-test/t/partition_error.test mysql-test/t/partition_mgm_err2.test mysql-test/t/repair.test mysql-test/t/show_check.test mysql-test/t/sp.test mysql-test/t/trigger.test mysql-test/t/variables.test mysys/charset.c mysys/default.c mysys/mf_qsort.c mysys/my_conio.c mysys/my_handler.c mysys/stacktrace.c mysys/tree.c regex/CMakeLists.txt regex/debug.c regex/debug.ih regex/engine.c regex/engine.ih regex/main.c regex/my_regex.h regex/regcomp.c regex/regcomp.ih regex/reginit.c scripts/mysql_system_tables.sql scripts/mysql_system_tables_fix.sql scripts/mysqld_multi.sh sql/binlog.cc sql/binlog.h sql/event_data_objects.cc sql/event_db_repository.cc sql/field.cc sql/field.h sql/field_conv.cc sql/filesort.cc sql/gstream.h sql/ha_partition.cc sql/handler.cc sql/handler.h sql/item.cc sql/item.h sql/item_cmpfunc.cc sql/item_cmpfunc.h sql/item_create.cc sql/item_create.h sql/item_func.cc sql/item_func.h sql/item_strfunc.cc sql/item_strfunc.h sql/item_sum.cc sql/item_sum.h sql/item_timefunc.cc sql/item_timefunc.h sql/item_xmlfunc.cc sql/key.cc sql/log.cc sql/log.h sql/log_event.cc sql/log_event.h sql/my_decimal.cc sql/my_decimal.h sql/mysqld.cc sql/mysqld.h sql/opt_range.cc sql/procedure.h sql/protocol.cc sql/protocol.h sql/rpl_rli.cc sql/rpl_slave.cc sql/rpl_utility.cc sql/set_var.cc sql/set_var.h sql/share/errmsg-utf8.txt sql/sp.cc sql/sp.h sql/sp_head.cc sql/sp_head.h sql/sql_acl.cc sql/sql_admin.cc sql/sql_analyse.cc sql/sql_audit.h sql/sql_base.cc sql/sql_base.h sql/sql_class.cc sql/sql_class.h sql/sql_db.cc sql/sql_db.h sql/sql_delete.cc sql/sql_error.cc sql/sql_error.h sql/sql_lex.cc sql/sql_lex.h sql/sql_load.cc sql/sql_parse.cc sql/sql_parse.h sql/sql_partition.cc sql/sql_partition.h sql/sql_partition_admin.cc sql/sql_prepare.cc sql/sql_reload.cc sql/sql_select.cc sql/sql_select.h sql/sql_show.cc sql/sql_signal.cc sql/sql_sort.h sql/sql_string.cc sql/sql_string.h sql/sql_table.cc sql/sql_table.h sql/sql_time.cc sql/sql_time.h sql/sql_trigger.cc sql/sql_truncate.cc sql/sql_view.cc sql/sql_yacc.yy sql/strfunc.cc sql/strfunc.h sql/sys_vars.cc sql/sys_vars.h sql/table.cc sql/table.h sql/thr_malloc.cc sql/thr_malloc.h sql/uniques.cc storage/archive/ha_archive.h storage/csv/ha_tina.h storage/federated/ha_federated.h storage/heap/hp_hash.c storage/innobase/handler/ha_innodb.cc storage/myisam/ft_boolean_search.c storage/myisam/ft_nlq_search.c storage/myisam/ft_parser.c storage/myisam/ft_static.c storage/myisam/ft_update.c storage/myisam/ftdefs.h storage/myisam/ha_myisam.cc storage/myisam/mi_key.c storage/perfschema/unittest/pfs-t.cc storage/perfschema/unittest/pfs_instr-oom-t.cc storage/perfschema/unittest/pfs_instr-t.cc storage/perfschema/unittest/pfs_instr_class-oom-t.cc storage/perfschema/unittest/pfs_instr_class-t.cc storage/perfschema/unittest/pfs_timer-t.cc strings/ctype-big5.c strings/ctype-bin.c strings/ctype-cp932.c strings/ctype-czech.c strings/ctype-euc_kr.c strings/ctype-eucjpms.c strings/ctype-gb2312.c strings/ctype-gbk.c strings/ctype-latin1.c strings/ctype-mb.c strings/ctype-simple.c strings/ctype-sjis.c strings/ctype-tis620.c strings/ctype-uca.c strings/ctype-ucs2.c strings/ctype-ujis.c strings/ctype-utf8.c strings/ctype-win1250ch.c strings/ctype.c strings/my_strchr.c strings/my_vsnprintf.c strings/uca-dump.c tests/mysql_client_test.c unittest/mysys/my_vsnprintf-t.c regex/tests_include.h === modified file 'mysql-test/suite/innodb/include/innodb_stats.inc' --- a/mysql-test/suite/innodb/include/innodb_stats.inc revid:vasil.dimov@stripped +++ b/mysql-test/suite/innodb/include/innodb_stats.inc revid:vasil.dimov@stripped @@ -16,3 +16,11 @@ table_name = 'test_innodb_stats' AND index_name = 'a_key' AND stat_name IN ('n_diff_pfx01', 'n_diff_pfx02', 'n_leaf_pages', 'size') ORDER BY stat_name; + +# provoke reading from persistent storage from +# row_update_statistics_if_needed() +INSERT INTO test_innodb_stats SELECT * FROM test_innodb_stats; + +# see what has been read +query_vertical SELECT * FROM information_schema.statistics +WHERE table_name = 'test_innodb_stats'; === modified file 'mysql-test/suite/innodb/r/innodb_stats.result' --- a/mysql-test/suite/innodb/r/innodb_stats.result revid:vasil.dimov@stripped +++ b/mysql-test/suite/innodb/r/innodb_stats.result revid:vasil.dimov@stripped @@ -33,6 +33,25 @@ stat_name size stat_value 1 sample_size NULL stat_description Number of pages in the index +INSERT INTO test_innodb_stats SELECT * FROM test_innodb_stats; +SELECT * FROM information_schema.statistics +WHERE table_name = 'test_innodb_stats'; +TABLE_CATALOG def +TABLE_SCHEMA test +TABLE_NAME test_innodb_stats +NON_UNIQUE 1 +INDEX_SCHEMA test +INDEX_NAME a_key +SEQ_IN_INDEX 1 +COLUMN_NAME a +COLLATION A +CARDINALITY 0 +SUB_PART NULL +PACKED NULL +NULLABLE YES +INDEX_TYPE BTREE +COMMENT +INDEX_COMMENT DELETE FROM test_innodb_stats; INSERT INTO test_innodb_stats (a) VALUES (1); ANALYZE TABLE test_innodb_stats; @@ -66,6 +85,25 @@ stat_name size stat_value 1 sample_size NULL stat_description Number of pages in the index +INSERT INTO test_innodb_stats SELECT * FROM test_innodb_stats; +SELECT * FROM information_schema.statistics +WHERE table_name = 'test_innodb_stats'; +TABLE_CATALOG def +TABLE_SCHEMA test +TABLE_NAME test_innodb_stats +NON_UNIQUE 1 +INDEX_SCHEMA test +INDEX_NAME a_key +SEQ_IN_INDEX 1 +COLUMN_NAME a +COLLATION A +CARDINALITY 1 +SUB_PART NULL +PACKED NULL +NULLABLE YES +INDEX_TYPE BTREE +COMMENT +INDEX_COMMENT DELETE FROM test_innodb_stats; INSERT INTO test_innodb_stats (a) VALUES (1), (1); ANALYZE TABLE test_innodb_stats; @@ -99,6 +137,25 @@ stat_name size stat_value 1 sample_size NULL stat_description Number of pages in the index +INSERT INTO test_innodb_stats SELECT * FROM test_innodb_stats; +SELECT * FROM information_schema.statistics +WHERE table_name = 'test_innodb_stats'; +TABLE_CATALOG def +TABLE_SCHEMA test +TABLE_NAME test_innodb_stats +NON_UNIQUE 1 +INDEX_SCHEMA test +INDEX_NAME a_key +SEQ_IN_INDEX 1 +COLUMN_NAME a +COLLATION A +CARDINALITY 2 +SUB_PART NULL +PACKED NULL +NULLABLE YES +INDEX_TYPE BTREE +COMMENT +INDEX_COMMENT DELETE FROM test_innodb_stats; INSERT INTO test_innodb_stats (a) VALUES (1), (1), (1); ANALYZE TABLE test_innodb_stats; @@ -132,6 +189,25 @@ stat_name size stat_value 1 sample_size NULL stat_description Number of pages in the index +INSERT INTO test_innodb_stats SELECT * FROM test_innodb_stats; +SELECT * FROM information_schema.statistics +WHERE table_name = 'test_innodb_stats'; +TABLE_CATALOG def +TABLE_SCHEMA test +TABLE_NAME test_innodb_stats +NON_UNIQUE 1 +INDEX_SCHEMA test +INDEX_NAME a_key +SEQ_IN_INDEX 1 +COLUMN_NAME a +COLLATION A +CARDINALITY 3 +SUB_PART NULL +PACKED NULL +NULLABLE YES +INDEX_TYPE BTREE +COMMENT +INDEX_COMMENT DELETE FROM test_innodb_stats; INSERT INTO test_innodb_stats (a) VALUES (1), (1), (1), (1), (1), (1), (1), (1), (1), (1); ANALYZE TABLE test_innodb_stats; @@ -165,6 +241,25 @@ stat_name size stat_value 1 sample_size NULL stat_description Number of pages in the index +INSERT INTO test_innodb_stats SELECT * FROM test_innodb_stats; +SELECT * FROM information_schema.statistics +WHERE table_name = 'test_innodb_stats'; +TABLE_CATALOG def +TABLE_SCHEMA test +TABLE_NAME test_innodb_stats +NON_UNIQUE 1 +INDEX_SCHEMA test +INDEX_NAME a_key +SEQ_IN_INDEX 1 +COLUMN_NAME a +COLLATION A +CARDINALITY 2 +SUB_PART NULL +PACKED NULL +NULLABLE YES +INDEX_TYPE BTREE +COMMENT +INDEX_COMMENT DELETE FROM test_innodb_stats; INSERT INTO test_innodb_stats (a) VALUES (1), (2); ANALYZE TABLE test_innodb_stats; @@ -198,6 +293,25 @@ stat_name size stat_value 1 sample_size NULL stat_description Number of pages in the index +INSERT INTO test_innodb_stats SELECT * FROM test_innodb_stats; +SELECT * FROM information_schema.statistics +WHERE table_name = 'test_innodb_stats'; +TABLE_CATALOG def +TABLE_SCHEMA test +TABLE_NAME test_innodb_stats +NON_UNIQUE 1 +INDEX_SCHEMA test +INDEX_NAME a_key +SEQ_IN_INDEX 1 +COLUMN_NAME a +COLLATION A +CARDINALITY 2 +SUB_PART NULL +PACKED NULL +NULLABLE YES +INDEX_TYPE BTREE +COMMENT +INDEX_COMMENT DELETE FROM test_innodb_stats; INSERT INTO test_innodb_stats (a) VALUES (1), (1), (2); ANALYZE TABLE test_innodb_stats; @@ -231,6 +345,25 @@ stat_name size stat_value 1 sample_size NULL stat_description Number of pages in the index +INSERT INTO test_innodb_stats SELECT * FROM test_innodb_stats; +SELECT * FROM information_schema.statistics +WHERE table_name = 'test_innodb_stats'; +TABLE_CATALOG def +TABLE_SCHEMA test +TABLE_NAME test_innodb_stats +NON_UNIQUE 1 +INDEX_SCHEMA test +INDEX_NAME a_key +SEQ_IN_INDEX 1 +COLUMN_NAME a +COLLATION A +CARDINALITY 3 +SUB_PART NULL +PACKED NULL +NULLABLE YES +INDEX_TYPE BTREE +COMMENT +INDEX_COMMENT DELETE FROM test_innodb_stats; INSERT INTO test_innodb_stats (a) VALUES (1), (2), (3); ANALYZE TABLE test_innodb_stats; @@ -264,6 +397,25 @@ stat_name size stat_value 1 sample_size NULL stat_description Number of pages in the index +INSERT INTO test_innodb_stats SELECT * FROM test_innodb_stats; +SELECT * FROM information_schema.statistics +WHERE table_name = 'test_innodb_stats'; +TABLE_CATALOG def +TABLE_SCHEMA test +TABLE_NAME test_innodb_stats +NON_UNIQUE 1 +INDEX_SCHEMA test +INDEX_NAME a_key +SEQ_IN_INDEX 1 +COLUMN_NAME a +COLLATION A +CARDINALITY 3 +SUB_PART NULL +PACKED NULL +NULLABLE YES +INDEX_TYPE BTREE +COMMENT +INDEX_COMMENT DELETE FROM test_innodb_stats; INSERT INTO test_innodb_stats (a) VALUES (1), (1), (2), (3), (3); ANALYZE TABLE test_innodb_stats; @@ -297,6 +449,25 @@ stat_name size stat_value 1 sample_size NULL stat_description Number of pages in the index +INSERT INTO test_innodb_stats SELECT * FROM test_innodb_stats; +SELECT * FROM information_schema.statistics +WHERE table_name = 'test_innodb_stats'; +TABLE_CATALOG def +TABLE_SCHEMA test +TABLE_NAME test_innodb_stats +NON_UNIQUE 1 +INDEX_SCHEMA test +INDEX_NAME a_key +SEQ_IN_INDEX 1 +COLUMN_NAME a +COLLATION A +CARDINALITY 5 +SUB_PART NULL +PACKED NULL +NULLABLE YES +INDEX_TYPE BTREE +COMMENT +INDEX_COMMENT DELETE FROM test_innodb_stats; INSERT INTO test_innodb_stats (a) VALUES (1), (2), (3), (4), (5), (1), (2), (3), (4), (5); ANALYZE TABLE test_innodb_stats; @@ -330,3 +501,22 @@ stat_name size stat_value 1 sample_size NULL stat_description Number of pages in the index +INSERT INTO test_innodb_stats SELECT * FROM test_innodb_stats; +SELECT * FROM information_schema.statistics +WHERE table_name = 'test_innodb_stats'; +TABLE_CATALOG def +TABLE_SCHEMA test +TABLE_NAME test_innodb_stats +NON_UNIQUE 1 +INDEX_SCHEMA test +INDEX_NAME a_key +SEQ_IN_INDEX 1 +COLUMN_NAME a +COLLATION A +CARDINALITY 10 +SUB_PART NULL +PACKED NULL +NULLABLE YES +INDEX_TYPE BTREE +COMMENT +INDEX_COMMENT === modified file 'storage/innobase/dict/dict0stats.c' --- a/storage/innobase/dict/dict0stats.c revid:vasil.dimov@stripped +++ b/storage/innobase/dict/dict0stats.c revid:vasil.dimov@stripped @@ -1798,7 +1798,7 @@ dict_stats_fetch_index_stats_step( switch (i) { case 0: /* innodb.index_stats.index_name */ - ut_a(dtype_get_mtype(type) == DATA_VARCHAR); + ut_a(dtype_get_mtype(type) == DATA_VARMYSQL); /* search for index in table's indexes whose name matches data; the fetched index name is in data, @@ -1829,7 +1829,7 @@ dict_stats_fetch_index_stats_step( case 1: /* innodb.index_stats.stat_name */ - ut_a(dtype_get_mtype(type) == DATA_VARCHAR); + ut_a(dtype_get_mtype(type) == DATA_VARMYSQL); ut_a(index != NULL); No bundle (reason: useless for push emails).